multisig

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(mSig *signing.MultiSignatureData, sig signing.SignatureData, index int)

AddSignature adds a signature to the multisig, at the corresponding index. If the signature already exists, replace it.

func AddSignatureFromPubKey

func AddSignatureFromPubKey(mSig *signing.MultiSignatureData, sig signing.SignatureData, 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 AddSignatureV2

func AddSignatureV2(mSig *signing.MultiSignatureData, sig signing.SignatureV2, keys []crypto.PubKey) error

func NewMultisig

func NewMultisig(n int) *signing.MultiSignatureData

NewMultisig returns a new MultiSignatureData

Types

type AminoMultisignature

type AminoMultisignature struct {
	BitArray *types.CompactBitArray
	Sigs     [][]byte
}

AminoMultisignature is used to represent amino multi-signatures for StdTx's. It is assumed that all signatures were made with SIGN_MODE_LEGACY_AMINO_JSON. Sigs is a list of signatures, sorted by corresponding index.

type GetSignBytesFunc

type GetSignBytesFunc func(mode signing.SignMode) ([]byte, error)

GetSignBytesFunc defines a function type which returns sign bytes for a given SignMode or an error. It will generally be implemented as a closure which wraps whatever signable object signatures are being verified against.

type PubKey

type PubKey interface {
	crypto.PubKey

	// VerifyMultisignature verifies the provide multi-signature represented by MultiSignatureData
	// using getSignBytes to retrieve the sign bytes to verify against for the provided mode.
	VerifyMultisignature(getSignBytes GetSignBytesFunc, sig *signing.MultiSignatureData) error

	// GetPubKeys returns the crypto.PubKey's nested within the multi-sig PubKey
	GetPubKeys() []crypto.PubKey

	// GetThreshold returns the threshold number of signatures that must be obtained to verify a signature.
	GetThreshold() uint
}

PubKey defines a type which supports multi-signature verification via MultiSignatureData which supports multiple SignMode's.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL