Editors Note: One day, we found ourselves discussing the security of bitcoin, only to realize that many readers may not truly understand the digital currency. Luckily, a team member’s father, Eoin Meehan, is well versed in the subject and has submitted a guest blog to help everyone understand this popular form of cryptocurrency.
Bitcoin is a cryptocurrency, reportedly designed by Satoshi Nakamoto in 2008. To fully understand how it works we must look at how “ordinary” currencies work.
To quote Sheldon Cooper “It was a warm, summer’s evening in ancient Greece …”
Well, no, we don’t need to go back THAT far.
Currencies evolved as people used bits of precious metals as tokens to exchange for goods and services, rather than using OTHER goods and services (which is barter). Gold and silver served this purpose well because they were
- Rare metals and durable
- Elements, so it was easy to see if they had been tampered with and
- Acceptable by everyone who traded with them – a common medium of exchange
Eventually someone realised that physically moving large amounts of precious metals was both cumbersome and risky, and came up with the idea of a paper token denoting ownership of a piece of gold that was held somewhere secure. The paper token said that whoever held this piece of paper could go to where the gold was stored and demand it to be handed over (which is why notes used to have “I promise to pay the bearer on demand the sum of x pounds” – its x pounds worth of gold).
Everyone accepted the concept of the paper representing the gold and so it took on the value of the gold itself. This became known as the “Gold Standard”
Then someone realised that because everyone was happy with the pieces of paper representing “value” there was really no need to keep tons of gold in a secure location, in case somebody actually turned up and asked for their pound of gold. And that’s what we have today with currencies such as the Euro.
So today, a currency has to have three attributes to be a currency:
- The tokens are rare or controlled.
- The tokens representing that value are very difficult to generate and replicate
- A value accepted and agreed by everyone who uses it – a common medium of exchange
Bitcoins are tokens that can be exchanged between parties in a transaction, just like physical notes. There are no physical bitcoins, so the transfer happens just like transferring money between bank accounts.
These “bank accounts” do not exist in any institution, but as “wallets” on electronic devices. These wallets are encrypted files on a PC, laptop, tablet or smartphone, managed by a Bitcoin-compliant application. The Bitcoin standard uses public/private key pairs to authorise and authenticate transfers between wallets, and each wallet has its own private/public key pair.
The transfer happens across a peer-to-peer network similar to Tor or Bittorrent.
But what happens if Alice sends 5 Bitcoins (BTCs) to Bob, and ALSO tries to send the SAME 5 BTCs to Carol?
To stop this happening there is a data construct called the block-chain which is held on all nodes participating in the Bitcoin network. The blockchain is an encrypted list of all transactions that have been “approved” in the Bitcoin universe, and acts as a shared ledger. Once Alice sends her 5 BTCs to Bob, those 5 BTCs are logged in the blockchain as a transfer between Alice’s wallet and Bob’s wallet. If Alice tries to send the SAME BTC’s again, the network will reject the transaction, as the BTCs are already “accounted for”
So how are the transactions added and “approved” to the blockchain? This is done by special nodes called “miners”. Miners have two functions – to authorise transactions and to generate new Bitcoins (hence the name).
When Alice sends Bob the 5 BTCs, the transaction is broadcast the Bitcoin network, and the transaction is marked pending (not complete). Miners listen for these broadcasts and begin working on adding the transaction to the blockchain.
The process of adding the transaction to the blockchain is computationally intensive. The miner has to apply a hash-function to the block-chain + the new block to generate a hash. Normally for hashing purposes we can just stop there. One computationally intensive process to create a number. But Bitcoin applies a ceiling such that the hash created must be equal-to or less-than the ceiling. This means the miner must recalculate the hash many times until it returns an acceptable value. If two miners return values, then the lower one “wins”. Once the hash is created and accepted, working backwards to see if this hash is valid for this block is trivial. So verification is easy.
This ceiling value is also how the network “self-regulates”. The more miners there are connected, the lower that ceiling value goes (the harder the task).
Once a miner successfully calculates the hash value, the block-chain is updated and the wallet applications notified. (Because of the intensity of the calculations, there is about 10 minutes between the transaction and its confirmation).
Now we come to the second function of the miner. As a reward for calculating the hash, the miner is allowed create a certain number of new bitcoins, and these are recorded as part of the verified transaction. They are then transferred to the miner’s appropriate wallet and “come into circulation”.
The number of bitcoins a miner is allowed create is a function of the total number of bitcoins that will ever be allowed. Currently its 25 BTCs. For every 210,000 blocks added to the blockchain, this number is halved. So Bitcoins become harder to generate the more that are in circulation. There is an arbitrary limit in the protocol that there will only ever be 21,000,000 bitcoins.
So one question you might ask is – what happens when all bitcoins are mined? What incentive is there for miners to keep, eh, mining? The protocol considers this. In each block record in the block-chain, a miner can charge a fee or commission for calculating the hash and verifying the transaction. So miners will still be mining bitcoins for their owners except they will be paid by other members to verify transactions.
Once Bitcoin is accepted a medium of exchange each BC has a value. This value can then be “matched” with real-world currencies just like a foreign-exchange transaction. There are a number of electronic exchanges set up which will perform this forex transaction … for a fee of course! The most notable one is probably is MtGox.