Skip to content
/ keysplit Public

A CLI tool to split BIP-39 seed phrases into multiple SLIP-39 shares using Shamir's Secret Sharing. Supports configurable M-of-N thresholds for secure backup distribution.

Notifications You must be signed in to change notification settings

lekom/keysplit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeySplit

Split your BIP-39 seed phrase into multiple shares using Shamir's Secret Sharing (SLIP-39). Any M shares can reconstruct the original seed, but fewer than M reveals nothing.

Why Use This?

A single seed phrase is a single point of failure. If someone finds it, they have full access to your funds. If you lose it, your funds are gone forever.

With Shamir's Secret Sharing, you can:

  • Split your 12/24-word seed into N shares (e.g., 5 shares)
  • Require M shares to reconstruct (e.g., 3 of 5)
  • Distribute shares to different locations/people
  • Survive loss of up to N-M shares (e.g., lose 2, still recover with 3)
  • Prevent theft unless attacker obtains M shares

Security Warning

Run this tool ONLY on an air-gapped, offline machine.

  • Never enter your seed phrase on a computer connected to the internet
  • Use a live USB (like Tails) on a machine with no network connection
  • Verify the code yourself before trusting it with real funds

Requirements

  • Python 3.8+
  • No external dependencies (uses bundled shamir_mnemonic library)

Usage

Splitting a Seed Phrase

python shamir_seed.py
  1. Select mode 1 (Split)
  2. Enter your BIP-39 seed phrase (12, 15, 18, or 24 words)
  3. Receive N SLIP-39 shares (each is a 20-word mnemonic)

Example output:

Generated 5 SLIP-39 shares (any 3 can reconstruct):

Share 1:
  academic acid acne academic acid beard romp chubby firm install...

Share 2:
  academic acid acne academic acid blimp lair intimate duke disaster...

[...]

Reconstructing a Seed Phrase

python3 shamir_seed.py
  1. Select mode 2 (Reconstruct)
  2. Enter M SLIP-39 shares (the minimum threshold)
  3. Receive your original BIP-39 seed phrase

Configuration

Edit the constants at the top of shamir_seed.py:

M = 3  # Minimum shares needed to reconstruct
N = 5  # Total shares to generate

Common configurations:

  • 2-of-3: Lose 1 share, still recover. Simple redundancy.
  • 3-of-5: Good balance of security and redundancy.
  • 4-of-7: Higher threshold for valuable holdings.

How It Works

  1. Your BIP-39 seed phrase is converted to entropy bytes
  2. The entropy is split using SLIP-39 (Shamir's Secret Sharing)
  3. Each share is encoded as a 20-word SLIP-39 mnemonic
  4. To recover, M shares are combined to reconstruct the entropy
  5. The entropy is converted back to BIP-39 words

BIP-39 vs SLIP-39

BIP-39 SLIP-39
Purpose Seed phrase Share encoding
Wordlist 2048 words 1024 words (different!)
Words overlap None

The wordlists are intentionally different so you can tell them apart at a glance.

Compatibility

SLIP-39 shares generated by this tool are compatible with:

  • Trezor Model T / Safe 3 / Safe 5
  • Other SLIP-39 compatible wallets and tools

Project Structure

KeySplit/
├── shamir_seed.py      # Main tool
├── bip39_words.txt     # BIP-39 wordlist (2048 words)
├── shamir_mnemonic/    # SLIP-39 library (from Trezor)
└── tests/
    ├── test_shamir_seed.py  # Tests for main tool
    └── test_shares.py       # Tests for SLIP-39 library

Running Tests

python tests/test_shamir_seed.py
python tests/test_shares.py

Best Practices for Share Storage

  1. Write shares on paper or metal — not digital storage
  2. Store in separate physical locations — safe deposit boxes, trusted family members, etc.
  3. Label shares clearly — "Share 1 of 5" with date
  4. Test recovery — verify you can reconstruct before relying on it
  5. Document your setup — record M, N, and where shares are stored (separately from shares)

References

License

The bundled shamir_mnemonic library is from Trezor and is licensed under their terms. See shamir_mnemonic/ for details.

About

A CLI tool to split BIP-39 seed phrases into multiple SLIP-39 shares using Shamir's Secret Sharing. Supports configurable M-of-N thresholds for secure backup distribution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages