Multisig Account
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 test3Once you have all the public keys, create the multisig account.
$ ./chain-maind keys add --multisig=test1,test2,test3[...] --multisig-threshold=2 multiWith the
--multisigflag, pass the names of the public keys to create a new multisig account called for example "multi".--multisig-thresholddenotes 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: ""Send some cro to this multisig account:
Step 2. Create a multisig transaction
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
The unsignedTx.json will now contain the unsigned version of the transaction, as can be seen by the empty list in signatures.
Step 3. Sign the transaction individually
Now we sign with at least 2 keys, for example test1 and test2 individually.
Step 4. Create the multisignature
With the signed transactions from step 3, we can sign a multisignature.
Now we can see the public keys that have signed a valid new signature as indicated in the signatures field.
Step 5. Broadcast the transaction
The final step is to broadcast this multisigned transaction.
Nice, that is it, now you should be able to create multisigned transactions. Verify that you received this transaction succesfully with
Last updated