Trusted answers to developer questions

Ahsan Amin

It's the procedure through which all the network's peers agree on the network's present state. For example, blockchain networks use different consensus algorithms to decide on the current state of the global ledger.

Different types of consensus algorithms are listed below:

- Proof of Work
- Proof of Stake
- Proof of Capacity
- proof of Burn

To mine the next block, every miner must solve a complex mathematical problem (which takes a lot of computational power). The miners compute the block's hash, and if their hash is less than the current difficulty level set by the network, they have found the correct solution. Otherwise, they can adjust the value of the ** **that gives the correct solution.

Depending on the network's current difficulty, nodes might have to compute millions or even billions of hashes to find the correct solution. Then they will send their block to all the other nodes on the network. Then they all will

Note:All other fields in aare fixed except the nonce. candidate block A block that a miner is trying to mine

- Start with an initial value of the nonce.
- Compute the hash of the block.
- While (hash is not less than the difficulty of the network):

a. Nonce = nonce + 1 (or you can randomly assign a new value to nonce)

b. Recompute the hash of the block

- After we've computed the correct hash, we'll send the block to the entire network.

You can visualize the steps in the following figure:

RELATED TAGS

blockchain

CONTRIBUTOR

Ahsan Amin

RELATED COURSES

View all Courses

Keep Exploring

Related Courses