At its core the blockchain is about several actors reaching consensus on what a valid block is. Each blockchain must choose its way of deciding exactly how that consensus is reached, and who can contribute to the search.
One of the better statements about the blockchain — and the Bitcoin blockchain in particular — that I have seen, and I wish I remembered when I read it, was something like this:
People think that the blockchain is all about solving incredibly difficult and complex equations, but the reality is that it’s like millions of computer shouting numbers across the internet until most of them reply “I agree”.
This sums up what happens with the consensus algorithm known as “proof-of-work” or POW. This is how the Bitcoin blockchain operates, and why you may read articles warning that it’s a huge waste of energy. With Bitcoin every miner is trying to come up with a single solution in the quickest time possible. If there are a million miners (an admittedly high estimate) then one may say that 999999 of these miners are wasting energy because only one will be the first to reach the correct answer.
Of course that’s an absurd oversimplification. All the other miners on the network are also verifying the one correct solution that has been found, and are an essential part of the process. The more miners are online, the quicker the solution can be verified, accepted as correct by 50% + 1 of the miners, and appended to the chain. And the more miners there are the more remote the possibility that a brute force attack (the 51% attack) can even be attempted, let alone succeed.
A What Attack?
The 51% attack is the most elementary attack on a proof-of-work (POW) blockchain network. If the consensus is 50%+1, then you can simply throw more miners on the network until you control 50%+1 of the global hashrate, and then you could rig the whole operation to enrich yourself by cheating, double-spending tokens, or making the network useless.
With today’s cloud infrastructure it’s easier than ever to create hundreds or thousands of virtual machines in a very short amount of time, so this is not just a theoretical threat. It’s the most common mode of attack on smaller POW blockchains.
When it comes to these attacks, greater network size provides more protection. There’s very little risk of someone coming along and suddenly generating more hashrate than the rest of the bitcoin network. That hashrate, FYI, is currently hovering around the 50 million terahash per second. A terahash is one trillion of hashes per second, or (if my math isn’t completely off) roughly 5 quintillion hashes per second.
That being said, POW is a first-generation blockchain consensus strategy. Newer blockchains can use a number of different strategies to establish consensus.
Cryptocurrency as a Reward for Mining
At the core of the idea of cryptocurrency is the idea of reward for work.
For example, miners in Bitcoin all try to solve the same problem at once because whatever miner discovers the solution first wins a block reward. That reward is a number of Bitcoins. Initially 50 BTC were awarded, then it became 25 BTC, and now that number has been halved again to 12.5 BTC. That is a substantial reward, even at this time. All the other miners get nothing.
A proof-of-stake strategy operates with different assumptions. Instead of miners, the network is run by people who have previously invested in the network by acquiring its cryptocurrency. The idea there is that you need to have “skin in the game” to share in the rewards. For the blockchains that implement this, there is no block reward. Instead, fees are paid on the transactions on the network which is then distributed to the nodes that have registered a stake. To register a stake it must be placed in some kind of escrow.
With the POS strategy nodes that have a stake collect, package and encrypt transaction data and push it to the blockchain. Any actor’s participation is equal to the actor’s stake divided by the total number of staked tokens.
The delegated POS strategy takes that concept to the next level. In this system the stake-holders (stake-hodlers?) elect a certain number of their own to be witnesses. This is typically a low, odd number to avoid possible deadlock. 21 is generally considered to be a good number of witness nodes.
Witness nodes are the only nodes that perform work (bundling and encrypting transactions) under this arrangement. Instead of earning a reward, witnesses are paid to ensure that their nodes perform the work.
These are the “big three” strategies at this time. There are other, less currently popular but not necessarily less valid strategies, like mandating that any one node on the network can only do work at certain time intervals, or where a number of nodes are chosen by lottery to perform work, and many more. The implementation details of each strategy can be wildly different.
The uptake on this is that while cryptocurrency saw the day thanks to proof-of-work blockchains, today the landscape offers many other possibilities which can be much more efficient than Bitcoin (which remains the gold standard). Less actors needed for consensus means less energy spent reaching that consensus, and also a much lower level of latency which allows for greater transaction throughput.
To bring Bitcoin up again here, few people know that it’s a fairly slow network that has a typical ability to process maybe 5 transactions per second. Compare this to the Visa payment network, which can handle over 24000 transactions per second, and it becomes clear that if crypto is ever to see wide adoption as a means of transaction competing with Visa and other payment networks it needs to be a lot quicker.
And that’s today’s lesson.