Documentation
¶
Overview ¶
提供一些通用的解析函数
Index ¶
- func AddressToPkScript(addr string) ([]byte, error)
- func AddressToType(addr string) (types.AddressType, error)
- func DecodeAddress(addr string) (*types.AddressScriptInfo, error)
- func DecodeAsmScript(pkScript []byte) (ops []types.ScriptOp, asm string, err error)
- func DecodePkScript(pkScript []byte) (*types.AddressInfo, error)
- func DecodeRawTx(raw []byte) (*types.Tx, error)
- func DecodeRawTxString(rawHex string) (*types.Tx, error)
- func ExtractTapScriptPath(w [][]byte) (stack [][]byte, script []byte, control []byte, ok bool)
- func IsTapScriptPathWitness(w [][]byte) bool
- func PKScriptToType(pkScript []byte) (types.AddressType, error)
- func ParseControlBlock(cb []byte) (types.TapControlBlock, error)
- func TapLeafHash(leafVersion byte, script []byte) [32]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressToPkScript ¶
通过btcd库, 解析钱包地址, 获取钱包地址对应的锁定脚本.
func AddressToType ¶ added in v0.1.0
func AddressToType(addr string) (types.AddressType, error)
通过btcd库, 解析钱包地址, 获取钱包地址对应类型.
func DecodeAddress ¶
func DecodeAddress(addr string) (*types.AddressScriptInfo, error)
通过btcd库, 解析钱包地址, 获取钱包地址对应的类型, 锁定脚本, 脚本哈希等信息.
func DecodeAsmScript ¶
反汇编脚本
func DecodePkScript ¶
func DecodePkScript(pkScript []byte) (*types.AddressInfo, error)
func ExtractTapScriptPath ¶
ExtractTapScriptPath: 返回(栈元素, 脚本, 控制块)
func IsTapScriptPathWitness ¶
严格:必须能成功解析 control block(长度规则 + 头字节 leaf version 合法)
func PKScriptToType ¶
func PKScriptToType(pkScript []byte) (types.AddressType, error)
func ParseControlBlock ¶
func ParseControlBlock(cb []byte) (types.TapControlBlock, error)
func TapLeafHash ¶
TapLeafHash computes the tagged hash for a tapscript leaf per BIP-342. H_TapLeaf(leafVer || varint(len(script)) || script)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.