@tevm/voltaire / primitives/StateProof
primitives/StateProof
Type Aliases
StateProofLike
StateProofLike =Defined in: src/primitives/StateProof/StateProofType.ts:73 Inputs that can be converted to StateProofStateProofType| {accountProof: readonlyUint8Array[];address:AddressType;balance:WeiType;codeHash:HashType;nonce:NonceType;storageHash:StateRootType;storageProof: readonlyStorageProofType[]; }
StateProofType
StateProofType = object
Defined in: src/primitives/StateProof/StateProofType.ts:28
StateProof represents an EIP-1186 account proof with storage proofs.
EIP-1186 defines a standard for providing Merkle proofs of account state and
storage values. This enables light clients and trustless systems to verify
account data without executing transactions or trusting external providers.
The proof structure includes:
- Account proof: RLP-encoded Merkle Patricia Trie nodes from state root to account
- Account fields: nonce, balance, codeHash, storageHash from the proven block
- Storage proofs: Optional array of proofs for specific storage slots
- Verify account proof against known state root
- Reconstruct account state from proof
- Verify each storage proof against account’s storage root
See
- EIP-1186: https://eips.ethereum.org/EIPS/eip-1186
- JSON-RPC eth_getProof method
Properties
accountProof
Defined in: src/primitives/StateProof/StateProofType.ts:39 Array of RLP-encoded Merkle Patricia Trie nodes. Forms the path from the state root to this account’s leaf node. Nodes are ordered from root to leaf.readonlyaccountProof: readonlyUint8Array[]
address
Defined in: src/primitives/StateProof/StateProofType.ts:32 The address of the account being proven.readonlyaddress:AddressType
balance
Defined in: src/primitives/StateProof/StateProofType.ts:44 Account balance in Wei at the proven block.readonlybalance:WeiType
codeHash
Defined in: src/primitives/StateProof/StateProofType.ts:50 Keccak256 hash of the account’s bytecode. For EOAs, this is the empty code hash.readonlycodeHash:HashType
nonce
Defined in: src/primitives/StateProof/StateProofType.ts:55 Transaction count (EOA) or contract creation count.readonlynonce:NonceType
storageHash
Defined in: src/primitives/StateProof/StateProofType.ts:61 Root hash of the account’s storage trie. Storage proofs must verify against this root.readonlystorageHash:StateRootType
storageProof
Defined in: src/primitives/StateProof/StateProofType.ts:67 Array of proofs for specific storage slots. Each proof demonstrates a key-value pair in the account’s storage.readonlystorageProof: readonlyStorageProofType[]
Functions
equals()
equals(Defined in: src/primitives/StateProof/equals.js:26 Compares two StateProofs for equality. All fields must match including all storage proofs.a,b):boolean
Parameters
a
StateProofType
First StateProof
b
StateProofType
Second StateProof
Returns
boolean
- True if equal
Example
from()
from(Defined in: src/primitives/StateProof/from.js:28 Creates a StateProof from an object with all required fields.proof):StateProofType
Parameters
proof
StateProofLike
Object containing all StateProof fields
Returns
StateProofType
- A validated StateProof

