Consensus mechanism and consensus algorithm in blockchain

what is consensus

Consensus, literally, is agreement on something. For example, a department recently came to a few new colleagues. In order to welcome the new colleagues and allow them to integrate into the new environment, the department head proposed to have a dinner after work. As for the dinner, everyone agreed with this move , After all, it doesn’t happen every month to get a free meal. At this time, it can be said that everyone has reached a consensus on the dinner party after work.

What is a consensus mechanism

The consensus mechanism is a set of systems consisting of agreements, incentives, and ideas that enable nodes in the entire network to reach a consensus on the state of the blockchain.

Consensus Mechanism Type

As we know, blockchain is a distributed decentralized network that provides immutability, privacy, security and transparency. No central authority exists to verify and verify transactions, yet every transaction in the blockchain is considered completely secure and verifiable. This is possible because of the consensus protocol, which is a core part of any blockchain network. A consensus algorithm is a procedure by which all peers of a blockchain network come to a mutual agreement on the current state of the distributed ledger. In this way, the consensus algorithm achieves the reliability of the blockchain network and establishes trust between unknown peers in a distributed computing environment. Essentially, the consensus protocol ensures that every new block added to the blockchain is the only version of the truth agreed upon by all nodes in the blockchain. The blockchain consensus protocol includes some specific goals, such as agreement, collaboration, cooperation, equal rights of each node, and mandatory participation of each node in the consensus process. Therefore, the purpose of the consensus algorithm is to find a common agreement, which is a win for the entire network. Now, we will discuss various consensus algorithms and how they work.

1. Based on proof of work ( Proof of Work PoW )

Proof of work is used to select the miner to generate the next block. Bitcoin uses this PoW consensus algorithm. The central idea of ​​this algorithm is to solve a complex mathematical problem and give a solution easily. This mathematical puzzle requires a lot of computing power, so the node that solves the puzzle as quickly as possible can mine the next block.

Proof-of-work consensus is the preferred mechanism for most cryptocurrencies in circulation today. This algorithm is used to validate transactions and create a new block in the blockchain. The idea of ​​Proof of Work (PoW) was first published by Cynthia Dwork and Moni Naor in 1993, and was later applied by Satoshi Nakamoto in his 2008 Bitcoin paper. The term "proof of work" was first used by Markus Jakobsson and Ari Juels in a 1999 publication.

Cryptocurrencies such as Ethereum (in its infancy), Litecoin, and Bitcoin are all currently using PoW.

The purpose of the consensus mechanism is to make all nodes reach a consensus, that is, to trust each other in an environment where nodes do not trust each other.

All transactions in the new block are verified and the new block is added to the blockchain.
The block will be added to the chain with the longest block height (.
Miners (special computers on the network) do computational work, solving a complex mathematical problem, to add the block to the network, so called work Proof.
Over time, this mathematical problem has become more complex.

Features of PoW

There are mainly two features that have contributed to the widespread popularity of this consensus protocol, they are .

It's hard to find a solution to a math problem.
It is easy to verify the correctness of this solution.

How does PoW work?

The PoW consensus algorithm involves verifying transactions through the mining process.

mining

The Proof of Work consensus algorithm involves solving a computationally challenging puzzle in order to create new blocks in the Bitcoin blockchain. This process is called "mining", and the nodes engaged in mining in the network are called "miners".

The incentive for mining transactions is financial rewards, with competing miners rewarded with 6.25 bitcoins and a small transaction fee.
This reward decreases by half of its current value over time.

Energy and time consumption in mining

Validating transactions in blocks to be added, organizing these transactions into blocks in chronological order, and announcing the newly mined block to the entire network does not take much energy and time.

The energy-consuming part is solving the "hard math problem" linking the new block to the last block in the valid blockchain.
When the miners finally find the correct solution, the nodes broadcast to the entire network at the same time, receiving a cryptocurrency award (reward) provided by the PoW protocol.

mining rewards

Currently, mining a block in the Bitcoin network gives the winning miner 6.25 bitcoins.
The number of bitcoins won is halved every four years. So, the next reduction in the number of bitcoins will be around 2024 (at the current pace and growth).
As more miners come along, the time to mine a new block inevitably gets shorter.
This means that new blocks will be discovered faster. To consistently find a block every 10 minutes (which is how long Bitcoin developers believe it will take for new coins to stabilize and diminish before reaching a maximum number of 21 million (expected at the current rate around 2140), The Bitcoin network periodically changes the difficulty level for mining new blocks.

Bitcoin's PoW system

Bitcoin uses the Hashcash proof-of-work system as the basis for mining. This "hard math problem" can be written in an abstract way, like the following.

Given data A, find a number x such that the result of appending the hash of x to A is a number less than B.

Miners bundle a set of transactions into a block and attempt to mine it. In order to mine, a difficult mathematical problem must be solved.
Known as the proof-of-work problem, this problem must be solved to show that the miner did some work in finding a solution to the problem, and therefore, the mined blocks must be valid.
The answer to this question needs to be lower than the block's hash to be accepted, which is called the "target hash".

The target hash is a number which the block header must be equal to or less than for a new block, along with the reward, to be awarded to the miner.

The lower the target value, the harder it is to generate a block.

Miners keep testing different unique values ​​(called nonce(s)) until a suitable one is produced.
Miners who successfully solve the problem are rewarded with bitcoins and the block is added to the blockchain by broadcast.

Note: The target hashrate is adjusted every 2016 blocks, or roughly every 2 weeks. All miners immediately stop working on the above block and start mining the next block.

Common cryptographic protocols used in PoW: The most widely used Proof of Work consensus is based on SHA-256, which was introduced as part of Bitcoin. Others include Scrypt, SHA-3, scrypt-jane, scrypt-n, and more.

The Proof of Work Challenge

The consensus mechanism of proof of work has the following problems.

51% risk. If a controlling entity owns 51% or more of the nodes in the network, that entity can compromise the blockchain by gaining a majority of the network.
waste time. Miners have to check many nonce values ​​to find the correct solution to the puzzle that must be solved to mine a block, a time-consuming process.
LF. Miners expend vast amounts of computing power in order to find difficult mathematical puzzles. This results in a waste of valuable resources (money, energy, space, hardware). It is estimated that by the end of 2018, 0.3% of the world's electricity will be used to verify transactions.
Not an instant transaction. It takes about 10-60 minutes for the transaction to be confirmed. Therefore, it is not an instantaneous transaction; it takes some time to mine the transaction and add it to the blockchain, thus committing the transaction.

2. Proof of Stake PoS

This is an alternative to the most common PoW. Ethereum has moved from PoW to PoS consensus. In this consensus algorithm, instead of investing in expensive hardware to solve a complex puzzle, validators invest in the system's coins by locking some of their coins as stakes. After that, all validators will start validating blocks. Validators validate blocks by placing stakes if they find a block that they believe can be added to the chain. All validators are rewarded proportional to their stake, which increases accordingly, based on the actual blocks added to the blockchain. Finally, a validator is selected to generate new blocks based on their economic stake in the network. Therefore, PoS uses an incentive mechanism to encourage validators to reach an agreement.

It aims to realize the distributed consensus of blockchain. This way of achieving consensus was first proposed here by quantum mechanics, and later Sunny King and his colleagues wrote a paper on it. This led to Proof-of-Stake (PoS) based Peercoin.

A bet is the value/money we bet on an outcome. This process is called staking.

Why Proof of Stake.

Before Proof of Stake, the most popular way to achieve distributed consensus was through Proof of Work (implemented in Bitcoin). However, proof-of-work is quite energy-intensive (electricity when mining bitcoins). Therefore, based on the proof-of-work consensus mechanism, if an entity has more computing resources, it will increase its chances of mining new blocks. In addition to the above two points, the PoW-based consensus mechanism has other weaknesses, which we will discuss later. In this case, a proof-of-stake based mechanism has its advantages.

What is Proof-of-Stake.

As can be understood from the name, nodes on the network bet a certain amount of cryptocurrency to become candidates for validating new blocks and earn fees from it. An algorithm then selects nodes from the candidate pool that will validate new blocks. This selection algorithm combines the amount staked (amount of cryptocurrencies) with other factors (like selection based on coin age, randomization process) to make selection fair for everyone on the network.

  • Selection based on coin age.
    The algorithm keeps track of how long each validator candidate remains a validator. The older a node is, the better its chances of becoming a new validator.
  • Random block selection.
    Validators are chosen with a combination of "lowest hashrate" and "highest stake". The node with the best weighted combination becomes the new validator.

A typical workflow based on PoS mechanism.

  • 1. Nodes conduct transactions. The PoS algorithm puts all these transactions in one pool.
  • 2. All nodes competing to be validators for the next block propose a bet. This bet is combined with other factors such as "coin age" or "random block selection" to select validators.
  • 3. The verifier verifies all transactions and publishes blocks. His stake is still locked, and the bogus rewards have not yet been awarded. This is to allow nodes on the network to "finalize" new blocks.
  • 4. If the block is "confirmed", the verifier can get back the equity and rewards. If the algorithm uses a coin age-based mechanism to select validators, then the current block validator's coin age will be reset to 0, which makes him a low priority in the next validator election.
  • 5. If the block is not validated by other nodes on the network, the validator loses his stake and is marked as "bad" by the algorithm. The process starts again from step 1, forging new blocks.

features

  • Fixed currency.
    The number of coins that are always in circulation in the network is limited. There is no such thing as bringing in new coins (as in Bitcoin and other PoW-based systems through mining). Note that the network starts with a finite number of coins, or in some cases "initially started with PoW and then moved to PoS". This way of launching with PoW is to introduce coins/cryptocurrencies to the network.
  • Transaction fees are rewarded to miners/forgers.
    A fee is charged for each transaction. This fee is accumulated and given to entities that forge new blocks. Note that transaction fees are not rewarded if forged blocks are found to be fraudulent. Additionally, validator stakes are also lost (this is also known as undercutting).
  • The impracticality of a 51% attack.
    To conduct a 51% attack, the attacker must own 51% of the total cryptocurrencies in the network, which is quite expensive. This shows that carrying out the attack is too cumbersome, expensive, and not very profitable. When accumulating a total cryptocurrency share, some problems arise because there may not be that many coins to buy, and it becomes more and more expensive to buy more and more coins/values. Additionally, validating incorrect transactions will result in validators losing their stake, thus being a negative reward.

Advantages of PoS

  • Energy efficient
    Since all nodes are not competing with each other to append a new block to the blockchain, energy is saved. Also, there are no problems to solve (like proof-of-work systems), which saves energy.
  • Decentralization
    In a blockchain like Bitcoin (where the proof-of-work system achieves distributed consensus), the additional rewards for joining a mining pool are exponential, resulting in a more centralized blockchain. In the case of proof-of-stake-based systems such as Peercoin, the reward is proportional (linear) to the stake amount. Therefore, there is absolutely no additional advantage to joining a mining pool; thereby promoting decentralization.
  • Security
    Someone trying to attack a network must have a 51% stake (quite expensive). This results in a secure network.

Weaknesses of the PoS mechanism

  • Validators with large stakes
    If a group of validator candidates is combined and owns a large share of the total cryptocurrency, they will have a greater chance of becoming a validator. An increase in opportunity leads to an increase in choice, which leads to the earning of more and more bogus rewards, leading to owning a huge share of currency. This can lead to the network becoming centralized over time.
  • The new technology
    PoS is still relatively new. Research is ongoing to find bugs, fix them, and make them viable in real money transaction networks.
  • "Nothing at stake" problem
    This problem describes that in the event of a blockchain split (blockchain fork), nodes supporting multiple blockchains have little to no downside. In the worst case, each Any fork will result in the work of multiple blockchains and validators, and the nodes in the network will never reach consensus.

Blockchain using Proof-of-Stake.

Ethereum (Casper update)
Peercoin
Nxt

3. Practical Byzantine Fault Tolerance pBFT

A consensus algorithm introduced by Barbara Liskov and Miguel Castro in the late 90s. pBFT is designed to work efficiently in asynchronous (no upper bound on when responses to requests are received) systems. It is optimized for low overhead time. Its goal is to solve many of the problems associated with existing Byzantine fault-tolerant solutions. Applications include distributed computing and blockchain.

insert image description here

What is Byzantine Fault Tolerance?

Byzantine Fault Tolerance (BFT) is a characteristic of distributed networks, even if some nodes in the network do not respond or respond with incorrect information, consensus (agreement on the same value) can be reached. The goal of the BFT mechanism is to prevent system failures by adopting collective decisions (correct and problematic nodes), aiming to reduce the influence of problematic nodes. BFT originated from the Byzantine Generals Problem.

Byzantine generals problem

This problem was properly explained in a 1982 paper by LESLIE LAMPORT, ROBERT SHOSTAK, and MARSHALL PEASE at Microsoft Research.

"Imagine several divisions of the Byzantine army encamped outside the enemy's city, each division commanded by its own general. The generals can communicate with each other only by messenger. After observing the enemy, they must decide on a common plan of action. However, some generals may be traitors, trying to prevent the loyal generals from reaching an agreement. The generals must decide when to attack the city, but they need to have a strong majority of the army attacking at the same time. The generals must have an algorithm to ensure that :( a) all loyal generals decide on the same plan of action, (b) a small number of traitors cannot make the loyal generals adopt a bad plan. The loyal generals will all do what the algorithm says, but the traitors can do whatever What they want to do. No matter what the traitors do, the algorithm must guarantee condition (a). Loyal generals should not only come to an agreement, but should come to an agreement on a reasonable plan.”

Byzantine fault tolerance can be achieved if correctly functioning nodes in the network agree on its value. Missing messages can be given a default voting value, that is, we can consider a message from a node to be "problematic" if it is not received within a certain time limit. Additionally, we can also assign a default response if the response from the majority of nodes is correct.

Leslie Lamport proved that if we have 3m+1 correctly working processors, consensus (agreement on the same state) can be reached if at most m processors are faulty, which means strictly speaking, more than three Two-thirds of the total number of processors should be honest.

Types of Byzantine faults.

Two types of failures are considered. One is a fail-stop (a node fails and ceases to function), and the other is an arbitrary node failure. Some failures of arbitrary nodes are given below.

  • failed to return a result
  • reply with an incorrect result
  • Response to an intentionally misleading result
  • React with different outcomes to different parts of the system

insert image description here

Advantages of pbft.

  • energy efficiency:

    pBFT can achieve distributed consensus without complex mathematical calculations (such as PoW). Zilliqa uses pBFT combined with the complex calculation of PoW, and a round of calculation is performed every 100 blocks.

  • The finality of the transaction: After the transaction is finally completed and reached a consensus, it does not require multiple confirmations (just like Bitcoin's PoW mechanism, each node will verify all transactions individually before adding a new block to the blockchain; confirmation May take 10-60 minutes, depending on how many entities confirm new blocks).

  • Low Reward Variance:

    Every node in the network participates in responding to customer requests, so every node can be incentivized, resulting in lower variance in rewards for nodes that help make decisions.

How does pBFT work?

pBFT attempts to provide a practical replication of a Byzantine state machine that works even in the presence of malicious nodes in the system.
The nodes in a distributed system supporting pBFT are arranged in order, one of the nodes is the primary node (or leader node), and the other nodes are called secondary nodes (or backup nodes). Note that any eligible node in the system can become primary by transitioning from secondary to primary (usually in the event of primary failure). Our goal is for all honest nodes to help reach consensus about the state of the system using the majority rule.
A practical Byzantine fault-tolerant system can operate under the following condition: the maximum number of malicious nodes cannot be greater than or equal to 1/3 of all nodes in the system. As the number of nodes increases, the system becomes more secure.

The pBFT consensus round is divided into 4 stages (refer to the picture below).

  • A client sends a request to the master (leader) node.

  • The primary node (leader) broadcasts the request to all secondary nodes (backups).

  • Nodes (primary and secondary) perform the requested service and then send a reply to the client.

  • The request is successfully serviced when the client receives 'm+1' replies with the same result from different nodes in the network, where m is the maximum number of failed nodes allowed.

    insert image description here

The master node (leader) is changed in each view (pBFT consensus round), and if the lead node does not broadcast a request to the backup node (secondary node), it can be replaced by the view change protocol. If desired, a majority of honest nodes can vote on the legitimacy of the current leader and replace it with the next leader.

Limitations of pBFT.

The pBFT consensus model can only work effectively when the number of nodes in the distributed network is small, because the communication overhead is very high, and every time a node is added in the network, the communication overhead will increase exponentially.

  • Sybil attack:

    The pBFT mechanism is vulnerable to Sybil attacks, where one entity (party) controls many identities. As the number of nodes in the network increases, Sybil attacks become more and more difficult to carry out. But since the pBFT mechanism also has scalability issues, the pBFT mechanism is used in combination with other mechanisms.

  • Scalability:

    pBFT does not scale well because its communication (with all other nodes at each step) is expensive. As the number of nodes in the network increases (increases to O(n^k), where n is the message and k is the number of nodes), the time to respond to a request also increases.

A platform using pBFT variants.

Zilliqa - pBFT combined with PoW consensus
Hyperledger Fabric - a permissioned version of pBFT
Tendermint - pBFT + DPoS (Delegated Proof-of-Stake)

4. Proof of Burn PoB

With PoB, validators do not need to invest in expensive hardware equipment, but instead "burn" coins by sending them to an unrecoverable address. By staking coins to an unreachable address, validators gain the privilege of mining on the system based on a random selection process. So burning coins here means validators have a long-term commitment in exchange for their short-term losses. Depending on how PoB is implemented, miners can burn the native currency of the blockchain application or the currency of an alternative chain, such as Bitcoin. The more coins they burn, the better their chances of being selected to mine the next block. While PoB is an interesting alternative to PoW, the protocol is still a needless waste of resources. And some people questioned that the mining rights only flow to those who are willing to burn more money.

Why is a proof of burn required?

There are some shortcomings in the PoW consensus algorithm, which makes researchers work on developing a new consensus algorithm, PoB.

The first disadvantage is that the power consumption of PoW is very high. Miners are rewarded by upgrading the ledger under POW mode. Computing power is used to solve a math problem in exchange for payment. The more miners spend to solve this problem, the better their chances of being allowed to mine blocks.
PoW requires a very high capital investment.

How does PoB work?

1. As the name itself suggests, there are some things that should be burned. Here we are talking about virtual currency, so obviously, in PoB, virtual currency is burned. The more coins miners burn, the more capable they are of creating blocks.

2. What we call burning does not exactly mean burning. It means not using the coin. This can be done if sending it where it cannot be used. Therefore, miners send these coins to such addresses, from where they cannot be spent. It is sent to a publicly verifiable address where it cannot be accessed and therefore cannot be used.

3. When a coin is burned, its usability decreases, causing the potential value of the coin to increase.

4. The question now is, why do we need to burn coins? The basic explanation for this is that by destroying the currency, consumers show a great commitment to the currency by giving up narrow margins for long-term profits.

5. In order to avoid any undue benefits for early adopters, PoB has designed a method that allows regular burning of cryptocurrency to maintain mining power. Any time a new block is mined, the energy to burn coins decreases slightly.

7. It's a deflationary idea, where the quantity of money decreases over time, increasing insufficiently, and therefore, the value of money holders. On the other hand, coins that grow in volume over time tend to lose value.

Advantages of PoB over PoS. In the Pos blockchain, the scarcity of the market is not permanent. The scarcity is only for a certain amount of time, i.e. until the counterfeiter locks up their coins, which is usually done by locking them. However, if the departing counterfeiters take the coins and sell them on the market, the coins can be re-entered into circulation. Whereas in the case of PoB, the coins are destroyed, so the scarcity is permanent.

Advantages of PoB.

It requires very little energy compared to PoW.
It reduces energy consumption by wasting insignificant resources when burning coins.
It encourages long-term participation in a project, as consumers show great commitment to the currency by giving up narrow margins in exchange for long-term profits.
The distribution of coins is fairer compared to all other consensuses.

Disadvantages of mortgage loans.

It is risky because people don't know if they will get the wealth they burnt in the future.
Since coins are burned, technically if we see resources are wasted.
It may be affected by the phenomenon of the rich getting richer. In this case, those who are rich get richer by owning more coins.

5. Proof of Capacity ( Proof of Capacity PoC )

In a proof-of-capacity consensus, validators should invest their hard drive space, not invest in expensive hardware or burn coins. The more hard drive space a validator has, the better their chances of being selected to mine the next block and earn the block reward.

Proof-of-Capacity mining is a very new mining method currently employed by a cryptocurrency, Burstcoin. Nonetheless, many see proof-of-capacity as a viable alternative to the mining techniques currently in use. It is able to mine by using hard drive space. Strategies like this offer many benefits, and it's something that many projects are focusing on right now.

Purpose of Proof of Capacity

PoW is one of the most well-known mining methods today. This requires miners to use computer resources to solve difficult mathematical hash functions. In the case of Bitcoin, a well-known hashing method called the SHA-256 algorithm is utilized. These hash functions are one-way functions with only one possible solution. They need this raw computing power to locate the exact function input to achieve the desired function output. The hash function takes a "nonce" as one of its input variables. Miners will loop calculating the nonce until they find a suitable hash. This is crude calculation and takes a lot of time and effort to do.
While the PoW algorithm worked well when Bitcoin was a relatively new technology, the network has grown exponentially. To maintain consistent block times, the Bitcoin system is designed to increase the difficulty of mining. As a result, mining has become so hard that only the most powerful computers, ASICs, can do it.
In order to solve hash functions, they also require a lot of computing power. All the energy invested by miners who cannot solve the hash function in time will be wasted.
As a result, smaller mining operations will have significantly less influence on key choices made by larger nodes. Therefore, there is an urgent need for a new mining method that is less energy-intensive than PoW and allows sufficient network decentralization. This is where the concept of Proof of Capacity comes into play.

features

Proof-of-Capacity consensus is an improvement on the well-known Proof-of-Work blockchain consensus technology.
Even before mining can begin, dedicated processing power and hard drive storage are required. Because of this, the system is faster than PoW.
Proof of Capacity takes only 4 minutes to produce a block, but Proof of Work takes 10 minutes.
It tries to solve the hashing problem of the PoW system. If more solutions or plots are available on the computer, the chances of winning the mining conflict are greater.

How does proof of capacity work?

Proof of capacity has two components. First, the drawing on disk, then the actual block mining

  1. drawing

    Depending on the size of your hard drive, it may take days or even weeks to create the drawing file. Drawing is done with Shabal hashes. The encryption/hash function used in Burstcoin is called Shabal. Shabal is a slow and thick cryptocurrency. Hence, it is an excellent cryptocurrency for Proof of Capability cryptocurrencies like Burstcoin. This is due to the fact that precomputed hashes are stored while still enabling minor real-time verification. Burst uses Shabal256, which is a 256-bit variant of Shabal. Shabal hashes are precomputed and saved on the hard drive because they are difficult to calculate.

First, the hard drive is mapped out. A list of all potential nonce values ​​is built over and over by hashing data, including the miner's account. Each nonce is composed of 8192 hash values, numbered from 0 to 8191. All hashes are coupled into "spoons", groups of two adjacent hashes.

  1. mining

    The second stage is the actual mining, which requires the miner to calculate the amount of a scoop. For example, if a miner starts mining and creates shovel 40, the miner goes to nonce 1 for shovel 40 and uses the data from that shovel to calculate a deadline value. For every nonce stored on the miner's hard drive, this procedure is repeated to calculate the deadline. After calculating all deadlines, miners choose the one with the shortest deadline. The deadline represents the time (in seconds) that has elapsed since the previous block was produced before a miner is authorized to produce a new block. If no one does so within this timeframe, the miner can produce a block and claim the block reward. For example, if miner A sets a minimum deadline of 40 seconds, and no other miner can forge a block within that time, then A will be guaranteed a chance to forge the next block and get paid.

application

Burstcoin is a cryptocurrency that operates on the principle of proof-of-skill. The Burstcoin team plans to work on a variety of use cases, including everything from payment solutions to smart contracts, crowdsourcing, and random messaging. Burstcoin is a worthy move to test the PoC possibilities as it offers consumers, companies, developers and miners a compelling idea. Although there are not many cryptocurrencies using proof-of-capability today, several projects are gaining traction in this space.
Proof of capability, according to BXTB (which is a dual blockchain, a dual token platform backed by the BXTB company) is attractive in allowing users to mine the BXTB governance token.
Permacoin repurposes Bitcoin's PoW for a more general purpose, building a reliable distributed storage system. Participants in PermaCoin must additionally save a huge file block in order to be eligible for leader election. An authoritative "dealer" who signs blocks of documents is responsible for distributing the documents.
Participants construct and commit to a unique graph of rare pebbles in SpaceMint's consensus mechanism, which is based on a form of non-interactive proof-of-capacity called proof-of-space.

Advantage

Any standard hard drive can be used, so there are certain advantages over other miners who invest in specialized equipment, such as mining bitcoins with ASICs.
Mining with hard disks saves 30 times the energy compared to mining with ASICs.
Because everyone has a hard drive, the proof of capability is more decentralized. We can even mine from the hard drive of an Android phone.
Miners do not need to regularly upgrade their equipment. Old hard drives are just as capable of storing data as new ones.
After mining is complete, people can wipe the hard drive and put it back to its original purpose.

Perhaps this is why many in the Bitcoin world see mining algorithms as the new decentralized, environmentally friendly remedy.

disadvantage

On the other hand, Proof of Capacity mining also has some disadvantages.

技术已经被少数开发者所接受。
除了挖币之外,在硬盘上绘制的数据是无用的。这表明,有很多空间没有被使用。
虽然产能证明挖矿减少了入门障碍,但消费者也可能购买更大的硬盘。没有什么能阻止一个人获得大得多的硬盘,并利用它们来挖掘大部分的钱。
如果挖矿变得流行,黑客有可能会试图利用它。目前,挖矿的恶意软件正在感染世界各地的许多电脑。PoW挖矿偶尔也会被检测出是导致电脑速度变慢的原因之一。另一方面,能力证明使得确定你的多余硬件空间是否被用于非法原因的难度大大增加。

One of the most attractive mining methods is Proof of Capacity. Not only does it rethink the way mining has been done in recent years, but it is also a solution that many believe is better for the environment. It also fits the most popular cryptocurrency panacea: a fully decentralized environment. This is still a fresh concept and has not seen widespread adoption like other algorithms. Now that initiatives like BXTB are looking at real-world applications of native coins created through proof-of-concepts, the industry is entering a new era. Bringing cryptocurrencies to the public is a daunting task, but things could improve if everyone got involved without having to spend money on additional technology. It remains to be seen whether Proof of Capability can overcome some of the scaling issues that more mature blockchains like Bitcoin and Ethereum are experiencing.

6. Proof of Elapsed Time PoET

PoET is one of the fairest consensus algorithms, it only uses fair means to select the next block. It is widely used in permissioned blockchain networks. In this algorithm, every validator on the network has a fair chance to create their own blocks. All nodes add proof of their waiting in the block by waiting for a random amount of time. Created blocks are broadcast to the network for consideration by others. The winner is the validator with the least timer value in the attestation part. Blocks from winning validator nodes are added to the blockchain. There are some additional checks in the algorithm to prevent nodes from always winning the election, to prevent nodes from producing the lowest timer value.

Proof of Time (PoET) is a consensus algorithm developed by Intel Corporation that enables permissioned blockchain networks to decide who creates the next block.
PoET follows a lottery system that distributes the chances of winning equally among network participants, giving every node an equal chance.
The PoET algorithm generates a random waiting time for each node in the blockchain network; each node must sleep during this time period.
The node with the shortest wait time will wake up first and win the block, thus being allowed to submit a new block to the blockchain.
The PoET workflow is similar to Bitcoin's Proof-of-Work (PoW), but consumes less electricity because it allows a node to sleep for a specified amount of time and switch to other tasks, increasing the energy efficiency of the network.

How does PoET work?

Based on the principle of a fair lottery system where each node is equally likely to be selected, the PoET mechanism spreads the chances of winning to as many network participants as possible.

Under PoET, each participating node in the network must wait for a randomly chosen period; the first to complete the specified waiting time wins the new block. Each node in the blockchain network will generate a random waiting time and sleep for this specified time.

The one who wakes up first – that is, the one with the shortest wait time – wakes up and submits a new block to the blockchain, broadcasting the necessary information to the entire peer-to-peer network. Then repeat the same process to discover the next block.

How is PoET different from PoW?

Essentially, the workflow is similar to the consensus mechanism followed by Bitcoin's Proof-of-Work (PoW) algorithm, but without its energy-intensive nature. It allows a node to sleep for a specified amount of time and switch to other tasks, thereby increasing the efficiency of the network.

Proof of time does not promote decentralization and openness like proof of work because it requires issuing a certificate to anyone who wants to join the network.

The mechanism for running trusted code in a secure environment also takes care of many other networking needs. It ensures that trusted code runs in a secure environment and cannot be changed by any actor. It also ensures that results are verifiable by participants or other permissioned entities, increasing the transparency of network consensus.

PoET controls the cost of the consensus process and keeps it flexible so that it remains proportional to the value generated by the process, which is an essential requirement for the cryptocurrency economy to continue to thrive.

What is Hyperledger Sawtooth?

Hyperledger Sawtooth is a distributed ledger – similar to a blockchain – designed for enterprise use such as supply chain and logistics. It can even be used for inventory management, accounting, or other time-consuming and error-prone business tasks.
Is there a proof of time coin?

PoET is mainly used in Hyperledger Sawtooth. As of January 2022, there is no cryptocurrency using PoET.
What is the difference between Proof of Work and Proof of Expiration Time?

PoW is a competitive work mechanism, while PoET is a random selection mechanism.

Investing in cryptocurrencies and other Initial Coin Offerings (“ICOs”) is highly risky and speculative, and this article is not a recommendation by Investopedia or the author to invest in cryptocurrencies or other ICOs. Since each individual's situation is unique, a qualified professional should always be consulted before making any financial decisions. Investopedia makes no representations or warranties as to the accuracy or timeliness of the information contained herein.
Compete risk-free with $100,000 in virtual cash
Put your trading skills to the test with our free stock simulator. Compete with thousands of Investopedia traders and reach the top with trading, submitting trades virtually before you start risking your own money. Practice trading strategies so that when you're ready to hit the real markets, you've got the practice you need. Try our stock simulator today >>

7. Delegated Proof Of Stake DPoS

is a consensus algorithm that is an advancement of the basic concept of Proof of Stake. The Delegated Proof of Stake (DPoS) consensus algorithm was developed in 2014 by Daniel Larimer, founder of BitShares, Steemit and EOS.

In a proof-of-stake consensus system, everyone can participate in the "coin minting" process, which means they have the opportunity to select second-tier nodes that further validate blocks and are rewarded for adding blocks to the blockchain. The DPos system is maintained by an election system for selecting nodes to validate blocks. These nodes are called "witnesses" or "block producers".

How DPoS Consensus Works

Voting:
In the DPoS consensus, users can vote directly, or give their voting rights to other entities to vote on their behalf. Selected witnesses are responsible for validating transactions to create blocks. If they validate and sign all transactions in a block, they are rewarded, which is usually shared with those who voted for the witnesses. If a witness fails to verify all transactions within the given time, the block is missed, all transactions are not verified, and no reward is distributed to that witness. The reward is added to the reward of the next witness who validates the block. Such transactions are collected by the next witness and such a block is said to be stolen.

Voting is proportional to each voter's stake size. A user does not need to have a great stake to gain access to the top-level witnesses. Conversely, the votes of users with large stakes can result in users with relatively small stakes being promoted to the top tier of witnesses.

Witnesses:
There is a certain cap on the number of witnesses at the top level, usually between 21-101. These witnesses are responsible for validating transactions and creating blocks, and earn associated fees. Witnesses can prevent specific transactions from being included in blocks, but they cannot change the information of any transactions, which makes them similar to miners in proof-of-work blockchains. Voting is an ongoing process, and each witness at the top is always likely to be replaced by a user who has received more votes and is therefore considered more trustworthy. As the number of applicants for witnesses increases, so does the competition, and reputation becomes critical for each witness to remain competitive.

Witnesses control themselves by threatening loss of revenue, locked stake and reputation scores. Witnesses must lock up some portion of their stake, which can be seized if they act maliciously or attempt to attack the blockchain.

In a DPoS blockchain with N block producers/witnesses, a round follows the following cycle sequence.

N个区块生产者从证人候选人库中选出。
第k个区块生产者签署第k个区块,直到k=N。
当一个区块被(2/3+1)的区块生产者投票通过时,该区块就被最终确定。在有两条链的情况下,遵循最长的链规则。添加的区块不能被逆转。

Delegates:
Users in a DPoS system also vote for a set of representatives that oversee the governance of the blockchain. They do not participate in transaction control. Delegates can propose changes to the size of blocks, or the amount of rewards that witnesses who validate blocks should receive. Once representatives propose these changes, users of the blockchain vote on whether to adopt them.

Block validator.
A block validator in DPoS refers to a full node that verifies whether a block created by a witness complies with the consensus rules. Any user can run a block validator and validate the network. There is no incentive to become a block validator.

Advantage:

The DPoS blockchain has a good protection function and can prevent double consumption.
DPoS is more democratic and financially inclusive since users/nodes require less staking.
DPoS provides more decentralization because the barriers to entry are low and more people participate in the consensus.
DPoS does not require large amounts of electricity to run the network, which makes it more sustainable.
Transactions in DPoS do not depend on the computing power required to run the network, so it is more scalable.
DPoS separates the election of block producers from the block production itself, which opens the door to more creative models to solve these two problems independently.
The DPoS method provides the basis for implementing interesting governance models in blockchain applications. In a sense, it forms a democracy.

Disadvantages:

Effective functioning and decision-making of the network requires well-informed principals and the appointment of honest witnesses.
A limited number of witnesses leads to centralization of the network.
DPoS blockchains are vulnerable to weighted voting issues. Users with minor interests can decline to vote if they deem their vote to be insignificant.

Below are some examples of DPoS blockchains.

Blockchain Number of Witnesses
EOS 21
BitShares 101
Steemit 21
Lisk 101
Ark 51

8. Proof of Authority ( PoA )

In the blockchain platform, the consensus mechanism can be divided into permissionless (such as Ethereum, Bitcoin) and permissioned (such as Hyperledger, Ethereum Private). Unlike permissionless blockchains, where anyone can become a node, in a permissioned blockchain, all nodes are pre-selected. This allows the use of consensus types with high scalability and bandwidth. One of these consensus types is Proof of Authority (PoA) consensus, which provides high performance and fault tolerance. The term was coined in 2017 by Gavin Wood, co-founder of Ethereum and Parity Technologies.

PoA work

In PoA, the right to produce new blocks is granted to nodes that have proven they have the authority to do so. These nodes are called "validators" and they run software that allows them to put transactions into blocks. This process is automated and does not require validators to constantly monitor their computers, but does require maintaining computers unaffected. PoA is suitable for both private networks and public networks, such as the POA network, where trust is decentralized.
The PoA consensus algorithm exploits the value of identity, which means that block validators are not betting on coins, but on their own reputation. PoA is guaranteed by trust in the chosen identity.

PoA consensus and common attacks.

1. Distributed Denial of Service Attack (DDos)
A Distributed Denial of Service (DDoS) attack is an attempt to make an online service unavailable by using traffic from multiple sources. An attacker floods a target network node with transactions and blocks in an attempt to disrupt its operation and render it unusable.

The PoA mechanism makes it possible to defend against such attacks, because network nodes are pre-authenticated, and the right to generate blocks can only be granted to those nodes that can withstand DoS attacks.

2. 51% attack:
In the PoA consensus, a 51% attack requires the attacker to gain control over 51% of the network nodes. This is different from a 51% attack of the proof-of-work consensus type, where an attacker needs to gain 51% of the network's computing power. In a permissioned blockchain network, gaining control of a node is much harder than gaining computing power.

In PoA, individuals earn the right to be validators and so have an incentive to retain their earned status. Validators are incentivized by reputation, which enables them to maintain their authority as nodes. PoA only allows non-consecutive block approvals from any one validator, which means that the risk of serious damage is concentrated on the authoritative nodes.

Conditions for reaching PoA consensus.

1. PoA consensus may vary according to different implementations, but in general, they are applied through the following conditions.
2. Verifiers need to confirm their real identity.
3. Candidates must be willing to invest money and put their reputation at risk. Rigorous procedures reduce the risk of selecting problematic validators and incentivize long-term commitment to the blockchain.
4. The method of selecting validators must be equal to all candidates.
5. The identity of the verifier must be verified to maintain the integrity of the blockchain. There should be some sort of procedure for selecting honest validators.

Advantages of PoA consensus:

As long as 51% of the nodes are not acting maliciously, there is a high risk tolerance.
The time interval for generating new blocks is predictable. For PoW and PoS consensus, this time is different.
High transaction rate.
Far more sustainable than computationally demanding algorithms such as Proof of Work.

limitation:

PoA is not decentralized, it is just to make the centralized system more efficient.
Validators of PoA are visible to anyone. Knowing the identity of the verifier has the potential to lead to manipulation by third parties.

Application of PoA consensus:

The PoA consensus algorithm can be applied to various scenarios and is considered to be the best choice for logistics applications, such as supply chains.
The proof-of-authority model enables companies to maintain their privacy while leveraging the benefits of blockchain technology. Microsoft Azure is another example where PoA is being implemented. The Azure platform provides solutions for private networks, and its system does not require a native currency like ether 'gas' on Ethereum because no mining is required. Azure nodes are pre-selected.

9. Zero Knowledge Proof (ZKP)

is an encryption scheme originally proposed by MIT researchers Shafi Goldwasser, Silvio Micali, and Charles Rackoff in the 1980s.

Zero-knowledge protocols are probabilistic evaluations, meaning they cannot prove something with the same certainty as simply revealing the full information. They provide unlinkable information that together show that the validity of the assertion is possible.

Currently, a website takes a user's password as input and compares its hash to a stored hash. Likewise, banks need your credit score to grant you a loan, putting your privacy and information leakage risks at the mercy of the host server. If a ZKP can be exploited, the client's password is unknown to the verifier, while the login can still be verified. Before ZKP, we always questioned the legitimacy of the verifier or the rationality of the proof system, but ZKP questioned the morality of the verifier. What if the validator tries to leak information?

Example 1: A colorblind friend and two balls.
There are two friends Sachin and Sanchita, where Sanchita is colorblind. Sachin had two balls and he needed to prove that they were different colours. Sanchita randomly swapped the ball behind his back and showed it to Sachin, who was to judge whether the ball was swapped or not. If the balls are the same color and Sachin gives wrong information, then there is a 50% chance that he will get it right. When this activity is repeated several times, the probability of Sachin giving the correct answer under false information will be greatly reduced. Here Sachin is the "Verifier" and Sanchita is the "Verifier". The color is absolute information or an algorithm to execute, justified without revealing the color information to the verifier.

Example-2: Finding Valdor.
Finding Valdor is a game where you have to find a man named Valdor from the above snapshots taken of massive crowds. Sachin has an algorithm for finding Waldo, but he doesn't want to reveal it to Sanchita. Sanchita wants to buy the algorithm, but needs to check that it works. Sachin cut a small hole in the cardboard and placed it on Valdor. Sachin is the "Prover" and Sanchita is the "Verifier". The algorithm is proven without knowing anything about the algorithm.

Properties of zero-knowledge proofs:

Zero-knowledge -
If the claim is true, the verifier has no knowledge that the claim is or was. The statement here can be an absolute value or an algorithm.

Completeness – An honest person would know that a statement is true if the statement is true.
An honest verifier can eventually be convinced if the claim is true.

Soundness -
If the prover is dishonest, they cannot convince the verifier of the soundness of the proof.

Types of zero-knowledge proofs:

Interactive zero-knowledge proofs -
which require the verifier to continually ask a series of questions about the "knowledge" the verifier possesses. The above example of finding Waldo is interactive because the "verifier" does a series of actions to prove the correctness of the knowledge to the verifier.

For the "interactive" solution to work, both the verifier and the verifier need to be online at the same time, making it difficult to scale up in real-world applications. Non-interactive zero-knowledge proofs do not require an interactive process, avoiding the possibility of collusion. It requires picking a hash function, which is randomly picked by the verifier to challenge. In 1986, Fiat and Shamir invented the Fiat-Shamir heuristic, which successfully changed interactive zero-knowledge proofs to non-interactive zero-knowledge proofs.

10. Non-Interactive Zero Knowledge Proof NIZKP

Early zero-knowledge proof verification systems used to be interactive. Informational "certifiers" known as "witnesses" and "verifiers" must be online at the same time in order for an operation to succeed.

This makes the whole process ambiguous and not scalable. In 1986, Fiat and Shamir invented the Fiat-Shamir heuristic, changing interactive zero-knowledge proofs to non-interactive zero-knowledge proofs.

The Fiat-Shamir heuristic is a technique for taking an interactive proof of knowledge and creating a digital signature based on it. This way, "witnesses" or facts can be publicly verified without requiring the prover to be online all the time.

Non-interactive zero-knowledge proofs and discrete algorithms:

Sanchita wants to prove to Sachin that she knows that y=g^a is the value of base g.
Sanchita randomly selects a value v from the value set Z, and calculates t=g^v.
Sanchita computes c = H(g, y, t), where H() is the hash function.
Sanchita calculates d = v - c*a.
Then, Sachin or anyone can check whether t = g^d * y^c.

The Fiat-Shamir heuristic allows us to replace the interactive step 3 with non-interactive random oracle access, but in practice, a hash function is used.

In an interactive ZKP, Sachin would pick a random value c from the set Z and send it to Sanchita.

If the hash used below does not depend on the (public) value of y, the security of the scheme is weakened, since a malicious verifier could choose some value x such that the product c*a is known.

Advantage:

It does not require validators or verifiers to be online all the time.
Transferability -
If a validator proves a witness once, it can be made public without the same process needing to be repeated again with a different validator.

application

Blockchain -
It can be used to verify transactions in a public blockchain, even if the sender, receiver, and transaction information are anonymized.
The basis for other protocols -
Bulletproofs was released in 2017. Zk-SNARKs are also the follow-up to non-interactive ZKPs.

Guess you like

Origin blog.csdn.net/coco2d_x2014/article/details/128175169