How to set up a DIY bitcoin multisig escrow in Caravan

First published: 12/19/2022
| Last updated: 01/18/2023
| -- min read

There are many ways that you can use bitcoin multisig for escrow. Here we look at how to set up a basic multisig wallet using Caravan to facilitate a bitcoin multisig escrow arrangement. This arrangement is most useful for coordinating a bitcoin transaction over the internet in exchange for goods between two counterparties with the help of a trusted intermediary.

Things you’ll need

We’ll be creating a 2-of-3 multisig wallet in our example here. Before heading over to Caravan, you will need to ensure you have the necessary items.

You’ll need:

  • Three hardware wallets (Trezor, Ledger, or Coldcard): One for the buyer, one for the seller, and one for the intermediary. Ideally, these should be purchased directly from the manufacturer.
  • Each participant must have access to a personal computer and a modern browser.
note: Caravan technically supports Hermit and manually uploading xpubs from any bitcoin wallet, but these are more advanced workflows and we assume you will use hardware wallets for the purposes of this guide.

1. Initialize all three wallets

The first step for setting up the multisig escrow wallet is for each participant in the multisig escrow (both counterparties and the intermediary) to create and secure their own key. All three participants must initialize and properly back up their key using the first-party hardware wallet software or on the device itself.

Natively, Caravan only supports Trezor, Ledger, and Coldcard, and you can find software and documentation at their respective sites: Trezor Suite, Ledger Live, Coldcard.

After initialization, each participant should ensure that their hardware wallet is initialized properly. For this, they could individually perform test transactions by having one of the other participants send a small amount of bitcoin to the address generated by the wallet. Each could then confirm they can spend it.

Before proceeding, all three participants should have a proper seed phrase backup on paper or metal. It’s critically important that no participant shares this secret information with any other participant. This ensures that no one party has control over a majority of keys in the multisig escrow wallet, allowing them to spend funds without the authorization of other parties.

2. Set up the multisig wallet in Caravan

Once your three hardware wallets are initialized and seed phrases as properly secure, visit the Caravan website hosted at GitHub to get started setting up the multisig wallet.

Importing keys for your multisig wallet

  1. On the welcome screen, select Wallet.
  2. You can either import a wallet configuration (for a wallet you previously set up) or set up a brand-new wallet. For our purposes, we’ll be creating a new multisig wallet.
  3. Under Quorum, you’ll see two spaces for numbers to configure the quorum settings. Leave it at the default—2 keys to sign and 3 total keys.
  4. You’ll see options for Address Type, Network, and Client; leave these set to default as well.
Caravan’s multisig wallet creation screen

For the rest of the key import process, you can set up a wallet remotely (two or more escrow participants are in different physical locations), or you can set up the wallet locally (all three participants are in the same physical location). Many escrow situations will likely require remote setup, but local setup removes many steps and can simplify the process, if possible for your situation.

Option A: Setting up a wallet entirely remotely

If you’re setting up the multisig wallet remotely, each of the two counterparties involved in the transaction must import the extended public key from their device on the Wallet page and digitally send it to the intermediary to construct the wallet.

Following these steps will allow the intermediary to construct the wallet and create the address needed to deposit funds in the next step.

Steps for the two counterparties (import keys and send only)
Caravan showing hardware wallet selection

Both counterparties should open Caravan on their own desktop machines and follow the below steps:

  1. Click on Extended Public Key 1.
  2. Under Select Method, choose the type of device you are using: Trezor, Ledger, or Coldcard. Select the model as well.
  3. You’ll see the BIP32 Path on-screen. Leave this set to default.
  4. Click Import Extended Public Key to begin importing the extended public key (Xpub) from your device.
  5. Follow the instructions in the Trezor or Ledger bridge software, or manually upload a Coldcard Xpub. (Note: For Trezor or Ledger you may need to unlock it using your PIN. If prompted for a passphrase by the Trezor bridge, leave this field blank.)
  6. Confirm that Caravan is now displaying the Xpub imported from the wallet in plain text on your screen.
  7. Copy this string of text and send it to the intermediary—the person in charge of constructing the wallet in Caravan. This is a public key, so you can safely send this to the intermediary over any digital channel (text message, email, etc.).
  8. Both counterparts can close Caravan for now. They will not need to construct the wallet on their own machines, although they could do so if they wanted to (all three participants would have to share Xpubs).
Caravan showing one xpub successfully imported
Steps for the intermediary constructing the wallet (use all three keys to construct wallet)

The intermediary constructing the wallet in Caravan should now have two Xpubs shared with them by the counterparties to the transaction.

The intermediary should now follow the below instructions to import their own Xpub from their personal device. Then, they should then manually paste in the Xpubs provided for each of the two keys that were imported by the two counterparties remotely:

  1. Click on Extended Public Key 1.
  2. Under Select Method, choose the type of device you are using: Trezor, Ledger, or Coldcard. Select the model as well.
  3. You’ll see the BIP32 Path on-screen. Leave this set to default.
  4. Click Import Extended Public Key to begin the process of importing the extended public key (Xpub) from your device.
  5. Follow the instructions in the Trezor or Ledger bridge software, or manually upload a Coldcard Xpub. (Note: For Trezor or Ledger you may need to unlock it using your PIN. If prompted for a passphrase by the Trezor bridge, leave this field blank.)
  6. Confirm that Caravan is now displaying the Xpub imported from the wallet in plain text on your screen.
  7. Click on Extended Public Key 2.
  8. Under Select Method, choose Enter as text.
  9. Paste the Xpub sent by counterparty A in the field.
  10. You’ll see the BIP32 Path on-screen. Leave this set to default.
  11. Click on Extended Public Key 3.
  12. Under Select Method, choose Enter as text.
  13. Paste the Xpub sent by counterparty B in the field.
  14. You’ll see the BIP32 Path on-screen. Leave this set to default.

After you paste in the third Xpub, Caravan will immediately show you a summary of the wallet construction with all three keys. Confirm the keys are correct and see below for how to download and distribute wallet details before moving on to the next step.

Option B: Set up the wallet locally

note: Skip these steps and go immediately to download your config file if you chose Option A.

If you’re setting up the multisig escrow wallet with all three parties in person, simply follow the below steps to import the three necessary keys to construct the wallet.

  1. Plug in a hardware wallet—Trezor, Ledger, or Coldcard.
  2. Click on Extended Public Key 1. (Note: You can give this key a custom label. Assuming a buyer, seller, and intermediary, we may want to name the first key, “Buyer key” and so on.)
  3. Click the dropdown list under Select Method to choose the type of device you are using for that key.
  4. Next, you’ll see a screen that shows the BIP32 Path. Leave this as the default.
  5. Click Import Extended Public Key to begin the process of importing the extended public key (Xpub) from your device.
  6. Follow the instructions in the Trezor or Ledger bridge software, or manually upload a Coldcard Xpub. (Note: For Trezor or Ledger you may need to unlock it using your PIN. If prompted for a passphrase by the Trezor bridge, leave this field blank.)
  7. Unplug the hardware wallet for this key.
  8. Repeat the above steps for both the 2nd and 3rd key.

After you paste in the third Xpub, Caravan will immediately show you a summary of the wallet construction with all three keys. Confirm the keys are correct and see below for how to download and distribute wallet details before moving on to the next step.

Important: Download and distribute your config file

The wallet confirmation screen the intermediary is presented with after importing all three Xpubs.

Before proceeding, you need to download your multisig wallet config file. You can think of this file like the treasure map that helps you reconstruct your multisig wallet in the future. Without the config file, you’ll need to repeat the setup process above—with all three keys imported in the correct order—to reconstruct your wallet and send funds.

To save time in the next steps and ensure you don’t make mistakes later, follow these steps to download and distribute your multisig config file:

  1. When you finish importing all three keys you’ll see a button labeled Download Wallet Details. Click this to download your multisig wallet’s multisig config file.
  2. Save this .json file in a secure location such as a password manager app.
  3. Send this file to all three participants, and ensure each participant also has a copy saved in a secure location such as a password manager.
  4. Click Confirm.

Your wallet is now created and Caravan takes you to a new screen where you can begin using it.

3. Sending funds to the multisig escrow wallet

After the wallet is properly constructed you’ll be presented with a screen that shows an overview of the wallet: its balances, addresses, and more.

Caravan multisig wallet before a deposit, showing no addresses and a zero balance.

Intermediary generates and sends address to the buyer

To deposit funds in your new multisig wallet, the intermediary in charge of constructing the wallet should follow these steps to generate and send the wallet’s deposit address to the buyer:

  1. Click the Receive tab. A QR code appears with the address you would share with the buyer in your multisig escrow setup and where the buyer would deposit bitcoin to fund the agreement.
  2. Scan or take a photo of the displayed QR code, or copy the address by clicking on the copy icon next to the address displayed lower on the page.
  3. Send this address to the buyer. This is a public address. While it’s best to ensure no one outside the escrow transaction sends funds to this address, it is perfectly safe to send it over normal communication mediums such as email or text message.
note: If you will be using this escrow setup for multiple transactions, you can click the Next Address box on the lower left to generate a new receiving address. This will help improve privacy.

Buyer sends funds

The next step is for the buyer to send funds to the wallet to begin the escrow transaction.

note: You may wish to ensure your multisig wallet is properly constructed by sending a small amount of bitcoin to the address and first ensuring participants can properly disburse these funds before funding the wallet with the full amount for the primary transaction. To do this, follow the rest of the steps in this article with a small amount of bitcoin.

Now, instruct the buyer to send funds:

  1. Instruct the buyer (counterparty A) to send funds to the receiving address, funding the escrow transaction.
  2. Click the Refresh button on-screen for the updated status of the receipt of your funds and to view confirmations. It may take several minutes for your transaction to confirm.
  3. If you are the intermediary facilitating the exchange of goods, wait for at least three confirmations before proceeding. You can check the number of confirmations using a tool like Blockstream Explorer or Mempool.space. Paste the address from the multisig escrow into one of these tools.

Congrats! Your multisig escrow wallet has been successfully funded. In the next step, we’ll use 2-of-3 keys to sign a transaction to disburse funds to the seller.

4. Disbursing funds from escrow

To send funds, begin by clicking on the Send tab. Here you see the following sections:

  • To: This is where you paste an address to send bitcoin.
  • Amount: This is where you enter the specific amount of funds you’re sending (or click MAX to send all of the wallet’s funds).
  • Fee Rate: This allows you to enter a sats/byte fee
The main “send” page with amount, to, and fee rate.

Collect the final settlement address from the seller (or buyer)

To disburse bitcoin from your multisig wallet, the intermediary first needs a final settlement address. In this example escrow, the intermediary would collect this when they clear the release of funds. Assuming everything went well, this would mean constructing a transaction that sends funds to the seller’s final bitcoin address.

The seller (or buyer, in the case of a refund) needs to provide you, the intermediary, with a deposit address from their individual wallet using either a separate bitcoin wallet or a separate, standalone address controlled by the key they contributed to the multisig setup (i.e., the seller’s key).

Once you have an address to which you want to finally send bitcoin, keep it on hand for the next steps create the transaction and authorize the spend.

Author the disbursement transaction

To finalize the disbursement of funds to one or the other party, the intermediary will need to sign with one of the parties to release funds to the seller, or in the case of a dispute, sign with one of the parties to refund the buyer. Either way, the basic steps for signing a transaction to disburse funds are the same.

The intermediary must now begin authoring the transaction from their machine. Follow these steps:

  1. If the wallet interface isn’t already open, navigate to the Caravan site on GitHub, select Wallet, and click Import Wallet Configuration. Upload your wallet config file from earlier.
  2. Click the Send tab.
  3. Enter the final settlement address (the seller’s address, or the buyer’s in the case of a refund) into the To field.
  4. Enter the amount you wish to send under Amount and take note of the specific amount.
  5. Enter your sats/byte fee under Fee and take note of the specific amount.
  6. If signing remotely in the next step, provide the details of the To, Amount, and Fee fields to the seller (or buyer if issuing a refund) for them to input them in the next step.
Caravan transaction preview.
note: It is best to choose a mid-range fee rate to be sure your transaction goes through without too much delay and avoids getting stuck in mempool. Because multisig transactions contain more data, it is normal for fees to be higher than when sending a singlesig transaction. Read more about bitcoin transaction fees.

Collect signature(s) for the transaction

Option A: Signing your transaction remotely

If the intermediary and the second signer are physically separate from one another, the counterparty to the transaction will need to enter the exact same above information into their own Caravan interface, posing as if they are going to sign the transaction and broadcast it themselves.

This step will provide the intermediary with the necessary secret signature data to be able to finalize and broadcast the transaction in the final step.

1. Counterparty signature generation

The seller (or the buyer, in the case of a refund), must follow these steps to collect their signature, providing it to the intermediary:

  1. Navigate to the Caravan site on GitHub.
  2. On the welcome screen, select Wallet.
  3. Click Import Wallet Configuration.
  4. Upload the wallet configuration file you backed up earlier. This will open the wallet interface.
  5. Click the Send tab
  6. Enter the provided final settlement address (the seller’s address, or the buyer’s in the case of a refund) into the To field.
  7. Enter the provided amount, exactly, under Amount.
  8. Enter the provided sats/byte fee, exactly, under Fee.
  9. Once everything is set, click Sign Transaction.
  10. Select the first key with which to sign by clicking Select Key. You will then see a dropdown list of the original keys from which to choose. Choose the first key.
  11. Connect your hardware wallet to the computer and click Sign.
  12. Confirm that the amount being sent and the address are correct on your hardware wallet’s screen (matching what Caravan is showing you on your desktop with the display screen on your hardware wallet).
  13. On the hardware wallet, confirm the fees, and choose to accept.
  14. Caravan then tells you a signature has been imported and displays the details.
An imported signature in Caravan.

2. Counterparty sends signature to the intermediary

  1. Copy the signature, paste it into a secure messenger (this is such as Telegram or Signal), and send it to the intermediary.
  2. The first signer is done with their part and can now exit Caravan.

3. Intermediary combines signatures

The intermediary should follow the steps below to sign the transaction using the signature provided by the seller (or the buyer in the case of a refund) and the signature by their own key:

  1. Select the key with which to sign by clicking Select Key. You will then see a dropdown list of the original keys from which to choose. Choose the first key.
  2. For the first signature, choose the key from the dropdown list that belongs to the person who signed first (i.e., who sent the file with the signature and transaction details).
  3. Paste their signature into Caravan—being sure to compare it to what was received and confirming it’s correct.
  4. For the second signature, physically connect your hardware wallet to the computer and click Sign.
  5. Confirm that the amount being sent and the address are correct on your hardware wallet’s screen (matching what Caravan is showing you on your desktop with the display screen on your hardware wallet).
  6. On the hardware wallet, confirm the fees, and choose to accept.

Caravan will then tell you a signature has been imported and displays the details for two signatures: the one you manually imported (as sent by the buyer or seller), and the second signature provided by your hardware wallet.

Now that the two required keys have been successfully signed, skip to the next section—the transaction is ready to be broadcast.

Option B: Signing the transaction locally

If the intermediary and the second keyholder (either the buyer or the seller) are in the same physical location, they can simply navigate to the transaction signing page and provide the required signatures.

  1. Navigate to the Caravan site on GitHub.
  2. On the welcome screen, select Wallet.
  3. Click Import Wallet Configuration.
  4. Upload the wallet configuration file you backed up earlier. This will open the wallet interface.
  5. Click the Send tab
  6. Enter the provided final settlement address (the seller’s address, or the buyer’s in the case of a refund) into the To field.
  7. Enter the provided amount, exactly, under Amount.
  8. Enter the provided sats/byte fee, exactly, under Fee.
  9. Once everything is set, click Sign Transaction.

One at a time, each needs to:

  1. Select the key with which to sign by clicking Select Key. You will then see a dropdown list of the original keys from which to choose. Choose the first key.
  2. Connect your hardware wallet to the computer and click Sign.
  3. Confirm that the amount being sent and the address are correct on your hardware wallet’s screen (matching what Caravan is showing you on your desktop with the display screen on your hardware wallet).
  4. On the hardware wallet, confirm the fees, and choose to accept.
  5. Caravan then tells you a signature has been imported and displays the details.
  6. Repeat the process above with the second key.

Now that the two required keys have been successfully signed, the transaction is ready to be broadcast.

Broadcast the transaction

  1. Once the second of the two required keys has successfully signed, the transaction is ready to be broadcast.
  2. Confirm the signatures are correct, and click Broadcast Transaction.

Caravan now tells you your transaction has been successfully broadcast and displays the transaction ID with an external link to Blockstream Explorer and a button for you to return to the main screen.

Congratulations, your escrow funds have been fully settled. You can now view your updated balance and your addresses—including details about the address you just spent from.

Followup

Check the status of the transaction

To see whether any bitcoin transactions sent or received is confirmed on the blockchain, click the Address tab. Here you will see a column labeled Last Used. If you see Pending displayed under this column, the transaction is not yet confirmed.

You can check the status of the transaction using a tool like Blockstream Explorer or Mempool.space. Simply copy and paste the transaction ID or click the external link provided in Caravan.

Reimporting your wallet in the future

If after clearing your browser, you would like to access your wallet again, you can simply import the config file that you downloaded earlier. Anyone with access to this file can always generate new addresses and send bitcoin to this escrow wallet, but you’ll always need at least 2-of-3 signatures to spend those funds.

Sign up to get notified for future blog articles.