wallet

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicKey

func PublicKey(lotusExportedPK string) (address.Address, error)

func WalletSign

func WalletSign(exportedPK string, msg []byte) (*crypto.Signature, error)

WalletSign allows to sign a message using an exported private key. The exported private key is a hex-encoded string of a sepc256k1 or BLS private key as exported by a Filecoin client (e.g: `lotus wallet export`). It automatically detects the key type and signs appropiately.

func WalletVerify added in v0.3.0

func WalletVerify(publicKey address.Address, msg []byte, sig []byte) (bool, error)

Types

type KeyInfo added in v0.4.0

type KeyInfo struct {
	Type       KeyType
	PrivateKey []byte
}

KeyInfo is used for storing keys in KeyStore

type KeyType added in v0.4.0

type KeyType string
const (
	KTBLS             KeyType = "bls"
	KTSecp256k1       KeyType = "secp256k1"
	KTSecp256k1Ledger KeyType = "secp256k1-ledger"
)

Jump to

Keyboard shortcuts

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