keysign

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	PoolPubKey    string   `json:"pool_pub_key"` // pub key of the pool that we would like to send this message from
	Messages      []string `json:"messages"`     // base64 encoded message to be signed
	SignerPubKeys []string `json:"signer_pub_keys"`
	BlockHeight   int64    `json:"block_height"`
	Version       string   `json:"tss_version"`
	// contains filtered or unexported fields
}

Request request to sign a message

func NewRequest

func NewRequest(pk string, msgs []string, blockHeight int64, signers []string, version string) Request

func (*Request) MarshalZerologObject added in v0.3.0

func (r *Request) MarshalZerologObject(e *zerolog.Event)

func (*Request) MsgID added in v0.4.0

func (r *Request) MsgID() (string, error)

MsgID returns the hash of the request.

func (*Request) SetLogFields added in v0.3.0

func (r *Request) SetLogFields(kv map[string]any)

type Response

type Response struct {
	Signatures []Signature   `json:"signatures"`
	Status     common.Status `json:"status"`
	Blame      blame.Blame   `json:"blame"`
}

Response key sign response

func NewResponse

func NewResponse(signatures []Signature, status common.Status, blame blame.Blame) Response

type Signature

type Signature struct {
	Msg        string `json:"signed_msg"`
	R          string `json:"r"`
	S          string `json:"s"`
	RecoveryID string `json:"recovery_id"`
}

signature

func NewSignature

func NewSignature(msg, r, s, recoveryID string) Signature

type SignatureNotifier

type SignatureNotifier struct {
	// contains filtered or unexported fields
}

SignatureNotifier is design to notify the

func NewSignatureNotifier

func NewSignatureNotifier(host host.Host, logger zerolog.Logger) *SignatureNotifier

NewSignatureNotifier create a new instance of SignatureNotifier

func (*SignatureNotifier) BroadcastFailed

func (s *SignatureNotifier) BroadcastFailed(messageID string, peers []peer.ID) error

BroadcastFailed will send keysign failed message to the nodes that are not in the keysign party

func (*SignatureNotifier) BroadcastSignature

func (s *SignatureNotifier) BroadcastSignature(messageID string, sig []*common.SignatureData, peers []peer.ID) error

BroadcastSignature sending the keysign signature to all other peers

func (*SignatureNotifier) Start added in v0.2.0

func (s *SignatureNotifier) Start()

Start launches a background cleanup goroutine

func (*SignatureNotifier) Stop added in v0.2.0

func (s *SignatureNotifier) Stop()

Stop stops the background cleanup goroutine

func (*SignatureNotifier) WaitForSignature

func (s *SignatureNotifier) WaitForSignature(
	messageID string,
	message [][]byte,
	poolPubKey string,
	timeout time.Duration,
	sigChan chan string,
) ([]*common.SignatureData, error)

WaitForSignature wait until keysign finished and signature is available

type TssKeySign

type TssKeySign interface {
	GetTssKeySignChannels() chan *p2p.Message
	GetTssCommonStruct() *common.TssCommon
	SignMessage(
		msgToSign [][]byte,
		localStateItem storage.KeygenLocalState,
		parties []string,
	) ([]*bc.SignatureData, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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