Question :How are blocks created?
Here is the Receipt to cook (create) a bitcoin block:
Ingredients:
1- Coinbase transaction (Generation transaction)
2- Set of valid transaction (not spent, signatures verified, amounts verified)
3- Hash of previous block
4- Unixtime stmaps or Epoch
Now you have all the ingredients, try to remember and confirm this
1. You have a market root
2. You know the networks current difficulty (4 bytes)
3. Nonce, incremented when mining (4 bytes)
Lets start cooking:
- Start with nonce 0
- Hash or compute the hash with all the ingredients (the block header) using sha-256
- Check the hash, check if the hash is under a "certain range
1" (or target if in a pool) - Yes? You found the Block
- No, increments the nonce and hash again
You never found the Block, nonce reached maximum?
- Don't worry change your ingredients for exmaple change the Timestamp or extra nonce field
- and try again
1. Certain range: The hash has to start with a pre-established number of zeroes (
as of today 18 zeros)
Hint: When selecting transaction select the transaction with fee to have extra BTC + block reward