Skip to content

Instantly share code, notes, and snippets.

@kdmukai
Last active August 7, 2023 21:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdmukai/53acf6edca61281dab472d70694f276b to your computer and use it in GitHub Desktop.
Save kdmukai/53acf6edca61281dab472d70694f276b to your computer and use it in GitHub Desktop.
Workshop: Creating Your Own Multisig Setup

Creating Your Own Multisig Setup

Software

Download Sparrow Wallet: sparrowwallet.com

  • Verify the release (instructions on the download page)
  • Connect Sparrow to your private electrum server (e.g. Umbrel) or a public server

Create a disposable test multisig wallet in Sparrow

  • "Policy Type": "Multi Signature"
  • "Cosigners": 2-of-3

Keystore 1:

Create a new, disposable "hot" test key

  • Go to BitcoinQ+A's "Seed Tool": https://bitcoiner.guide/seed/
  • Click "Download" to get an offline copy
  • Open the html file
    • You can turn off your laptop's wifi to prove it's really working offline.
  • Generate a new 12-word seed and write it down on paper.
  • On the same paper, write the "BIP32 Root Fingerprint" (aka master fingerprint).
  • Keep your tab open for now so we can refer back to this new key.

Import the new key's xpub into Sparrow

  • In Sparrow, for Keystore 1 click on "New or Imported Software Wallet"
  • In "Mnemonic Words (BIP39), set the droplist to 12 words.
  • Enter the 12-word seed from above.
  • "Use passphrase?" not recommended for now (to keep things simple).
  • Click "Create Keystore"
  • Click "Import Keystore"
  • Update the Label field to "Hot Wallet".
  • Note the "Master fingerprint" field and verify that it matches the fingerprint you wrote down above.
  • Derivation path will be the default for native segwit multisig: m/48'/0'/0'/2'
  • Click the left/right swap icon next to the "xpub / Zpub" field to display the xpub in its "Zpub" format. Compare that to the "BIP48: Multisig" section's native segwit xpub in Seed Tool.
  • Once you've confirmed that they match, you can close Seed Tool.

Keystore #2 & #3: External Hardware Wallet (aka HWW)

Select one high-quality hww:

  • BitBox02 (USB)
  • ColdCard (SD card or USB)
  • Jade(?) (QR)
  • Passport (QR or SD card)
  • SeedSigner (QR)

Select one consumer-grade hww:

  • Ledger (USB)
  • KeepKey (USB)

Import from HWW (aka export xpub from HWW)

  • Steps vary depending on type:
    • USB: "Connect Hardware Wallet"
    • QR / SD card: "Airgapped Hardware Wallet"
    • Specific hwws:
      • Coldcard: Settings / Multisig Wallets / Export XPUB / Account number 0
      • SeedSigner: Export Xpub / Multisig / Native Segwit
  • Verify that the resulting Master fingerprint matches expected fingerprint (if you know it)
  • After the last Keystore is applied:
    • Don't add a local storage password.
    • A "Backup Multisig Wallet" dialog will appear.
      • Save PDF backup

Note: Coldcard multisig wallet setup

Coldcard stores your full multisig wallet info (all three xpubs, fingerprints, derivation paths) onboard to enable verifying receive and change addrs.

  • Backup your Sparrow multisig in the Coldcard format and save to an SD card.
  • On the Coldcard: Settings / Multisig Wallets / Import from SD

Receive some sats into your multisig!

  • Click on "Receive" and move some spare change to your test multisig.
    • Send from Strike (or similar) so you don't dox any of your own utxos.
    • We're doing this onchain on mainnet! So just move ~$10 worth.
      • (we'll transfer it all back out at the end)
    • Check your mempool.space and set a high enough fee.
      • If fees are high, just eat the loss so you'll get confirmed in the next block and we can continue.

While you wait: Set up a cosigner

  • Grab a partner; they're your new (pretend) family member, biz partner, etc.
  • In Sparrow / Settings / "Export" / Sparrow wallet export (*.mv.db)
    • Save the file to your laptop. This is your wallet backup.
  • Send your wallet backup file to your "trusted" (pretend) partner.
    • Transfer via SD card, send over Telegram or Signal, etc.

Cosigner: Import your partner's wallet

  • In Sparrow's top menu: "File" / "Import Wallet" / Sparrow / Import File
  • Give it a name, skip the local wallet encryption password option.
  • You should now see your partner's multisig wallet w/full transaction history.

Transaction #1: self-cycle test

We're going to cycle your sats back to your new multisig.

  • Get a new receive address.
  • Click on "Send" and paste it in "Pay to".
  • Specify a label (e.g. "self-cycle test")
  • Specify "Max" amount.
  • Check your mempool.space and set a high enough fee.
  • "Create Transaction"
  • "Finalize Transaction for Signing"
  • Signing options will differ by hww:
    • USB: "Sign" / "Scan..."
    • QR: "Show QR" then when it's signed in the hww, "Scan QR"
    • SD card: "Save transaction" then when it's signed, "Load transaction"

Transaction #2: Co-signer test / sweep multisig wallet

  • Construct a tx to send all your sats back home.
  • Send the psbt to your cosigner
    • This time pretend they're remote!
    • File transfer via Telegram, Signal.
    • Paste raw base64 psbt into messenger:
      • File / Save PSBT / To clipboard / As Base64
      • Cosigner then copies the text: File / Open Transaction / From Text
    • Cosigner signs the psbt and transmits the signed psbt back:
      • (same method? Is signature included?)
  • Sign with a 2nd key and broadcast.

Cleanup

  • DELETE the wallet from Sparrow.

Wrapup

  • Collaborative multisig (Unchained Capital, Casa, Swan(soon))

Alternate setup #1:

If the hardware is available, consider setting up your Keystore #2 and #3 as:

USB or SD-card based:

  • BitBox02
  • Coldcard

QR code-based:

  • Jade
  • Passport
  • SeedSigner

Alternate setup #2:

Use Specter-Desktop as your coordinator software instead of Sparrow.

https://specter.solutions/desktop/

Alternate setup #3:

Use Nunchuk as your coodinator app and invite friends to be co-signers in your test multisig.

Can mix QR-code signers, NFC signers (TapSigner, Coldcard), and Bluetooth signers(? Ledger?).

Note: Not sure how you'd use USB or SD-card signers; may or may not be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment