One of the difficulties that distributed blockchain networks face is reaching an agreement on which transactions are legitimate, which blocks are valid and which chain is longest. To solve this problem, each blockchain implements a series of consensus rules to which every user, or node, must adhere.
One of the difficulties that distributed blockchain networks face is reaching an agreement on which transactions are legitimate, which blocks are valid and which chain is longest. To solve this problem, each blockchain implements a series of consensus rules to which every user, or node, must adhere.
Consensus rules are a specific set of rules that specify a variety of blockchain properties and procedures. These rules need to be followed when validating blocks and the transactions within them. As long as they are followed by the majority of nodes, agreement is retained and the whole operation continues (this is true for proof of work blockchains, while some alternative consensus algorithms use a less democratic approach).
In order to reach consensus, the majority of nodes must individually accept a single data value and they must do so unanimously. The majority must be in consensus, even if some of the nodes aren’t observing the rules or are unreliable.
Blockchain consensus rules essentials
- Consensus rules achieve consistency and agreement between nodes.
- They determine the validity of every block and transaction, and define the basic properties of the blockchain.
- The community usually decides upon what the consensus rules are (private blockchains are a different matter).
- The rules are enforced by the client and upheld by full nodes.
- Actors that fail to adhere to the rules are banned from the network.
Consensus rules basics
Consensus rules are necessary to achieve synchronization and reach agreement between the thousands of nodes on a blockchain network. Since each node effectively stores a copy of the blockchain, a mechanism is required that allows the nodes to select a reliable block for the continuation of the chain. This is where consensus rules come in.
Every block and transaction within it needs to be in accordance with consensus rules. Furthermore, these rules also determine the basic properties of the blockchain. This includes everything from block time, block size, max supply, means of proof (commonly proof of work), to transaction size, signature requirements, available transaction inputs and outputs and more. They also determine the protocol by which the validators must check the blockchain.
But who determines consensus rules in the first place? When it comes to Bitcoin, they were originally written by Satoshi Nakamoto, but since he made the software open-source, the community now decides on the rules. Any rule change requires the majority of the community to agree upon it. Disagreements may lead to forks.
The rules are not stored and enforced by the blockchain, but by the client software. The rules a user wishes to follow are therefore dependent on which client they choose to run. The most popular Bitcoin client is Bitcoin Core, the continuation of Nakamoto’s original client.
Full nodes, which store the entire copy of the blockchain, are of greatest importance when it comes to upholding consensus rules. These nodes validate transactions and blocks according to the rules and reject any that don’t follow them. Whenever a new block is mined, every full node validates it according to consensus rules. If everything is in order, it’s accepted as the continuation of the chain. If not, it’s rejected (orphaned) and another takes its place.
Additionally, miners tend to select only valid transactions from the mempool to be put into new blocks. They can include invalid transactions (as an attempt to fork the blockchain, for instance), but at the risk of losing the mining reward due to their block being rejected.
Trustlessness in consensus making
Trustlessness can be problematic for consensus making. If blockchain requires no trust between its users, what guarantee do we have that the nodes don’t just follow their selfish interests? Why doesn’t a node simply validate the transactions it likes and censor the rest?
This behavior is unacceptable because it would allow a perpetrator to re-spend coins that have already been spent, a process commonly known as double spending.
The major reason this doesn’t happen (or rather happens rarely) is consensus rules. If full nodes start validating false transactions and passing around invalid blocks, they will be banned by other nodes (the banning process is usually automatized). Since blockchain operates on a trustless basis, each node must reach conclusions on the validity of transactions and blocks on its own. This way, when the results are compared, unreliable nodes are quickly weeded out.
A means of achieving consensus is indispensable on a distributed blockchain network. Consensus rules are a solution that allows the network to function in the absence of any requirement for trust between its users. While these rules are essential, an average user doesn’t need to worry about them.
If you operate with cryptocurrency through an exchange, it will make sure that your crypto transactions are in accordance with consensus rules, so you need not worry about it. That is why so many prefer to trade via a reliable exchange, like Bitstamp, the world’s longest-running cryptocurrency exchange.