Documentation ¶
Overview ¶
Package tss provides the TSS signer functionalities for the zetaclient to sign transactions on external chains
Index ¶
- func GetTssAddrBTC(tssPubkey string, bitcoinChainID int64) (string, error)
- func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error)
- func IsEnvFlagEnabled(flag string) bool
- func SetupTSSServer(peer p2p.AddrList, privkey tmcrypto.PrivKey, preParams *keygen.LocalPreParams, ...) (*tss.TssServer, error)
- func TestKeysign(tssPubkey string, tssServer tss.TssServer) error
- type ConcurrentKeysignsTracker
- type Key
- type TSS
- func (tss *TSS) BTCAddress() string
- func (tss *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash
- func (tss *TSS) EVMAddress() ethcommon.Address
- func (tss *TSS) EVMAddressList() []ethcommon.Address
- func (tss *TSS) InsertPubKey(pk string) error
- func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error
- func (tss *TSS) PubKeyCompressedBytes() []byte
- func (tss *TSS) Pubkey() []byte
- func (tss *TSS) Sign(ctx context.Context, digest []byte, height uint64, nonce uint64, chainID int64, ...) ([65]byte, error)
- func (tss *TSS) SignBatch(ctx context.Context, digests [][]byte, height uint64, nonce uint64, ...) ([][65]byte, error)
- func (tss *TSS) Validate() error
- func (tss *TSS) VerifyKeysharesForPubkeys(tssList []observertypes.TSS, granteePubKey32 string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTssAddrBTC ¶
GetTssAddrBTC generates a bech32 p2wpkh address from pubkey
func GetTssAddrEVM ¶
GetTssAddrEVM generates an EVM address from pubkey
func IsEnvFlagEnabled ¶
IsEnvFlagEnabled checks if the environment flag is enabled
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 TSS ¶
type TSS struct { Server *tss.TssServer Keys map[string]*Key // PubkeyInBech32 => TSSKey CurrentPubkey string Signers []string ZetacoreClient interfaces.ZetacoreClient KeysignsTracker *ConcurrentKeysignsTracker // TODO: support multiple Bitcoin network, not just one network // https://github.com/zeta-chain/node/issues/1397 BitcoinChainID int64 // 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, client interfaces.ZetacoreClient, tssHistoricalList []observertypes.TSS, bitcoinChainID int64, hotkeyPassword string, tssServer *tss.TssServer, ) (*TSS, error)
NewTSS creates a new TSS instance which can be used to sign transactions
func (*TSS) BTCAddress ¶
BTCAddress generates a bech32 p2wpkh address from pubkey
func (*TSS) BTCAddressWitnessPubkeyHash ¶
func (tss *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash
BTCAddressWitnessPubkeyHash generates a bech32 p2wpkh address from pubkey
func (*TSS) EVMAddress ¶
EVMAddress generates an EVM address from pubkey
func (*TSS) EVMAddressList ¶
func (*TSS) InsertPubKey ¶
InsertPubKey adds a new key to the TSS keys map
func (*TSS) LoadTssFilesFromDirectory ¶
LoadTssFilesFromDirectory loads the TSS files at the directory specified by the `tssPath`
func (*TSS) PubKeyCompressedBytes ¶
PubKeyCompressedBytes returns the compressed bytes of the current pubkey
func (*TSS) Sign ¶
func (tss *TSS) Sign( ctx context.Context, digest []byte, height uint64, nonce uint64, chainID int64, 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, chainID int64, ) ([][65]byte, error)
SignBatch is hash of some data digest should be batch of hashes of some data
func (*TSS) VerifyKeysharesForPubkeys ¶
func (tss *TSS) VerifyKeysharesForPubkeys(tssList []observertypes.TSS, granteePubKey32 string) error
VerifyKeysharesForPubkeys verifies the keyshares present on the node. It checks whether the node has TSS key shares for the TSS ceremonies it was part of.