Bitcoin's Algorithmic
Building Blocks
Theory, mathematics, and working code — everything you need to understand the cryptographic primitives that make Bitcoin trustless, secure, and verifiable.
SHA-256
Bitcoin's primary hash function. Every block header, every transaction ID, every Merkle tree leaf passes through SHA-256. Understand how 512-bit message blocks are compressed into a 256-bit digest through 64 rounds of bitwise operations.
RIPEMD-160
Applied after SHA-256 to produce shorter, more compact Bitcoin addresses (the HASH160 operation). Its 160-bit output strikes a balance between security and address brevity, using parallel processing of 80 rounds across two independent pipelines.
ECDSA secp256k1
The digital signature algorithm that proves you own bitcoins without revealing your private key. Built on elliptic curve cryptography over the secp256k1 curve — the same curve chosen by Satoshi for its efficient computation and well-understood security.
HMAC-SHA512
The keyed hash function at the core of HD wallet derivation (BIP32) and seed generation (BIP39). By combining a secret key with the SHA-512 hash function, HMAC produces authentication codes that are computationally infeasible to forge without the key.