ethereumjs-monorepo

@ethereumjs/mpt


@ethereumjs/mpt / verifyMPTWithMerkleProof

Function: verifyMPTWithMerkleProof()

verifyMPTWithMerkleProof(trie, rootHash, key, proof): Promise<Uint8Array<ArrayBufferLike> | null>

Defined in: proof/proof.ts:95

Verify a proof by loading nodes into a scratch trie and reading the key.

Parameters

trie

MerklePatriciaTrie

Reference trie (supplies key-hashing options)

rootHash

Uint8Array

Expected root hash of the proven trie

key

Uint8Array

Key whose value is being verified

proof

Proof

EIP-1186 proof nodes

Returns

Promise<Uint8Array<ArrayBufferLike> | null>

Proven value, or null for a valid non-existence proof

Throws

If the proof is invalid