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.
35 minutes · 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.
45 minutes · 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.
55 minutes · 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.
65 minutes · 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.
35 minutes · 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.
45 minutes · 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.
55 minutes · Open lessonThreshold cryptography
Threshold signing divides authority among several participants. A required number can create one valid group signature without combining their secret shares.
65 minutes · 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.
35 minutes · Open lesson