Skip to content

Instantly share code, notes, and snippets.

@odudex
Last active October 7, 2025 18:00
Show Gist options
  • Save odudex/89d8338527ff45c5f929d685dc48c6d8 to your computer and use it in GitHub Desktop.
Save odudex/89d8338527ff45c5f929d685dc48c6d8 to your computer and use it in GitHub Desktop.
Mnemonic Splitting Using XOR

Mnemonic Splitting Using XOR

Overview

You can split a mnemonic into two separate mnemonics (or "shares") using the XOR operation. Neither share reveals any information about the original secret on its own. The original mnemonic can only be recovered when both shares are combined.

Core Principle

If A XOR B = C, then B XOR C = A.

  • A: Your original mnemonic (the secret to protect)
  • B: A newly generated, random mnemonic (Share 1)
  • C: The resulting mnemonic from the XOR operation (Share 2)

Step-by-Step Guide to Splitting Your Mnemonic

Phase 1: The Splitting Process

Step 1: Generate a Random Share (Mnemonic B)

  1. Generate a new, random mnemonic from dice rolls or an image
  2. CRITICAL: This mnemonic must have the same number of words (12 or 24) as your original mnemonic (A)

Step 2: Backup Mnemonic B

  • Use a safe method to backup mnemonic B

Step 3: Perform the XOR Operation

  1. Load mnemonic A, go to Wallet -> Mnemonic XOR and load mnemonic B to be XORed with A
  2. The resulting entropy of A XOR B will be used to create the second share, mnemonic C

Step 4: Back Up Mnemonic C

  1. Go to Backup and choose your favorite secure method to backup mnemonic C

Phase 2: Verification & Finalization

⚠️ DO NOT SKIP THIS PHASE

Step 5: Verify the Recovery Process

This is non-negotiable. Before relying on the system or destroying the original mnemonic, perform a test:

  1. Retrieve mnemonic B and C backups
  2. Load one of them and XOR it with the other
  3. Verify that the resulting mnemonic matches the original mnemonic A

Step 6: Destroy the Original

⚠️ Only after you have successfully verified in Step 5 that the recovery works perfectly should you securely destroy the original mnemonic (A).


Important Notes

  • Keep shares separate: Store mnemonic B and mnemonic C in different secure locations
  • Both shares required: Neither share alone provides any information about the original mnemonic
  • Always verify: Test the recovery process before destroying the original
  • Same word count: All three mnemonics (A, B, and C) must have the same number of words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment