hdwallet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bip39GenMnemonic

func Bip39GenMnemonic(size int) (string, error)

func Bip39MnemonicToSeed

func Bip39MnemonicToSeed(mnemonic string, password string) ([]byte, error)

func DcrMnemonicToSeed

func DcrMnemonicToSeed(words []string) ([]byte, error)

DecodeMnemonics returns the decoded value that is encoded by words. Any words that are whitespace are empty are skipped.

func DcrMultiPubkeyToAddress

func DcrMultiPubkeyToAddress(netId [2]byte, nRequired int, keys [][]byte) (string, error)

func DcrPubkeyToAddress

func DcrPubkeyToAddress(key []byte, netId [2]byte) string

func DcrSeedToMnemonic

func DcrSeedToMnemonic(seed []byte) string

dcr 的助记词跟种子的转换可以互逆,没有遵守 bip39 规范

func ExtendKeyB58ToPubkey

func ExtendKeyB58ToPubkey(extendKeyB58Str string, children ...uint32) ([]byte, error)

return compressed ecc pubkey or children ecc pubkey compressed from an extended key(support public or private) base58-encoded

func MnemonicFromSeed

func MnemonicFromSeed(seedStr string) (string, error)

func MultiPubkeyToAddress

func MultiPubkeyToAddress(netId byte, nRequired int, keys ...[]byte) (string, error)

func PathFromMnemonic

func PathFromMnemonic(mnemonic string, pathStr string) (string, error)

func PathFromSeed

func PathFromSeed(seedStr string, pathStr string) (string, error)

func PubkeyToAddress

func PubkeyToAddress(key []byte, netId byte) string

func SeedToPubKey

func SeedToPubKey(seed []byte, purpose uint32, coinType uint32, account uint32, change uint32, index uint32) ([]byte, error)

return compressed pubkey

Types

type DcrNetWorkParams

type DcrNetWorkParams struct {
	HDPrivateKeyID [4]byte
	HDPublicKeyID  [4]byte
	HDCoinType     uint32

	PubKeyAddrID     [2]byte
	PubKeyHashAddrID [2]byte
	PKHEdwardsAddrID [2]byte
	PKHSchnorrAddrID [2]byte
	ScriptHashAddrID [2]byte
	PrivateKeyID     [2]byte
}

Jump to

Keyboard shortcuts

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