Do You Want to Build a Blockchain?
summary
Builds a minimal blockchain in JavaScript that actually runs: blocks hold a single transaction class, use SHA‑256 via Node.js crypto, and include previousHash for integrity; implements proof‑of‑work with a nonce (demo difficulty = 4, first matching nonce for "a" = 8602183 found by brute force), an HTTP API using Express, and peer discovery/replication over discovery-swarm. Nodes exchange blocks, request the longest chain, and in the demo two nodes reconcile to a three‑block chain, showing the design works end‑to‑end.
AI-written summary · about
chapters (11)
- 0:00Start
- 3:21What What Is a Block
- 4:50Javascript Code
- 6:04Hash Algorithm
- 9:21The Integrity of a Blockchain
- 14:18Genesis Block
- 20:11Limited Http Interface
- 20:29Http Route Handler
- 23:08Create a Block
- 24:27The Double Spend Problem
- 25:38Proof of Work








