eth2keymanager

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 8 Imported by: 4

README

Blox Eth Key Manager

Blox Eth Key Manager is a library wrapping all major functionality an eth 2.0 validator will need:

Installation
go get github.com/bloxapp/eth2-key-manager
Security and Architecture

eth2keymanager is the entry point to manage all operations, in it sits a unique wallet and accounts.
eth2keymanager <- Wallet <- [Accounts]

An account is the entity that ultimately signs transactions.
Wallets and accounts are derived according to EIP-2334:

  1. Withdrawal key: m/12381/3600/account_index/0
  2. Validation key: m/12381/3600/account_index/0/0

The seed is needed just to execute specific operations like creating new accounts or signing with the withdrawal key.

Examples:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCrypto

func InitCrypto()

InitCrypto initializes cryptography

Types

type KeyVault

type KeyVault struct {
	Context *core.WalletContext
	// contains filtered or unexported fields
}

KeyVault is an EIP 2333,2334,2335 compliant hierarchical deterministic portfolio https://eips.ethereum.org/EIPS/eip-2333 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2334.md https://eips.ethereum.org/EIPS/eip-2335

func NewKeyVault

func NewKeyVault(options *KeyVaultOptions) (*KeyVault, error)

NewKeyVault creates a new wallet (with new ids) and will save it to storage Import and New are the same action.

func OpenKeyVault

func OpenKeyVault(options *KeyVaultOptions) (*KeyVault, error)

OpenKeyVault opens an existing KeyVault (and wallet) from memory

func (*KeyVault) Wallet

func (kv *KeyVault) Wallet() (core.Wallet, error)

Wallet returns wallet

type KeyVaultOptions

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

KeyVaultOptions contains options to create a new key vault object

func (*KeyVaultOptions) SetEncryptor

func (options *KeyVaultOptions) SetEncryptor(encryptor encryptor2.Encryptor) *KeyVaultOptions

SetEncryptor is the encryptor setter

func (*KeyVaultOptions) SetPassword

func (options *KeyVaultOptions) SetPassword(password string) *KeyVaultOptions

SetPassword is the password setter

func (*KeyVaultOptions) SetStorage

func (options *KeyVaultOptions) SetStorage(storage interface{}) *KeyVaultOptions

SetStorage is the storage setter

func (*KeyVaultOptions) SetWalletType

func (options *KeyVaultOptions) SetWalletType(walletType core.WalletType) *KeyVaultOptions

SetWalletType is the wallet type setter

Jump to

Keyboard shortcuts

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