Overview
Multisignature accounts are accounts that are generated from multiple public keys. A multisig necessitates that any transaction made on its behalf must be signed by a specified threshold of its members. A common use case for multisigs is to increase security of a signing account, and/or enable multiple parties to agree on and authorize a transaction. The first step is to create a multisig signing key by using the public keys of all possible signers and the minimum threshold of addresses that are needed to sign any transaction from the account. The threshold can be the same amount as the total number of addresses comprising the multisig. Whatever machine is generating the multisig, it should at least have all of the public keys imported into the same keyring. When you want to create a multisig transaction, you would create the transaction as normal, but instead of signing it with a single account’s private key, you would need to sign it with the private keys of the accounts that make up the multisig key. This is done by signing the transaction multiple times, once with each private key. The order of the signatures matters and must match the order of the public keys in the multisig key. Once you have a transaction with the necessary signatures, it can be broadcasted to the network. The network will verify that the transaction has the necessary signatures from the accounts in the multisig key before it is executed.Step by step guide to multisig transactions
This tutorial will use the test keyring which will store the keys in the default home directory~/.simapp
unless otherwise specified.
Verify which keys are available in the test keyring by running --keyring-backend test
.
In order to specify a consistent keyring for the entirety of the tutorial, set the default keyring by running simd config keyring-backend test
.
my_validator
account to the alice-bob-multisig
account.
Fund the multisig by sending it stake
from the genesis account.
alice-bob-multisig
to send 1000stake to the recipient account. The transaction will be generated but not broadcasted yet.
simd tx multisign
command. This command requires the names and signed transactions of all the participants in the multisig account. Here, Alice and Bob are the participants: