Bitcoin Baby Steps (I)

By | 2011-04-15

I’m still interested in Bitcoins, and I am continuing my experiments and investigation. I have downloaded the beta Bitcoin Wallet for Android app, which is simplistic for now, and only works on the Bitcoin test network; but it is enough to see the potential of the system.

Bitcoin Wallet App

Bitcoin Wallet App

When it runs you are presented with a refreshingly simple screen that contains a Bitcoin address (which you can use to receive coins) a QR code representation of that address (so another user could scan your phone with their phone to send you Bitcoins) and the balance on that address. A visit to the Bitcoin faucet provided me with 50 bit coins (from the test network, so they aren’t worth anything) and I sent them back to the faucet just to watch it work. A quick trip to the Bitcoin testnet block explorer showed the transactions I generated. All looking good to me. If they had been on the real network, and I had a merchant willing to accept them, I could quite easily have performed a financial transaction using only my phone and some clever software.

I should stop at this point to explain a little. Bitcoins are generated then passed from address to address. A Bitcoin address is simply the public key half of a public/private encryption key pair. You can make as many address key pairs as you want. When you want to receive money you tell the sender the public key (actually you tell them a cryptographic hash of the public key, but that is unimportant for us as users). The sender then writes a little transaction record (or rather their Bitcoin software does) detailing how much they want to send you, and then signs that transaction with the private half of the key. Being that only they have the private half, but everyone who cares to look can find the public half, anyone can verify that the owner of that private key really did sign that transaction. That signature is like the signature on a cheque, only it is utterly unforgeable (for all reasonable circumstances).

That transaction is then posted to the Bitcoin peer to peer network; for inclusion in the ever-increasing list of transactions. We needn’t go into how that works, suffice it to say, that signed transactions are verified and added to a similarly unforgeable chain. That chain is agreed upon by the network as a whole, and very shortly becomes confirmed by multiple peers. It is this majority confirmation system that would have to be subverted before someone could spend coins multiple times.

Now then, what stops them making up any old transaction, with any amount of Bitcoins listed and just signing that? The answer is that the transaction includes the Bitcoin address they want to send from; and the Bitcoin network can simply look back through previous transactions to confirm that that sender has sufficient funds for the transaction they are signing. That is the “verify” part described in the previous paragraph.

  • Generate: 50 to address GENERATORADDRESS1
  • Spend: 10 from GENERATORADDRESS1 to MERCHANTADDRESS1
  • Spend: 10 from MERCHANTADDRESS1 to MERCHANTADDRESS2

When MERCHANTADDRESS2 wants to accept MERCHANTADDRESS1’s money, it simply looks backwards through the transaction list and finds that MERCHANTADDRESS1 has received 10 bit coins, but never spent them; it checks that the signature on the transaction is valid and accepts the money. If they are really paranoid they can wait for multiple peers in the network to further include that transaction in their master list, and the transaction is then publicly agreed and announced and can’t be withdrawn.

As a Bitcoin user, we probably don’t need to know as much detail as I have described, but being a computer geek, I like to know, and I also like to be able to confirm for myself how trustworthy the design is. I think it’s pretty good.

My next step was to get a real Bitcoin address. As I’ve already gone on a little too long, I’ll save that part for another post.

Leave a Reply