Blockchain – Part 2 – The 51% hack and the AWS Solution

Blockchain – Part 1 – a Foundation of Distrust

Proof of Work

In Part 1, I discussed the proof of work algorithm which involves creating a cryptographic hash that would require approximately 10 minutes of compute time for every block that is added to the blockchain. The problem with this mechanism is that for every block successfully added to the chain by individual miners; there are thousands of miners whose work is discarded because they came in second when creating the block.

So, why would we deliberately give all the miners in the network a task to complete that is going to use so much compute power?

The idea is to make it financially unviable for hackers.

Double Spend

In a public network where anybody can become a miner, how do you stop somebody creating false records and double-spending cryptocurrency? For example, Miner A – the hacker – makes a payment to Miner B.  All the miners start creating the next block in the chain.  Miner A completes their block first, but deliberately excludes from their block the transaction with Miner B.  Then, instead of publishing that block – because Miner B would certainly complain; Miner A goes on to successfully create a second block of new transactions.  Miner C in the meantime has completed and published the first block.  When Miner A publishes their two blocks, that is now the longest chain and so all the other miners take their update from Miner A; and the transaction with Miner B is lost.  Miner A keeps both their money and whatever goods they purchased from Miner B.

Obviously, there are safeguards in place, but all safeguards have their limits.

The 51% Hack

The proof of work algorithm is designed to make it such an enormous task for a miner to double spend in such a way, that the cost would outstrip the benefit.  For example, Miner A had to have enough compute power to outperform all the other miners in the network combined.

This is something referred to as the 51% hack and in 2019 a number of smaller crypto currencies with only a very limited number of miners, did actually suffer such a hack. Earlier this year a miner successfully instigated a 51% attack and blockchain reorg of 3693 blocks of Etherium Classic at block 10904146.

So what happened?  2miner, one of the largest members of the Etherium Classic network and with considerable hashing power, went offline for maintenance.  At the same time an unknown miner added 3000 blocks to the ETC blockchain.  By the time 2miner came back online, the ETC block was one of the longest and therefore most mined chains in the network.

The problem that was faced was not only of identifying the hack but also the compute power needed to repair the chain.  After all, just as it takes a lot of PoW to build a chain, it also takes a lot of PoW to repair it.

Whilst it is said that this could never happen to Bitcoin because of the number of miners in the network, the size of the Blockchain and the sheer cost of compute power; proof of work has been called into question and a number of alternatives to proof of work are being actively investigated.  These alternatives include proof of state, auditing services based on the computer science technique of formal verification, “bug-bounties” to reward reporting cryptocurrency flaws, and more recently the use of AI to monitor transactions and detect suspicious activity.

Why use Blockchain?

So, why would you ever use blockchain?

Well, there are safeguards.  In a public and untrusted network then there is safety in numbers.  The more miners you have, and more importantly, the more distributed the compute power, the safer the network.

The question remains; do you really need a public network?

Hyperledger Fabric

If the objective is simply to have the benefits of a distributed ledger amongst trusted members then why not look at HyperLedger Fabric?

HyperLedger Fabric, available on Amazon Web Services, is a private blockchain to which you add members using a voting policy – in other words, consensus of the existing members.

Amazon offers a private network that requires a level of registration; the individual ledgers are shared across availability zones and the whole blockchain is protected with Amazon security.

Furthermore, using subnets, it is possible to create multiple blockchains with different members.

Because all the members are known, there is no need for proof of work or proof of state and so no need for massive compute power.  Instead, you have a distributed ledger shared by trusted members on a multi-domain distributed network.

Case Studies

Who would use such a ledger?

The airline industry requires that every component of an aircraft can be tracked back through every stage from raw materials to final machine and build.  The component manufacturer and the airline manufacturer could share information on a primary domain in HyperLedger, whereas raw material suppliers could be on separate sub domains with the component manufacturer.  This means that suppliers do not have visibility of each other, the airline manufacturer does not have visibility of the suppliers to the component manufacturer, but the component manufacturer has visibility of everybody.

As raw materials are sourced and built, subdomain ledgers are maintained.  The component manufacturer is then positioned to transfer relevant information to the primary ledger along with all manufacturing details.

Other examples of multi-domain ledger systems could include Government Voting mechanisms, NHS dangerous disease data, criminal records, medical records and so on.

Utilising Blockchain

Blockchain as an emerging technology is incredibly powerful and resilient.

AWS offers a number of Blockchain solutions including HyperLedger Fabric and multi-domain solutions.


John Dunning works for 1Tech, an AWS Cloud Partner.