exported

package
v0.0.0-...-74e6f8a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyIDLengthMin = 4
	KeyIDLengthMax = 256
)

key id length range bounds dictated by tofnd

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AckType_name = map[int32]string{
	0: "ACK_TYPE_UNSPECIFIED",
	1: "ACK_TYPE_KEYGEN",
	2: "ACK_TYPE_SIGN",
}
View Source
var AckType_value = map[string]int32{
	"ACK_TYPE_UNSPECIFIED": 0,
	"ACK_TYPE_KEYGEN":      1,
	"ACK_TYPE_SIGN":        2,
}
View Source
var KeyRole_name = map[int32]string{
	0: "KEY_ROLE_UNSPECIFIED",
	1: "KEY_ROLE_MASTER_KEY",
	2: "KEY_ROLE_SECONDARY_KEY",
	3: "KEY_ROLE_EXTERNAL_KEY",
}
View Source
var KeyRole_value = map[string]int32{
	"KEY_ROLE_UNSPECIFIED":   0,
	"KEY_ROLE_MASTER_KEY":    1,
	"KEY_ROLE_SECONDARY_KEY": 2,
	"KEY_ROLE_EXTERNAL_KEY":  3,
}
View Source
var KeyShareDistributionPolicy_name = map[int32]string{
	0: "KEY_SHARE_DISTRIBUTION_POLICY_UNSPECIFIED",
	1: "KEY_SHARE_DISTRIBUTION_POLICY_WEIGHTED_BY_STAKE",
	2: "KEY_SHARE_DISTRIBUTION_POLICY_ONE_PER_VALIDATOR",
}
View Source
var KeyShareDistributionPolicy_value = map[string]int32{
	"KEY_SHARE_DISTRIBUTION_POLICY_UNSPECIFIED":       0,
	"KEY_SHARE_DISTRIBUTION_POLICY_WEIGHTED_BY_STAKE": 1,
	"KEY_SHARE_DISTRIBUTION_POLICY_ONE_PER_VALIDATOR": 2,
}
View Source
var KeyType_name = map[int32]string{
	0: "KEY_TYPE_UNSPECIFIED",
	1: "KEY_TYPE_THRESHOLD",
	2: "KEY_TYPE_MULTISIG",
}
View Source
var KeyType_value = map[string]int32{
	"KEY_TYPE_UNSPECIFIED": 0,
	"KEY_TYPE_THRESHOLD":   1,
	"KEY_TYPE_MULTISIG":    2,
}
View Source
var SigStatus_name = map[int32]string{
	0: "SIG_STATUS_UNSPECIFIED",
	1: "SIG_STATUS_QUEUED",
	2: "SIG_STATUS_SIGNING",
	3: "SIG_STATUS_SIGNED",
	4: "SIG_STATUS_ABORTED",
	5: "SIG_STATUS_INVALID",
}
View Source
var SigStatus_value = map[string]int32{
	"SIG_STATUS_UNSPECIFIED": 0,
	"SIG_STATUS_QUEUED":      1,
	"SIG_STATUS_SIGNING":     2,
	"SIG_STATUS_SIGNED":      3,
	"SIG_STATUS_ABORTED":     4,
	"SIG_STATUS_INVALID":     5,
}

Functions

func KeyIDsToStrings

func KeyIDsToStrings(keyIDs []KeyID) []string

KeyIDsToStrings converts a slice of type KeyID to a slice of strings

Types

type AckType

type AckType int32
const (
	AckType_Unspecified AckType = 0
	AckType_Keygen      AckType = 1
	AckType_Sign        AckType = 2
)

func (AckType) EnumDescriptor

func (AckType) EnumDescriptor() ([]byte, []int)

func (AckType) String

func (x AckType) String() string

type Handler

type Handler func(ctx sdk.Context, info SignInfo) error

Handler defines a function that handles a signature after it has been generated and voted on

type Key

type Key struct {
	ID        KeyID
	Value     ecdsa.PublicKey
	Role      KeyRole
	RotatedAt *time.Time
}

Key contains the public key value and corresponding ID

type KeyID

type KeyID string

KeyID ensures a correctly formatted tss key ID

func (KeyID) Validate

func (id KeyID) Validate() error

Validate returns an error, if the key ID is too short or too long

type KeyRole

type KeyRole int32
const (
	Unknown      KeyRole = 0
	MasterKey    KeyRole = 1
	SecondaryKey KeyRole = 2
	ExternalKey  KeyRole = 3
)

func GetKeyRoles

func GetKeyRoles() []KeyRole

GetKeyRoles returns an array of all types of key role

func KeyRoleFromSimpleStr

func KeyRoleFromSimpleStr(str string) (KeyRole, error)

KeyRoleFromSimpleStr creates a KeyRole from string

func (KeyRole) EnumDescriptor

func (KeyRole) EnumDescriptor() ([]byte, []int)

func (KeyRole) SimpleString

func (x KeyRole) SimpleString() string

SimpleString returns a human-readable string

func (KeyRole) String

func (x KeyRole) String() string

func (KeyRole) Validate

func (x KeyRole) Validate() error

Validate validates the KeyRole

type KeyShareDistributionPolicy

type KeyShareDistributionPolicy int32
const (
	Unspecified     KeyShareDistributionPolicy = 0
	WeightedByStake KeyShareDistributionPolicy = 1
	OnePerValidator KeyShareDistributionPolicy = 2
)

func KeyShareDistributionPolicyFromSimpleStr

func KeyShareDistributionPolicyFromSimpleStr(str string) (KeyShareDistributionPolicy, error)

KeyShareDistributionPolicyFromSimpleStr creates a KeyShareDistributionPolicy from string

func (KeyShareDistributionPolicy) EnumDescriptor

func (KeyShareDistributionPolicy) EnumDescriptor() ([]byte, []int)

func (KeyShareDistributionPolicy) SimpleString

func (r KeyShareDistributionPolicy) SimpleString() string

SimpleString returns a human-readable string

func (KeyShareDistributionPolicy) String

func (KeyShareDistributionPolicy) Validate

func (r KeyShareDistributionPolicy) Validate() error

Validate validates the KeyShareDistributionPolicy

type KeyType

type KeyType int32
const (
	KEY_TYPE_UNSPECIFIED KeyType = 0
	Threshold            KeyType = 1
	Multisig             KeyType = 2
)

func KeyTypeFromSimpleStr

func KeyTypeFromSimpleStr(str string) (KeyType, error)

KeyTypeFromSimpleStr creates a KeyType from string

func (KeyType) EnumDescriptor

func (KeyType) EnumDescriptor() ([]byte, []int)

func (KeyType) SimpleString

func (x KeyType) SimpleString() string

SimpleString returns a human-readable string

func (KeyType) String

func (x KeyType) String() string

func (KeyType) Validate

func (x KeyType) Validate() error

Validate validates the KeyType

type MultisigKey

type MultisigKey struct {
	ID        KeyID
	Values    []ecdsa.PublicKey
	Role      KeyRole
	RotatedAt *time.Time
}

MultisigKey contains the public key value and corresponding ID

type PubKeyInfo

type PubKeyInfo struct {
	PubKey    []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
	Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
}

PubKeyInfo holds a pubkey and a signature

func (*PubKeyInfo) Descriptor

func (*PubKeyInfo) Descriptor() ([]byte, []int)

func (*PubKeyInfo) GetPubKey

func (m *PubKeyInfo) GetPubKey() []byte

func (*PubKeyInfo) GetSignature

func (m *PubKeyInfo) GetSignature() []byte

func (*PubKeyInfo) Marshal

func (m *PubKeyInfo) Marshal() (dAtA []byte, err error)

func (*PubKeyInfo) MarshalTo

func (m *PubKeyInfo) MarshalTo(dAtA []byte) (int, error)

func (*PubKeyInfo) MarshalToSizedBuffer

func (m *PubKeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PubKeyInfo) ProtoMessage

func (*PubKeyInfo) ProtoMessage()

func (*PubKeyInfo) Reset

func (m *PubKeyInfo) Reset()

func (*PubKeyInfo) Size

func (m *PubKeyInfo) Size() (n int)

func (*PubKeyInfo) String

func (m *PubKeyInfo) String() string

func (*PubKeyInfo) Unmarshal

func (m *PubKeyInfo) Unmarshal(dAtA []byte) error

func (PubKeyInfo) Validate

func (p PubKeyInfo) Validate() error

Validate validates the KeyType

func (*PubKeyInfo) XXX_DiscardUnknown

func (m *PubKeyInfo) XXX_DiscardUnknown()

func (*PubKeyInfo) XXX_Marshal

func (m *PubKeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubKeyInfo) XXX_Merge

func (m *PubKeyInfo) XXX_Merge(src proto.Message)

func (*PubKeyInfo) XXX_Size

func (m *PubKeyInfo) XXX_Size() int

func (*PubKeyInfo) XXX_Unmarshal

func (m *PubKeyInfo) XXX_Unmarshal(b []byte) error

type SigStatus

type SigStatus int32
const (
	SigStatus_Unspecified SigStatus = 0
	SigStatus_Queued      SigStatus = 1
	SigStatus_Signing     SigStatus = 2
	SigStatus_Signed      SigStatus = 3
	SigStatus_Aborted     SigStatus = 4
	SigStatus_Invalid     SigStatus = 5
)

func (SigStatus) EnumDescriptor

func (SigStatus) EnumDescriptor() ([]byte, []int)

func (SigStatus) String

func (x SigStatus) String() string

type SignInfo

type SignInfo struct {
	KeyID           KeyID  `protobuf:"bytes,1,opt,name=key_id,json=keyId,proto3,casttype=KeyID" json:"key_id,omitempty"`
	SigID           string `protobuf:"bytes,2,opt,name=sig_id,json=sigId,proto3" json:"sig_id,omitempty"`
	Msg             []byte `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
	SnapshotCounter int64  `protobuf:"varint,4,opt,name=snapshot_counter,json=snapshotCounter,proto3" json:"snapshot_counter,omitempty"`
	RequestModule   string `protobuf:"bytes,5,opt,name=request_module,json=requestModule,proto3" json:"request_module,omitempty"`
	Metadata        string `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
}

SignInfo holds information about a sign request

func (*SignInfo) Descriptor

func (*SignInfo) Descriptor() ([]byte, []int)

func (*SignInfo) GetKeyID

func (m *SignInfo) GetKeyID() KeyID

func (*SignInfo) GetMetadata

func (m *SignInfo) GetMetadata() string

func (*SignInfo) GetMsg

func (m *SignInfo) GetMsg() []byte

func (*SignInfo) GetRequestModule

func (m *SignInfo) GetRequestModule() string

func (*SignInfo) GetSigID

func (m *SignInfo) GetSigID() string

func (*SignInfo) GetSnapshotCounter

func (m *SignInfo) GetSnapshotCounter() int64

func (*SignInfo) MarshalTo

func (m *SignInfo) MarshalTo(dAtA []byte) (int, error)

func (*SignInfo) MarshalToSizedBuffer

func (m *SignInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SignInfo) ProtoMessage

func (*SignInfo) ProtoMessage()

func (*SignInfo) Reset

func (m *SignInfo) Reset()

func (*SignInfo) Size

func (m *SignInfo) Size() (n int)

func (*SignInfo) String

func (m *SignInfo) String() string

func (*SignInfo) Unmarshal

func (m *SignInfo) Unmarshal(dAtA []byte) error
	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}

func (*SignInfo) XXX_DiscardUnknown

func (m *SignInfo) XXX_DiscardUnknown()

func (*SignInfo) XXX_Marshal

func (m *SignInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignInfo) XXX_Merge

func (m *SignInfo) XXX_Merge(src proto.Message)

func (*SignInfo) XXX_Size

func (m *SignInfo) XXX_Size() int

func (*SignInfo) XXX_Unmarshal

func (m *SignInfo) XXX_Unmarshal(b []byte) error

type Signature

type Signature struct {
	R *big.Int
	S *big.Int
}

Signature - an ECDSA signature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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