Skip to content
Last updated

JSON-RPC over HTTP

Send standard JSON-RPC 2.0 requests to blockchain nodes through a single HTTPS endpoint.

Request format

POST https://rpc.vilna.io/{chain}

Where {chain} is either a CAIP-2 chain ID or a network alias (see supported networks).

ParameterValue
Content-Typeapplication/json
AuthenticationX-Api-Key header
Max request body1 MB
Timeout30 seconds

Examples

Ethereum (EVM)

curl -X POST https://rpc.vilna.io/ethereum \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

All EVM-compatible chains (Ethereum, BSC, Polygon, Avalanche, Arbitrum, Optimism, Base, etc.) support the same set of Ethereum JSON-RPC methods.

Solana

curl -X POST https://rpc.vilna.io/solana \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "getBalance",
    "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"],
    "id": 1
  }'

Solana supports its native JSON-RPC API methods.

Bitcoin

curl -X POST https://rpc.vilna.io/bitcoin \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "getblockcount",
    "params": [],
    "id": 1
  }'

Bitcoin supports standard Bitcoin Core JSON-RPC methods.

Error handling

System errors

Returned by Vilna RPC when the request cannot reach the blockchain node:

{"error": "description of the problem"}
SituationHTTP status
Missing API key401
Invalid API key401
Network not found404
Protocol mismatch400
Network unavailable502

For common API errors and troubleshooting, see the Errors guide.

Blockchain node errors

If the request reaches the node but the node returns an error, you receive the node's native JSON-RPC error format:

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32601,
    "message": "Method not found"
  },
  "id": 1
}

These errors come directly from the blockchain node and follow the JSON-RPC 2.0 error specification.

Next steps