proof

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const ShareInclusionQueryPath = "shareInclusionProof"
View Source
const TxInclusionQueryPath = "txInclusionProof"

Variables

This section is empty.

Functions

func CreateShareToRowRootProofs added in v1.14.0

func CreateShareToRowRootProofs(squareSize int, rowShares [][]shares.Share, rowRoots [][]byte, startLeaf, endLeaf int) ([]*coretypes.NMTProof, [][]byte, error)

CreateShareToRowRootProofs takes a set of shares and their corresponding row roots, and generates an NMT inclusion proof of a set of shares, defined by startLeaf and endLeaf, to their corresponding row roots.

func NewShareInclusionProof

func NewShareInclusionProof(
	dataSquare square.Square,
	namespace appns.Namespace,
	shareRange shares.Range,
) (types.ShareProof, error)

NewShareInclusionProof takes an ODS, extends it, then returns an NMT inclusion proof for a set of shares belonging to the same namespace to the data root. Expects the share range to be pre-validated.

func NewShareInclusionProofFromEDS added in v1.10.0

func NewShareInclusionProofFromEDS(
	eds *rsmt2d.ExtendedDataSquare,
	namespace appns.Namespace,
	shareRange shares.Range,
) (types.ShareProof, error)

NewShareInclusionProofFromEDS takes an extended data square, and returns an NMT inclusion proof for a set of shares belonging to the same namespace to the data root. Expects the share range to be pre-validated.

func NewTxInclusionProof

func NewTxInclusionProof(txs [][]byte, txIndex, appVersion uint64) (types.ShareProof, error)

NewTxInclusionProof returns a new share inclusion proof for the given transaction index.

func ParseNamespace added in v1.0.0

func ParseNamespace(rawShares []shares.Share, startShare, endShare int) (appns.Namespace, error)

ParseNamespace validates the share range, checks if it only contains one namespace and returns that namespace ID. The provided range, defined by startShare and endShare, is end-exclusive.

func QueryShareInclusionProof

func QueryShareInclusionProof(_ sdk.Context, path []string, req abci.RequestQuery) ([]byte, error)

QueryShareInclusionProof defines the logic performed when querying for the inclusion proofs of a set of shares to the data root. The share range should be appended to the path. Example path for proving the set of shares [3, 5]: custom/shareInclusionProof/3/5

func QueryTxInclusionProof

func QueryTxInclusionProof(_ sdk.Context, path []string, req abci.RequestQuery) ([]byte, error)

Querier defines the logic performed when the ABCI client using the Query method with the custom prove.QueryPath. The index of the transaction being proved must be appended to the path. The marshalled bytes of the transaction proof (tmproto.ShareProof) are returned.

example path for proving the third transaction in that block: custom/txInclusionProof/3

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL