This section is made to give more in-depth info on different blockchain consensus mechanisms.
Calculation processes that allow for the secure validating and updating of a blockchain ledger. Usually performed by decentralized user nodes.
The more extensive and widely distributed the nodes (participants) are, the lower the probability of collusion and corruption is.
Most mechanisms are variations of Proof of Work and/or Proof of Stake consensus, so I suggest understanding these two well, first.
Determining which consensus mechanism is preferable often comes down to a trilemma tradeoff between security, scalability, and decentralization.
The "proof" is showing that each validator/miner/staker/participant/etc. is invested in the network; thus has aligned incentives to not corrupt the network.
There is a glossary section at the end of this page.
Proof of Work (PoW):
The following explanation for Proof of Work consensus will largely be in reference to the SHA-256 version that Bitcoin uses. However, there are many Proof of Work derivatives used by other cryptocurrencies, that follow somewhat different rules.
The Chill Explanation for Proof of Work: A bunch of different people, from around the world, use their computers to calculate that everything happening in the system is correct. Participants get compensated/rewarded for using the energy and bandwidth (“work”) of their computers.
Now, let’s get gritty...
Proof of Work- Consensus mechanism that involves mining blocks, using a designated hashing algorithm. The process of mining is the “work” being proven.
A miner/participant/validator takes thousands of transactions that are unconfirmed/outstanding and builds a candidate block of transactions to be verified against the system rules. This candidate block also includes:
The header (id) from the previous block, which helps maintain links, forming the blockchain.
A nonce (random numbers added to the data to achieve the desired difficulty target).
The miner’s BTC address for receiving the potential reward amount.
Once a candidate block is constructed, the miner uses the SHA-256 hashing algorithm to calculate the correct hash (64 character long) id of that block data.
The SHA-256 hashing algorithm is deterministic (not random), meaning that if you run the SHA-256 computer command on the word "Cat" it will produce a very specific 64 character hash id for the word "Cat" (data). However, if you slightly change the data to read "CaT", then the 64 character hash id will be entirely different than the one was derived from "Cat".
The tricky part of consensus that involves intensive amounts of brute force computing "work". This work is the process of adding all sorts of nonce options to the block data and hashing each option, until the desired difficulty target (number of leading zeros on the hash id) is met. This would be like adding a series of random numbers to the end of "Cat" (i.e. "Cat 9903412") and hashing it with SHA-256 in hopes that it will yield the difficulty target you want in the hash id.
"Proof" of all the work being done is when a miner shows their valid hash, and the nonce used to produce it.
If the miner obtains the stipulated difficulty target, then their computer boradcasts the correct hash id to all the other nodes in the network so those nodes can begin to verify that block id, then compile and hash out the next valid block id.
When a miner receives a new block, they know that they lost the race for the block they were working on, and it’s time to start racing to mine the next block.
If more than one miner discovers the correct hash id and broadcasts the result, then a (non-contentious) fork is happening in the network, as new blocks are being added to each respective previous correct block. This becomes a relay race, where ultimately the longest chain wins; is accepted by the network as the winning blockchain. For this reason, most Proof of Work systems stipulate that the block reward cannot be spent by the miner who won it, until a certain number of other blocks have been mined on top of it.
The power of a miner's CPU, GPU, or ASIC determines the number of hashes per second their computer/node can run, thus is positively correlated to that miner's ability to calculate the correct nonce that will result in the correct hash id, which wins them the block reward. The Bitcoin network processes hundreds of quadrillions (peta) hashes per second, and it still takes an average of 10 minutes to produce a valid block.
Network bandwidth is also an economic factor in mining (potential constraint), because if a miner has poor bandwidth relative to other miners, it puts them at a disadvantage in winning the race to be the validated block.
Blocks get built in a chain that can reference everything down to the past. It's difficult to corrupt the network because in order to take control of the network, a user would have to exactly reproduce every transaction of the blockchain, up to the current point in time, including software bugs. This is extremely time and energy prohibitive. Thus, the more established (longer) the blockchain becomes, the more difficult it is to attack.
Every user node (participant) includes every block ever mined, including the first (genesis) block Each block is kept as a constant in the code.Each node is able to independently verify every transaction on that blockchain.
Electricity and Security-
Mining uses a lot of electric power (work), thus the cost of electricity is an economic factor in mining (potential constraint).
Proof of Work uses the cost of electricity to underpin the security of the network. In order to participate, miners have to incur costs (energy), for the possibility of rewards (coins). This helps keep the system honest because if users spend money on energy, and play fair (using correct inputs to try and produce correct outputs), then users may be rewarded with money back. It doesn’t pay to cheat. It takes too much energy, just to end up with a non-verifiable hash/output.
There is incentive to comply with new consensus, because if a miner works against a new protocol agreement, they are essentially burning energy for nothing.
Use, Scale, and Capacity-
A secure transaction settlement takes time to verify, which affects scalability.If tons of everyday transactions (i.e. buying a cup of coffee) happen on a blockchain, then the capacity must be able to handle all those transactions.Or, many of these transactions can happen on overlay networks (with eventual settlement) which preserves the benefits of using the blockchain, without flooding the network.
“The best protocol doesn’t win. The protocol that’s good enough, and achieves network scale first, wins.” -Andreas Antonopoulos
Great video on the more technical aspects of how Bitcoin's PoW works:
Proof of Stake (PoS):
Participants from around the world, stake money (usually by placing it in an escrow account) for the opportunity to use their computers to validate the network (calculate that everything happening in the system is correct).
Participants are often rewarded with more money if they are chosen to validate the network, and do so correctly. Participant's stake is often penalized if they are chosen to validate the network, and do so incorrectly. Thus, the amount of money (usually in the form of that network's native cryptocurrency) a participant stakes is their incentive to follow the rules and participate fairly, or else they loose some, or all, of what they staked, and can possibly loose opportunity to validate the network, in the future. The overall idea is that currency holders with the highest amount of value at stake, have the lowest incentive to corrupt the system.
Decentralization and Security-
If the required amount staked to validate in PoS is less expensive than processors used to competitively validate in PoW, then there is more incentive for participation in the network. The greater the number of diversely distributed participants/nodes/validators of the network, the less likely a collusion attack becomes.
PoS uses less energy than PoW because users are not feverishly competing with computer power to validate the next block. Instead, they are chosen either deterministically (often based on the stake they place in escrow), or at random, to run software that validates the next block of transactions, to be added to the blockchain.
This model tends to lend itself to stakers hoarding their holdings, instead of spending/using their coinage.
Rich Get Richer-
Although PoS saves on energy consumption, a big argument against it relates to the wealthiest participants in the network being the most likely chosen to make even more money by being selected as validators, thus earning the block reward.
The remainder of consensus algorithms discussed below are largely derivatives of PoW and PoS.
Byzantine Fault Tolerance (BFT):
BFT is classically based on the Byzantine generals' problem, where there is a collection of Byzantine generals (nodes) that would have to agree on how to attack a city, in order to be successful. Coordination and commitment to the plan in crucial. Assuming the generals are distributed in different places surrounding the target location, there runs a risk of plan changes being tampered with by an enemy before being communicated to each general, or generals not agreeing to the plan.
BFT theory plays a huge role in how most consensus algorithms are designed. Byzantine fault tolerance represents conditions within distributed computing (blockchain is a distributed ledger system) where members of the distributed system (nodes/perticipants) may fail to behave properly, and there is imperfect information if a node has misbehaved.
In blockchain consensus, this is why it's important for validators to be called upon to determine if the next block given to them is correct/trustworthy.
Practical Byzantine Fault Tolerance (pBFT)-
Where less than 20 pre-selected and trusted validators determine consensus for the entire network.
Used by Hyperledger Fabric.
Federated Byzantine Fault Tolerance (fBFT)-
Consensus system where each node ("general") is called upon to establish truth for each of their respective chains.
Used by Stellar and Ripple.
BFT models often end up being more centralized; with a smaller collection of nodes ("generals") having control over the network. This can be secure, as long as those nodes are established as trusted representatives to validate the system. Fewer nodes participating in consensus usually implies more efficient validation, thus faster throughput and ability for the network to scale.
Delegated Proof of Stake (DPoS):
Just like Proof of Stake, but the participants in the network elect for certain nodes/delegates that they feel are trustworthy, to validate the network and possibly update network rules. Much like PoS, this model still gives the highest stakeholders the most control over how the network is run, however, these high stakeholders can play a more passive role when it comes to participation and decision making. Some examples of this model are BitShares, EOS, and Steemit.
Proof of Activity:
The process starts as proof of work consensus, then moves into proof of stake consensus once a miner validates a block.
A miner uses a hashing function on their computer to come up with the correct hash for the current block. There are no nonces or transaction roots included in a block, just the block header and the miner's reward address. Then, a selected group of validating nodes sign off on a new block that is mined. The larger a node's stake, the more likely they are to be added to the trusted signing group. Mining rewards are split among the miner who hashed the correct block, and the nodes who signed it. Decred currently uses this model of consensus.
Proof of Authority:
Network consensus mechanism where a validator's identity and social capital (not financial capital) are at stake. This is a consensus model that lends itself to more transparency of the validators, and if they misbehave their reputation and ability to support the network is diminished. Favors validators with more established reputations.
Proof of Burn:
Consensus algorithm that involves PoW validators "burning" their stake by sending specified amounts of currency to unspendable "eater" addresses, in order to prove fidelity to the network and hopefully get rewarded with lifetime privlidges to validate the next block. Eater addresses are made at random so no one can determine the private key. By burning their holdings, miners are proving that they follow consensus rules with likely no reward in the short-run, in hopes of always having an option of pay-out, in the long run. Burners are not guaranteed to be selected to mine future blocks. Slimcoin and Counterparty run types of Proof of Burn consensus.
Proof of Capacity (PoC):
Proof of Capacity consensus happens in two main steps. Step 1) the miner's node plots all possible solutions to the hashing algorithm before the mining process even begins and stores a list of possible solutions on the mining node's hard drive. Thus, user nodes with more hard drive space can store more solution possibilities. Miners with more solution possibilities stored have better chances of matching the set difficulty target (required hash value)., thus have more chances in winning the mining reward. Step 2) the miner with the fastest plotted solution stored on their hard drive gets to be the next one to mine a block. Mining rights are determined based on a user node's extra hard drive space (instead of processing power, or stake). Burstcoin currently uses this method.
Proof of Elapsed Time (PoET):
Consensus mechanism where each node is assigned a random wait time; like placing them in a validator queue. The first node to finish its wait time gets validate the next block that is added to the blockchain. Most common in closed/permissioned blockchain networks, where all node representatives are known and trusted, because there is no other mechanism to ensure that participants have aligned incentives to protect the network. Invented by Intel and used in their Hyperledger Fabric.
Proof of Importance (PoI):
Consensus system where validators are selected based on a combination of three factors: 1) net transfers or total amount spent within a certain time frame, 2) vested amount of currency, and 3) being a node that is heavily connected with other nodes in the system. This is like a PoS system where hoarding is less incentivized because validators are also chosen based on their ability to facilitate transfers (use of the native currency). XEM currently uses this model.
Proof of Weight:
Mechanics are a lot like Proof of Stake, but where the validators are chosen by the "weight" (aligned incentives) they have with the network, outside of currency. For example, if there is a blockchain network that specializes in file storage and transfer, some of the biggest stakeholders in that network, that carry the most weight (thus have the greatest incentive to support the network), are the ones that store the most files, so they are given the first options to validate the network.
Ripple's Protocol Consensus Algorithm (RPCA):
Voting system that operates as a distributed agreement protocol, to determine proper order of transactions and if a transaction is valid. Each ledger is determined by a consensus of participants; not a miner building a block with the transactions they want.
There is not block reward incentive in RPCA. Many argue that this does not encourage enough decentralized participation.
Ripple's consensus process incurs minimal energy consumption, especially compared to PoW.
Ripple employs use of a "Unique Node List" to determine nodes that are trusted within the network, and thus can help build a candidate set of transactions to update the ledger with. When a trusted node sends in a transaction proposal that matches a transaction in the candidate set, that transaction receives one vote. This process continues for a specified amount of time, and if a transaction gets at least a 50% approval rating within this given amount of time, the transaction is then packaged into a new proposal. The new proposal is then distributed to trusted nodes and the process of voting on valid transactions continues, this time with an approval threshold of 60%. This process continues to 70%, then 80%. When 80% is reached, a ledger is considered valid, and the consensus process for that newest ledger is closed and added to the Last Closed Ledger, discarding any transactions found to be invalid. In each iteration, disputed transactions are disposed of until the initial 80% threshold is reached.
Even though Ripple has a relatively fast and efficient consensus protocol to run its network, this is done so at the price of increased centralization. This is often the case with consensus protocols; a trilemma tradeoff among speed, security, and centralization.
Bonus Concept: Direct Acyclic Graphs(DAGs)
This is a popular form of consensus for non-blockchain database structures. To send a transaction, a node must validate two other transactions that already took place. As more transactions are sent through the network, the system of checks and balances gets stronger. There are no transaction fees (i.e. gas) in a DAG network, outside of having to participate in proving past transactions. This models lends itself to running an asynchronous network because not all transactions are being validated at the same time, as is the case in a blockchain network. This model is designed to scale far beyond monetary transactions, by being a mechanism for interconnected devices within the Internet of Things (IoT). The graph itself looks like dots (validator nodes) with lines pointing to other dots, and all lines are pointing in the same direction; expanding the network. IOTA's Tangle uses this model.
Used to identify a particular block within an entire blockchain and is hashed repeatedly to create proof of work for mining rewards.
Process used in distributed computing systems to achieve overall agreement, thus system reliability. Nodes/participants agree on how to validate and maintain the system (ledger, in the case of blockchain).
The duration of time that must elapse since the last block was forged before a miner is allowed to forge a new block. If no one else has forged a block within this time, the miner can forge a block and claim the block reward.
Sets the number of bits (usually leading zeros) that must be present in the hash required to mine a given block. The lower the difficulty target, the harder it is to find the numbers. For example, if the difficulty target is to get two zeros at the front of the hash function, then you have to brute force run (“work”) as many attempts as it takes to produce a hash that leads with the two zeros.
Target is adjusted by the system to help ensure that blocks are mined within a certain time target; makes sure coins are being released into circulation, at the rate specified by the network.
The difficulty of the algorithm can be set to an arbitrary target, and the cumulative difficulty of a given chain is referred to as "chain weight".
(Non-contentious)- Race condition where Miner A and Miner B produce a valid block at approximately the same time; two competing blockchains are being propagated around the world (via P2P network nodes). When Miner C begins building a candidate block using the inputs (header) from Miner A’s block, then they are effectively voting for that received block, as the valid block; continuing the chain with Miner A’s block as the valid one; Miner B’s block is therefore losing. The chain that ends up longer (based on miners building new blocks on it) wins the race condition; the other blockchain is abandoned. Does not result in a different blockchain.
(Contentious)- Occurs when the network participants disagree on how to update the system. Usually begins as discussion within the development community, then is examined and tested (usually in a testnet/safe chain duplicate). Subject to participants in the system (those who run nodes of that blockchain), including developers, miners, exchanges, wallets, and merchants. Upgrading to a new consensus protocol becomes increasingly difficult over time, due to the former protocol being diversely and extensively ingrained in decentralized systems; harder and harder to pool all participants to officially change the entire network. Results in a different blockchain.
64 character long identification fingerprint for the block data, written in hexadecimal format. Takes a lot of energy to perform the number of hash operations needed to mine a block with a low difficulty target.
Unique id that is used to identify each block on a blockchain. In the Bitcoin network, the header is an 80 byte string, and is comprised of a 4 byte Bitcoin version number, 32 byte previous block hash, 32 byte merkle root, 4 byte timestamp of the block, 4 byte difficulty target for the block, and 4 byte nonce used by miners. The block header is hashed by altering the nonce value, until the desired difficulty target is achieved.
Base 16 number system that simplifies how binary (base 2 number system) is represented.
Uses 0,1,2,3,4,5,6,7,8,9 and a,b,c,d,e,f = 16 characters
A represents 10
B represents 11
C represents 12
D represents 13
E represents 14
F represents 15
Ex. the number 231 would be represented as E7. E sixteens + 7 ones; (14*16) + 7; 224+7 = 231
Note- we commonly use a base 10 number system in everyday life (0-9).
The delay before data begins following an instruction for its transfer. Poor bandwidth causes latency issues. As block size increases, miners with poorer bandwidth are at a greater disadvantage. For example, propagating a 1mb block to 8 nodes takes a certain amount of time. Propagating an 8mb block to those same 8 nodes, takes 8 times as long.
A participant who uses their computing power to add a new block to the blockchain, and be compensated in that network's native currency, for doing so.
Network participant, often recognized by a computer that is running a full copy of a given blockchain network.
In most systems, a user must run a full node on their computer in order to participate in mining.
Random numbers added to the block header that, when rehashed, meets the difficulty target restrictions.. Finding the correct nonce is what finally makes a miners proof of work able to be validated.
Processors (CPU, GPU, ASIC)-
CPU (Central Processing Unit)- silicon-based microprocessor in charge of completing most of a computer's calculations. Often better at processing the most diverse and general computing tasks.
GPU (Graphical Processing Unit)- specialized type of silicon-based microprocessor that are often more powerful than CPUs, thus used for more data intensive applications. Often better at processing more focused and specific computing tasks.
ASIC (Application-Specific Integrated Circuit)- microchip designed to conduct a very specific instruction set, often very quickly. In the case of blockcahin mining, ASICs are made to specifically follow a given currency's hashing algorithm very quickly, in order to be the first to find the correct nonce that produces a hash id that matches the current difficulty target. CPUs and GPUs can also perform these hashes, but are often not specific/fast enough to be competitive with ASICs. Some PoW networks are designed to be ASIC resistant, in order to encourage more participants, thus security, within the network.
Component added to beginning of every candidate block that pays the miner a certain amount (i.e. 25 BTC). So, if that miner properly mines the constructed block, they get a lot of money. If that block gets created (that miner wins the race to mine the block), then 25 new bitcoins (or other native currency) enter the system, in the form of that miner's reward. Reward is only granted to longest valid chain (see "fork" section).
In Bitcoin Core, you cannot spend your reward in less than 100 blocks, in order to ensure what the longest valid chain is.
When there are no more amounts of currency being produced with each new block, then the reward to validators often becomes the transaction fees present in that block. This gives incentive for validators to construct blocks of transactions that have higher fees attached to them.
Software codes containing functions are used to evaluate block data for compliance to a system’s rules.
Example rules include:
Transactions must be properly signed
Transactions may not have been spent before
Outputs are properly formatted
Can’t spend mining rewards in less than 100 blocks
Miners can only pay themselves a reward at the correct rate for whatever block the network is at (i.e. 25 BTC reward, based on block number)
Bitcoin Core Implementation Guide, written in C++, contains functions that evaluate block data for Bitcoin’s rule compliance.
Computer command that takes data input of any size and mixes it up, to produce a fixed output that is a 256 bit long hash (64 characters long). Output appears random, but is in fact, deterministic (same inputs will always generate the same output); can be used to proof a data set.
If only one bit (piece of data) is changed (i.e. “HELLO” to “HELLo”), then the hash/fingerprint/outcome can be TOTALLY different (i.e. A$GN009&^ to J7^65kU00PL7). This allows users to “fingerprint” data, generating a unique id for PDFs, software downloads, statements, etc.
History- originally developed to prevent spammers on message boards. The extra effort it took to compute a hash for their post was worth it to legitimate participants, but not to spammers.
When other miners in the network examine a candidate block to determine if transaction and block rules are met.
BA in Economics. BS in Finance. Hostess of the Crypt Keepers’ Club. Passionate about research, and processing data. I don’t fold sheets, I spread them.
Connect with Me:
Note that you must be logged into Facebook to be directed to my page.
DISCLAIMER: Information is constantly changing, especially in cryptocurrency. Do more research. Be accountable for your decisions. ALL INVESTMENTS ARE DONE SO AT YOUR OWN RISK!
Have something constructive to add? Do so in this comment box, below. BE KIND! Insecure egos do not appeal to anyone's better nature.