Documentation ¶
Index ¶
Constants ¶
const ( // KeystoreFileNameFormat exposes the filename the keystore should be formatted in. KeystoreFileNameFormat = "keystore-%d.json" // AccountsPath where all imported keymanager keystores are kept. AccountsPath = "accounts" // AccountsKeystoreFileName exposes the name of the keystore file. AccountsKeystoreFileName = "all-accounts.keystore.json" )
const ( // KeymanagerConfigFileName for the keymanager used by the wallet: imported, derived, or remote. KeymanagerConfigFileName = "keymanageropts.json" // NewWalletPasswordPromptText for wallet creation. NewWalletPasswordPromptText = "New wallet password" // WalletPasswordPromptText for wallet unlocking. PasswordPromptText = "Wallet password" // ConfirmPasswordPromptText for confirming a wallet password. ConfirmPasswordPromptText = "Confirm password" // DefaultWalletPasswordFile used to store a wallet password with appropriate permissions // if a user signs up via the Prysm web UI via RPC. DefaultWalletPasswordFile = "walletpassword.txt" // CheckExistsErrMsg for when there is an error while checking for a wallet CheckExistsErrMsg = "could not check if wallet exists" // CheckValidityErrMsg for when there is an error while checking wallet validity CheckValidityErrMsg = "could not check if wallet is valid" // InvalidWalletErrMsg for when a directory does not contain a valid wallet InvalidWalletErrMsg = "directory does not contain valid wallet" )
Variables ¶
var ErrInfinitePubKey = errors.New("received an infinite public key")
ErrInfinitePubKey describes an error due to an infinite public key.
var ErrNoWalletFound = errors.New(
"no wallet found. You can create a new wallet with `validator wallet create`. " +
"If you already did, perhaps you created a wallet in a custom directory, which you can specify using " +
"`--wallet-dir=/path/to/my/wallet`",
)
var ErrSecretUnmarshal = errors.New("could not unmarshal bytes into secret key")
ErrSecretUnmarshal describes an error which happens during unmarshalling a secret key.
var ErrSigFailedToVerify = errors.New("signature did not verify")
ErrSigFailedToVerify returns when a signature of a block object(ie attestation, slashing, exit... etc) failed to verify.
var ErrZeroKey = errors.New("received secret key is zero")
ErrZeroKey describes an error due to a zero secret key.
Functions ¶
Types ¶
type AccountsKeystoreRepresentation ¶
type AccountsKeystoreRepresentation struct { Crypto map[string]interface{} `json:"crypto"` ID string `json:"uuid"` Version uint `json:"version"` Name string `json:"name"` DisabledPublicKeys []string `json:"disabled_public_keys"` }
AccountsKeystoreRepresentation defines an internal Prysm representation of validator accounts, encrypted according to the EIP-2334 standard but containing extra fields such as markers for disabled public keys.
type Keymanager ¶
type Keymanager struct {
// contains filtered or unexported fields
}
Keymanager implementation for imported keystores utilizing EIP-2335.
func NewKeymanager ¶
func NewKeymanager(wallet *Wallet) (*Keymanager, error)
NewKeymanager instantiates a new imported keymanager from configuration options.
func (*Keymanager) VerifySignature ¶
func (km *Keymanager) VerifySignature(slotInfo *SlotInfo, pubKeyIndex uint64, signature bls.Signature) error
VerifyBlockSigningRoot verifies the signing root of a block given it's public key, signature and domain.
type Kind ¶
type Kind int
Kind defines an enum for either imported, derived, or remote-signing keystores for Prysm wallets.
type SlotInfo ¶
func NewSlotInfo ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet is a primitive in Prysm's account management which has the capability of creating new accounts, reading existing accounts, and providing secure access to eth2 secrets depending on an associated keymanager (either imported, derived, or remote signing enabled).
func OpenWallet ¶
OpenWallet instantiates a wallet from a specified path. It checks the type of keymanager associated with the wallet by reading files in the wallet path, if applicable. If a wallet does not exist, returns an appropriate error.