Mathematics and cryptography
Understand the primitives without treating cryptography as magic.
Follow these 9 lessons in order, or choose the topic you need. Each lesson combines an explanation, a worked example and practice inside the Guild.
Modular arithmetic
Modular arithmetic wraps numbers around a fixed boundary, like hours on a clock. Bitcoin's signature mathematics uses this kind of arithmetic.
Open lessonHash functions and SHA-256
A hash turns any message into a fixed-size fingerprint. Bitcoin commonly uses the Secure Hash Algorithm 256, called SHA-256, to detect changes and make commitments.
Open lessonHash160 and Merkle trees
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.
Open lessonElliptic-curve keys
A private key is a secret number. Bitcoin multiplies it by a fixed curve point to create a public key, a one-way operation used to authorize spending.
Open lessonECDSA signatures
The Elliptic Curve Digital Signature Algorithm, called ECDSA, lets a private key authorize a message without revealing the key. Safe signing also depends on a unique secret nonce.
Open lessonSchnorr and BIP340
Schnorr signatures use simpler algebra than Bitcoin's earlier signature system. Bitcoin Improvement Proposal 340 defines the exact Schnorr format used by Taproot.
Open lessonTagged hashes
A tagged hash adds a purpose label before hashing. This stops the same bytes from being mistaken for a message used by a different protocol rule.
Open lessonThreshold cryptography
Threshold signing divides authority among several participants. A required number can create one valid group signature without combining their secret shares.
Open lessonThe Bitcoin cryptography map
Connect SHA-256, HASH256, HASH160, HMAC-SHA512, PBKDF2, secp256k1, ECDSA, Schnorr, tagged hashes, and Merkle commitments to the exact job each performs.
Open lesson