proof

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMemtreeSize = 256 << 20
View Source
const NODE_SIZE = 32

Variables

This section is empty.

Functions

func BuildSha254Memtree

func BuildSha254Memtree(rawIn io.Reader, size abi.UnpaddedPieceSize) ([]byte, error)

BuildSha254Memtree builds a sha256 memtree from the input data Returned slice should be released to the pool after use

func ComputeBinShaParent

func ComputeBinShaParent(left, right [NODE_SIZE]byte) [NODE_SIZE]byte

func NodeLevel

func NodeLevel(leaves, arity int64) int

Types

type RawMerkleProof

type RawMerkleProof struct {
	Leaf  [32]byte
	Proof [][32]byte
	Root  [32]byte
}

func MemtreeProof

func MemtreeProof(memtree []byte, leafIndex int64) (*RawMerkleProof, error)

MemtreeProof generates a Merkle proof for the given leaf index from the memtree. The memtree is a byte slice containing all the nodes of the Merkle tree, including leaves and internal nodes.

Jump to

Keyboard shortcuts

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