> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# primitives/StateProof

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / primitives/StateProof

# primitives/StateProof

## Type Aliases

### StateProofLike

> **StateProofLike** = [`StateProofType`](#stateprooftype) | \{ `accountProof`: readonly `Uint8Array`\[]; `address`: [`AddressType`](Address.mdx#addresstype); `balance`: [`WeiType`](../index/namespaces/BrandedWei.mdx#weitype); `codeHash`: [`HashType`](../index/namespaces/HashType.mdx#hashtype); `nonce`: [`NonceType`](Nonce.mdx#noncetype); `storageHash`: [`StateRootType`](StateRoot.mdx#stateroottype); `storageProof`: readonly [`StorageProofType`](StorageProof.mdx#storageprooftype)\[]; }

Defined in: [src/primitives/StateProof/StateProofType.ts:73](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L73)

Inputs that can be converted to StateProof

***

### StateProofType

> **StateProofType** = `object`

Defined in: [src/primitives/StateProof/StateProofType.ts:28](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L28)

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

Verification process:

1. Verify account proof against known state root
2. Reconstruct account state from proof
3. Verify each storage proof against account's storage root

#### See

* EIP-1186: [https://eips.ethereum.org/EIPS/eip-1186](https://eips.ethereum.org/EIPS/eip-1186)
* JSON-RPC eth\_getProof method

#### Properties

##### accountProof

> `readonly` **accountProof**: readonly `Uint8Array`\[]

Defined in: [src/primitives/StateProof/StateProofType.ts:39](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L39)

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.

##### address

> `readonly` **address**: [`AddressType`](Address.mdx#addresstype)

Defined in: [src/primitives/StateProof/StateProofType.ts:32](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L32)

The address of the account being proven.

##### balance

> `readonly` **balance**: [`WeiType`](../index/namespaces/BrandedWei.mdx#weitype)

Defined in: [src/primitives/StateProof/StateProofType.ts:44](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L44)

Account balance in Wei at the proven block.

##### codeHash

> `readonly` **codeHash**: [`HashType`](../index/namespaces/HashType.mdx#hashtype)

Defined in: [src/primitives/StateProof/StateProofType.ts:50](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L50)

Keccak256 hash of the account's bytecode.
For EOAs, this is the empty code hash.

##### nonce

> `readonly` **nonce**: [`NonceType`](Nonce.mdx#noncetype)

Defined in: [src/primitives/StateProof/StateProofType.ts:55](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L55)

Transaction count (EOA) or contract creation count.

##### storageHash

> `readonly` **storageHash**: [`StateRootType`](StateRoot.mdx#stateroottype)

Defined in: [src/primitives/StateProof/StateProofType.ts:61](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L61)

Root hash of the account's storage trie.
Storage proofs must verify against this root.

##### storageProof

> `readonly` **storageProof**: readonly [`StorageProofType`](StorageProof.mdx#storageprooftype)\[]

Defined in: [src/primitives/StateProof/StateProofType.ts:67](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/StateProofType.ts#L67)

Array of proofs for specific storage slots.
Each proof demonstrates a key-value pair in the account's storage.

## Functions

### equals()

> **equals**(`a`, `b`): `boolean`

Defined in: [src/primitives/StateProof/equals.js:26](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/equals.js#L26)

Compares two StateProofs for equality.
All fields must match including all storage proofs.

#### Parameters

##### a

[`StateProofType`](#stateprooftype)

First StateProof

##### b

[`StateProofType`](#stateprooftype)

Second StateProof

#### Returns

`boolean`

* True if equal

#### Example

```typescript theme={null}
const isEqual = StateProof.equals(proof1, proof2);
```

***

### from()

> **from**(`proof`): [`StateProofType`](#stateprooftype)

Defined in: [src/primitives/StateProof/from.js:28](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StateProof/from.js#L28)

Creates a StateProof from an object with all required fields.

#### Parameters

##### proof

[`StateProofLike`](#stateprooflike)

Object containing all StateProof fields

#### Returns

[`StateProofType`](#stateprooftype)

* A validated StateProof

#### Example

```typescript theme={null}
const proof = StateProof.from({
  address: Address.from("0x..."),
  accountProof: [node1, node2, node3],
  balance: Wei.from(1000000000000000000n),
  codeHash: Hash.from("0x..."),
  nonce: Nonce.from(5n),
  storageHash: StateRoot.from("0x..."),
  storageProof: [storageProof1, storageProof2],
});
```
