πΈπ― An open source Musig privacy based wallet π―πΈ
Munstr (MuSig + Nostr) is a combination of Schnorr signature based MuSig (multisignature) keys in a terminal based wallet using decentralized Nostr networks as a communication layer to facilitate a secure and encrypted method of transporting and digitally signing bitcoin transactions in a way that chain analysis cannot identify the nature and setup of the transaction data. To anyone observing the blockchain, Munstr transactions look like single key Pay-to-Taproot (P2TR) spends.
This is facilitated through an interactive, multi-signature (n-of-n) Bitcoin wallet that is designed to enable a group of signers to coordinate an interactive signing session for taproot based outputs that belong to an aggregated public key.
This software is beta and should not be used for any real funds. Code and authors are subject to change. The maintainers take no responsibility for any lost funds or damages incurred.
π Open source for anyone to use or to contribute to
π Multisignature keysets to reduce single key risk
π Encrypted Communications with Nostr decentralized events
πͺ Taproot supported outputs
There are three major components to Munstr.
The signer is responsible for using private keys in a multisignature keyset to digitally sign a partially signed bitcoin transaction (PSBT).
The Nostr decentralized network acts as a transport and communications layer for PSBT data.
Coordinators act as a mediator between digital signers and wallets. The coordinator facilitates digital signatures from each required (n-of-n) key signers and assists in broadcasting the fully signed transaction.
- Start virtualenv
python3 -m venv .venv
pip3 install -r requirements.txt
- Initialize the persistent storage: Create a
src/coordinator/db.json
file from the provideddb.template.json
.cp src/coordinator/db.template.json src/coordinator/db.json
- Start the coordinator
./start_coordinator.py
./start_signer.py
Possible arguments:
--wallet_id
: The coordinator persists wallets by ID with some associated information. Default is none.--key_seed
: An optional seed to use when initializing the signer's keys. Not recommended for anything other than testing.--nonce_seed
: An optional seed to use when creating nonces. Not recommended for anything other than testing.
- Start the coordinator
- In a separate terminal window, start a signer (Signer1) and use the
--key_seed
option to set a seed for the key, and the--nonce_seed
option to set the nonce seed (must be an integer). Example:./start_signer.py --key_seed=key0 --nonce_seed=256
- Signer1: Execute the "new wallet" command. When prompted to specify a quorum, enter "2". Take note of the wallet ID that is returned.
- In a separate terminal window, start a second signer (Signer2) with the
--wallet_id
flag set to the wallet ID that was returned in the previous step. Example:./start_signer.py --key_seed=key1 --nonce_seed=256 --wallet_id=527f0dee-8b2a-45a1-87c6-98e9b6f642f7
- Have each signer send keys to the coordinator (
send pk
command) - Have each signer get an address from the coordinator (
address
). Confirm that the addresses are the same. This address corresponds to an aggregate pubkey that combines the keys of each signer. - Outside of Munstr, fund the address.
- Have one signer initiate a spend by using the
spend
command. - Execute the
sign
command from each of the signers. After all signers have provided nonces, the coordinator will return the aggregate nonce, and the signers will be prompted to provide a partial signature. The coordinator will then aggregate the signatures and provide a raw hex transaction that is ready for broadcast!
- MuSig 2 enhancements
- More accurate transaction fee estimation
- Better nostr encrypted DM support
- Custom nostr relay servers
- Custom nostr PSBT event types
- Node connectivity
- Sovereign TX lookup & broadcast
- Seed Phrases & xpubs
- Hardware Wallet support
- SeedSigner (Taproot incoming)
- Blockstream Jade
In addition to the libraries listed in requirements.txt
, this project also uses:
- Code from the Bitcoin Optech Taproot & Schnorr workshop, specifically the Python test framework. The
test_framework
folder has been brought into our project and renamed tosrc/bitcoin
. - Nostr by fiatjaf
- 1313 Mockingbird Lane font by Jeff Bensch
- Frankenstein Emoji
- Markdown Badges by Ileriayo
- ANSI FIGlet font: Bloody
MuSig
- [blog] Taproot and MuSig2 Recap by Elle Mouton
- [video] Tim Ruffing | MuSig 2: Simple Two-Round Schnorr Multi-Signatures
Licensed under the MIT License, Copyright Β© 2023-present TeamMunstr