package
0.0.0-20210331065242-323b27c6239d
Repository: https://github.com/classzz/czzutil.git
Documentation: pkg.go.dev

# README

merkleblock

Build Status ISC License GoDoc

Package merkleblock provides an API for creating and validating SPV proofs. An SPV proof is a cryptographic proof that a given transaction is contained in the block. Instead of the prover providing the full block he can provide the much smaller SPV proof.

Installation and Updating

$ go get -u github.com/gcash/bchutil/merkleblock

License

Package merkleblock is licensed under the copyfree ISC License.

# Functions

NewMerkleBlockFromMsg returns a MerkleBlock from parsing a wire.MsgMerkleBlock which can be used for extracting transaction matches from for verification on a partial merkle tree.
NewMerkleBlockWithFilter returns a new *wire.MsgMerkleBlock and an array of the matched transaction index numbers based on the passed block and bloom filter.
NewMerkleBlockWithTxnSet returns a new *wire.MsgMerkleBlock containing a partial merkle tree built using the list of transactions provided.
TxInSet checks if a given transaction is included in the given list of transactions.

# Variables

MaxTxnCount defines the maximum number of transactions we will process before aborting merkle tree traversal operations.

# Structs

MerkleBlock is used to house intermediate information needed to generate a wire.MsgMerkleBlock.
PartialBlock is used to house intermediate information needed to decode a wire.MsgMerkleBlock.