Documentation ¶
Index ¶
Constants ¶
const (
PubKeyAminoRoute = "tendermint/PubKeyMultisigThreshold"
)
TODO: Figure out API for others to either add their own pubkey types, or to make verify / marshal accept a cdc.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Multisignature ¶
type Multisignature struct { BitArray *types.CompactBitArray Sigs [][]byte }
Multisignature is used to represent the signature object used in the multisigs. Sigs is a list of signatures, sorted by corresponding index.
func NewMultisig ¶
func NewMultisig(n int) *Multisignature
NewMultisig returns a new Multisignature of size n.
func (*Multisignature) AddSignature ¶
func (mSig *Multisignature) AddSignature(sig []byte, index int)
AddSignature adds a signature to the multisig, at the corresponding index. If the signature already exists, replace it.
func (*Multisignature) AddSignatureFromPubKey ¶
func (mSig *Multisignature) AddSignatureFromPubKey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) error
AddSignatureFromPubKey adds a signature to the multisig, at the index in keys corresponding to the provided pubkey.
func (*Multisignature) Marshal ¶
func (mSig *Multisignature) Marshal() []byte
Marshal the multisignature with amino
type PubKey ¶
PubKey implements a K of N threshold multisig.
func (PubKey) Equals ¶
Equals returns true iff pk and other both have the same number of keys, and all constituent keys are the same, and in the same order.
func (PubKey) VerifyBytes ¶
VerifyBytes expects sig to be an amino encoded version of a MultiSignature. Returns true iff the multisignature contains k or more signatures for the correct corresponding keys, and all signatures are valid. (Not just k of the signatures) The multisig uses a bitarray, so multiple signatures for the same key is not a concern.