Global blockchain supervision and query platform

English
Download

Securing the Blockchain: How the Blockchain Prevents Fraud

Securing the Blockchain: How the Blockchain Prevents Fraud WikiBit 2022-04-11 10:57

Types of Consensus Mechanisms: Key Features, Pros and Cons, Use Cases

If you know anything about cryptocurrencies, such as Bitcoin, you will know two things about them: first, they are held digitally and do not have a physical form, and second, they are decentralised, meaning they are not controlled by any bank or other centralised organisation. Now, crypto aficionados have extolled several benefits of the currency's decentralised character, such as protection from the manipulation of a third party, such as banks or governments, speedier transaction times, and so on. However, it raises numerous issues in the mind of a layperson. Despite their numerous flaws, banks play a variety of crucial functions in our daily financial lives, and their absence raises concerns about the stability of such a financial system.

One of the most significant duties of a financial organisation, such as a bank, is to keep a trustworthy record of all of its users' financial facts, including but not limited to account balance and transaction history. Any of these facts may be obtained by simply contacting a bank and receiving reliable information. Cryptocurrencies, on the other hand, are decentralised, self-regulating systems with no central authority. Blockchain technology, also known as distributed ledger technology or DLT, is at the heart of cryptocurrencies. DLT, as the name implies, is a ledger or database that is distributed in a totally transparent manner to all of its users.The blockchain records every transaction made with that currency and appends it to the current ledger, which is subsequently used to keep track of user balances. Now, in order for a cryptocurrency to function properly, all of its users must agree to this ledger as the sole source of truth, because all subsequent transactions will be dependent on the information contained on the blockchain. Cryptocurrencies employ consensus processes to achieve user agreement.

Consensus processes are not a novel concept. They have long been used to achieve consensus between distributed systems. In the context of blockchain and cryptocurrencies, they are used to reach a consensus on the network's “state,” i.e., on the ledger that is disseminated to all users. Consensus methods also play a crucial role in protecting the blockchain against malicious assaults like as the 51 percent attack and the Sybil attack, as well as in tackling the problem of double-spending. The endeavour to spend the same unit of cash more than once is referred to as double-spending. It is a near-impossible achievement to do with a fiat currency like the dollar or rupee.For instance, if you spend a $5 bill to pay for a service, you no longer have custody of that bill, making it difficult to spend it again. However, with digital currencies that do not have a central authority, such as Bitcoin, double spending is avoided by keeping a record of every transaction from the currency's inception. That record is widely acknowledged, and user balances are changed as a result. Any attempt to spend a unit that has already been spent will be refused since it does not match the commonly recognised record.

Now that it is evident that consensus mechanisms are the basic foundation of blockchain technology, I'd want to look at the many types of consensus mechanisms, their purposes, pros and downsides, and a high-level overview of each of their use cases.

  • Proof-of-Work: The transactions are not stored individually on the blockchain, but rather in the form of blocks. Each block contains a number of transactions that have been validated. When a new block is generated and published to the blockchain, it becomes an irreversible component of the current chain of blocks (hence the term blockchain), which serves as the currency's sole source of truth. As a result, it is critical that block publishers, also known as miners, be encouraged to protect the blockchain's integrity rather than destroy it. Certain blockchains do this by requiring miners (block publishers) to solve an extremely sophisticated mathematical problem of varying difficulty each time they attempt to construct and publish a block.They can publish the block and collect their reward once they have solved the mathematical issue.

    So, what exactly is the mathematical issue, and what does it have to do with cryptocurrency? As previously stated, a block is made up of a collection of validated transactions as well as some other information like as the block number, timestamp, hash value of the previous block, and so on. The mathematical difficulty is to discover a number or nonce that, when coupled with all of the other data in the block and fed through a hash function, produces a result that meets the pre-determined requirement. In Bitcoin, for example, the hash function employed is SHA-256, and the fulfilling condition is to obtain an output with a specified amount of leading zeroes.The distinctive property of SHA-256 is that a single input always produces the same output, whereas tiny changes in the input might give radically different outputs. Miners are always fighting with one another to solve the task first, because the one who creates the block first receives the benefits. The reward is essentially a set amount of the same cryptocurrency, which also serves as a way of producing additional money.

    The important point to note about Proof-of-work is that the computation of the mathematical problem is computationally very expensive, and requires a huge amount of energy and time. Since each block has information about the preceding block and any change in block data can widely distort the output, any malicious attempt to change any of the blocks in the chain will invalidate the rest of the following blockchain for the attacker and they will have to re-do the entire mining process for every block, which will be computationally very expensive. Thus, all the miners are incentivized to protect the integrity of the blockchain.

    The main advantage of this strategy is that it is an established and tested method that is resistant to all types of security threats. Proof-of-Work is now used by two of the largest blockchains, Bitcoin and Ethereum. The problem is that this entire process wastes a tremendous amount of energy. For example, Ethereum consumes 73.2 TWh of electricity per year, which is about equivalent to Austria's energy production.

  • Proof-of-Stake: The massive energy consumption of Proof-of-work is a major environmental problem. As a result, blockchains like as Ethereum are shifting to a different type of consensus mechanism known as Proof-of-Stake. Proof-of-stake, rather than relying on a race between miners, distributes the option to publish new blocks among validators at random. The validators put up a stake (32 ETH for Ethereum) and are then chosen at random to publish fresh blocks. They are also in charge of validating the blocks generated by other validators. The stake put by the validators serves as a deterrent to bad behaviour. Any misbehaviour or collaboration might result in the loss of the entire share.

    While Proof-of-Stake is good for the environment (it is expected to lower Ethereum's energy usage by 99.5 percent) and is a highly secure method against a 51 percent assault (since an attacker will need to hold 51 percent of the whole stake), it also has drawbacks. It is far more difficult to execute than PoW, with several drawbacks such as “Long-range attack,” “Nothing at stake,” “Stake grinding,” and so on. Choosing between the two major consensus models thus becomes a matter of trade-offs. Proof-of-Stake is used by blockchains other than Ethereum, including Cardano, Avalanche, Polkadot, and Solana.

  • Delegated Proof of Stake: Delegated Proof-of-Concept Stake is a Proof of Stake variation in which users may stake their currencies and vote for a delegate. The weight of the user's vote would be determined by the amount invested by the user. Finally, the delegate with the most votes will be given the opportunity to publish the following block. This system is also called as “Democracy in Blockchain” because to its voting premise.The main benefit of this technique is its speed and scalability. It is one of the quickest consensus processes available and is unquestionably the best choice in a system where speed is critical. It uses less energy than Proof of Work and does not need as much hardware. The major disadvantage is that this strategy jeopardises the decentralised character of a blockchain. Because it concentrates power in the hands of a few individuals, it also increases the risk of a 51 percent attack and the worry of delegates conspiring and establishing a cartel.

  • Blockchains like EOS use Delegated Proof of Stake.

    4. Proof of Capacity / Proof of Space and Time: Proof of Capacity is a proof-of-capacity variant that focuses on memory rather than computing power. Proof of Capacity is superior to PoW in that it forces nodes to store precomputed hashes on their hard drives and other memory units even before mining begins. This is referred to as scheming. Because of plotting, Proof of Capacity is a quicker technique than Proof of Work. Another advantage of this approach is that, unlike the Proof of Work process, it saves a lot of energy.Not to add, every technical advancement in the capacity of a hard drive to retain more hashes would better the system for those who are not involved in blockchain, as opposed to Proof of Work, where many manufacturers design specialised chips that accomplish nothing but mining.

    While this technique has potential, it has not been thoroughly tested to see how it will fare against various types of security attacks. Chia is a great example of a blockchain that uses Proof-Of-Capacity.

    5. Unique Node List: A Unique Nodes List is a consensus technique used in blockchains such as Ripple and Stellar. UNLs, at their heart, let select nodes to sign off on transactions, and any user may simply verify the signed blocks to stay up to current. The essential question with this consensus process is determining which nodes will be able to sign off on transactions. How can we avoid a Sybil attack, in which one user pretends to be a slew of nodes in order to enhance their chances of signing off on transactions?

    UNLs are similar to certificate authorities, which issue digital certificates to specific websites, except that instead of saying that the nodes in the UNL are legitimate, they claim that each node is unique, as in it is managed by a separate entity, minimising the possibility of a Sybil assault. The UNL consensus technique is also one of the quickest available.

    The main downside is that it is a considerably more centralised blockchain system than other consensus processes. Ripple and Stellar, for example, come with a pre-determined Unique Node List. Many pieces of study have revealed that in order to avoid any divergence in the blockchain, all users must agree to at least 60% - 90% of the UNL. Not to mention, because UNL nodes have a modest, well-known identity, they are far more vulnerable to subpoenas and other forms of intervention.

    Types of Consensus Mechanisms: Key Features, Pros and Cons, Use Cases

    If you know anything about cryptocurrencies like Bitcoin, you will know two things about them: firstly, they are stored somewhere digitally and do not have a physical form, and secondly, they are decentralized as in not being controlled by any bank or other centralized agency. Now, crypto enthusiasts have touted many advantages of the decentralized nature of the currency like protection from the meddling of a third party like banks or government, faster transaction times, etc. However, in the mind of a layman, it raises many questions. Despite the many faults of banks, they do serve a lot of important roles in our day-to-day financial life and the lack of them may bring some questions about the stability of such a financial system.

    One of the most important roles of a financial institution, such as a bank, is to maintain a reliable record of all the financial details of each and every one of its users, including but not limited to account balance and transaction history. One can simply query a bank about any of these details and can receive accurate information regarding them. Cryptocurrencies, however, are decentralized, self-regulating systems that do not have a single authority. At its core, cryptocurrencies are powered by blockchain technology, also known as distributed ledger technology or DLT. As the name suggests, DLT is a ledger or database, that is distributed to every one of its users in a completely transparent manner. The blockchain records every transaction completed using that currency and appends it on top of the existing ledger, which then is used to maintain a record of user balances. Now, for a cryptocurrency to operate successfully, it is imperative that every one of its users agree to this ledger as the single source of truth since every further transaction will be based upon the information stored on the blockchain. To create that agreement amongst the users, cryptocurrencies use consensus mechanisms.

    Consensus mechanisms are not a new phenomenon. They have been used for a long time to create consensus between distributed systems. In terms of blockchain and cryptocurrency, they are used to create an agreement on the “state” of the network, i.e., on the ledger that is distributed to all the users. Another important role of consensus mechanisms is to protect the blockchain from malicious attacks such as the 51% attack and the Sybil attack, while also solving the problem of double-spending. Double-spending refers to the effort to spend the same unit of currency more than once. It is an almost impossible feat to accomplish with a fiat currency such as the dollar or rupee. For example, if you spend a 5 dollar note to pay for a service, you are no longer in possession of that note, thus making it impossible to spend it again. In currencies like Bitcoin, however, which are digital and do not have a central authority, double spending is prevented by creating a record of each and every transaction since the start of the currency itself. That record is universally accepted and the user balances are updated accordingly. Any effort to spend a unit that has already been spent will not match with the widely accepted record and will be denied.

    Now that it has become crystal clear that consensus mechanisms form the very backbone of blockchain technology, I want to take a look at the different types of consensus mechanisms, their objectives, and pros and cons as well as take a surface-level look at each of their use cases.

    • Proof-of-Work: The transactions are not recorded onto the blockchain individually but in the form of blocks. Each block contains a bunch of verified transactions. Once a new block is created and published onto the blockchain, it becomes an irreversible part of the existing chain of blocks (hence the name blockchain), which is the single source of truth for that currency. Therefore, it becomes imperative that publishers of the blocks, also known as miners, are incentivized to maintain the integrity of the blockchain and not destroy it. Certain blockchains achieve this by tasking the miners (publishers of the blocks) to solve a very complex mathematical problem, of a certain difficulty, every time they are trying to create and publish a block. Once they solve the mathematical problem, they can publish the block and earn their reward.

      So, what is the mathematical problem and what is the point of it with regards to cryptocurrency. As I mentioned, a block consists of a bunch of verified transactions along with some other data like block number, timestamp, previous blocks hash value, etc. The mathematical problem is to find a number or nonce, that when combined with all the other data of the block and inputted into a hash function, gives an output that satisfies the pre-decided condition. For example, in Bitcoin, the hash function that is used is SHA-256 and the satisfying condition is to get an output with a certain number of leading zeroes. The specialty of SHA-256 is that the one input will always give the same output and even the slightest change in the input can result in a widely different output. The miners are in a constant race with each other to solve the problem before anyone else as the person that creates the block earliest is the one that earns the rewards. The reward is essentially a certain amount of the same cryptocurrency, which actually serves as a tool for the creation of more of the currency.

      The important point to note about Proof-of-work is that the computation of the mathematical problem is computationally very expensive, and requires a huge amount of energy and time. Since each block has information about the preceding block and any change in block data can widely distort the output, any malicious attempt to change any of the blocks in the chain will invalidate the rest of the following blockchain for the attacker and they will have to re-do the entire mining process for every block, which will be computationally very expensive. Thus, all the miners are incentivized to protect the integrity of the blockchain.

      The important benefit of this approach is that it is a very tried and tested method and it holds up against all forms of security attacks. Two of the biggest blockchains, Bitcoin and Ethereum, currently use Proof-of-Work. The downside, however, is that this entire process wastes an incredible amount of energy. For example, Ethereum consumes 73.2 TWh of electricity annually, which is about the same as the energy production of Austria.

    • Proof-of-Stake: The enormous energy consumption of Proof-of-work is an extreme concern for the environment. Therefore, blockchains like Ethereum are switching to another form of consensus mechanism, known as the Proof-of-Stake. Proof-of-stake, rather than being dependent upon a race between the miners, randomizes the opportunity to publish new blocks amongst validators. The validators place a stake (32 ETH for Ethereum) and then are randomly selected to publish new blocks. They are also responsible for attesting to the blocks created by other validators. The stake placed by the validators acts as an incentive for good behavior. Any malpractice or collusion can lead to slashing the entirety of the stake.

      While Proof-of-Stake is excellent for the environment (it is supposed to reduce Ethereums energy consumption by 99.5%) and is a really secure mechanism against a 51% attack (as an attacker will need to hold 51 % of the entire stake), it comes with disadvantages of its own. It is much more difficult to implement than PoW, with a wide variety of inconveniences such as “Long-range attack”, “Nothing at stake”, “Stake grinding”, etc. Therefore, choosing between the two main consensus models becomes a matter of trade-offs. Outside of Ethereum, blockchains like Cardano, Avalanche, Polkadot, and Solana use Proof-of-Stake.

    • Delegated Proof of Stake: Delegated Proof-of-Stake is a variant of Proof of Stake, where the users can stake their coins and vote for a delegate. The weight of the vote of the user would depend upon the amount that the user has staked. In the end, the delegate that has the greatest number of votes will get the chance to publish the next block. Because of its voting principle, this mechanism is also known as “Democracy in Blockchain”.

      The biggest advantage of this approach is its speed and scalability. It is one of the fastest consensus mechanisms out there and is certainly the preferred choice in a system where the importance of speed is paramount. It does not consume as much energy as Proof of Work and does not require as much hardware. The biggest downside, however, is the fact that this approach threatens the decentralized nature of a blockchain. Since it concentrates the power in the hands of a handful of people, it also has a bigger threat of a 51% attack and the fear of delegates colluding and forming a cartel.

      Blockchains like EOS use Delegated Proof of Stake.

    • 4. Proof of Capacity/Proof of Space and Time: Proof of Capacity is a variation of the proof-of-work that focuses more on the memory rather than processing power. It is an improvement over PoW in the sense that even before the mining is started, Proof of Capacity requires nodes to store precomputed hashes on their hard drives and other memory units. This process is known as plotting. Plotting makes Proof of capacity a faster mechanism than Proof of Work. Another advantage to this method is that it saves a lot of energy, unlike the Proof of Work mechanism. Not to mention, any technological improvement in the capacity of a hard drive to hold more hashes will also improve the technology for people that are not in blockchain, unlike Proof of Work where many manufacturers build specialized chips that perform nothing else except mining.

      While this mechanism has potential, it has not been used as widely to know how it would hold up against different forms of security threats. A really good example of a blockchain using Proof-Of-Capacity is Chia.

      5. Unique Node Lists (UNL): A consensus mechanism that is used in blockchains like Ripple and Stellar is known as a Unique Nodes List. At its core, UNLs allow certain nodes to sign off on transactions and any user can simply verify the signed blocks to come up to date. The question at the core of this consensus mechanism is to identify which nodes will have the capacity to sign off on transactions. How do we prevent a Sybil attack where one user pretends to be a bunch of nodes and try to increase their odds of signing off on transactions?

      UNLs are very much like the certificate authorities that issue digital certificates to certain websites, except, rather than claiming that the nodes in the UNL are legit, they claim that each node is unique, as in they are being operated by a different entity and hence reducing the likelihood of a Sybil attack. UNL consensus mechanism is also one of the faster mechanisms out there.

      The biggest disadvantage, however, is that it is a much more centralized system of blockchain than other consensus mechanisms. For example, Ripple and Stellar come with a pre-decided Unique Node List. Many pieces of research have shown that to avoid any divergence in the blockchain, it is imperative that all the users agree to at least 60%-90% of the UNL. Not to mention, because of the nodes of UNL being a small, known identity, they are much more susceptible to subpoenas and other such interferences.

      6. Proof of Elapsed Time: This is another consensus mechanism that seeks to replace the inefficiencies and waste-inducing competition of Proof-of-work systems by focusing on randomization. A mechanism used in blockchains like Hyperledger Sawtooth, Proof of Elapsed Time randomly gives a timer object to its nodes. The node whose timer expires first is then given the responsibility of publishing the next block.

      This system provides an effective solution to the Random Leader Selection aspect of the Byzantine Generals Problem. However, partner technology SGX, which is developed by Intel, has been shown to have some critical vulnerabilities which make it difficult to trust the consensus mechanism. Not to mention, it is important to make sure that every node that is being given a timer object is unique and that no user is pretending to be multiple nodes to increase their odds of being chosen.

      7. Proof of Authority: Proof of Authority as a consensus mechanism is not too dissimilar to Proof of Stake. The main difference between the two is the fact that while in Proof of Stake, the validators staked coins, in Proof of Authority, they stake their reputation. The number of validators in the blockchain is fairly small and thus it is better used for a private blockchain.

      This mechanism is a fast, scalable mechanism along with being energy efficient. However, as the name suggests, this consensus mechanism does not abide by the principles of decentralization. The number of validators is extremely small and hence, things like censorship and fund freezing can be easily implemented.

      8. Directed Acyclic Graph: A directed acyclic graph is a commonly known data structure in computer science. In fact, a blockchain is also an example of a DAG as it has a clear direction, devoid of any cycles, and is a graph. Tangle, which is used by IOTA, is also a form of a DAG consensus mechanism. In this mechanism, each block must have two parents. So, in order to complete a transaction through the DAG consensus mechanism, a user needs to verify its previous two transactions. The biggest advantage of this mechanism is its potential to reduce latency and transaction fees. However, this consensus model does little to nothing to improve scalability and is extremely vulnerable as any attack only requires 34% of the hashing power to disrupt the system.

      The choice of a suitable consensus mechanism means understanding their trade-offs. Blockchain technology is still a very young field and no consensus mechanism is perfect. However, there is an enormous amount of exciting research going on and many exciting new blockchains are pushing the limits of what is possible through varied consensus mechanisms.

Disclaimer:

The views in this article only represent the author's personal views, and do not constitute investment advice on this platform. This platform does not guarantee the accuracy, completeness and timeliness of the information in the article, and will not be liable for any loss caused by the use of or reliance on the information in the article.

  • Token conversion
  • Exchange rate conversion
  • Calculation for foreign exchange purchasing
/
PC(S)
Current Rate
Available

0.00