keystore

package
v1.0.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFromExport

func AddressFromExport(exported string) (address.Address, error)

AddressFromExport derives filecoin address from a lotus wallet export string

func EVMSigner

func EVMSigner(ks KeyStore, w model.Wallet) (signer.EVMSigner, error)

EVMSigner loads a wallet's key and returns an EVMSigner for Ethereum/FEVM transaction signing. Returns an error if the key type is BLS.

func Signer

func Signer(ks KeyStore, w model.Wallet) (signer.Signer, error)

Signer loads a wallet's private key from the keystore and returns a go-synapse Signer. For secp256k1 keys the result also satisfies signer.EVMSigner (check with signer.AsEVM).

Types

type KeyInfo

type KeyInfo struct {
	Address address.Address
	Name    string // relative identifier within the keystore
}

type KeyStore

type KeyStore interface {
	Put(privateKey string) (name string, addr address.Address, err error)
	Get(name string) (privateKey string, err error)
	List() ([]KeyInfo, error)
	Delete(name string) error
	Has(name string) bool
}

KeyStore stores keys by a short name (typically the filecoin address). The name is a relative identifier -- implementations resolve it against their own storage root. Callers must pass back the name returned by Put.

type LocalKeyStore

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

filesystem keystore implementation

func NewLocalKeyStore

func NewLocalKeyStore(dir string) (*LocalKeyStore, error)

func (*LocalKeyStore) Delete

func (ks *LocalKeyStore) Delete(name string) error

func (*LocalKeyStore) Get

func (ks *LocalKeyStore) Get(name string) (string, error)

func (*LocalKeyStore) Has

func (ks *LocalKeyStore) Has(name string) bool

func (*LocalKeyStore) List

func (ks *LocalKeyStore) List() ([]KeyInfo, error)

func (*LocalKeyStore) Put

func (ks *LocalKeyStore) Put(privateKey string) (string, address.Address, error)

lotus wallet export format expected (hex-encoded JSON with Type and PrivateKey)

Jump to

Keyboard shortcuts

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