Overview
Muun Wallet implements a collaborative 2-of-2 multisig architecture where every bitcoin transaction requires signatures from both the user’s key and Muun’s key. This design ensures that neither party can unilaterally move funds, providing enhanced security while maintaining user sovereignty.Muun uses standard Bitcoin multisig scripts (not smart contracts), ensuring compatibility across the Bitcoin ecosystem and enabling recovery through any Bitcoin-compatible wallet.
How It Works
Key Structure
The wallet uses hierarchical deterministic (HD) keys following BIP32:- User Key: Generated and stored on the user’s device
- Muun Key: Generated and managed by Muun’s servers
- Derivation Path: Both keys derive child keys using the same path structure
Address Generation
Muun supports multiple address versions, with v2+ using 2-of-2 multisig:- Derive child keys for both user and Muun using the same path
- Create a 2-of-2 multisig redeem script from the public keys
- Generate a P2SH or SegWit address from the script hash
Transaction Signing
Every transaction follows this collaborative signing flow:- User initiates a transaction
- User’s app creates and signs the transaction locally
- Transaction is sent to Muun’s server
- Muun validates and co-signs the transaction
- Fully signed transaction is broadcast to the Bitcoin network
Address Versions
Muun has evolved its address scheme over time:| Version | Type | Description |
|---|---|---|
| v1 | Single-sig | Legacy single-signature addresses |
| v2 | 2-of-2 P2SH | Standard multisig with P2SH wrapping |
| v3 | 2-of-2 P2WSH | Native SegWit multisig |
| v4 | 2-of-2 P2WSH | Enhanced SegWit implementation |
| v5 | 2-of-2 Taproot | Taproot with MuSig2 |
| v6 | 2-of-2 Taproot | Latest Taproot implementation |
MuSig2 for Taproot
For Taproot addresses (v5+), Muun uses MuSig2 for signature aggregation:- Privacy: Multisig appears as a single-sig transaction on-chain
- Efficiency: Smaller transaction size and lower fees
- Security: Maintains 2-of-2 security guarantees
Security Benefits
Multi-Party Control
Defense Against Attacks
- Device Compromise: An attacker with your phone cannot move funds without Muun’s cooperation
- Server Compromise: Even if Muun’s servers are compromised, attackers need both keys
- Phishing Protection: Muun can validate transaction details before co-signing
Recovery Path
Users always maintain a recovery option:- Emergency Kit contains both encrypted keys
- Recovery Code can decrypt the keys
- Can sweep funds to any Bitcoin wallet without Muun’s cooperation
Implementation Details
Script Structure (V2)
The witness/script stack for a v2 transaction:libwallet/V2.go:53-56
Key Derivation
Both parties derive keys using identical paths:- Deterministic address generation
- Easy backup and recovery
- Standard BIP32 compatibility
User Experience
For Users
The multisig architecture is transparent to users:- Transactions appear instant (co-signing happens automatically)
- No additional steps required
- Standard Bitcoin addresses
- Emergency recovery available if needed
For Developers
When integrating or understanding Muun:- All UTXOs require both signatures
- Server API provides Muun’s signature after validation
- Recovery tools must handle 2-of-2 script construction
- Multiple address versions must be supported for backward compatibility
Related Features
Emergency Kit
PDF backup containing both encrypted keys for recovery
Recovery
How to recover funds without Muun’s cooperation
Lightning Network
How multisig integrates with Lightning payments
Submarine Swaps
Trustless swaps between on-chain and Lightning