Deep dive into the four fundamental mathematical concepts that power modern cryptography and blockchain technology.
The foundation of modern cryptography
Modular arithmetic is like clock math. When the hour hand goes past 12, it wraps back to 1. In math terms, we're working with remainders after division. This simple concept is the foundation of nearly all modern encryption.
For example: 17 mod 5 = 2 (because 17 ÷ 5 = 3 remainder 2)
In Bitcoin, modular arithmetic is used in ECDSA (Elliptic Curve Digital Signature Algorithm) to create and verify digital signatures. Every transaction you make is secured by these calculations.
The atoms of mathematics
A prime number is a natural number greater than 1 that can only be divided evenly by 1 and itself. These seemingly simple numbers are the building blocks of all integers and form the foundation of cryptographic security.
The beauty of primes: every integer greater than 1 can be uniquely expressed as a product of prime numbers (Fundamental Theorem of Arithmetic).
While Bitcoin uses elliptic curves (not RSA), prime numbers are still crucial. The secp256k1 curve used by Bitcoin is defined over a prime field with a 256-bit prime number.
The one-way function
A discrete logarithm is the inverse of modular exponentiation. If g^x mod p = h, then x is the discrete logarithm of h to the base g, modulo p. The magic: computing g^x mod p is easy, but finding x from the result is incredibly hard.
This asymmetry (easy one way, hard the other) is what makes public-key cryptography possible.
Even if an attacker sees all public communication, they cannot compute the shared secret without solving the discrete log problem.
The discrete log problem on elliptic curves (ECDLP) is what secures your Bitcoin wallet. Your private key is essentially a secret exponent, and your public key is the result of elliptic curve multiplication - easy to compute, impossible to reverse.
The modern standard
An elliptic curve is a special type of curve defined by the equation y² = x³ + ax + b. When we combine this with modular arithmetic over a prime field, we get Elliptic Curve Cryptography (ECC) - the backbone of Bitcoin and Ethereum.
ECC provides the same security as RSA with much smaller key sizes: a 256-bit ECC key ≈ 3072-bit RSA key.
Bitcoin uses a specific elliptic curve called secp256k1, defined by:
Where p is a massive 256-bit prime. Your Bitcoin private key is a random 256-bit number k, and your public key is the point K = k × G, where G is the generator point.
Every Bitcoin address is derived from an elliptic curve public key. When you sign a transaction, you prove ownership of the private key without revealing it - this is the magic of ECDSA (Elliptic Curve Digital Signature Algorithm).