Some consensus protocols i found on the internet :)
1. Proof-of-work
Bitcoin uses Adam Back Hashcash Proof of Work algorithm (Back 1997) which builds on mathematical puzzles that takes a lot of computational effort to solve, and can be easily verified. The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits. The average work required is exponential in the number of zero bits required in the prefix. The solution can be verified by executing a single hash with little computational effort (Nakamoto 2008). When new transactions occur, they are broadcasted to all nodes in the network, each node collect the new transactions in a block. For each block, miners are allowed to assign the first transaction to themselves from a coinbase generation, essentially the block reward with new coins.
Each miner receives a challenge string derived from the hash on the previous block and does computations on the challenge to come up with a proof response. When the miner has a proof response, it is then hashed together with the challenge string to give a unique output and then the block is broadcasted to all nodes. The other miners can check with little computational effort if the transactions in the block are valid and reach consensus on the proof. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash (Nakamoto 2008). It is extremely unlikely, but if two miners should come up with a proof at the same time, the network chooses the longest branch on the next block and the other block becomes a detached/orphaned block, the longest branch is the one with most computational effort behind it (Nakamoto 2008).
Each transactions is like a proposed entry in the ledger, and the transactions are collated in blocks, like a page in a ledger. The miners receive multiple transactions broadcasted from the whole network that are collated by hashing transactions in pairs, forming a tree structure that ends up with a single root hash. The previous block’s hash is then combined with the root hash of the tree, in order to create a connection between the blocks in the chain.
Bitcoin is technically designed for scaling of miners, such that regardless of the amount of miners, if there are four or a million miners, a block is created every 10 minutes on average. When more miners join the network, the difficulty on the cryptographic puzzle is increased by requiring more zero bits in the prefix of hash proof. Every 2016 blocks, the proof of work difficulty is calibrated to maintain the average time of 10 minutes per block. If it took more than 2 weeks to create 2016 blocks, the difficulty is simplified and vice versa (Nakamoto 2008).
1.1 Security of the network
The Bitcoin protocol is designed so that all the miners work on the longest chain of blocks, where the longest chain of blocks is the one that has the most work done on it. If someone would try to double-spend or revert a transaction, they would have to create a block apart from the one that all the miners are working on and beat all the other miners with more computing power. The attacker would have to redo the work on the block he wants to change in addition to the blocks chained after it, thus an attacker would need 51% or more computing power of the network, known as the 51% attack. The computing power, or hash rate, of the Bitcoin network 16th June 2017 is 64’826’395 petaflops(Bitcoinwatch.com 2017), while the top 500 supercomputers in the world combined in November 2016 was 672 petaflops (a 60% increase from last year)(Top500.org 2016). The Bitcoin network is about 100 000 times faster than the top 500 supercomputers combined.
The uptime of the Bitcoin system has been 100% since it’s birth in january 2009. The reason has been so fail-safe is because there is no single-point of attack. All the nodes hold the public ledger. If a node should fail or be taken down, there are still all the other nodes holding the public ledger and keeping the Bitcoin network online, in contrast to a traditional centralized single-point of failure architecture that would go down if the host is attacked.
The Bitcoin network is an open network, meaning that there is no information to steal and anyone can join to mine or use the network by following the protocol rules. Apart from the security of the network, there is a concern for the security of each individual’s keychains. This is up to each user to choose to balance between convenience and risk.
2 Proof-of-stake
The proof-of-work protocol has an extra step. Miners has to spend money on electricity and equipment just to solve a cryptographic puzzle. In proof-of-stake, the money that would have been spent on mining rigs is inserted directly into the Blockchain network. Proof-of-stake (PoS) is a protocol that can be used by Blockchain networks instead of PoW and other protocols to achieve distributed consensus. In a PoS Blockchain network, any owner of a cryptocurrency can invest their cryptocurrency or stake cryptocurrency into the creation of new blocks. Each staking account can be thought of as a miniature mining rig (Nxt 2014). An individual who stakes their cryptocurrency into a PoS blockchain is called a forger (Popov 2016). PoS is not suited for a new cryptocurrency which haven’t distributed, because all the stakes are centralized, thus giving too much control to the owners holding stakes.
PoS has no coinbase transaction to create new coins and distribute them to the miners such as in PoW block rewards (Nakamoto 2008). Forgers in PoS gets rewarded by transaction fees alone. Which forger who gets to create the next block and be rewarded is chosen in a pseudo-random deterministic way, the chance that one account is chosen for the reward depends on their stake (Popov 2016). Blocks in PoS are generated based on unique, verifiable and almost-unpredictable information from the the preceding block. The connected blocks creates a chain of blocks and transactions traceable all the way back to the genesis block. A PoS protocol must define how the next valid block in a Blockchain is chosen by the forging algorithm. Below are two forging algorithms which are currently implemented Blockchains such as Nxt (Nxt 2014), Peercoin and more (King & Nadal 2012).
The Nxt Blockchain protocol will be used as a foundation to explain the foundations of a block selection algorithm in a PoS Blockchain. To determine which forger’s account is eligible to generate the next block, there are three key values: Base target value, target value and cumulative difficulty. These values are also used to decide which block is chosen in case of forks (2.1.6).
- The base target value changes from block to block and is generated using the previous block’s base target value and multiplying it by how much time which was required to generate that block
- The target value is a value calculated by each forger’s account and is based on the account’s current stake. The target value grows for each second since the previous block’s timestamp and is expressed as:
- The Blockchain network derives a new cumulative difficulty value from the previous block’s value. This is used in case of ambiguity to achieve consensus on the Blockchain network by choosing the block with the highest cumulative difficulty. The cumulative difficulty value is derived from the base target value as shown in the formula below:
Each block has a generation signature parameter. To participate in the block forging process a forger’s active account signs the generation signature of a block cryptographically using the forger’s public key. This process will create a 64-byte signature that is hashed using the SHA-256 hashing algorithm. This is referred to as the account’s hit (Nxt 2014).
The hit value is compared to the current target value. If the target value is higher than the hit the next block in the chain can be generated. When an active forger’s account wins the right to generate a new block in Nxt PoS blockchain, the forger bundles available transactions into a new block and populates the block with all the required parameters. Then the block is broadcasted to the network as a candidate to be verified for the next block in the Blockchain (Nxt 2014). The payload, a forger’s account and signatures on each block has the possibility to be verified by all the nodes on the Blockchain network that receive it. When multiple blocks are generated, the block with the highest cumulative difficulty value will be chosen as the authoritative block (Nxt 2014).
3 Proof-of-capacity
In this protocol miners dedicate hard drive space to the network. Miners use the proof that they have dedicated their hard drive space to the network to validate transactions and reach consensus in the network. The algorithm generates large data sets or “plots” which are stored on miners hard drives. The more plots a miner has the higher change of validating the next block in the chain (Burstcoin 2014).
4 Proof-of-activity
This protocol is an extension of the Bitcoin protocol that combines both PoW and PoS. PoW is used to mine blocks that does not contain any transactions. The winning block only contains a header and the reward address of the miner. Then the protocol switches to PoS. Based on the information in the block header, a random selection of forgers are chosen to sign the new block. The more cryptocurrency a forger has, the more likely she is to be chosen. The blocks becomes verified when signed by the validators (Bentov et al. 2014).
5 Proof-of-burn
The concept behind this protocol is that miners should prove that they have burned a certain amount of cryptocurrency. Burning means sending a cryptocurrency to a verifiably unspendable address. This is very expensive considering that you destroy a certain amount of cryptocurrency, but consumes no other resources than the underlying cryptocurrency’s value. This method can be used for mining another cryptocurrency. A miner can use the value of burned coins to increase the chance that their block will be selected. It can also be used for bootstrapping one cryptocurrency of another, sending a cryptocurrency to a burn address and receiving another one in return (P4Titan 2014).
6 Proof-of-elapsed time
Intel has made their own alternative protocol. This protocol is similar to PoW, but consumes less electric power. The system ensures that blocks in the network gets produced in a random fashion, but without requiring the miner to solve a cryptographic puzzle like in PoW. To use this protocol an intel processor is required and this requires the user to trust in the centralized institution of Intel (Intel 2016). Making this a more centralized protocol than the ones previously mentioned.
“Back — Hashcash — A Denial of Service Counter-Measure.Pdf.” Accessed March 7, 2019. http://www.hashcash.org/hashcash.pdf.
Nakamoto S. (2008) Bitcoin: A Peer-to-Peer Electronic Cash System. [online] Available at: https://bitcoin.org/bitcoin.pdf [Read 9.6.2016].
Bitcoinwatch.com (2017). Bitcoin Watch. [online] Available at: http://www.bitcoinwatch.com/ [Accessed 24.06.2017].
Top500.org (2016). NOVEMBER 2016. [online] Avaivable at: https://www.top500.org/lists/2016/11/ [Accessed 24.06.2017].
Nxt (2014). Nxt whitepaper, created by the Nxt community. [online] Available at: https://bravenewcoin.com/assets/Whitepapers/NxtWhitepaper-v122-rev4.pdf [Accessed 21.06.2017]
Popov S. (2016). A Probabilistic Analysis of the Nxt Forging Algorithm. Ledger Journal. 1: 69–83. ISSN 2379–5980. doi:10.5195/LEDGER.2016.46. [Accessed 21.06.2017].
King S., Nadal S. (2012). PPCoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake. [online] Avaivable at: http://peerco.in/assets/paper/peercoin-paper.pdf [Accessed 21.06.2017].
Bentov I., Lee C., Mizrahi A., Rosenfeld M. (2014). Proof of Activity: Extending Bitcoin’s Proof of Work via Proof of Stake. [online] Available at: https://eprint.iacr.org/2014/452.pdf [Accessed 23.06.2017].
P4Titan (2014). Slimcoin A Peer-to-Peer Crypto-Currency with Proof-of-Burn. [online] Available at: http://www.slimcoin.club/whitepaper.pdf [Accessed 23.06.2017].
Intel (2016). Proof of Elapsed Time (PoET). [online] Available at:
https://intelledger.github.io/introduction.html#proof-of-elapsed-time-poet [Accessed 23.06.2017].