Documentation
¶
Overview ¶
Package bitcoin provides BIP 37 partial merkle tree verification and thin wrappers around btcsuite/btcd for transaction and txoutproof parsing.
Index ¶
- func ComputeTxID(rawTxHex string) (string, error)
- func DecodeTransaction(rawTxHex string) (*wire.MsgTx, error)
- func DecodeTxOutProof(txoutproofHex string) (*wire.MsgMerkleBlock, error)
- func ExtractOpReturn(rawTxHex string) (string, error)
- func ParseBlockHash(txoutproofHex string) (string, error)
- type MerkleResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeTxID ¶
ComputeTxID computes the txid from raw transaction hex (display order, handles segwit).
func DecodeTransaction ¶
DecodeTransaction decodes raw transaction hex into a wire.MsgTx.
func DecodeTxOutProof ¶
func DecodeTxOutProof(txoutproofHex string) (*wire.MsgMerkleBlock, error)
DecodeTxOutProof decodes a txoutproof hex string into a wire.MsgMerkleBlock.
func ExtractOpReturn ¶
ExtractOpReturn parses a raw transaction and returns the OP_RETURN data as hex.
func ParseBlockHash ¶
ParseBlockHash decodes a txoutproof hex string and returns the block hash (display order).
Types ¶
type MerkleResult ¶
MerkleResult holds the result of a partial merkle tree verification.
func VerifyPartialMerkleTree ¶
func VerifyPartialMerkleTree( hashes []*chainhash.Hash, flagBytes []byte, totalTxs uint32, expectedRoot *chainhash.Hash, ) MerkleResult
VerifyPartialMerkleTree verifies a Bitcoin BIP 37 partial merkle tree. Takes the hashes and raw flag bytes from wire.MsgMerkleBlock directly.