Signing with a Multisig

Collecting signatures for a multisig address requires to write the transaction into file and submit it to collect the various signatures, then combine them into the multisig siganure.

Not all commands in the CLI support the name of a locally registered key. A useful command to write human readable commands while star addresses are explicitely required is

$(iovnscli keys show anykey -a)

which can be inserted into any CLI command to write the name of a key when the star address is required.

In this exemple, we will sign a send transaction from a multisig account.

Writing the transaction into file

The first step for signing a multisig transaction is to write the transaction in a way that can be shared off chain. This is done with the flag --generate-only

iovnscli tx send $(iovnscli keys show anykey -a) $(iovnscli keys show benkeys -a) 10iov --generate-only > unsignedTx.json

the transaction to be signed is now in the file unsignedTx.json.

Collecting signatures

The second step is for each signature owner to generate their signature for the file unsignedTx.json with the command sign

iovnscli tx sign unsignedTx.json --from=$(iovnscli keys show -a benkeys) --multisig=$(iovnscli keys show -a anykey)  --output-document=sig1.jso

Flag

Description

--from

this signature address

--multisig=

the address of the multisig for which this signature is requested

--output-document=

the file where the signature is written

Combining signatures

Once there are more signatures than required by the threshold, the signature files can be combined into a signed transaction file with the command multisign

iovnscli tx multisign unsignedTx.json anykey sig1.json sig2.json > completeTx.json

Broadcast the signed transaction

The latest file completeTx.json is a valid signed transaction ready to be sent to the IOV Name Service. The command to do so is broadcast

iovnscli tx broadcast completeTx.json

Last updated