Hash160 and Merkle trees
Terms used in this lesson
- Hash160
- SHA-256 followed by RIPEMD-160, producing the 20-byte hash used by several Bitcoin spending conditions.
- SHA-256
- A cryptographic hash function used throughout Bitcoin to produce fixed-size 256-bit digests.
- RIPEMD-160
- A 160-bit cryptographic hash function used in Bitcoin’s HASH160 construction.
Bitcoin combines two hash functions for some identifiers and arranges transaction hashes in a tree so one item can be proven part of a larger set.
Loading lesson visuals...
Learn the idea
HASH160 means SHA-256 followed by RIPEMD-160, producing 20 bytes. A Merkle tree commits to many items by hashing leaves and then repeatedly hashing pairs until one Merkle root remains. A Merkle proof supplies the sibling hashes needed to recompute the root for one leaf.
Build leaf hashes
Each item is serialized and hashed under the protocol's rule. In a Bitcoin block, transaction hashes become leaves of the transaction Merkle tree.
Inspect every idea above to open it.
It proves that a leaf is included under a particular root. Transaction validity and whether that root belongs to an accepted valid block require additional checks.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.