Multisig with THORCli
How to do multisig transactions.

Create the multisig

First, collect the pubkeys that will be part of the multisig. They can be printed using THORCli:
thornode keys show person1 --pubkey
Then share the pubkey with the other parties. Each party can add these pubkeys:
thornode keys add person2 --pubkey {pubkey}
Then each party can create the multisig (here a 2/3):
thornode keys add multisig --multisig person1,person2,person3 --multisig-threshold 2

Create the Transaction

Any of the parties can create the raw transaction:
thornode tx bank send thor1505gp5h48zd24uexrfgka70fg8ccedafsnj0e3 thor1gutjhrw4xlu3n3p3k3r0vexl2xknq3nv8ux9fy 100000000rune --chain-id thorchain-mainnet-v1 --node --gas 3000000 --generate-only >> tx_raw.json
This will output and save a file called tx_raw.json
Edit this file using nano tx_raw.json and change @type from "/" to “/types.MsgSend”
Print the final transaction using cat tx_raw.json and confirm it looks like this:

Sign the Transaction

The transaction needs to be signed by two of the three parties.

From Person1:

thornode tx sign --from person1 --multisig multisig tx_raw.json --sign-mode amino-json --chain-id thorchain-mainnet-v1 --node >> tx_signed1.json
This will output a signed file called tx_signed1.json

From Person2:

thornode tx sign --from person2 --multisig multisig tx_raw.json --sign-mode amino-json --chain-id thorchain-mainnet-v1 --node >> tx_signed2.json
This will output a signed file called tx_signed1.json

Build and Broadcast

Getting both tx files

One of members need to give the other person the json file. It can be printed to screen cat tx_signed1.json then copied and sent.
The other person can nano tx_signed1.json, paste in the file contents then ctrl-x to save. They should now have both signed files in their repo.

Build the transaction.

First, get the sequence and account number for the multisig address:
Then add it to the final signing instruction:
thornode tx multisign -a 33401 -s 0 --from multisig tx.json multisig tx_signed1.json tx_signed2.json --chain-id thorchain-mainnet-v1 --node >> tx_ms.json
This will output a final signed file called tx_ms.json

Broadcast it

thornode tx broadcast tx_ms.json --chain-id thorchain-mainnet-v1 --node --gas auto
Copy link
Create the multisig
Create the Transaction
Sign the Transaction
Build and Broadcast