A Multisig account is a Cronos POS Chain account with a key that requires multiple signers in order to sign transactions. This is a useful feature to increase security as it requires the consent of more than 1 party in order to make a transaction.
This guide assumes that you have some CRO to make a transfer as well as a valid RCPC node with the --node argument against which you can broadcast transactions.
Step 1. Generate a Multisig key
First, make sure you have the public keys that will be used to create the multisig key. If not then make a public key through the command
$ ./chain-maind keys add test3
Once you have all the public keys, create the multisig account.
$ ./chain-maind keys add --multisig=test1,test2,test3[...] --multisig-threshold=2 multi
With the --multisig flag, pass the names of the public keys to create a new multisig account called for example "multi".
--multisig-threshold denotes the minimum number of private keys needed to sign a transaction, for example "2".
By default the order does not matter in which you pass the existing keys to create a multisig account.
Check that this multisig account multi is succesfully created:
$ ./chain-maind keys show multi
- name: multi
type: multi
address: cro1klzn5esvee42swkj6y9sharx43gnsu9epy75jj
pubkey: '{"@type":"/cosmos.crypto.multisig.LegacyAminoPubKey","threshold":2,"public_keys":[
{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+MWcbaU4KISL5sCmxMIiiVnMDfyAR9j5i/AZ3jeByo0"},
{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A5EYG0FaECx2ONp0mSIvn66cHmYwe40VPSCxHEm9zDi0"},
{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AzCHURcUtzNhozSkNNkrj5sSyJVjjNoVHHczvcax6eb0"}`]}'
mnemonic: ""
If we want to send for example 1 cro from the multisig account to another account, we first setup the unsigned transaction and store the output in unsignedTx.json