Overview
Muun Wallet provides multiple recovery mechanisms to ensure you can always access your Bitcoin, regardless of what happens to your device, Muun’s servers, or your backups. Understanding these mechanisms is crucial for maintaining control of your funds.Muun’s architecture ensures you always maintain sovereignty over your funds. Even if Muun disappears, you can recover everything using your Emergency Kit.
Recovery Scenarios
Scenario 1: Lost or Broken Device (Muun Operational)
Situation: Your phone is lost, stolen, or broken, but Muun’s servers are working. Requirements:- Recovery code (written down during wallet creation)
- Install Muun on a new device
- Tap “Recover wallet” on the welcome screen
- Enter recovery code (8 words or alphanumeric string)
- Set new PIN for the new device
- Wait for sync (wallet state downloads from server)
- Access restored with full balance and history
Scenario 2: Forgotten PIN (Device Still Available)
Situation: You forgot your PIN but still have the device. Requirements:- Recovery code
- Access to the device (locked)
- Tap “Forgot PIN?” on the lock screen
- Enter recovery code
- Set new PIN
- Wallet unlocked without losing any data
Scenario 3: Lost Recovery Code (Device Still Available)
Situation: You lost your recovery code but still have access to the unlocked wallet. Requirements:- Access to unlocked wallet
- Open Muun (unlock with PIN/biometrics)
- Go to Settings → Security
- Tap “Show Recovery Code”
- Authenticate (PIN/biometrics/security card)
- Write down new code on paper
- Verify you’ve written it correctly
- Store securely in multiple locations
Scenario 4: Complete Emergency (Muun Offline Forever)
Situation: Muun’s servers are permanently offline, company is gone, or you want to recover without their cooperation. Requirements:- Emergency Kit PDF
- Recovery code
- Bitcoin recovery tool (Muun provides one, or use Bitcoin Core)
Recovery Code
What is the Recovery Code?
The recovery code is a cryptographically secure password generated when you create your wallet. It’s the master key to your Bitcoin.- Random generation: Uses cryptographically secure random number generator
- High entropy: 128+ bits of randomness
- Versioned format: Supports upgrades to the code format
- Checksum: Detects typos during entry
libwallet/recoverycode.go:12-15
Recovery Code Format
Muun supports multiple recovery code versions:libwallet/recoverycode.go:22-40
Recovery Code Validation
- Correct alphabet (no confusing characters like 0/O or 1/I/l)
- Proper length
- Valid checksum
- Recognized version
Storing Your Recovery Code
Critical Best Practices: Common Mistakes to Avoid:- ❌ “I’ll remember it” (you won’t)
- ❌ Saving in password manager (defeats the purpose)
- ❌ Storing in cloud (can be hacked)
- ❌ Only one copy (can be lost/destroyed)
- ❌ Storing with Emergency Kit PDF (all-eggs-one-basket)
Emergency Recovery
When to Use Emergency Recovery
Use this process when:- Muun’s servers are permanently offline
- You don’t trust Muun anymore and want to migrate
- Normal recovery isn’t working
- You want to prove you can recover independently
Prerequisites
You Need:- Emergency Kit PDF (from your backup)
- Recovery Code (written down separately)
- Bitcoin recovery tool:
- Muun’s official recovery tool (recommended)
- Bitcoin Core with descriptor wallet support
- Custom tool following Muun’s specs
- A new Bitcoin wallet to sweep funds to
- Transactions signed with both recovered keys
Step-by-Step Emergency Recovery
Step 1: Extract Encrypted Keys
- Open PDF in any PDF reader
- Locate encrypted keys section
- Copy first encrypted key (user key)
- Copy second encrypted key (Muun’s key)
- Note the fingerprints for verification
libwallet/challenge_keys.go:117-134
Step 2: Decrypt Keys with Recovery Code
-
Convert recovery code to key:
- Apply Scrypt KDF with salt
- Produces challenge private key
-
For each encrypted key:
- Parse ephemeral public key from encrypted data
- Perform ECDH: challenge_key × ephemeral_pubkey = shared_secret
- Decrypt ciphertext using shared secret
- Extract 32-byte private key + 32-byte chain code
- Reconstruct BIP32 HD master key
-
Verify:
- Derive public key from private key
- Check fingerprint matches PDF
- Confirm it’s the correct key
libwallet/challenge_keys.go:55-115
Step 3: Scan Blockchain for UTXOs
- Start at birthday block (no need to scan earlier)
-
Use output descriptors to generate all address types:
- V2: P2SH multisig
- V3-V4: P2WSH SegWit multisig
- V5-V6: P2TR Taproot with MuSig2
- Submarine swaps
- Incoming swaps
-
Derive addresses using both keys:
- Check each address for UTXOs on the blockchain
- Build UTXO list with amounts and outpoints
- Bitcoin Core’s
scantxoutsetwith descriptors - Electrum server queries
- Block explorer APIs (less private)
Step 4: Create Sweep Transaction
To move funds to a new wallet:-
Create transaction:
- Inputs: All UTXOs you found
- Output: Your new wallet’s address
- Fee: Estimate current network fee
-
Sign inputs:
- For each input, derive keys using its path
- Create user signature
- Create Muun signature (you have both keys!)
- Build witness/scriptSig with both signatures
-
Verify transaction:
- Check all inputs are signed correctly
- Verify fee is reasonable
- Confirm output address is yours
-
Broadcast transaction:
- Submit to Bitcoin network via any node
- Monitor for confirmation
libwallet/V2.go:72-90
Step 5: Wait for Confirmation
Once broadcast:- First confirmation: 10 minutes average
- Full security: 6 confirmations (1 hour)
- Track status: Use block explorers
- Funds in new wallet: Once confirmed, emergency complete!
Recovery Tool Recommendations
Official Muun Recovery Tool (Recommended):- Pre-built for Muun’s format
- Handles all address versions
- Automates the entire process
- Open source for verification
- Follow Muun’s published recovery specs
- Test with small amounts first
- Verify against official tool’s output
Special Recovery Cases
Submarine Swap Recovery
If you have pending submarine swaps during emergency recovery:- If before timeout: Cannot complete without server
- If after timeout: Can reclaim to refund address (v1) or multisig (v2)
- Wait for timeout, then sweep
- If you have the preimage: Can claim the HTLC
- If you don’t have preimage: Server will refund after timeout
- Check Emergency Kit metadata for invoice data
libwallet/submarineSwapV2.go:34-36
Incoming Swap Recovery
For Lightning payments received via submarine swaps:- Emergency Kit may contain invoice metadata
- If previously revealed, preimage may be recoverable
- Otherwise, server can refund after timeout
libwallet/incoming_swap.go:238-260
Multi-Signature Coordination
All recovery requires both keys because of 2-of-2 multisig:- Normal operation: User signs, Muun’s server signs
- Emergency: User signs with both (has both keys from Emergency Kit)
- Fully self-sovereign: No dependency on Muun
libwallet/V2.go:53-68
Testing Your Recovery
Dry Run Recovery Test
Before an emergency, test your recovery:- Small test wallet: Create a wallet with a small amount
- Export Emergency Kit: Generate and save the PDF
- Write recovery code: Store securely
- Uninstall app: Remove from device
- Recover: Use recovery code to restore
- Verify: Confirm balance appears
- Keep testing wallet: Use it to practice emergency recovery later
Emergency Kit Verification
Periodically verify your Emergency Kit:- Check PDF readability: Ensure it’s not corrupted
- Verify verification code: Match PDF to app
- Test recovery code: Confirm you can read what you wrote
- Update if needed: Regenerate if damaged
Security Considerations
What Can Go Wrong
Single Point of Failure Risks:- ❌ Only digital Emergency Kit → Device failure loses it
- ❌ Recovery code only in memory → Forgotten
- ❌ Emergency Kit + recovery code together → Theft = total loss
- ❌ Never tested recovery → Broken process discovered too late
- ✅ Multiple Emergency Kit copies (different locations)
- ✅ Multiple recovery code copies (different locations)
- ✅ Separate storage (never together)
- ✅ Regular testing (know it works)
Privacy During Recovery
Emergency recovery reveals:- All your addresses to the recovery tool
- Your transaction history
- Your balance
- Run your own Bitcoin node for scanning
- Use recovery tools locally (not web-based)
- Sweep to a fresh wallet (don’t reuse addresses)
Recovery Code vs. Seed Phrase
Muun doesn’t use standard BIP39 seed phrases:| Feature | Muun Recovery Code | BIP39 Seed |
|---|---|---|
| Format | Custom versioned | 12/24 words |
| Compatibility | Muun only | Many wallets |
| Decrypts | Emergency Kit | Direct key |
| Upgradeable | Yes (versioned) | No |
| Emergency use | Requires EK PDF | Self-contained |
- Allows protocol upgrades
- Supports collaborative custody
- Enables Emergency Kit encryption
- Maintains compatibility with future features
Related Features
Emergency Kit
Detailed guide to Emergency Kit generation and contents
Multisig
Why recovery requires both multisig keys
Security Cards
Using NFC cards as additional recovery factor
Submarine Swaps
Recovering funds from submarine swaps