Sub topic 13
Multisig and Shamir Backups
This chapter covers two ways to split trust so that no single piece of paper or metal can steal or lose your funds. It assumes you have read the earlier chapters on storage media, storage locations, and the optional passphrase. You should also know what a BIP-39 phrase is and that a wallet derives its keys from it.
Why splitting is tempting, and why it is risky
A single recovery phrase is a single point of failure in two directions. Anyone who finds it can take your funds. If it burns, you lose them. Redundant copies reduce loss risk but increase theft risk. Splitting tries to reduce both at once.
Two mature techniques do this:
- Shamir's Secret Sharing splits one secret into several shares. Any threshold number of shares rebuilds the secret, and fewer reveal nothing.
- Multisig (multi-signature) uses several independent keys. A transaction is valid only when enough of them sign.
Both add moving parts, and each part is a new way to make a mistake. Use them only when your holdings and threat model justify the extra work.
What not to do: splitting a phrase by hand
Some people cut a 12-word phrase into two lists of six words and store each list separately. This looks safe, but it weakens the phrase. Whoever finds one half has already learned six of the words. The following code shows how much search space remains for the missing words.
# Search space left when an attacker knows part of a 12-word phrase.
# Each BIP-39 word carries 11 bits.
total_words = 12
for known in (0, 3, 6, 9):
unknown_bits = (total_words - known) * 11
print(f"{known:2d} words known -> about {unknown_bits} bits left to guess")With six words known, about 66 bits remain, and the checksum trims only about 4 bits more. That is far below the 128 bits you started with. Hand-splitting also means that losing either half destroys the whole phrase, because no threshold is involved. If you want splitting, use a scheme designed for it.
Shamir's Secret Sharing
Shamir's scheme hides the secret as the constant term of a random polynomial. A 2-of-3 scheme uses a line, a 3-of-5 scheme uses a parabola, and so on. Each share is one point on the curve. Two points define a line, so two shares recover it. One point on its own fits infinitely many lines and tells you nothing.
The toy implementation below shows the idea. It is for learning only. Never use it for a real secret, because it lacks the checksums, encoding, and review that production tools have.
import secrets
P = 2**521 - 1 # a Mersenne prime, larger than any 256-bit secret
def split(secret, k, n):
"""Return n shares; any k of them rebuild the secret."""
coeffs = [secret] + [secrets.randbelow(P) for _ in range(k - 1)]
shares = []
for x in range(1, n + 1):
y = 0
for c in reversed(coeffs): # Horner's method
y = (y * x + c) % P
shares.append((x, y))
return shares
def combine(shares):
"""Lagrange interpolation at x = 0."""
total = 0
for i, (xi, yi) in enumerate(shares):
num, den = 1, 1
for j, (xj, _) in enumerate(shares):
if i != j:
num = num * (-xj) % P
den = den * (xi - xj) % P
total = (total + yi * num * pow(den, -1, P)) % P
return total
demo_secret = secrets.randbelow(2**256) # random demo value, not a real seed
shares = split(demo_secret, k=2, n=3)
print(combine(shares[:2]) == demo_secret) # True
print(combine([shares[0], shares[2]]) == demo_secret) # True
print(combine(shares[:1]) == demo_secret) # False: one share is not enoughSLIP-39 in practice
For real wallets, the relevant standard is SLIP-39. It adds a checksum to each share, encodes shares as words from its own 1,024-word list, and supports groups. For example, you can require 2 of 3 groups, where each group is itself a 2-of-3 set of shares. Some hardware wallets, including recent Trezor models, support it.
Things to know before you adopt it:
- SLIP-39 shares are not BIP-39 phrases. A wallet that only understands BIP-39 cannot read them.
- Shares must be combined on one device at recovery time. At that moment the full secret exists in one place, so recovery needs a trusted device.
- Support is narrower than for BIP-39. Check that the wallet you would use in ten years can still import your shares, and keep a note of which wallet and version created them.
- Each share still needs the careful writing, media, and location practices from earlier chapters.
A simpler relative is Seed XOR, which splits a phrase into parts that are all required. It is n-of-n, so losing any one part loses everything. Treat it as a theft-resistance tool only, not a loss-resistance tool.
Multisig
In a multisig wallet, several separate keys control the funds, and spending needs m of n signatures. A 2-of-3 setup is common. You might hold one key on a hardware wallet at home, one on a different vendor's device in a safe-deposit box, and one with a trusted family member.
The main benefit is that each key has its own phrase, device, and location. A thief who steals one device or phrase cannot spend. If you lose one key, the other two still work. Mixing device brands also protects you against a bug in one vendor's firmware.
The part people forget: the wallet descriptor
With a single-key wallet, the phrase is enough to recover. With multisig, the phrase is not enough. Rebuilding the wallet also requires the configuration:
- the threshold (for example 2-of-3),
- the script type,
- the extended public keys (xpubs) of all cosigners, in the correct order.
This is usually saved as an output descriptor or a wallet file. Without it, you hold m valid phrases but cannot find your addresses. The descriptor is not secret in the way a phrase is, but it reveals your balance and history to anyone who sees it. Store copies with each key, and also store each cosigner's xpub, because you cannot derive another cosigner's xpub from your own phrase.
Multisig costs
- Transactions are larger, so fees are somewhat higher.
- Setup and recovery take more steps, and every cosigner must be tested.
- Your on-chain footprint can reveal that you use multisig.
- Support differs by chain. The workflow above is Bitcoin-style. On Ethereum-style chains, similar protection usually comes from smart contract wallets, which have their own recovery rules and risks.
Choosing between the options
| Approach | Protects against | Main extra risk | Recovery needs |
|---|---|---|---|
| Single phrase, well stored | Basic loss with copies | Theft if one copy is found | One phrase |
| Phrase plus passphrase | Theft of the phrase alone | Forgetting the passphrase | Phrase and passphrase |
| Shamir (SLIP-39) | Theft of one share, loss of some shares | Wallet compatibility, one-device recombination | Threshold of shares |
| Multisig | Theft or loss of one key or device | Lost descriptor, complexity | m keys plus configuration |
Failure modes and testing
Pick a threshold that tolerates the failures you expect. In a 2-of-3 scheme, one lost or destroyed piece is survivable. Two lost pieces are not. One stolen piece is survivable, and two stolen pieces are not. Place the pieces so that no single fire, burglary, or person can reach the threshold. For example, do not store two of three shares in the same house.
Test the full recovery before you trust it:
- Set up the scheme with a small amount of funds or on a test network.
- Receive funds, then wipe or set aside the original device.
- Rebuild the wallet using only the stored pieces, in the way a stranger or heir would.
- Send the funds out again and confirm that it worked.
- Write down what you needed and what was missing.
Also plan for the people involved. Heirs need written instructions that explain the scheme, where each piece lives, and which software opens it. Do not put the pieces themselves in that document.
Exercise
You set up a 3-of-5 Shamir scheme and keep two shares at home, two in a bank box, and one with a relative. A burglar breaks in and takes both home shares. Are your funds at risk, and what would you do?
Show answer
The funds are not directly at risk, because two shares are below the threshold of three. But the margin is now thin: an attacker who obtains just one more share could recover the secret. The sensible response is to treat it as a partial exposure. Recover the wallet from the remaining three shares (bank box and relative) on a trusted device, create a fresh wallet with a new scheme and new shares, move the funds to it, and retire the old shares. The original placement also had a flaw, since two shares in one place meant one burglary got you two-thirds of the way to the threshold.
Exercise
A friend has a 2-of-3 multisig wallet and stored all three phrases carefully, but no other information. Why might recovery still fail, and what should they add?
Show answer
Rebuilding a multisig wallet needs its configuration (threshold, script type, and the xpubs of all cosigners in order) as well as the keys. A phrase only produces its own key, not the other cosigners' xpubs. They should back up the output descriptor or wallet file and each cosigner's xpub, store copies alongside each key, and test a full recovery.