Emergency Multisig payout tool

From Bisq Wiki
Jump to navigation Jump to search

Summary

This tool allows for a Mediator to create an unsigned transaction releasing the funds in the 2-of-2 multisig controlled by the traders and send it to each of them, have them sign it and return the signatures and have the the Mediator combine the three pieces (unsigned transaction and both signatures from the traders) to broadcast the transaction.

Warning

In this process traders copy and paste their private keys from the Bisq software into a notepad. As a precaution it is advised they remove all of their funds from this wallet before starting this procedure and consider switching to a new data directory to get a new wallet.

Precautions

The traders need to make sure the transaction details match the correct resolution before signing.

What you need

As Mediator

fields description
depositTxId ID for the transaction that sent both trader’s funds into the 2-of-2 multisig
amountInMultisig Amount locked in the 2-of-2 multisig
buyerPayoutAmount Amount to be released to the BTC buyer
sellerPayoutAmount Amount to be released to the BTC seller
buyerPayoutAddress Address onto which the BTC buyer should be paid
sellerPayoutAddress Address onto which the BTC seller should be paid
buyerPubKeyAsHex BTC buyer’s public key
sellerPubKeyAsHex BTC seller’s public key

As a trader (each one only needs their own private key)

fields description
privatekeyHex your private key for this trade

Open a text editor where you can gather all this information.

Get multisig public keys

Each trader involved can get their public keys and the other trader's in their trade JSON contract.

  1. Find your trade under PORTFOLIO.
  2. Click the i icon next to the trade ID, and at the bottom click VIEW CONTRACT IN JSON FORMAT. At the end, you see the Buyer and Seller public keys:
BuyerMultiSigPubKeyHex: <hex value>
SellerMultiSigPubKeyHex: <hex value>


Get private keys

To access your Bisq wallet private key

  1. Press ctrl + j, alt +j or cmd + j.
  2. Check Include private keys and click COPY TO CLIPBOARD and paste it to a text editor.
  3. In the text editor, search for the public key value. You are looking for an entry that reads DeterministicKey{pub HEX=<hex value> where <hex value> is the public key.
  4. When you've found this entry, select and copy the priv HEX=<hex value>. This value is the private key.
  5. Copy, paste and save that information in a bisqWallet.txt file.

Note: If your wallet uses a password, you will need to remove the password to view the private keys in wallet data.

Get payout addresses

Open the trade details and click on VIEW CONTRACT IN JSON FORMAT. At the end of the JSON contract file you can also find the intended payout address for each trader:

makerPayoutAddressString: <address value>
takerPayoutAddressString: <address value> 

Create Transaction

  1. Press ctrl+g. Click INPUTS and fill in the fields.
  2. Once finished click EXPORT and copy the string you get, save it and share it with each trader. This is the unsigned transaction

Sign Transaction

  1. Press ctrl+g and click IMPORT. Copy the string you got on step 2, paste it in the first field and press IMPORT FROM STRING. It should populate the view with the information about the payout transaction.
  2. Go to SIGN and paste your private key for this trade (priv HEX=) and click GENERATE SIGNATURE.
  3. Copy the signature hex that you get and share it with the mediator

Broadcast The Transaction

  1. Press ctrl+g and click IMPORT. Copy the string you got on step 2, paste it in the first field and press IMPORT FROM STRING. It should populate the view with the info about the payout transaction.
  2. Click BUILD (to the let). Paste the Buyer's signature on the first field and the Seller's on the second field.
  3. Click the BUILD button bellow the field where you pasted the signatures and it should populate with the signed transaction. Save the resulting text just to be safe.
  4. Click BROADCAST.
  5. Verify on a block explorer that the transaction was indeed broadcast.