Candidate Block
In a couple of words, a candidate block is a block that a mining node (miner) is attempting to mine to receive the block reward. So a candidate block might be portrayed as a brief block that will be either approved or disposed of by the network. Miners contend with one another to approve the next block and add it to the blockchain, on the whole, they need to make a candidate block to partake in the mining competition.
Candidate blocks are made by miners by gathering and putting together numerous unverified transactions from the memory pool. The transactions are then hashed to form a Merkle tree structure, which will ultimately deliver a Merkle root (or root hash). The Merkle root is a single hash that addresses generally previous hashes of that tree, and subsequently, all transactions that were remembered for that specific block.
The root hash - along with the hash of the previous block and a random number called nonce - is then put into the block's header. The block header is then hashed by the miner, generating an output in light of those parts (root hash, previous block's hash, and nonce) plus a couple of different components. The subsequent output is the block hash and will act as a unique identifier of the recently produced block (candidate block).
To be considered as substantial, the output (block hash) must beginning with a certain number of zeros (under a target value that is defined by the protocol). This means that the mining system depends on numerous endeavors (trial and mistake) as the mining nodes need to perform a heap of hashing capabilities with various nonce values until a legitimate block hash is at last delivered. The block hash created demonstrates that the miner went about his responsibilities (thus Proof of Work).
After a miner finds a substantial block hash, their candidate block will be communicated to the other nodes of the network, which will check the validness of the hash. In the case of everything is great, the candidate block will then, at that point, be recorded into the blockchain. As of now, each approving node refreshes its copy of the blockchain data to mirror the recent mined block, and the miner will get the block reward.