Two base primitives in the blockchain system:
- Transaction
- Block
Nodes collect new transactions into a block, hash them into a hash
tree (merkle root hash
), and scan through nonce
values to make the block's hash satisfy
proof-of-work requirements.
When a miner solves the proof-of-work
, it broadcasts the block
to network nodes and if the block is valid it is added to the blockchain. The first transaction in
the block is the coinbase transaction
that creates a new coin owned by the creator of the
block.
A node is responsible for processing, validating, and relaying the block and its transactions. A node is distinct on the network from miners and wallets.
cargo fix --allow-staged --allow-dirty --all-targets --all-features; cargo fmt; cargo clippy --workspace --all-targets --all-features -- -D warnings