Stanford CS251: Lecture 3
Lecture 3: Bitcoin overview There are three Bitcoin protocols Consensus Protocol - decides what the ledger is Transaction Protocol - assigns meaning to the ledger Network Protocol - the P2P protocol which decides what new should be added to the ledger Consensus Protocol Bitcoin fields (Virtual field) Hash - 4 bytes. SHA256-squared. This is not part of the block but is calculated on the fly. Version - 4 bytes. Set to 3, might never change. Previous block - 32 bytes. Hash of the previous block on which we build this block. mrkl_root (Merkle root) - 32 bytes Time - 4 bytes. Timestamp of mining the block. Bits - 4 bits. This is the difficulty level. Lock time - 4 bytes. The transaction cannot be posted on the blockchain till the lock time constraint is met. Nonce - 4 bytes. Random nonce tweaked to find a block with the right difficulty. n_tx & txn_data in the Merkle root are stored separately. The nonce is only 32 bits, Changing that might not be sufficient to get the desired number of difficulty(70+ zeros). Therefore, changes can be made to the Coinbase transaction (explained below) to generate more randomness. ...