Documentation ¶
Index ¶
- Constants
- func GenerateAndConfirmMnemonic(skipMnemonicConfirm bool) (string, error)
- type EnglishMnemonicGenerator
- type Keymanager
- func (km *Keymanager) DeleteKeystores(ctx context.Context, publicKeys [][]byte) ([]*ethpbservice.DeletedKeystoreStatus, error)
- func (km *Keymanager) ExtractKeystores(ctx context.Context, publicKeys []bls.PublicKey, password string) ([]*keymanager.Keystore, error)
- func (km *Keymanager) FetchValidatingPrivateKeys(ctx context.Context) ([][32]byte, error)
- func (km *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error)
- func (km *Keymanager) ImportKeystores(ctx context.Context, keystores []*keymanager.Keystore, passwords []string) ([]*ethpbservice.ImportedKeystoreStatus, error)
- func (km *Keymanager) ListKeymanagerAccounts(ctx context.Context, cfg keymanager.ListKeymanagerAccountConfig) error
- func (km *Keymanager) RecoverAccountsFromMnemonic(ctx context.Context, mnemonic, mnemonicPassphrase string, numAccounts int) error
- func (km *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (bls.Signature, error)
- func (km *Keymanager) SubscribeAccountChanges(pubKeysChan chan [][fieldparams.BLSPubkeyLength]byte) event.Subscription
- func (km *Keymanager) ValidatingAccountNames(_ context.Context) ([]string, error)
- type SetupConfig
Constants ¶
const ( // DerivationPathFormat describes the structure of how keys are derived from a master key. DerivationPathFormat = "m / purpose / coin_type / account_index / withdrawal_key / validating_key" // ValidatingKeyDerivationPathTemplate defining the hierarchical path for validating // keys for Prysm Ethereum validators. According to EIP-2334, the format is as follows: // m / purpose / coin_type / account_index / withdrawal_key / validating_key ValidatingKeyDerivationPathTemplate = "m/12381/3600/%d/0/0" )
Variables ¶
This section is empty.
Functions ¶
func GenerateAndConfirmMnemonic ¶
GenerateAndConfirmMnemonic requires confirming the generated mnemonics.
Types ¶
type EnglishMnemonicGenerator ¶
type EnglishMnemonicGenerator struct {
// contains filtered or unexported fields
}
EnglishMnemonicGenerator implements methods for creating mnemonic seed phrases in english using a given source of entropy such as a private key.
func (*EnglishMnemonicGenerator) ConfirmAcknowledgement ¶
func (m *EnglishMnemonicGenerator) ConfirmAcknowledgement(phrase string) error
ConfirmAcknowledgement displays the mnemonic phrase to the user and confirms the user has written down the phrase securely offline.
type Keymanager ¶
type Keymanager struct {
// contains filtered or unexported fields
}
Keymanager implementation for derived, HD keymanager using EIP-2333 and EIP-2334.
func NewKeymanager ¶
func NewKeymanager( ctx context.Context, cfg *SetupConfig, ) (*Keymanager, error)
NewKeymanager instantiates a new derived keymanager from configuration options.
func (*Keymanager) DeleteKeystores ¶
func (km *Keymanager) DeleteKeystores( ctx context.Context, publicKeys [][]byte, ) ([]*ethpbservice.DeletedKeystoreStatus, error)
DeleteKeystores for a derived keymanager.
func (*Keymanager) ExtractKeystores ¶
func (km *Keymanager) ExtractKeystores( ctx context.Context, publicKeys []bls.PublicKey, password string, ) ([]*keymanager.Keystore, error)
ExtractKeystores retrieves the secret keys for specified public keys in the function input, encrypts them using the specified password, and returns their respective EIP-2335 keystores.
func (*Keymanager) FetchValidatingPrivateKeys ¶
func (km *Keymanager) FetchValidatingPrivateKeys(ctx context.Context) ([][32]byte, error)
FetchValidatingPrivateKeys fetches the list of validating private keys from the keymanager.
func (*Keymanager) FetchValidatingPublicKeys ¶
func (km *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error)
FetchValidatingPublicKeys fetches the list of validating public keys from the keymanager.
func (*Keymanager) ImportKeystores ¶
func (km *Keymanager) ImportKeystores( ctx context.Context, keystores []*keymanager.Keystore, passwords []string, ) ([]*ethpbservice.ImportedKeystoreStatus, error)
ImportKeystores for a derived keymanager.
func (*Keymanager) ListKeymanagerAccounts ¶
func (km *Keymanager) ListKeymanagerAccounts(ctx context.Context, cfg keymanager.ListKeymanagerAccountConfig) error
func (*Keymanager) RecoverAccountsFromMnemonic ¶
func (km *Keymanager) RecoverAccountsFromMnemonic( ctx context.Context, mnemonic, mnemonicPassphrase string, numAccounts int, ) error
RecoverAccountsFromMnemonic given a mnemonic phrase, is able to regenerate N accounts from a derived seed, encrypt them according to the EIP-2334 JSON standard, and write them to disk. Then, the mnemonic is never stored nor used by the validator.
func (*Keymanager) Sign ¶
func (km *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (bls.Signature, error)
Sign signs a message using a validator key.
func (*Keymanager) SubscribeAccountChanges ¶
func (km *Keymanager) SubscribeAccountChanges(pubKeysChan chan [][fieldparams.BLSPubkeyLength]byte) event.Subscription
SubscribeAccountChanges creates an event subscription for a channel to listen for public key changes at runtime, such as when new validator accounts are imported into the keymanager while the validator process is running.
func (*Keymanager) ValidatingAccountNames ¶
func (km *Keymanager) ValidatingAccountNames(_ context.Context) ([]string, error)
ValidatingAccountNames for the derived keymanager.
type SetupConfig ¶
SetupConfig includes configuration values for initializing a keymanager, such as passwords, the wallet, and more.