Ethereum Protocol

The Ethereum protocol exposes an EIP-1193 provider over a WalletPair encrypted channel. Frames use the canonical eip155:<decimal chain ID> suffix; the EIP-155 value in that suffix selects the request chain context and is authenticated by AEAD.

Envelope shapes

The encrypted plaintext is a JSON value encoded with the MessagePack profile. It is not a JSON-RPC 2.0 response object and has no jsonrpc field.

// Request (dApp → Wallet)
{ "id": "req-1", "method": "eth_getBalance", "params": ["0x…", "latest"] }

// Response (Wallet → dApp)
{ "id": "req-1", "result": "0x0" }

// Event (Wallet → dApp)
{ "event": "chainChanged", "data": "0x1" }

An ID is a unique printable ASCII string of 1–128 bytes among outstanding requests. A response reuses the exact ID and has exactly one of result or error. The receiver rejects values that match more than one envelope shape.

Required methods

AreaMethods
Accounts and chaineth_requestAccounts, eth_accounts, eth_chainId, net_version
Permissions and networkwallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions
Signing and sendingeth_sendTransaction, personal_sign, eth_signTypedData and v1/v3/v4, wallet_sendCalls, wallet_getCallsStatus

EIP-5792 support also requires wallet_getCapabilities. Wallets may serve the listed read-only RPC methods locally or through a trusted endpoint, but must never blindly forward unknown methods or infer safety from an eth_ prefix.

Events

EventData
connect{ chainId: "0x1" }
disconnectAn EIP-1193 ProviderRpcError
chainChangedNew canonical hexadecimal chain ID
accountsChangedThe complete eth_accounts array
message{ type: string, data: unknown }

Errors

CodeMeaning
4001User rejected the request.
4100Method or account is not authorized.
4200Method is not supported.
4900 / 4901Provider or requested chain is disconnected.
-32600 / -32602 / -32603Malformed request, invalid parameters, or internal failure.

Wallet security requirements

  • Authorize accounts per paired dApp origin; do not expose accounts before approval.
  • Validate actual decoded account, chain, value, target, calldata, and typed-data domain before signing.
  • Reject a signing address that is not currently authorized and warn on EIP-712 domain-chain conflicts.
  • Validate chain metadata and RPC URLs independently; they are untrusted dApp input.
  • Return a -32005 limit error when a valid response exceeds the 64 KiB plaintext bound.