verified-state

Verifies Ethereum balances, nonces, code, and storage via beacon chain light client Merkle proofs.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill verified-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: verified-state
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/verified-state
Command: npx skills add https://github.com/Nethereum/Nethereum --skill verified-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Applications that query Ethereum state through an RPC provider must trust that provider to return honest data. This Skill removes that trust assumption by cryptographically verifying balances, nonces, contract code, and storage values against a beacon chain state root using Merkle proofs from eth_getProof.

Core Features & Use Cases

  • Transparent RPC Verification: The UseVerifiedState interceptor automatically verifies eth_getBalance, eth_getTransactionCount, eth_getCode, and eth_blockNumber on any Web3 client.
  • Direct Verified Queries: Call VerifiedStateService methods to fetch verified balances, nonces, contract bytecode, and individual storage slots.
  • Finalized vs Optimistic Modes: Choose finalized mode for fund transfers or optimistic mode for low-latency UI dashboards.
  • Verified EVM Execution: Combine with the EVM simulator to run contract calls like ERC-20 balanceOf against individually verified storage slots.
  • Use Case: A self-custodial wallet displays a user's ETH balance with cryptographic proof of correctness, eliminating reliance on a third-party RPC node.

Quick Start

Set up a Nethereum light client with a beacon chain API endpoint and use UseVerifiedState on my Web3 instance so every balance query is verified by Merkle proof.

Frequently Asked Questions about verified-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify Ethereum balances without trusting my RPC provider?

Use Nethereum's VerifiedStateService with a beacon chain light client to validate eth_getProof Merkle proofs against a trusted state root. Calling web3.UseVerifiedState(verifiedStateService) makes every balance, nonce, and code query cryptographically verified.

What is the difference between finalized and optimistic verification mode?

Finalized mode verifies against economically final beacon chain checkpoints but lags 12-15 minutes behind the chain head. Optimistic mode verifies against attestation-based headers within seconds of the head but is theoretically revertible during reorganizations.

Does verified state querying require an archive node?

An archive node is recommended for finalized mode because standard nodes prune state beyond roughly 128 blocks, and finalized blocks sit near that pruning boundary. Optimistic mode works with regular full nodes.

Why does verified state fail with missing trie node errors?

This error means the RPC node has pruned the state for the requested block, so the Merkle proof cannot be generated. Switch to optimistic mode, use an archive node, or enable FallbackOnError to degrade to unverified responses.

Can I verify ERC-20 token balances with light client proofs?

Yes, by combining VerifiedNodeDataService with the Nethereum EVM simulator. The simulator executes the balanceOf bytecode locally while every storage read during execution is individually verified via Merkle proofs.