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 https://rpc.ninerealms.com:443 --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 "/cosmos.bank.v1beta1.MsgSend" to “/types.MsgSend”
Print the final transaction using cat tx_raw.json and confirm it looks like this:
{"body":{"messages":[{"@type":"/types.MsgSend","from_address":"thor1up5rgh793fwf0c9ep50x00jusqk72crv6pjhw0",
"to_address":"thor1qdmw84vz60uf0m86d9uggr4jxx8f8krm8jq7w2",
"amount":[{"denom":"rune","amount":"1110000"}]}],"memo":"",
"timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},
"auth_info":{"signer_infos":[],
"fee":{"amount":[],"gas_limit":"3000000","payer":"","granter":""}},
"signatures":[]}

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 https://rpc.ninerealms.com:443 >> 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 https://rpc.ninerealms.com:443 >> 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:
curl https://thornode.ninerealms.com/cosmos/auth/v1beta1/accounts/thor1505gp5h48zd24uexrfgka70fg8ccedafsnj0e3
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 https://rpc.ninerealms.com:443 >> 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 https://rpc.ninerealms.com:443 --gas auto
Copy link
Outline
Create the multisig
Create the Transaction
Sign the Transaction
Build and Broadcast