So the bank needs to track where each coin is - that is, who currently owns it. If we use a digital coin to purchase something from you, we need to inform the bank that we have done so and that you now own that coin. If you like, the transaction has to be registered with the central bank.

That way, we can't use the same coin to buy something from you and then from Tom, Dick and Harry as well. It also means the bank is able to tell if we're trying to use a coin we don't own to purchase something, and can turn down the transaction.

Since we have to worry about someone gaming the system, the purchasing transactions we register with the bank will have to be digitally signed by us. If transactions weren't signed, you could flood the bank with bogus transactions that purported to come from us and that transferred all our coins to you. Therefore, not only are the coins digitally signed (by the bank), but the transactions involving coins are also signed (by the buyer).

Of course, that means everyone who uses digital coins has to be registered with the bank so that the bank has copies of everyone's public keys. Remember, in order to verify a transaction, the bank has to decrypt the signature with the buyer's public signature.

Let's take a break here and recap what we have for our digital cash. We have unique coins, check. Coins can be unambiguously transferred from buyer to seller, check. (Note that even though we can clone coins ad infinitum, only one person owns and can use the coin itself.) We have a way of creating more coins by an authorised entity, check.

What we don't have - at all - is anonymity. The bank in this situation is all-knowing and all-seeing. It knows who owns every digital coin; it knows every single transaction that took place and the counterparties involved. It's much worse than normal cash in that respect, and it could be argued that it's even worse than cheques and credit cards. Although it has some advantages, this is clearly not a complete solution.

Bitcoin

What is crypto-currency?

Enter Bitcoin. The designer of Bitcoin, Satoshi Nakamoto (who may or may not exist or whose name may be a pseudonym), recognised the problem of the central bank becoming omniscient. His solution was radical: make the central bank a peer-to-peer network and make the participants in Bitcoin anonymous.

First things first: with Bitcoin, buyers and sellers are known by their 'address'. A Bitcoin address is a merely mathematical conversion of a public key from an asymmetric cipher key pair. You can have as many addresses as you want and you store them in a 'wallet', which is a digital repository on your computer. If you lose your wallet (that is, you don't back it up), you will lose all of your bitcoins.

The next innovation for Bitcoin is the public network. When you buy or sell, you will generate a transaction. The transaction will be assigned a unique sequential identifier from a timestamp server (actually a distributed timestamp server). This transaction is then broadcast to peer nodes on the network.

These peers have a couple of jobs to do when they receive a transaction: they must verify the transaction (in essence, check the digital signature and respond to the sender with a confirmation), and add the transaction to a special file called a 'block'.

Virtual mining

What is crypto-currency?

The block in Bitcoin terms is an intriguing beast. It's generated through a difficult (that is, time-consuming) process. Generating one is how bitcoins are created: you collect a group of transactions, plus a random number (which is known as the 'nonce'), plus the hash of the last validated block, and then you hash the lot. The answer you get has to have a certain number of zero bits at the front. If it doesn't, you alter the nonce and try again. Repeat until you solve the problem.

Once you do solve the problem, you broadcast the block to the network so that other nodes can verify it and you get 50 bitcoins for your trouble, which are added to your digital wallet. The system is designed so that the payment for blocks is halved every four years or so.

If your block is validated, it is added to the publicly available block chain. Because your block has a reference to the previous block through that block's hash, the chain is slowly built up. Anybody can verify the chain at any point by following the blocks from the very first (known as the 'genesis block') and verifying the hashes.

All blocks are transmitted or synchronised throughout the network, there is no central repository. Blocks are created, on average, about once every 10 minutes (the block chain at the time of writing was 150,955 blocks long and about 600MB in size).

The process of generating a block is known as mining. It is the only way to generate new bitcoins. The system is designed so that a maximum of 21 million bitcoins can be generated.

Using this system, we have finally found our digital currency. It's anonymous (participants are known only by their addresses, and each participant can use many addresses). Although bitcoins can be cloned and spent twice, the network maintains information about the monetary value of each address so the double-spend problem is avoided. Finally, transactions of bitcoins are verified and confirmed by the network.

Julian M Bucknall has worked for companies ranging from TurboPower to Microsoft and is now CTO for Developer Express.

--------------------------------------------------------------------------------------------------

First published in PC Plus Issue 316

Liked this? Then check out The death of money

Sign up for TechRadar's free Week in Tech newsletter
Get the top stories of the week, plus the most popular reviews delivered straight to your inbox. Sign up at http://www.techradar.com/register

Follow TechRadar on Twitter * Find us on Facebook * Add us on Google+