The one-sentence version
Hide the secret in the constant term of a polynomial of degree , and give each person one point on the polynomial. Any points determine the polynomial uniquely by Lagrange interpolation, recovering the secret; with fewer than points, every possible value of the secret is equally likely, and not a bit of information leaks.
This article has three layers:
- The intuition: two points determine a line
- Real-world use: wallet backups, MPC wallets, threshold signatures, the DNSSEC root key
- The mathematics: polynomials over finite fields, Lagrange interpolation, perfect security and a worked example
Layer 1: The Intuition
1.1 Why "split" a private key
If a Bitcoin private key is stored in only one place:
- Lose it, and the money is gone forever;
- Have it stolen, and the money is gone too.
Keeping several copies protects against loss but multiplies the risk of theft. What we want is: split it into 5 shares for 5 people (or 5 places), so that any 3 together can recover it, while any 2 together are useless. This is called a threshold scheme.
1.2 Two points determine a line
Start with the simplest scheme:
- Plot the secret on the -axis, as the point ;
- Draw any line (with a random slope) through this point;
- Take the points on the line at , and give one to each person.
Any two people put their points together; two points determine a line, and extending it to the -axis reveals . But someone holding just one point sees infinitely many lines through it, meeting the -axis at any value at all, so they can't guess at all.
For a threshold of 3, replace the line with a parabola (three points determine a parabola); for a threshold of , use a polynomial of degree .
1.3 The same thing as Reed–Solomon codes
Reed–Solomon error correction treats data as polynomial coefficients and sends the polynomial's values at many points, so the data can be interpolated back even if some points are lost. Shamir's secret sharing uses the same evaluation map with a different emphasis: error-correcting codes care about "recovering what was lost", while secret sharing also cares that "too few points reveal nothing".
Layer 2: Real-World Use
| Where | How it's used |
|---|---|
| Split backups of recovery phrases (SLIP-39, hardware wallets such as Trezor) | A wallet seed is split into several recovery phrases, such as "any 3 of 5" |
| Corporate / exchange cold wallets | The private key is divided among several executives or safes, guarding against one person acting alone or a single point of loss |
| MPC wallets and threshold signatures | One step further: the private key never appears whole anywhere, and the parties jointly compute a signature from their shares (such as the FROST and GG20 protocols) |
| The DNSSEC root key | Recovery credentials for the internet's root zone signing key are held by trusted community representatives around the world, and several must be present |
| HashiCorp Vault | The unseal master key is split into 5 shares with a threshold of 3 by default |
How it differs from multisig
Bitcoin multisig specifies on-chain that "signatures from 3 different private keys are required", and the rule is publicly visible. Threshold signatures use secret sharing off-chain and produce one ordinary signature, which on-chain looks just like a single-person wallet, with lower fees and more privacy.
Two weaknesses of plain Shamir
- At the moment of recovery, the complete secret appears on some machine, which becomes a target. The point of MPC wallets is to avoid even this moment.
- If the person distributing shares (the dealer) cheats and hands out inconsistent shares, the recipients can't tell. Verifiable secret sharing (Feldman / Pedersen VSS) solves this by attaching a commitment to each coefficient.
Layer 3: The Mathematics
3.1 Working in a finite field
Polynomials over the real numbers leak information (the size of a share can hint at the range of the secret), so everything happens in a finite field , where is a prime larger than the secret.
Distribution: the secret is , with threshold . Randomly choose and let
and person receives the share , for .
3.2 Why points determine the polynomial uniquely
A nonzero polynomial of degree at most over a field has at most roots (abstract algebra: is an integral domain, and the factor theorem). If two polynomials of degree agree at points, their difference has roots and must be the zero polynomial. So it is unique.
3.3 Lagrange interpolation
Given points , construct
which equals at and at the other . Then . We only need the constant term:
Note that is a linear combination of the shares. This is crucial: in threshold signatures, the parties needn't hand over their shares; each computes only the part "share ", and these are added in the exponent or as elliptic curve points.
3.4 Why shares reveal nothing
Fix any shares. For every candidate value of the secret , adding the point gives points in all, which determine exactly one polynomial. So each corresponds to the same number (exactly one) of coefficient choices, and since coefficients are chosen uniformly at random, each has probability .
This is called information-theoretic security (perfect security): it depends on no computational hardness, and no amount of computing power, quantum or otherwise, helps. The reasoning is the same as for the one-time pad.
3.5 A worked example
A scheme over
The secret is , with random and :
The five shares:
| Computing | Share | |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 |
Recover from shares 1, 3 and 5:
- . and (), so
- . and , so
The result is . (Checked with Python.)
Summary
| Layer | Key points |
|---|---|
| Intuition | points determine a polynomial of degree ; the secret is its -intercept |
| Algebra | Polynomials over a field have a bounded number of roots; Lagrange interpolation; the secret is a linear combination of shares |
| Security | With fewer than shares it is information-theoretically secure, and even quantum computers can't help |
| Engineering | Wallet backups, MPC wallets, threshold signatures; dealer cheating must be guarded against (VSS) |