tss

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTssAddrEVM

func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error)

func IsEnvFlagEnabled

func IsEnvFlagEnabled(flag string) bool

func SetupTSSServer

func SetupTSSServer(peer p2p.AddrList, privkey tmcrypto.PrivKey, preParams *keygen.LocalPreParams, cfg config.Config, tssPassword string) (*tss.TssServer, error)

func TestKeysign

func TestKeysign(tssPubkey string, tssServer *tss.TssServer) error

Types

type ConcurrentKeysignsTracker

type ConcurrentKeysignsTracker struct {
	Logger zerolog.Logger
	// contains filtered or unexported fields
}

ConcurrentKeysignsTracker keeps track of concurrent keysigns performed by go-tss

func NewKeysignsTracker

func NewKeysignsTracker(logger zerolog.Logger) *ConcurrentKeysignsTracker

NewKeysignsTracker - constructor

func (*ConcurrentKeysignsTracker) EndMsgSign

func (k *ConcurrentKeysignsTracker) EndMsgSign()

EndMsgSign is decrementing the number of active signing ceremonies as well as updating the prometheus metric

func (*ConcurrentKeysignsTracker) GetNumActiveMessageSigns

func (k *ConcurrentKeysignsTracker) GetNumActiveMessageSigns() int64

GetNumActiveMessageSigns gets the current number of active signing ceremonies

func (*ConcurrentKeysignsTracker) StartMsgSign

func (k *ConcurrentKeysignsTracker) StartMsgSign()

StartMsgSign is incrementing the number of active signing ceremonies as well as updating the prometheus metric

type Key

type Key struct {
	PubkeyInBytes  []byte // FIXME: compressed pubkey?
	PubkeyInBech32 string // FIXME: same above
	AddressInHex   string
}

func NewTSSKey

func NewTSSKey(pk string) (*Key, error)

type TSS

type TSS struct {
	Server        *tss.TssServer
	Keys          map[string]*Key // PubkeyInBech32 => TSSKey
	CurrentPubkey string

	Signers         []string
	CoreBridge      interfaces.PellCoreBridger
	KeysignsTracker *ConcurrentKeysignsTracker
	// contains filtered or unexported fields
}

TSS is a struct that holds the server and the keys for TSS

func NewTSS

func NewTSS(
	ctx context.Context,
	peer p2p.AddrList,
	privkey tmcrypto.PrivKey,
	preParams *keygen.LocalPreParams,
	bridge interfaces.PellCoreBridger,
	tssHistoricalList []relayertypes.TSS,
	tssPassword string,
	hotkeyPassword string,
) (*TSS, error)

NewTSS creates a new TSS instance

func (*TSS) EVMAddress

func (tss *TSS) EVMAddress() ethcommon.Address

func (*TSS) InsertPubKey

func (tss *TSS) InsertPubKey(pk string) error

InsertPubKey adds a new key to the TSS keys map

func (*TSS) LoadTssFilesFromDirectory

func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error

func (*TSS) PubKeyCompressedBytes

func (tss *TSS) PubKeyCompressedBytes() []byte

func (*TSS) Pubkey

func (tss *TSS) Pubkey() []byte

FIXME: does it return pubkey in compressed form or uncompressed?

func (*TSS) Sign

func (tss *TSS) Sign(ctx context.Context, digest []byte, height uint64, nonce uint64, chain *chains.Chain, optionalPubKey string) ([65]byte, error)

Sign signs a digest digest should be Hashes of some data NOTE: Specify optionalPubkey to use a different pubkey than the current pubkey set during keygen

func (*TSS) SignBatch

func (tss *TSS) SignBatch(ctx context.Context, digests [][]byte, height uint64, nonce uint64, chain *chains.Chain) ([][65]byte, error)

SignBatch is hash of some data digest should be batch of hashes of some data

func (*TSS) Validate

func (tss *TSS) Validate() error

func (*TSS) VerifyKeysharesForPubkeys

func (tss *TSS) VerifyKeysharesForPubkeys(tssList []relayertypes.TSS, granteePubKey32 string) error

Jump to

Keyboard shortcuts

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