Where there are systems, there are protocols – and managing a decentralised ledger requires some of the most dynamic and inventive protocols of them all!
To get you familiar with the concept in this article we will answer:
A protocol is a set of rules that govern a system or collection of procedures. More specifically, in computer science, a protocol is a set of rules or procedures that govern the transfer of data between two or more electronic devices. The protocol helps to establish how the information exchanged between two or more devices needs to be structured and how each party will send and receive it. Some examples of key protocols we use every day are the internet protocols: TCP/IP, HTTPS, and DNS.
Protocols in the realm of blockchain are a bit broader than in general computer science. Rather than just outlining the rules for data transfer, a blockchain’s protocol outlines the whole series of rules needed to govern the distributed ledger. Therefore, a blockchain’s protocol is the predefined set of rules which must be agreed upon by all of the participating nodes or peers in the network. Each blockchain that is developed has its own unique protocol in which it defines its objectives and design.
Slightly confusingly, the sections of a blockchain’s protocol (or the whole set of rules) are divided up into 3 distinct categories, which are also referred to as protocols. These should include:
The above diagram shows how these protocols work together in a blockchain node.
1. Any transaction is first communicated via the network protocol.
2. The consensus protocol then determines whether the data adheres to the consensus checks. If it does then it will make it into a block.
3. Finally, the information in the transaction is processed by the state transition function, which takes the block information and decides what result or behaviour to perform. This could be something simple, like changing someone’s wallet balance, or more complex behaviours requiring smart contracts.
At this point in blockchain history the networking and consensus protocols are fairly standard tools. Obviously they are still incredibly important to the running of the chain, but they do more of the basic functions required to make the blockchain actually work. It’s the state transition function that really stands out within each blockchain and differentiates each one.
In older blockchain’s like Bitcoin, the state transition function merely changed wallet balances in relation to the currency transitions happening on its network. Newer blockchain networks have since taken this precedent and given it new life. Using a concept called smart contracts, the state transition function can now be used to perform just about any action that a non-decentralised programme could. This is where DApps functionality sits. DApp developers can create smart contracts which communicate with this area of the protocol to allow an infinite variety of actions to take place within the blockchain.
CENNZnet’s state transition function has taken this a step further. Rather than have DApp builders create their own complex smart contracts to communicate with the protocol, CENNZnet provides a selection of pre-built core services within the actual protocol. These pre-built services or modules provide a lot of the basic functions that all DApps will need. So rather than having each DApp developer build them individually from scratch, all they need is a much simpler form of smart contract to tap into the ready-made service. You can learn a bit more about these modules in our next article.
In a blockchain, every transaction that takes place must be processed by every participating node. By using the protocols, every node will process the transaction identically. This means that at the end of every transaction the state (record of the blockchain) of each node will be identical. Each node comes independently to the same conclusion, this is the basis of what makes the ledger decentralised and is known as deterministic.
If a node doesn’t follow protocol for a transaction, then it’s state will be different to every other node in the chain. As blockchain records are permanent and cannot be erased, this forever changes the node’s copy of the decentralised ledger and means it can no longer interact with the rest of the chain. This is what’s known as a fork. The node which didn’t follow protocol is now unable to take part in the chain.
This is really important for the safety of the network as it means that nodes who deliberately don’t follow protocol, for personal or malicious purposes, are immediately separated from the blockchain so that they cannot impact the state of the whole chain.