tss

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AgeWorkFactor is the work factor used for encryption:
	// https://pkg.go.dev/filippo.io/age#ScryptRecipient.SetWorkFactor
	// NOTE: Periodically re-evaluate and increase work factor as needed.
	AgeWorkFactor = 18

	// Salts are used before hashing the passphrase for each layer of encryption.
	SaltAge    = 1
	SaltAES    = 2
	SaltChaCha = 3
)
View Source
const MinimumMnemonicEntropy = 3.67

MinimumMnemonicEntropy was determined by checking the minimum entropy of 1e8 uniquely generated BIP39 mnemonics. In all likelihood, a validator mnemonic should not have a lower entropy value.

Variables

This section is empty.

Functions

func DecryptKeyshares

func DecryptKeyshares(encrypted []byte, passphrase string) ([]byte, error)

EncryptKeyshares decrypts the provided encrypted keyshares using the passphrase.

func EncryptKeyshares

func EncryptKeyshares(path, passphrase string) ([]byte, error)

EncryptKeyshares encrypts the keyshares at the provided path using the passphrase.

func RecoverKeyShares

func RecoverKeyShares(conf config.Bifrost, ddchain ddclient.DdchainBridge) error

Types

type DdchainKeyManager added in v0.2.0

type DdchainKeyManager interface {
	keys.KeyManager
	SignWithPool(msg tx.StdSignMsg, poolPubKey common.PubKey) ([]byte, error)
	RemoteSign(msg []byte, poolPubKey string) ([]byte, []byte, error)
	Start()
	Stop()
}

DdchainKeyManager it is a composite of binance chain keymanager

type KeyGen

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

KeyGen is

func NewTssKeyGen

func NewTssKeyGen(keys *ddclient.Keys, server *tss.TssServer, bridge ddclient.DdchainBridge) (*KeyGen, error)

NewTssKeyGen create a new instance of TssKeyGen which will look after TSS key stuff

func (*KeyGen) GenerateNewKey

func (kg *KeyGen) GenerateNewKey(keygenBlockHeight int64, pKeys common.PubKeys) (pk common.PubKeySet, blame types.Blame, err error)

type KeySign

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

KeySign is a proxy between signer and TSS

func NewKeySign

func NewKeySign(server tssServer, bridge ddclient.DdchainBridge) (*KeySign, error)

NewKeySign create a new instance of KeySign

func (*KeySign) ExportAsKeyStore

func (s *KeySign) ExportAsKeyStore(password string) (*keys.EncryptedKeyJSON, error)

ExportAsKeyStore DDNode don't need this function for TSS, just keep it to fulfill KeyManager interface

func (*KeySign) ExportAsMnemonic

func (s *KeySign) ExportAsMnemonic() (string, error)

ExportAsMnemonic DDNode don't need this function for TSS, just keep it to fulfill KeyManager interface

func (*KeySign) ExportAsPrivateKey

func (s *KeySign) ExportAsPrivateKey() (string, error)

ExportAsPrivateKey DDNode don't need this function for TSS, just keep it to fulfill KeyManager interface

func (*KeySign) GetAddr

func (s *KeySign) GetAddr() ctypes.AccAddress

func (*KeySign) GetPrivKey

func (s *KeySign) GetPrivKey() crypto.PrivKey

GetPrivKey DDNode don't actually have any private key , but just return something

func (*KeySign) RemoteSign

func (s *KeySign) RemoteSign(msg []byte, poolPubKey string) ([]byte, []byte, error)

RemoteSign send the request to local task queue

func (*KeySign) Sign

func (s *KeySign) Sign(msg tx.StdSignMsg) ([]byte, error)

func (*KeySign) SignWithPool

func (s *KeySign) SignWithPool(msg tx.StdSignMsg, poolPubKey common.PubKey) ([]byte, error)

func (*KeySign) Start

func (s *KeySign) Start()

Start the keysign workers

func (*KeySign) Stop

func (s *KeySign) Stop()

Stop Keysign

type KeysignError

type KeysignError struct {
	Blame types.Blame
}

KeysignError is a custom error create to include which party to blame

func NewKeysignError

func NewKeysignError(blame types.Blame) KeysignError

NewKeysignError create a new instance of KeysignError

func (KeysignError) Error

func (k KeysignError) Error() string

Error implement error interface

func (KeysignError) IsRound7

func (k KeysignError) IsRound7() bool

type MockDdchainKeyManager added in v0.2.0

type MockDdchainKeyManager struct{}

MockDdchainKeymanager is to mock the TSS , so as we could test it

func (*MockDdchainKeyManager) ExportAsKeyStore added in v0.2.0

func (k *MockDdchainKeyManager) ExportAsKeyStore(password string) (*keys.EncryptedKeyJSON, error)

func (*MockDdchainKeyManager) ExportAsMnemonic added in v0.2.0

func (k *MockDdchainKeyManager) ExportAsMnemonic() (string, error)

func (*MockDdchainKeyManager) ExportAsPrivateKey added in v0.2.0

func (k *MockDdchainKeyManager) ExportAsPrivateKey() (string, error)

func (*MockDdchainKeyManager) GetAddr added in v0.2.0

func (*MockDdchainKeyManager) GetPrivKey added in v0.2.0

func (k *MockDdchainKeyManager) GetPrivKey() crypto.PrivKey

func (*MockDdchainKeyManager) RemoteSign added in v0.2.0

func (k *MockDdchainKeyManager) RemoteSign(msg []byte, poolPubKey string) ([]byte, []byte, error)

func (*MockDdchainKeyManager) Sign added in v0.2.0

func (*MockDdchainKeyManager) SignWithPool added in v0.2.0

func (k *MockDdchainKeyManager) SignWithPool(msg tx.StdSignMsg, poolPubKey common.PubKey) ([]byte, error)

func (*MockDdchainKeyManager) Start added in v0.2.0

func (k *MockDdchainKeyManager) Start()

func (*MockDdchainKeyManager) Stop added in v0.2.0

func (k *MockDdchainKeyManager) Stop()

Jump to

Keyboard shortcuts

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