What happens when you spend bitcoins?

Wednesday 19 August 2015

Bitcoin is a form of money unlike any other you’ve seen. Forget your preconceptions about cash: here’s (roughly) what’s really happening.

When you’re using regular cash, you hand over tokens (notes and coins) that signify value. When you make an electronic transfer, the bank or payment processor is updating a centralised ledger of balances - which it can also manipulate, should it wish, reversing transactions or making them unilaterally.

Read also: Mining like it's 1959

Bitcoin is utterly different. So different that normal money doesn’t provide many useful analogues for what’s going on when you make a transaction.

Locked box

Your bitcoin address is like a locked box to which only you have the key

With a bitcoin transaction, you’re essentially saying: ‘I have the right to spend the contents of this address. I am going to give them to a new owner by setting a test for that ownership that only the holder of the new address’s private key can pass.’ As Mastering Bitcoin explains:

‘Transactions move value from transaction inputs to transaction outputs. An input is where the coin value is coming from, usually a previous transaction’s output. A transaction output assigns a new owner to the value by associating it with a key. The destination key is called an encumbrance. It imposes a requirement for a signature for the funds to be redeemed in future transactions. Outputs from one transaction can be used as inputs in a new transaction, thus creating a chain of ownership as the value is moved from address to address.’

This is a bit like locking some cash in a box, or a series of boxes. When you want to send some money to someone else, you unlock your box (using your key to prove your right to spend it) and drop some of the funds inside through the slot in the top of the recipient’s box (setting the criteria of having the right key for the recipient).

The analogous action works in bitcoin because the magic of public key cryptography means that anyone can encrypt a message with the recipient’s public key - which can be made known to everyone - but that message can only be decrypted by the person who owns the private key (which they tell no one else).

This feature of public key cryptography, along with consensus systems like proof-of-work and proof-of-stake, are foundational to cryptocurrency. It is also the reason that bitcoin transactions, unlike bank transfers, are irreversible.

comments powered by Disqus