hd

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BIP32 chainpath prefix
	CHAINPATH_PREFIX_DEPOSIT   = 0
	CHAINPATH_PREFIX_CHANGE    = 1
	CHAINPATH_PREFIX_SWEEP     = 2
	CHAINPATH_PREFIX_SWEEP_DRY = 102
)

Variables

This section is empty.

Functions

func AddrFromPubKeyBytes

func AddrFromPubKeyBytes(coin string, pubKeyBytes []byte) string

func CalcHash

func CalcHash(buf []byte, hasher hash.Hash) []byte

Calculate the hash of hasher over buf.

func CalcHash160

func CalcHash160(buf []byte) []byte

calculate hash160 which is ripemd160(sha256(data))

func CalcHash256

func CalcHash256(buf []byte) []byte

calculate hash256 which is sha256(sha256(data))

func CalcSha512

func CalcSha512(buf []byte) []byte

calculate sha512(data)

func ComputeAddress

func ComputeAddress(coin string, pubKeyHex string, chainHex string, path string, index int32) string

func ComputeAddressForPrivKey

func ComputeAddressForPrivKey(coin string, privKey string) string

func ComputeMastersFromSeed

func ComputeMastersFromSeed(seed string) (string, string, string, string)

returns MPK, Chain, and master secret in hex.

func ComputePrivateKey

func ComputePrivateKey(mprivHex string, chainHex string, path string, index int32) string

func ComputeTxId

func ComputeTxId(rawTxHex string) string

func ComputeWIF

func ComputeWIF(coin string, privKey string, compress bool) string

func DerivePrivateKey

func DerivePrivateKey(privKeyBytes []byte, chain []byte, i uint32, prime bool) ([]byte, []byte)

func DerivePrivateKeyForPath

func DerivePrivateKeyForPath(privKeyBytes []byte, chain []byte, path string) []byte

func DerivePublicKey

func DerivePublicKey(pubKeyBytes []byte, chain []byte, i uint32) ([]byte, []byte)

func DerivePublicKeyForPath

func DerivePublicKeyForPath(pubKeyBytes []byte, chain []byte, path string) []byte

func HexDecode

func HexDecode(str string) []byte

func HexEncode

func HexEncode(b []byte) string

func I64

func I64(key []byte, data []byte) ([]byte, []byte)

func PubKeyBytesFromPrivKeyBytes

func PubKeyBytesFromPrivKeyBytes(privKeyBytes []byte, compress bool) (pubKeyBytes []byte)

func ReverseBytes

func ReverseBytes(buf []byte) []byte

func SignMessage

func SignMessage(privKey string, message string, compress bool) string

func WIFFromPrivKeyBytes

func WIFFromPrivKeyBytes(coin string, privKeyBytes []byte, compress bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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