Ethereum JSON-RPC Skill

Use this skill to run Ethereum execution JSON-RPC operations through uxc + JSON-RPC.

Reuse the uxc skill for shared execution, auth, and error-handling guidance.

Prerequisites

Scope

This skill covers a safe read-first Ethereum execution surface:

This skill does not cover:

Endpoint And Schema

This skill defaults to a public read provider:

The operation surface comes from the official Ethereum execution OpenRPC schema:

uxc JSON-RPC discovery normally depends on OpenRPC or rpc.discover. Ethereum RPC providers often do not expose discovery directly, so this skill uses a fixed --schema-url link and request flow.

The official execution OpenRPC document is strong enough for normal request/response methods, but it does not currently expose pubsub methods such as eth_subscribe. Use the schema-backed link for reads, and use uxc subscribe start directly for subscriptions.

For subscriptions, use a WebSocket Ethereum RPC provider that you have verified actually accepts eth_subscribe. Do not assume a public HTTPS host automatically guarantees the same wss:// host is stable for pubsub.

Authentication

The default public read provider used by this skill does not require authentication.

If a user later points the same workflow at a private Ethereum RPC provider, verify its auth model first before reusing this skill unchanged.

Core Workflow

  1. Use the fixed link command by default:

    • command -v ethereum-jsonrpc-cli
    • If missing, create it: uxc link ethereum-jsonrpc-cli https://ethereum-rpc.publicnode.com --schema-url https://raw.githubusercontent.com/ethereum/execution-apis/assembled-spec/refs-openrpc.json
    • ethereum-jsonrpc-cli -h
  2. Inspect operation schema first:

    • ethereum-jsonrpc-cli eth_blockNumber -h
    • ethereum-jsonrpc-cli eth_getBlockByNumber -h
    • ethereum-jsonrpc-cli eth_getBalance -h
  3. Prefer chain and balance/block reads before deeper state queries:

    • ethereum-jsonrpc-cli eth_chainId
    • ethereum-jsonrpc-cli eth_blockNumber
    • ethereum-jsonrpc-cli eth_getBalance Address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Block=latest
  4. Execute with key/value or positional JSON:

    • key/value: ethereum-jsonrpc-cli eth_getBalance Address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Block=latest
    • positional JSON: ethereum-jsonrpc-cli eth_getBlockByNumber '["latest", false]'
    • nested positional JSON: ethereum-jsonrpc-cli eth_call '[{"to":"0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","data":"0x313ce567"},"latest"]'
  5. Use uxc subscribe start directly for pubsub streams:

    • uxc subscribe start wss://<verified-ethereum-rpc-host> eth_subscribe '{"params":["newHeads"]}' --sink file:$HOME/.uxc/subscriptions/eth-new-heads.ndjson
    • uxc subscribe start wss://<verified-ethereum-rpc-host> eth_subscribe '{"params":["logs",{"address":"0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}]}' --sink file:$HOME/.uxc/subscriptions/eth-logs.ndjson
    • uxc subscribe status <job_id>
    • uxc subscribe stop <job_id>

Recommended Read Operations

Recommended Subscription Operations

Subscription params[0] modes that are usually most useful:

Guardrails

References