keys

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: LGPL-3.0 Imports: 14 Imported by: 12

Documentation

Overview

Package keys provides key management utilities for TRON accounts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewKey

func AddNewKey(password string)

AddNewKey creates a new account in the default keystore directory.

func FromMnemonicSeedAndPassphrase

func FromMnemonicSeedAndPassphrase(mnemonic, passphrase string, index int) (*btcec.PrivateKey, *btcec.PublicKey)

FromMnemonicSeedAndPassphrase derives a key pair from a BIP39 mnemonic and passphrase at the given TRON HD path index (44'/195'/0'/0/{index}).

func GenerateKey added in v0.24.1

func GenerateKey() (*btcec.PrivateKey, error)

GenerateKey generates a new random secp256k1 private key.

func GetPrivateKeyFromBytes added in v0.24.1

func GetPrivateKeyFromBytes(privateKeyBytes []byte) (*btcec.PrivateKey, error)

GetPrivateKeyFromBytes creates a private key from raw 32-byte key material.

func GetPrivateKeyFromHex added in v0.24.1

func GetPrivateKeyFromHex(privateKeyHex string) (*btcec.PrivateKey, error)

GetPrivateKeyFromHex parses a hex-encoded private key string.

func ListKeys

func ListKeys(keystoreDir string)

ListKeys prints all accounts in the keystore directory to stdout.

Types

type Dump

type Dump struct {
	PrivateKey, PublicKeyCompressed, PublicKey string
}

Dump holds hex-encoded representations of a key pair.

func EncodeHex

func EncodeHex(sk *btcec.PrivateKey, pk *btcec.PublicKey) *Dump

EncodeHex serializes a private/public key pair into hex-encoded strings.

Directories

Path Synopsis
Package hd provides basic functionality Hierarchical Deterministic Wallets.
Package hd provides basic functionality Hierarchical Deterministic Wallets.

Jump to

Keyboard shortcuts

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