Of the major problems Bitcoin set out to solve, one was the risk of centralization — and that’s part of what has made it one of the quickest growing currency today. Another was the issue of security.
Both of these are deeply tied to cryptography — the science of securing information using mathematical algorithms.
At the heart of the cryptography that powers Bitcoin are modular arithmetic and finite field.
Modular Arithmetic
Simpler than it sounds, it’s something you already use every day whenever you read a clock.
Modular arithmetic deals with the remainder left after division.
An analog clock never shows 13, 14, or 30. It counts from 1 to 12, then wraps back around. A digital clock goes up to 24, but if your clock reads 23:00 and you want to convert it to a 12-hour format, you apply modulo 12. Here’s the idea: numbers wrap around once they hit a limit. In this case: 23 mod 12 = 11 So, 23:00 becomes 11 PM.
No matter how large the number gets, modulo arithmetic always brings it back within a fixed range. Bitcoin leans on this heavily — the specific modulus it uses is a 256-bit prime number: p = 2²⁵⁶ − 2³² − 977, chosen for both its size and its mathematical properties. Every arithmetic operation in Bitcoin's cryptography runs against this prime, ensuring results stay within a predictable, bounded space.
Finite Fields
A finite field is a set with a finite number of elements that supports four operations — addition, subtraction, multiplication, and division (except by zero) — while always producing a result that still remains within the set.
This property is known as closure.
For example, if your finite field is {0, 1, 2, 3, 4, 5, 6} (a field of order 7), then:
3 + 5 = 8 → 8 mod 7 = 1 ✅ (still inside the set)
6 * 3 = 18 → 18 mod 7 = 4 ✅ (still inside the set)
But there’s one important condition: the number of elements in the field must be a prime number, or a power of a prime.
This guarantees that every element (aside from zero) has a multiplicative inverse, which makes division possible without breaking out of the field.
In Bitcoin's case, the finite field has exactly p elements — that same 256-bit prime — giving it an astronomically large but still finite and well-structured space to operate in. Division inside this field works through something called Fermat's Little Theorem: instead of dividing by a, Bitcoin computes a^(p−2) mod p, which gives the same result while staying entirely within the field.
Why does Bitcoin care?
Bitcoin’s security is built on elliptic curve cryptography — a branch of cryptography where private keys, public keys, and signatures are generated through mathematical operations on points on a curve. The specific curve Bitcoin uses is called secp256k1, defined by the equation y² = x³ + 7, and all point operations on it happen inside the finite field described above.
The challenge is that, without boundaries, these operations would produce numbers that grow astronomically large, very quickly.
Finite fields solve this problem. By performing elliptic curve operations inside a finite field using modular arithmetic, Bitcoin keeps every result bounded within a fixed range. A private key is simply a random integer between 1 and the curve's order n — another large prime, close in size to p. The corresponding public key is derived by multiplying a fixed starting point G (the generator point) by that private key, entirely using modular arithmetic.
In practice, this means the numbers never grow beyond a fixed size (256 bits for bitcoin), making the cryptography both secure and computationally feasible.
Finite fields are a major reason Bitcoin’s cryptography can actually work efficiently in the real world.
Top comments (0)