keys

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultEthDerivationPath    string = "m/44'/60'/0'/0/%d"
	DefaultBeaconDerivationPath string = "m/12381/3600/%d/0/0"
	DefaultMnemonic             string = "test test test test test test test test test test test junk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyGenerator

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

KeyGenerator is a simple utility for generating EOA and BLS private keys from a mnemonic and derivation paths. This is meant to be used in testing scenarios where complete flexibility of derivation paths isn't a priority.

func NewKeyGenerator

func NewKeyGenerator(mnemonic string, ethDerivationPath string, blsDerivationPath string) (*KeyGenerator, error)

Create a new key generator from explicit values

func NewKeyGeneratorWithDefaults

func NewKeyGeneratorWithDefaults() (*KeyGenerator, error)

Create a new key generator with default values

func (*KeyGenerator) GetBlsPrivateKey

func (g *KeyGenerator) GetBlsPrivateKey(index uint) (*types.BLSPrivateKey, error)

Get the BLS private key for the given index

func (*KeyGenerator) GetEthPrivateKey

func (g *KeyGenerator) GetEthPrivateKey(index uint) (*ecdsa.PrivateKey, error)

Get the EOA private key for the given index

Jump to

Keyboard shortcuts

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