82

In this answer, I will go through the steps necessary to redeem the second output of the transaction listed above. The answer will be limited to redeeming an output of the particular type present in this transaction (an output which requires providing a new transaction signed with a private key whose corresponding public key hashes to the hash in the script ...


42

wallet.dat, addr.dat and blkindex.dat are Berkeley Database files. They can be read using standard tools, but aren't human readable by themselves. blk0001.dat (and additional blk000n.dat blocks) contain the blockchain itself, that's just a binary concatenation of the blocks. wallet.dat contains your private keys, your address book, a copy of the ...


41

I know this question is old, but I stumbled upon it looking how to teach myself how multisig addresses work, and I imagine others will to. So I’m going to try to explain the typical flow for creating, adding bitcoins to, and eventually spending a multisig address. This explanation is aimed at beginners, so please excuse my lack of brevity. First off, some ...


31

Start with an invalid public key Bitcoin addresses are the pubkeyhash (not pubkey) plus version and checksum information, encoded in base 58. Bitcoin address = version + RIPEMD-160(SHA-256( Public Key )) + checksum The steps for converting a public key to an address can be found here: https://en.bitcoin.it/wiki/Address Since the address uses the ...


23

In each iteration, you concatenate two subsequent hashes of the previous level, and double-sha256 them. If there is an odd number of hashes, concatenate the last element with itself. This gives you a new list of hashes. Repeat, and stop when one hash remains. This is the merkle root. Assume you have tx hashes Ha1,Ha2,Ha3,Ha4,Ha5,Ha6,Ha7 First iteration: ...


22

Enable txindex=1 in your bitcoin.conf (You'll need to rebuild the database as the transaction index is normally not maintained, start using -reindex to do so), and use the getrawtransaction call to request information about any transaction (it won't work for the genesis block's coinbase transaction though, it's a special case). Note that this will only give ...


21

Satoshi: If the only library is closed source, then there's a project to make an open source one. If the only library is GPL, then there's a project to make a non-GPL one. If the best library is MIT, Boost, new-BSD or public domain, then we can stop re-writing it. I don't question that GPL is a good license for operating systems, ...


21

What does the bits field represent? First of all, we need to understand what the 'bits' field means. Bits is in 'compact' format. This is kind of like a floating point format, but it represents big integers rather than arbitrary real numbers. The first byte indicates the number of bytes the represented number takes up, and the next one to three bytes ...


17

I am basically doing the same thing for bitcoinmonitor.net. I have a database of addresses to monitor and get notifications from bitcoind for any incoming transaction. I maintain a patchset for bitcoind which allows setting an url which will be called with any incoming unconfirmed transaction, including transaction details in a json object. Also for any new ...


16

Take a look at Windows Build Instructions By Matt Corallo, it's outdated, but has some additional comments to the included doc. Install: MinGW Automated Installer from http://sourceforge.net/projects/mingw/files/OldFiles/mingw-get-inst/mingw-get-inst-20110316/. Install with the C++ and MSYS options checked. Activestate Perl (for building ...


15

Really old versions of Bitcoin did not use checksums in network messages (Satoshi incorrectly assumed that the TCP checksum was sufficient). When Bitcoin was changed to start using its own checksums in network messages, version and verack messages could not be immediately updated to use checksums because old clients would be unable to understand checksum-...


13

(disclaimer: I work on Bitcoin Core) As Luca already mentioned, you have to distinguish wallet implementations and the fully verifying nodes on the network. Because of how Satoshi wrote his code (a node and a wallet in the same program), the two are often confused, but this is considered a bad idea now. They can perfectly function independently. The ...


12

They'd have no problem finding peers for several reasons: Once the client finds a single peer, it can get a list of peers from that peer. The client has a built-in list of about 500 peer IP addresses known to be stable. The client knows several DNS names (such as bitseed.xf2.org and dnsseed.bluematt.me) that resolve to lists of Bitcoin peers. The client ...


12

The characters excluded in Base58 are 0OIl. oiL are allowed, making these two valid addresses. It is impossible to send to an invalid address, as Bitcoin transaction scripts actually include raw 160-bit hashes (which by definition have a one-to-one correspondence with valid addresses), not addresses. Bitcoin clients will simply refuse to do anything if an ...


11

The answers to your questions, in order: The fee paid for a transaction is determined by the size of a transaction. Currently, if you want to do fancy things with bitcoins, you need to put a script in the transaction that sends them -- each output includes a script giving the conditions under which it may be used as an input. OP_EVAL, p2sh and CHV (check-...


11

None. It's impossible to send bitcoins to an invalid address. Those addresses are valid, though they might not be owned by anyone. Look at pszBase58 more carefully: 'o', 'i', and 'L' are allowed. The first few posts in that forum thread are wrong. The network doesn't know anything about Bitcoin addresses. At the network level, you never send bitcoins to an ...


11

Chris Larsen has been publicly identified as CEO of OpenCoin, the company behind the new Ripple. The core developers have been publicly identified as Jed McCaleb, Arthur Britto, Stefan Thomas, and me (David Schwartz).


11

The reference implementation, Bitcoin Core, is written primarily in C++, with various resource files and scripts in other languages. Another implementation, mainly used in lightweight clients like MultiBit and Bitcoin Wallet (Android), is bitcoinj. It is written in Java.


10

The standard Bitcoin client does not at this time support IPv6. Bitcoins.lc is a mining pool, and mining pools work by having an interface (such as PushPool) visible to the public which handles all the getwork stuff and various internals, miner tracking etc. This interface operates as a proxy to the actual bitcoin client and so the client itself can bind to ...


10

I don't believe anyone has published a detailed spec anywhere if that is what you are hoping for. There is some information on the bitcoin wiki, but your best option is to review the existing implementations. Check out BitCoinJ (a from scratch bitcoin implementation in Java) and BitCoinSharp (a C# port of BitCoinJ). They are not full implementations yet, ...


10

Sorry Alex, but you're wrong on the question being asked. It's trivial to put bitcoins "beyond use" so that they can never be spent again. All you would have to do is send the bitcoins to a made up address, which no one would have a key to. This has already been done, since coins have been sent to addresses which are almost certainly unowned (like the ...


10

You could use the JSON encoded ticker data available from MtGox at: https://mtgox.com/api/0/data/ticker.php Just use whatever your language's equivalent to cURL or wGet is and parse as appropriate.


10

If scripts were Turing-complete, you could construct a fairly short script that took an extremely long time to run (a la the Busy Beaver) or contained an infinite loop. This would tend to result in a denial of service against everyone on the network, when they tried to verify the transaction. And there would be no general way to tell whether a script ...


10

To understand Bitcoin Core, the best resource is probably the source code itself: https://github.com/bitcoin/bitcoin To help understand what is going on in the code, try the developer documentation and the Princeton Bitcoin Book. Keep in mind that the code gets updated faster than the documentation, so the code should be your source of truth. Some ...


9

BitCoinJ In addition to @D.H's answer, BitCoinJ provides the following for developers open source through Subversion easy to use Java API easy to integrate via Maven access to either release or snapshot editions depending on your risk profile BitCoinJ also uses the Bouncy Castle encryption algorithm implementations. Some of these were missing or poorly ...


9

As a Programmer You can contribute by acquiring the bitcoin source code at github. Fixing bugs, adding features and creating a "pull request". Here are guidelines for creating pull requests. Gavin Andresen, currently the lead developer of bitcoin, has suggested that testing is a bottleneck, so it would be helpful to compile the existing pull requests on ...


9

The power to dissent over changes that causes existing clients to reject a block does lie disproportionately with miners. Any change that causes existing clients to consider a block invalid is useless until the majority of miners update. Miners who consider the block invalid will never attempt to build on a chain that includes any such blocks. So until a ...


9

New clients that do not yet have addresses stored in the addr.dat will use irc as a bootstrapping mechanism. Even with this limited role, using IRC exposes a weakness: https://en.bitcoin.it/wiki/Weaknesses#Cancer_nodes The IRC bootstrapping will be going away in the future [Edit: as David write, it is deprecated in the latest version], in favor of the ...


9

I'm assuming you mean what will happen to Bitcoin if SHA256 is discovered to no longer be suitable for use as Bitcoin uses it. First, such a thing is likely to happen very gradually. We'll first see hints of weaknesses and attacks that currently take millions of years will shrink to thousands of years and then hundreds of years. So there will be plenty of ...


Only top voted, non community-wiki answers of a minimum length are eligible