Documentation ¶
Index ¶
- func BTCAddrBytesFromPubKeyBytes(pubKeyBytes []byte) (addrBytes []byte, checksum []byte)
- func BTCAddrFromPubKeyBytes(pubKeyBytes []byte) string
- func CalcHash(data []byte, hasher hash.Hash) []byte
- func CalcHash160(data []byte) []byte
- func CalcHash256(data []byte) []byte
- func CalcSha512(data []byte) []byte
- func ComputeBTCAddress(pubKeyHex string, chainCodeHex string, path string, index int32) string
- func ComputeBTCAddressForPrivKey(privKey string) string
- func ComputeBTCTxId(rawTxHex string) string
- func ComputeMastersFromSeed(seed string) (string, string, string)
- func ComputePrivateKey(mprivHex string, chainHex string, path string, index int32) string
- func ComputeWIF(privKey string, compress bool) string
- func DerivePrivateKey(privKeyBytes []byte, chainCode []byte, index uint32, prime bool) ([]byte, []byte)
- func DerivePrivateKeyForPath(privKeyBytes []byte, chainCode []byte, path string) []byte
- func DerivePublicKey(pubKeyBytes []byte, chainCode []byte, index uint32) ([]byte, []byte)
- func DerivePublicKeyForPath(pubKeyBytes []byte, chainCode []byte, path string) []byte
- func HexDecode(str string) []byte
- func HexEncode(b []byte) string
- func I64(key []byte, data []byte) ([]byte, []byte)
- func PubKeyBytesFromPrivKeyBytes(privKeyBytes []byte, compress bool) (pubKeyBytes []byte)
- func ReverseBytes(buf []byte) []byte
- func SignBTCMessage(privKey string, message string, compress bool) string
- func WIFFromPrivKeyBytes(privKeyBytes []byte, compress bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BTCAddrBytesFromPubKeyBytes ¶
BTCAddrBytesFromPubKeyBytes returns a hex Bitcoin mainnet address and its checksum.
func BTCAddrFromPubKeyBytes ¶
BTCAddrFromPubKeyBytes returns a B58 encoded Bitcoin mainnet address.
func CalcHash160 ¶
CalcHash160 returns the ripemd160(sha256(data)).
func CalcHash256 ¶
CalcHash256 returns the sha256(sha256(data)).
func ComputeBTCAddress ¶
ComputeBTCAddress returns the BTC address using the pubKeyHex and chainCodeHex for the given path and index.
func ComputeBTCAddressForPrivKey ¶
ComputeBTCAddressForPrivKey returns the Bitcoin address for the given privKey.
func ComputeBTCTxId ¶
ComputeBTCTxId returns the bitcoin transaction ID.
func ComputeMastersFromSeed ¶
ComputeMastersFromSeed returns the master public key, master secret, and chain code in hex.
func ComputePrivateKey ¶
ComputePrivateKey returns the private key using the master mprivHex and chainCodeHex for the given path and index.
func ComputeWIF ¶
ComputeWIF returns the privKey in Wallet Import Format.
func DerivePrivateKey ¶
func DerivePrivateKey(privKeyBytes []byte, chainCode []byte, index uint32, prime bool) ([]byte, []byte)
DerivePrivateKey derives the private key with index and chainCode. If prime is true, the derivation is 'hardened'. It returns the new private key and new chain code.
func DerivePrivateKeyForPath ¶
DerivePrivateKeyForPath derives the private key by following the path from privKeyBytes, using the given chainCode.
func DerivePublicKey ¶
DerivePublicKey derives the public key with index and chainCode. It returns the new public key and new chain code.
func DerivePublicKeyForPath ¶
DerivePublicKeyForPath derives the public key by following the path from pubKeyBytes using the given chainCode.
func HexDecode ¶
HexDecode hex decodes the str. If str is not valid hex it will return an empty byte slice.
func PubKeyBytesFromPrivKeyBytes ¶
PubKeyBytesFromPrivKeyBytes returns the optionally compressed public key bytes.
func ReverseBytes ¶
ReverseBytes returns the buf in the opposite order
func SignBTCMessage ¶
SignBTCMessage signs a "Bitcoin Signed Message".
func WIFFromPrivKeyBytes ¶
WIFFromPrivKeyBytes returns the privKeyBytes in Wallet Import Format.
Types ¶
This section is empty.