Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

mpt source pure

Variables 1

var ErrInvalidRoot, ErrMissingNode, ErrUnexpectedNode, ErrInvalidReference, ErrValueMismatch, ErrKeyPresent, ErrKeyAbsent

1var (
2	ErrInvalidRoot      = errors.New("mpt: invalid root length")
3	ErrMissingNode      = errors.New("mpt: proof node missing")
4	ErrUnexpectedNode   = errors.New("mpt: unexpected node shape")
5	ErrInvalidReference = errors.New("mpt: invalid child reference")
6	ErrValueMismatch    = errors.New("mpt: value mismatch")
7	ErrKeyPresent       = errors.New("mpt: key present")
8	ErrKeyAbsent        = errors.New("mpt: key absent")
9)
source

Functions 3

func EmptyRoot

1func EmptyRoot() [32]byte
source

EmptyRoot is keccak256(rlp("")), the root of an empty Ethereum MPT.

func Verify

1func Verify(root []byte, key []byte, value []byte, proof [][]byte) error
source

Verify verifies an Ethereum Merkle Patricia Trie existence proof. Thin wrapper around verifyProof: go-ethereum has no combined verify+compare function of its own (callers compare inline at each VerifyProof call site).

func VerifyAbsence

1func VerifyAbsence(root []byte, key []byte, proof [][]byte) error
source

VerifyAbsence verifies that key is absent from the trie under root. Thin wrapper around verifyProof (see Verify).

Imports 6

Source Files 5