Blockchain – the latest voodoo to be cast in the IT realm with many not even understanding what it is and most not understanding the problem it tries to address.
As simply put as possible: Blockchain is a public database with private information shared between peers with a record of transactions, audit trail and authentication of users.
Can it be made easy to understand?
Well, let’s try, starting with … What was the original problem?
Essentially the issue was how could a currency be created without a bank. This creates a number of requirements … Basically: It must have a common understanding to have a value, there must also be a common ledger and record of transactions as well as mechanisms for people to spend. For transactions to be recorded, it would need a peer to peer infrastructure.
Okay, so – in order to transfer money from one person to another, we need a record of how much money they have.
Great – let’s give users a “wallet” that is available from anywhere. We then need to be able to send messages to transfer currency from one wallet to another.
Okay, now we’re cooking with gas! – but how do I know that the payment really came from User A? Shouldn’t we have some kind of signature?
Now that we have a private key in the wallet, the user can sign stuff and it can’t possibly be from anyone else. Though, we need to put better security around the payment, don’t we?
So far, so good. But while we do this, we need to ensure that the payload is unique to prevent re-spending the same currency.
Also, we have already said that this will not be stored on a server, so we need to know who has been involved in handing this package from one end of the internet to the other. In fact, instead of just handing one transaction, surely we should gather some of the transactions together into a block? While we are at it, let’s make sure the wallets are accessible on lots of nodes around the internet, that way, we don’t need to worry about (1) if the user can get to their wallet, ie. high availability or (2) that the wallet is anywhere vulnerable.
Ah, now that’s a bit better. However, this block will need to be passed between several peers in order to tell User B about User A’s payment. There are risks around malicious as well as accidental change on the way through that have not really been addressed.
Okay, so imagine this block is going to be replicated several times. We already have the encrypted and signed payloads and the block has a header so that you know what is detailed in the block as well as that it is unique.
In practice, what happens is that validators each check the validity of the block and when they have confirmed, tell everyone else that it is valid. This will mean that depending where you view this cloud from, changes how valid you consider the block to be, but over time, this improves …
This is where it gets quite technical. We use an algorithm in order to determine the validity of the block and what are called “miners” to calculate that validity. We also pay the miners in order to make a fair system that prioritises the costly computational effort.
So now we understand why we’re doing things in this way, let’s have a look at the process of what we’re doing:
- Start with a client, a wallet that contains keypairs, and some unspent currency
- You create a new transaction spending some of your unspent currency. Sign it with your private key. Your client will store a copy of it
- Your client starts to broadcast the new transaction through the Network
- Every client that receives your transaction checks whether the signature is okay, whether there are any errors, and whether you are trying to perform a double-spend. If your transaction fails any of the criteria, it is ignored by the client entirely
- All the clients that know about your transaction follow a similar route of broadcasting as you did.
- Eventually your transaction reaches some mining pools and the recipients of the transactions. The latter will see the new transaction in their wallets and store a copy of it indefinitely, but it will appear as 0 confirmations. The mining pools will see it as a new transaction and will include it in every block they try to create. They will store a local copy of the temporary blocks and give out the corresponding work to solve to their miners.
- The miners don’t know anything about your transaction. Their job is to crunch numbers, not to check for block validity, as that’s a task for the pool.
- Eventually your transaction is included in a block that gets solved. It gets broadcasted proudly through the network and everyone keeps a note of it from now on to know if some new transaction conflicts with it in a double-spend attempt. Now your transaction has 1 confirmations.
- The block creation process continues, and as more and more blocks build on the block your transaction gets included, it gains more confirmations. Eventually reaching 6 and more confirmations, it is considered fully confirmed.
- The transaction finishes its life cycle once it is spent by another transaction, meaning that its outputs can be forgotten from the “unspent” memory and disregarded for any other attempts to spend them. It will, however, remain in the blockchain for as long as people will keep track of the full chain.
Interestingly, this is not just a method of publicly maintaining private transaction, it can apply to any information, such as legal agreements or contracts.
However, before you rush out and start building your own Bitcoin or blockchain project, there are considerations about race conditions within the transaction network. It is worth learning the full story first, but this is a basic overview that demonstrates the elegance of the blockchain as a solution, as well as how wildly misunderstood it can become.
But it doesn’t stop there!
In addition to passing data, currency and contracts, you can also have self executing code – which transforms this to quite an incredible and complex organic mechanism that is continuously validated and secure. This changes blockchain into an online computer with the ability to be accessed from anywhere in the world. The fundamental concepts underlying blockchain will enable a revolution in computing. If harnessed through the right networks, with the right code, it could enable a revolution in how we perceive public and private data. If properly aligned to business processes and governance, it could enable the ability to run a de-centralised insurance company, bank, or effectively replace any type of business/institution that usually acts as an intermediary, without a human having to lift a finger.
“A blockchain is a magic computer that anyone can upload programs to and leave the programs to self-execute, where the current and all previous states of every program are always publicly visible, and which carries a very strong crypto economically secured guarantee that programs running on the chain will continue to execute in exactly the way that the blockchain protocol specifies.” — Vitalik Buterin