Blockchain Consensus

Blockchains use a variety of consensus models that enable a group of mutually distrusting users to work together.

Many mining nodes are competing at the same time to solve a puzzle to gain the right of publishing the next block (and if applicable, a financial award). They are generally mutually distrusting users that may only know each other by their public addresses. Each user may be motivated by a desire for financial gain, not the well-being of the other mining nodes or even the network as a whole. In such a situation, why would a user propagate a block solved by another user? Also, who resolves conflicts when multiple mining nodes solve a block at approximately the same time? To make this work, blockchains use a variety of consensus models that enable a group of mutually distrusting users to work together. Note that when a user joins a blockchain system, the user agrees to the initial state of the system. This is recorded in the only pre-configured block, the genesis block. Every blockchain has a published genesis block and every block must be added to the blockchain after it, based on an agreed-upon consensus method.

Regardless of the method, however, each block must be valid and thus can be validated independently by each user in the blockchain network. By combining the initial state and the ability to verify every block since then, users can agree on the current state of the blockchain. Note that if there were ever two valid chains presented to a user, the default mechanism, in most blockchain systems, is that the longer chain is ‘more’ valid and should be adopted (this happens occasionally and will be discussed later).

The following properties are then in place:
In practice, node software handles all the details. Key to the blockchain approach is that there is no need to have a trusted third party to give the state of the system—every user within the system can verify the system’s integrity. To add a new block to the blockchain, all participating nodes must come to a common agreement over time, however, so some temporary disagreement is permitted. The method of agreement (or consensus) must work even in the presence of possibly malicious users attempting to disrupt or take over the blockchain. This section discusses several major consensus models, as well as conflict resolution.

Proof of Work Consensus Model
In the proof of work model, a user gets the right to publish the next block by solving a computationally intensive puzzle. The solution to this puzzle is the “proof” they have performed work. The puzzle is designed such that solving the puzzle is difficult, but checking that a solution is valid is easy. This enables all other mining nodes to easily validate any proposed next blocks, and any proposed block that did not satisfy the puzzle would be rejected. A common puzzle method is to require that the hash of the block be less than a certain value. Mining nodes then make many small changes to the block (the nonce) trying to find a block hash that meets the requirement. For each attempt, the mining node must compute the hash for the entire block header, which is a computationally intensive process. The required value may be modified over time to adjust the difficulty to influence how often blocks are being published. For example, Bitcoin, which uses the proof of work model, adjusts the puzzle difficulty every two weeks to influence the block publication rate to be around once every ten minutes.

An important aspect of this model is that the past work put into a puzzle does not influence one’s likelihood of solving future puzzles. Hashing a candidate block one thousand or one million times (with different nonce values) only increases the likelihood of solving the current puzzle (as the nonce input space is being reduced with each hash calculation), it does not increase the user’s likelihood of solving any future puzzles, and therefore each puzzle to solve for a block is independent and requires the same amount of work. This means that when a user receives a completed block from another user, they are incentivized to include the new block because they know the other mining nodes will include it and start building off it. If they refuse to accept the new block, they will be building off a shorter chain of blocks and (as mentioned previously) by default, the longest valid chain is adopted.

There is no shortcut to this process; mining nodes must expend computation effort, time, and resources to find the correct nonce value for the target. Once a user has performed this work, they send their block with a valid nonce to the other nodes in the network. The recipient nodes verify that this work was done properly, add the block to their copy of the blockchain, and resend the block to their peer nodes. In this manner, the new block gets quickly distributed throughout the network of participating nodes. Verification of the nonce is easy since only a single hash needs to be done to check to see if it solves the puzzle.

The proof of work consensus model is designed for the case where there is little to no trust amongst users of the system. It ensures mining nodes cannot game the system by always being able to solve the puzzles and thereby control the blockchain and the transactions added to it. However, a major pitfall of the proof of work consensus model is its excessive use of energy in solving the puzzles. This is not trivial; for example, currently the Bitcoin blockchain uses more electricity than the entire country of Ireland, and it has been speculated that it will consume as much electricity as the entire country of Denmark by 2020. Software and hardware continually improve, with the result that puzzles can be solved more efficiently, but blockchain networks are growing, and the puzzle targets get harder as more mining nodes participate. Due to the increasing difficulty of the proof of work puzzles, it is becoming harder for any one computer to solve a puzzle. Therefore, mining nodes have organized themselves into “pools” or “collectives” whereby they collectively solve puzzles. This is because it is possible to distribute the work between two or more nodes across a collective to share the workload and rewards.

Proof of Stake Consensus Model
The proof of stake model is based on the idea that the more stake a user has in the system, the more likely it will want the system to succeed, and the less likely it will want to subvert it. Proof of stake blockchain systems use the amount of stake a user has as a determining factor for new block creation. The methods for how the blockchain system uses the stakes can vary – from random selection of staked users, to multi-round voting, to a coin aging system. Regardless of the exact approach, users with more stake are more likely to produce new blocks.

With this consensus model, there is no need to perform resource intensive computations (time, electricity, processing power) as found in proof of work. Since this consensus method employs less resources, some blockchains have decided to forego a reward for new block creation; these systems are designed so that all the cryptocurrency is already distributed among users rather than new coins being generated at a constant pace.

Within a proof of stake blockchain system, where the choice of block creator is a random choice (sometimes referred to as Chain-based proof of stake), the blockchain system will look at all users with stake and choose amongst them based on their stake to overall system stake ratio. So, if a user had 42% of the stake they would be chosen 42% of the time; those with 1% would be chosen 1% of the time.

When the choice of block creator is a multi-round voting system (sometime referred to as Byzantine Fault Tolerance proof of stake) there is added complexity. The blockchain system will select several staked users to create proposed blocks. The system will then ask all staked users to vote for the next block. After several rounds of this voting, a new block is decided upon. This method allows all staked users to have a voice in the block selection process for every new block. Finally, there is a method of proof of stake which allows users to create blocks by “spending” aged cryptocurrency (sometimes referred to as “Coin age” proof of stake). The user’s staked cryptocurrency has an additional “age” property, and after a certain amount of time (such as 30 days) the staked cryptocurrency can be “spent” and allow the user to create a new block on the blockchain. The “spent” cryptocurrency then has its “age” reset to 0, and it cannot be used again until after the requisite time has passed. This method allows for users with more stake to create more blocks, but to not dominate the system – since they have a cooldown timer attached to every cryptocurrency spent creating blocks.

Under proof of stake systems, the “rich” can more easily stake more of the digital assets, earning themselves more assets; however, to obtain the majority of assets within a system in order to “control” it is generally cost prohibitive.

Round Robin Consensus Model
In some blockchain systems there does exist some level of trust between mining nodes. In this case, there is no need for a complicated consensus mechanism to determine which participant adds the next block to the chain. This consensus model is often used for private blockchains and is called round robin, where nodes take turns in creating blocks. To handle situations where a mining node is not available when it is their turn, these systems may include an element of randomness to enable available nodes to publish blocks so that unavailable nodes will not cause a halt in block production. This model ensures no one node creates the majority of the blocks, it benefits from a straightforward approach, it lacks cryptographic puzzles, and has low power requirements.

Unfortunately, due to the need for some level of trust amongst nodes, round robin does not work well in the permissionless open networks used by most blockchain based cryptocurrencies because malicious nodes can continuously add additional nodes to increase the odds of subverting the network.

Ledger Conflicts and Resolutions
It is possible that multiple blocks will be published at approximately the same time. This can cause differing versions of a blockchain to exist at any given moment; these must be resolved quickly in order to have consistency in the blockchain.

With any distributed network, some systems within the network will be behind on information or have alternative information. This depends on network latency between nodes and the proximity of groups of nodes. Blockchain systems that allow any node to generate blocks are more prone to have conflicts due to this openness. A major part of agreeing on the state of the blockchain system (coming to consensus) is resolving conflicting data.

Conflicts are usually quickly resolved. Most blockchain systems will wait until the next block is generated and use that chain as the “official” blockchain, thus adopting the “longer blockchain”.

Source: National Institute of Standards and Technology, U.S. Department of Commerce (Jan 2018)

New Media Aid has been the app development partner for Kelly Turkeys since 2006 and has developed a number of mission-critical bespoke apps for us and we highly recommend them for bespoke application development.

Asa Howard, Finance Director
Kelly Turkeys - Danbury, Essex

New Media Aid has been our development partner for both our website and virtual learning environment since 2004. The quality of service has been consistently exceptional in every way. I would be very happy to recommend them for any development and as a highly reliable long term partner as well as for short term projects.

John Rubinstein, Principal
Woodhouse College - Finchley, London

New Media Aid has developed a number of advanced, bespoke apps for BAE Systems and we are happy to recommend them for bespoke app development.

Rob Morris, Vice President Marketing & Analysis, Asset Management
BAE Systems - Hatfield, Hertfordshire

These apps developed by App Developer for Android mark a new turn towards technology for an industry that’s been slow to adapt until now. With no suitable ‘off the shelf’ solution available below costly, enterprise level software, we were involved in the development process from the start, getting the right solution that suited our operations and our customers.

Ben Guy, Managing Director
Hammond Produce

App Developer for Android quickly understood what we needed and were able to develop exactly what was required with minimal input from ourselves. As this was the first Android app we had developed we were pleased that it was done on time and within the quoted price. We would gladly work with them again and recommend them.

Mark Austin, Managing Director
Wing Parking

Having recently moved to Android PDAs for our mobile workforce, we identified a need for a Bespoke App and a Web-based Management System to control it. App Developer for Android demonstrated a real understanding for our needs and a "can do" attitude that we found extremely helpful. Their solution was provided on time and within budget and has exceeded our expectations. We will be happy to work with them again when we have further requirements.

Trevor Wright, IT Manager

New Media Aid has successfully developed a number of bespoke applications for us over the last few years - we have always been pleased with the results and with the ongoing support and assistance we receive.

Anne Barlow, Marketing Manager
British Chiropractic Association - Reading, Berkshire

New Media Aid undoubtedly fulfils the requirements we have for our company’s corporate website. Not only did they provide us with all the features we needed from the get-go, they also promptly come up with solutions when we have new requests.

JD Venter, Deputy Editor
Dry Cargo International - Colchester, Essex

New Media Aid developed a bespoke website and content management system for us that makes it easy to run our business. The app has been designed in such a way that we’re able to have it updated when our needs as a company develop. Our trade customers love the fact that they can login and view historical orders as well as viewing new products and ordering online themselves. I would definitely recommend New Media Aid for bespoke app development.

Shona Easton, Managing Director
Easton Design Studio - Cranleigh, Surrey

We are thrilled and very excited by our new mobile-friendly website from New Media Aid which is seamlessly integrated with a bespoke candidate and vacancy management system. They have been extremely responsive and patient and have talked us through the whole process. They are always available for queries and trouble-shooting not only on this project but also with other web apps they have developed for us. We couldn’t recommend them more highly.

Millie Harvey, Marketing Manager
Excelerate Resources - Warwick

New Media Aid develops business-critical bespoke applications for Gateway College and we are happy to recommend them for bespoke application development.

Paul Taylor, Network And Corporate Data Manager
Gateway College - Leicester

We are delighted with the flexible and efficient service we received from New Media Aid. Highly professional and personable which works well for us as a small business. We wanted to update our old website and not being IT specialists it was good to talk through issues and get helpful advice on new design ideas and practical solutions. Working together on the design and implementation of our new site has resulted in a user-friendly eCommerce website on PCs, phones and tablets – and we instantly saw a huge increase in business once the new site went live. No hesitation in recommending their services.

Gordon Little, Managing Director
GE Little Radiator Covers - Basildon, Essex

New Media Aid developed Gigacom Tems a bespoke and fully integrated project management system. New Media Aid fully support all our IT requirements and must be congratulated on the valued and excellent support that we continue to receive from the New Media Aid team. I have no doubt that without the high level of innovative support that we receive we would not be able to efficiently deliver the services that we provide for our customers.

Phil Taylor, Operational Management Team
Gigacom Telecommunication Engineers Management Services - Alton, Hampshire

The certificate scanning system developed by New Media Aid is working really well for us and is more efficient than our previous way of processing certificates. It really is brilliant and must have saved us a fortune in paper!

Rachel Bothamley, Senior Examinations Officer
Lincoln College

New Media Aid has supported the development of a complex store and back office system that significantly helps improve the accuracy of our processes whilst improving the efficiency and service to our clients. Couldn't be happier with a supplier (who we genuinely consider as a partner).

Stephen Mason, Managing Director
Mason Information Technologies - Nottingham

New Media Aid has an excellent understanding of our business and therefore can offer a high level, intuitive service. They have programmed and maintained our websites and CMS for nearly 10 years and are responsive and very easy to work with, we highly recommend talking to them about your digital projects.

Donald Campbell, Marketing Manager
Team London Bridge - Southwark, London

Excellent service, clear pricing and Alastair is so easy to deal with. Would definitely recommend. We're very pleased with our new App!

Mary Stealey, Operations Manager
Just Filters - Harlow, Essex

Alastair was great at understanding our needs and building a new android app and web-facing management interface that met all our requirements. The solution was delivered within impressive timescales and at a competitive price. He kept us up to date throughout the project, was happy to be involved in conference calls to discuss setup and deployment, and was always incredibly responsive to our questions and requests for further enhancements. It was a pleasure working with Alastair and we look forward to the opportunity of working with him again in the future.

Stephen Connolly, Technical Team Manager
Parker Hannifin - Hemel Hempstead, Hertfordshire