This project demonstrates a simple implementation of a Merkle Tree using JavaScript and SHA-256 hashing.
- Transactions used are hardcoded to build logic and merkle leaf,
- Each transaction is first serialized and hashed to form the leaf nodes of the tree.
- Pairs of hashes are then concatenated and re-hashed repeatedly until a single Merkle Root is produced.
The following hardcoded transactions were used as input:
- Temu → Raphael (100)
- Jane → Jumia (200)
- Taiwo → Kehinde (300)
- Mohammed → Abubakar (400)
- Buddy → Tom (500)
- Peter → Jesus (600)
- Transactions are converted into deterministic strings.
- Each string is hashed using SHA-256 to create leaf nodes.
- Leaf hashes are paired, concatenated, and hashed again.
- The process repeats until one hash remains — the Merkle Root.
Below is a screenshot showing the generated Merkle Tree levels and final Merkle Root:
node index.js