What is Candidate Block?

A candidate block is one that a mining node (miner) is attempting to mine to earn the block reward. You can think of a candidate block as a temporary block that the network will either validate or reject. Miners are in a race to validate the next block and add it to the blockchain, but they first need to create a candidate block to join the mining competition.


Understanding about Candidate Block

Candidate blocks are formed by miners who gather and arrange several unconfirmed transactions from the memory pool. These transactions are hashed to create a Merkle tree structure, which ultimately leads to the generation of a Merkle root (or root hash). This Merkle root is a single hash that encapsulates all the previous hashes of that tree, thus representing all the transactions included in that specific block.

The root hash, along with the hash of the previous block and a random number known as nonce, is then incorporated into the block’s header. The miner hashes the block header, producing an output based on these components (root hash, previous block’s hash, and nonce) along with a few additional elements. The output generated is the block hash, which acts as a unique identifier for the newly created block (candidate block).

ADVERTISEMENT

For the output (block hash) to be considered valid, it must begin with a specific number of zeros (less than a target value set by the protocol). This indicates that the mining process involves numerous attempts (trial and error), as mining nodes must execute a multitude of hashing functions with various nonce values until a valid block hash is finally achieved. The block hash generated serves as proof that the miner has completed their task (hence Proof of Work).

Once a miner discovers a valid block hash, they send their candidate block out to all the other nodes in the network, which will check if the hash is legit. If all checks out, the candidate block gets added to the blockchain. At this stage, every validating node refreshes its version of the blockchain data to include the newly mined block, and the miner receives the block reward.

Conclusion

A candidate block is a vital component in blockchain mining. It’s the miner’s attempt to add a new block of transactions to the chain. Understanding candidate blocks helps clarify how blockchains remain secure, decentralized, and consistently updated across all nodes in the network.