I am studying the ADR20 (https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) and roughly understand the encoding and signing basics.
I notice there can be multiple SignerInfo under AuthInfo, each I assume correspond to either 1) the required signer of each message or 2) the required signers if it’s a multisig address? However, in the SignDoc structure, only one AccountNumber is defined. Does it mean for the same transaction each signer will have a different SignDoc and they have to sign with their AccountNumber?
Thank you.
I notice there can be multiple SignerInfo under AuthInfo , each I assume correspond to either 1) the required signer of each message or 2) the required signers if it’s a multisig address?
It’s just (1), since for (2) there is logically only 1 account, and the multi signatures are gathered and concatenated and submitted as a single signer.
Does it mean for the same transaction each signer will have a different SignDoc and they have to sign with their AccountNumber ?
Yes. Note under Signature verifiers do:
For each required signer:
- Pull account number and sequence from the state.
- Obtain the public key either from state or AuthInfo's signer_infos.
- Create a SignDoc and serialize it using ADR 027.