Documentation ¶
Overview ¶
Package btc provides utilities for BTC - Bitcoin.
Index ¶
- func CheckEncode(input []byte, version []byte) string
- func P2PKH(buf []byte, net *NetworkParams) (addr string, err error)
- func P2SH(buf []byte, net *NetworkParams) (addr string, err error)
- func P2WPKH(buf []byte, net *NetworkParams) (addr string, err error)
- func P2WPKHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)
- func P2WSH(buf []byte, net *NetworkParams) (addr string, err error)
- func P2WSHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)
- type NetworkParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEncode ¶
CheckEncode prepends version bytes and appends a four byte checksum.
func P2PKH ¶
func P2PKH(buf []byte, net *NetworkParams) (addr string, err error)
P2PKH pay to public key hash
func P2SH ¶
func P2SH(buf []byte, net *NetworkParams) (addr string, err error)
P2SH pay to script hash
func P2WPKH ¶
func P2WPKH(buf []byte, net *NetworkParams) (addr string, err error)
P2WPKH pay to witness public key hash
func P2WPKHInP2SH ¶
func P2WPKHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)
P2WPKHInP2SH pay to witness public key hash nested in pay to script hash
func P2WSH ¶
func P2WSH(buf []byte, net *NetworkParams) (addr string, err error)
P2WSH pay to witness script hash
func P2WSHInP2SH ¶
func P2WSHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)
P2WSHInP2SH pay to witness script hash nested in pay to script hash
Types ¶
type NetworkParams ¶
var MainNetParams NetworkParams
func NewNetworkParams ¶
func NewNetworkParams(raw *chaincfg.Params, pubKeyHashAddrID int64, scriptHashAddrID int64) (net NetworkParams)
func (*NetworkParams) GetRaw ¶
func (np *NetworkParams) GetRaw() *chaincfg.Params
Click to show internal directories.
Click to hide internal directories.