FM-39 · Seed phrase concealmentDistribution: unlimited. Copy freely.
Bitcoin Seed BookSelf-custody field manual

Shamir by hand, SLIP-39 and Codex32

Home » Resources » Shamir by hand, SLIP-39 and Codex32

Our page on splitting a seed across places explains why a threshold scheme beats cutting a phrase into pieces, and introduces SLIP-39 and Codex32. This page covers the maths under them, the ways a homemade split fails, and which wallets restore each standard. If every part of the split must be present, that is a different scheme, covered on XOR seed splitting.

How Shamir works

Adi Shamir published the method in 1979, in a two-page paper called "How to share a secret". A threshold scheme splits a secret D into n pieces so that any k pieces rebuild D, and any k − 1 pieces leave D "completely undetermined (in the sense that all its possible values are equally likely)".

The construction is a polynomial. Pick one of degree k − 1 whose constant term is the secret and whose other coefficients are random:

q(x) = a0 + a1x + … + ak−1xk−1, with a0 = D

Each share is a point: share 1 is q(1), share 2 is q(2), and so on. Any k points fix exactly one polynomial of degree k − 1, so k shares give back q, and q(0) is the secret.

In a 2-of-3 split the polynomial is a straight line. Two points fix it. One point fits a line through every possible secret, so it tells the holder nothing.

That last claim only holds under two conditions the paper states. The arithmetic is done modulo a prime p, because "the set of integers modulo a prime number p forms a field in which interpolation is possible". And the coefficients are chosen at random "from a uniform distribution". Break either and the guarantee goes.

Why not split BIP-39 words yourself

The tempting shortcut is to treat each of the 12 words as a number from 0 to 2,047 and run Shamir on those numbers. Take the public example seed:

pizza educate fat kiss domain venue … (this phrase is public: never use it for real funds)

  1. The field is wrong. 2,048 is not a prime, so arithmetic modulo 2,048 is not a field, and Shamir's proof doesn't apply. The leak is easy to show. In a 2-of-n split, share 2 is D + 2a1. Twice anything is even, so share 2 has the same odd-or-even as the secret. Whoever holds share 2 learns the last bit of every word's index: 12 bits off a 12-word seed, from one share that was meant to reveal nothing.
  2. A share has no checksum. A word miscopied on one share produces a different seed when you combine them. The rebuilt 12-word phrase has only BIP-39's 4-bit checksum, so about one wrong result in 16 still looks valid. Nothing tells you which share was bad.
  3. Index zero. The secret sits at x = 0. SLIP-39's authors warn that "some implementations might fail to check" that no share claims x = 0. Someone who can edit one share changes it to (0, y), and a careless tool then returns y as the secret, whatever the other shares say. The attacker knows y.
  4. Nobody else can restore it. SLIP-39 states the problem: "the lack of SSS standardization to date presents a risk of being unable to perform secret recovery". Your heir needs your tool, your conventions and your share order, years from now.

If you want a threshold, use one of the two standards below, and make the shares on an offline device or by hand, never on a web page or an online tool.

SLIP-39 in detail

SatoshiLabs created SLIP-39 in December 2017. It runs Shamir separately on each byte of the secret over GF(256), the same field AES uses, so the arithmetic is sound. It stores the secret at x = 255 instead of 0, which removes the index-zero attack.

  • Word list. 1,024 words, so each word carries 10 bits. A 128-bit secret makes 20-word shares; 256 bits make 33. The first two words are a random identifier and the iteration exponent, so all shares of one backup start with the same two words and you can tell at a glance whether they belong together.
  • Checksum. The last three words are an RS1024 checksum, a Reed-Solomon code over GF(1024). It detects any error in up to three words and misses larger errors less than once in 109. The spec tells wallets not to auto-correct, because a correction can turn a bad share into a valid-looking one.
  • Digest share. The point at x = 254 holds a 4-byte HMAC-SHA256 digest of the secret. A set of shares that doesn't belong together fails with a random chance of 2−32 of slipping through. The price is stated in the spec: someone holding T − 1 shares can use the digest to cut the secret's strength by 32 bits, which is why the minimum secret size is 128 bits.
  • Encryption. The master secret goes through a four-round Feistel network with PBKDF2-HMAC-SHA256, at 10,000 × 2e iterations. The spec adds it because Shamir has no proof of security when parts of shares leak. Your SLIP-39 passphrase goes in here, and as with BIP-39, "there is no way to verify that the correct passphrase was used".

SLIP-39 is not BIP-39. A BIP-39 seed can be moved into SLIP-39 only with 59-word shares, and the reverse "is not possible".

Codex32 in detail

Codex32 is BIP-93, assigned in February 2023. The project began in 2020 as a way to do everything with pencil, paper and paper wheels called volvelles. Its README calls it "tedious and not for the faint-of-heart".

  • Field and alphabet. It works in GF(32), written in the 32-character bech32 alphabet from BIP-173. A small field is what makes the lookup tables small enough to use by hand.
  • Format. A share reads ms1, then a threshold digit from 2 to 9, a 4-character identifier, a share index and the payload. Index s is the unshared secret. A 128-bit seed is 48 characters; a 256-bit seed is 74. The BIP says handwritten shares should be in capitals.
  • Checksum. 13 characters. It can correct up to four wrong characters, eight unreadable ones, or 13 unreadable in a row. You can check it by hand, so you can verify a share every year without showing it to any device.
  • No passphrase, no groups. BIP-93 drops both "because of the need to support hand computation".
  • Not BIP-39. It encodes a BIP-32 master seed directly. The authors argue that a BIP-39 checksum can't be computed by hand, so there is no point keeping it. SLIP-39 shares can't be turned into Codex32 shares either, because the fields differ.

The time it takes is covered on the split page.

Side by side

Scheme Field and symbols Share checksum Own passphrase
DIY over BIP-39 words mod 2,048, not a field none no
SLIP-39 GF(256), 1,024 words RS1024, 3 words, detects ≤3 errors yes, with key stretching
Codex32 (BIP-93) GF(32), bech32 characters 13 characters, corrects ≤4 errors no

Which wallets restore which

This is what each wallet's own release notes or support pages said by 6 August 2026. We left out wallets whose support we could only find claimed by someone else.

Wallet SLIP-39 Codex32
Trezor creates and restores; Multi-share needs firmware 2.7.2 or newer not mentioned
Electrum restores, since 4.1.5 (July 2021) not mentioned
Sparrow restores shares, since 2.0.0 (September 2024) imports, since 2.4.0 (February 2026)
Bitcoin Core not mentioned not in a release: two pull requests closed unmerged, one proof of concept open

A homemade split restores in nothing except the tool that made it.

Before you put coins on a SLIP-39 or Codex32 wallet, restore it from the minimum number of shares on the wallet you will actually recover with, offline, and check that it shows the same first receive address. Then test the backup on a schedule.

Hiding is not encrypting. The ciphers are public and a seed phrase carries its own checksum, so a list someone recognises as a seed can be tried against every cipher in minutes. Add a BIP-39 passphrase to the wallet and keep it somewhere else.

What to do

  1. Don't run Shamir on BIP-39 word numbers yourself.
  2. Pick SLIP-39 if you want groups or a passphrase and are happy to use a device.
  3. Pick Codex32 if you want to make and check shares by hand, and accept that fewer wallets read it.
  4. Start a new wallet in the scheme you chose and move the coins to it.
  5. Restore once from the minimum shares before funding it.

We will never ask for a seed word or a passphrase. Never type one into this site or any tool it links to.

Sources

  • How to share a secret, Adi Shamir, Communications of the ACM 22(11), November 1979 (threshold definition, polynomial construction, prime field, uniform coefficients)
  • SLIP-0039: Shamir's Secret-Sharing for Mnemonic Codes, SatoshiLabs, created 2017-12-18 (GF(256), index 255, index-zero attack, word list, RS1024, digest, Feistel encryption, passphrase, standardization, BIP-39 conversion)
  • BIP-93: codex32, assigned 2023-02-13 (GF(32), bech32 alphabet, share format, lengths, error correction, no passphrase or groups, BIP-32 seed, BIP-39 and SLIP-39 rationale)
  • codex32 project README, Blockstream Research (volvelles, project history)
  • SLIP39 FAQs, Trezor (Multi-share firmware version)
  • Electrum release notes (4.1.5: restoring from SLIP39 seeds)
  • Sparrow 2.0.0 and Sparrow 2.4.0 release notes (SLIP39 share recovery; Codex32 importer)
  • Bitcoin Core pull requests #27351, #32652 and #33043 (codex32 import, closed unmerged; paper backup proof of concept, open)