In practical terms, blockchain network difficulty means that miners need to come up with a hash for a block that is smaller than the target hash for the previous block of the blockchain.
Because all information on a public blockchain network such as Ethereum and Bitcoin is open and available, anyone can see all the blocks and their hashes that the blockchain network created since its inception.
A cryptography algorithm can only create one hash for one set of data, which means that if miners were to run data that only consisted of transactions on the network, they’d only come up with one hash and coming up with a smaller hash would be impossible.
For this reason, miners add an integer number to the data with the transactions and generate hashes for that set of data. The integer number is called nonce. A nonce is an abbreviation for “number used once.”
In reality, miners are using hardware and software that come up with nonces, add them to data with transactions that are currently occurring on the network, obtain the hash for the data that includes that nonce and compare the resulting hash to the target hash. If the resulting hash is smaller than the target hash, the miner wins and the block from that miner become a part of the blockchain.
For this reason, mining is more of a gamble than a race based on competency of the participants. Mining is somewhat similar to playing a lottery and winning in a lottery. However, because the blockchain networks are transparent and decentralized, the law of averages applies and those who play a lot win a lot. The miners that are able to come up with a winning hash get network rewards.
Drawbacks of proof of stake approach
While the proof of stake approach in the cryptocurrency world has shown its validity and benefits, it also has certain disadvantages.
The first disadvantage is that when a network such as bitcoin becomes really popular, the number of miners grows exponentially. With the number of miners grows the difficulty and the miners start using more and more electricity to come up with a winning hash.
The second disadvantage is that because winning becomes hard, many of the miners join their efforts and create mining pools, which can become problematic to a blockchain network under certain conditions.
A mining pool is an approach to mining in which several parties contribute to generation of a block on a blockchain network. The parties split the reward in the case of winning.
The issue with mining pools is that they can potentially lead to the centralization of power. This contradicts to the principle of decentralization, which is one of the foundational principles behind both the bitcoin and the ethereum networks. According to this principle, the networks do not have an owner or a governing authority that can concentrate all the power in its hands and start making decisions about what happens to the network. However, if a mining pool was to grow large enough, its owners could start making decisions about what transactions they would include into the blockchain blocks.
Proof of stake algorithm
Proof of stake concept is very different from the concept of proof of work. In proof of stake, members of a group of validators take turns in proposing and voting for blocks that will become a part of the blockchain. The weight of a vote of each member of the group depends on the deposit, or stake, of that member.
Advantages of a proof of stake algorithm are security, energy efficiency and reduced risks of centralization.
Here’s how a proof of stake algorithm would work: a blockchain network would have a group of validating members. These members are the ones that own the coin of the network, which in Ethereum’s case would be Ether. To become a validator, a member would create a special type of transaction and send funds into a special deposit vault. A consensus algorithm would then create a new block and have members voting on which block become a part of the network blockchain.
Two types of proof of stake algorithms
From the technical standpoint, there are a lot of different consensus algorithms that could automate the proof of stake concept. There are also many ways to incentivize winners and members of the network to participate in the process. The two main types of consensus algorithms are chain-based proof of stake and Byzantine fault tolerance (or BFT).
A chain-based proof of stake algorithm pseudo-randomly picks a winner during a certain period of time and gives the winner a right to create a block of the blockchain. Just like with proof of work algorithm, the block needs to refer to the previous block of the blockchain to make sure that the new block can become a part of the blockchain.
A BFT algorithm randomly gives validating members a right to propose blocks for voting. After proposed blocks are created, members send their votes in a number of voting rounds. The process ends with members permanently agreeing on what blocks become a part of the blockchain.