The concept of proof of work is an expensive computer calculation that must be performed to create a new group of trustless transactions on a blockchain.
Mining accomplished two things:
- It verifies the legitimacy of a transaction and helps prevent double-spending;
- It creates new digital currencies by rewarding miners who successfully perform the previous task.
How setting a transaction works:
- Transactions are bundled into what is called a block;
- Miners verify the transactions within each block, ensuring they are legitimate;
- To verify transactions, miners try to solve a mathematical puzzle, known as proof-of-work;
- A reward is given to the first miner who solves the mathematical puzzle;
- Verified transactions are kept within the blockchain
All network miners compete to solve the mathematical problem first. The work to solve the puzzle is moderately hard on the requester side but easy to check for the network. A problem essentially requires a huge number of attempts to solve finally. When a miner finds the right solution, the miner announces it to the network, and at the same time, receives a cryptocurrency prize or “reward” provided by the protocol. Currently, the reward is 12.5 bitcoin.
This threshold is also known as “difficulty.” The difficulty is what makes mining competitive. This means that the more computing power added to the network, the higher the parameters increase. This then also increases the average number of calculations that are needed to create a new block. Subsequently, the cost of block creation also increases, which then pushes miners to improve the efficiency of their mining to maintain a positive economic balance. In Bitcoin, blocks are set to be mined about every 10 minutes. This calculation is performed by the network that decides the difficulty of each calculation to ensure that at least ten minutes pass between the generation of each block. To do this, a formula similar to this is used: new difficulty = old difficulty * (actual time of last 2016 blocks/20160 minutes)
Once mined, the block is considered validated and added to the blockchain. The validation is important as it ensures that the block is not faked or duplicated. (See Figure 10.1)Block validation includes the following:
- Ensuring block data is valid.
- Header hash is less than difficulty target.
- Correct timestamp.
- Block size within limits.
- First (only) transaction is a coinbase (new coin) generation transaction.
Figure 10.1: Validating a Block
Proof of work is used by the bitcoin blockchain, Ethereum, and many other blockchains; however, Ethereum does change it up a bit. As of this writing, only 15 seconds pass between each generation of Ethereum blocks. Ethereum developers are talking about developing a “hard fork” to increase times to 45 seconds and implementing a proof-of-stake system to replace proof-of-work.
What Does a 64 Digit Hexadecimal Look Like?