BLOCKCHAIN · ETHEREUM · GO · 8 LESSONS
Blockchain foundations in Go
Hash chains, Merkle proofs, signatures, addresses, account and UTXO ledgers, RLP, proof of work and fork choice.
Hash chains: every block commits to the exact bytes of the block before it
Link blocks with SHA-256 over a canonical byte encoding, verify the chain from genesis and report the first link that breaks.
5 min · Worked lesson
Merkle proofs: show one transaction is in a block with about log2(n) hashes
Build a domain-separated Merkle tree, generate and verify inclusion proofs, and explain the duplicate-leaf and second-preimage pitfalls.
5 min · Worked lesson
secp256k1 signatures: sign a 32-byte digest, recover the signer and reject high-s twins
Sign a Keccak-256 digest with go-ethereum's crypto package, recover and check the signer's address, and enforce the low-s rule on untrusted signatures.
5 min · Worked lesson
Ethereum addresses: 20 bytes of Keccak-256, an EIP-55 checksum and strict input validation
Derive an address from a public key, produce and check EIP-55 checksums, and validate user-supplied addresses, including the zero address.
5 min · Worked lesson
Account model versus UTXO: two ledgers and two ways to stop a double spend
Implement minimal UTXO and account ledgers in Go, reject double spends in each, and explain what each model makes easy or hard for an indexer.
5 min · Worked lesson
RLP: Ethereum's canonical encoding, and why its decoder rejects every other spelling
Encode and decode Go structs with go-ethereum's rlp package, recognize the canonical-form rules, and bound untrusted input before decoding it.
5 min · Worked lesson
Proof of work: finding a nonce takes thousands of hashes, checking it takes one
Mine a toy block against a big.Int target, verify it with one hash, compute its expected work and retarget from observed block times.
5 min · Worked lesson
Fork choice and reorgs: follow the heaviest chain and undo what the old branch indexed
Implement a heaviest-chain fork-choice rule, compute a reorganization's undo and apply path, apply confirmation depth, and use Ethereum's safe and finalized tags.
5 min · Worked lesson