Skip to content
Sign inJoin the waitlist

RPC

JSON-RPC 2.0 over HTTPS, answered by a Robinhood Chain node that Blockhash runs.

Endpoint

Send JSON-RPC 2.0 as an HTTPS POST to the endpoint.

The chain is Robinhood Chain. Its chain ID is 4663.

A page in a browser may call the endpoint from any origin.

There is no WebSocket endpoint.

Endpoint
Chain ID
4663
Protocol
JSON-RPC 2.0, HTTPS POST
Batch
Up to 100 calls
Request body
Up to 1 MB

Sending the key

Put the key at the end of the path, or send it as a Bearer token to /v1.

Sent as a header, the key is not part of the URL.

A request with no key, or with a key that does not exist or was revoked, is answered 401.

A revoked key stops answering within 30 seconds.

RPC=https://api.blockhash.xyz/v1
KEY="<your key>"

curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
{"jsonrpc":"2.0","id":1,"result":"0x1237"}

Single calls and batches

A request is one call, or a list of calls that is answered as a list.

A batch holds up to 100 calls. A request body holds up to 1 MB.

A batch is answered 200, and each call in it has its own result or its own error.

The one exception: where calls of the batch went to the node or the index and none of them was answered, the status is 502, or 504 if one ran past its time.

A refusal of the whole request (the key, the size, the speed) is one error for all of it.

A batch costs the sum of its calls.

curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '[{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]},
      {"jsonrpc":"2.0","id":2,"method":"eth_gasPrice","params":[]}]'
[{"jsonrpc":"2.0","id":1,"result":"0x1237"},
 {"jsonrpc":"2.0","id":2,"result":"0x1319a60"}]

Namespaces

Every method of the node’s eth, net, web3 and arb namespaces is passed to the node unchanged, except subscriptions.

Each call costs a fixed number of compute units.

The Data API’s four calls are answered at the same endpoint.

What is not answered

The node keeps recent state only, and this endpoint has no WebSocket.

WhatThe answerWhat answers instead
debug_ and trace_ methods-32601: “The method debug_traceTransaction is not offered”ETH moved inside contracts is read with blockhash_getAssetTransfers and the internal category.
eth_subscribe, eth_unsubscribe -32601: “The method eth_subscribe needs a WebSocket, which this endpoint does not have”Ask again on a timer: eth_blockNumber for new blocks, eth_getLogs for new logs.
State at an old block: eth_call, eth_getBalance and the like with a past blockThe node’s own error, with a sentence that names the call to use.A token balance at any block is read with blockhash_getTokenBalances and blockNumber.
Any other method-32601, naming the method

Log reads

In one eth_getLogs call, fromBlock and toBlock may be up to 10,000 blocks apart, and the answer holds up to 10,000 logs.

A wider range is refused with -32602, and the message says how far apart the two blocks are.

A range that holds more than 10,000 logs is refused the same way. Narrow fromBlock and toBlock and ask again.

latest, pending, safe and finalized are measured as the block they name when the call arrives. earliest is block 0.

To read further back, walk the chain 10,000 blocks at a time.

Blocks a call
Up to 10,000
Logs a call
Up to 10,000
Costs
60 units

Sending a transaction

Sign the transaction yourself and send its bytes with eth_sendRawTransaction.

The call is passed through the node to the chain’s sequencer, and costs 40 units.

Moving from Alchemy

The endpoint has Alchemy’s form: JSON-RPC 2.0 over HTTPS, with the key as the last part of the path.

Change the URL and the key. The host is another, and the path is /v1 where Alchemy’s is /v2. The rest of a client’s code stays as it is.

Code that already calls the four index calls by Alchemy’s names keeps working. New code calls them by their blockhash_ names.

Errors use the HTTP statuses Alchemy uses, so a client’s retry code works unchanged.

What differs

  • There is no WebSocket endpoint and no subscriptions.
  • debug_ and trace_ methods are not offered.
  • The node keeps recent state only: a read of state at an old block is refused.
  • eth_getLogs reads up to 10,000 blocks a call.
  • The index calls differ in a few places, which the Data API page lists under each call.

The endpoint

Alchemy: https://robinhood-mainnet.g.alchemy.com/v2/<key>Blockhash: https://api.blockhash.xyz/v1/<key>

Change the URL and the key. The calls stay the same.

Calls

These are the node calls most clients send. Every other method of the four namespaces is sent the same way.

The answers are the chain’s own, read at block 116,313,703. The block they name is 116,313,282.

… stands for what is left out of a long answer, and for an address that is somebody’s own account.

eth_call

Reads a contract without sending a transaction. This one asks USDG for the balance of the WETH/USDG pool.

Costs
26 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[
       {"to":"0x5fc5360d0400a0fd4f2af552add042d716f1d168",
        "data":"0x70a0823100000000000000000000000052e65b17fb6e5ba00ed806f37afcd2daa50271ca"},
       "latest"]}'
{"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000016d5e49eb8f"}

eth_getLogs

Reads the logs that match a filter. This one reads the transfers of USDG into the WETH/USDG pool over 162 blocks.

Costs
60 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[
       {"address":"0x5fc5360d0400a0fd4f2af552add042d716f1d168",
        "topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          null,
          "0x00000000000000000000000052e65b17fb6e5ba00ed806f37afcd2daa50271ca"],
        "fromBlock":"0x6eeccc2","toBlock":"0x6eecd63"}]}'
{"jsonrpc":"2.0","id":1,"result":[
  {"address":"0x5fc5360d0400a0fd4f2af552add042d716f1d168",
   "topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
     "0x0000000000000000000000005399d94d2cab7c252a6034042e1917a0e5e17a18",
     "0x00000000000000000000000052e65b17fb6e5ba00ed806f37afcd2daa50271ca"],
   "data":"0x00000000000000000000000000000000000000000000000000000000007deef9",
   "blockNumber":"0x6eeccc2",
   "transactionHash":"0xfc94b068a5df32475fb8cb7dfa41046ab7923c7744d6109e08d84336bcfd811d",
   "transactionIndex":"0x2",
   "blockHash":"0x059a2e1e3be6967cd782145ac308039919d2037f70472e95c80bae0ca2c0dafd",
   "logIndex":"0x3",
   "removed":false},
  …]}

eth_getBlockByNumber

Gets a block. With false as the second parameter its transactions are listed by hash.

Costs
20 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x6eeccc2",false]}'
{"jsonrpc":"2.0","id":1,"result":{
  "number":"0x6eeccc2",
  "hash":"0x059a2e1e3be6967cd782145ac308039919d2037f70472e95c80bae0ca2c0dafd",
  "parentHash":"0x3ddcc7bc66d64978227a63759dcee119a5fdd5bdd4e3ac720d189b68ec2d7a04",
  "timestamp":"0x6afbd9fa",
  "miner":"0xa4b000000000000000000073657175656e636572",
  "gasLimit":"0x4000000000000",
  "gasUsed":"0xb797e",
  "baseFeePerGas":"0x1312d00",
  "l1BlockNumber":"0x19353a1",
  "transactions":[
    "0x82bea0ad11a2f2071ed6664564337fffee4a5050564913749b3030ae8252a7fc",
    "0xe2b6c452616797420cc8097772e427644d30f85406394240aaf1570618920ed0",
    "0xfc94b068a5df32475fb8cb7dfa41046ab7923c7744d6109e08d84336bcfd811d",
    "0xa12c23341c13f0661cf9bd2c8708cc2cd9096e9a9924192e3ee75ee35ffabcdd",
    "0x565a226af525420f49cef2e3b091210949edc10fab051b57d7d5e78a7c2d259f"],
  …}}

eth_getBlockReceipts

Gets the receipt of every transaction in a block, in one call.

Costs
20 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockReceipts","params":["0x6eeccc2"]}'
{"jsonrpc":"2.0","id":1,"result":[
  {"blockHash":"0x059a2e1e3be6967cd782145ac308039919d2037f70472e95c80bae0ca2c0dafd",
   "blockNumber":"0x6eeccc2",
   "contractAddress":null,
   "cumulativeGasUsed":"0x0",
   "effectiveGasPrice":"0x1312d00",
   "from":"0x00000000000000000000000000000000000a4b05",
   "gasUsed":"0x0",
   "gasUsedForL1":"0x0",
   "l1BlockNumber":"0x19353a1",
   "logs":[],
   "logsBloom":"0x…",
   "status":"0x1",
   "to":"0x00000000000000000000000000000000000a4b05",
   "transactionHash":"0x82bea0ad11a2f2071ed6664564337fffee4a5050564913749b3030ae8252a7fc",
   "transactionIndex":"0x0",
   "type":"0x6a"},
  …]}

eth_getTransactionReceipt

Gets one transaction’s receipt: whether it succeeded, the gas it used and its logs.

Costs
20 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":[
       "0xfc94b068a5df32475fb8cb7dfa41046ab7923c7744d6109e08d84336bcfd811d"]}'
{"jsonrpc":"2.0","id":1,"result":
  {"blockHash":"0x059a2e1e3be6967cd782145ac308039919d2037f70472e95c80bae0ca2c0dafd",
   "blockNumber":"0x6eeccc2",
   "contractAddress":null,
   "cumulativeGasUsed":"0x69d14",
   "effectiveGasPrice":"0x1312d00",
   "from":"0x…",
   "gasUsed":"0x5c325",
   "gasUsedForL1":"0x0",
   "l1BlockNumber":"0x19353a1",
   "logs":[
     {"address":"0x5fc5360d0400a0fd4f2af552add042d716f1d168",
      "topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x0000000000000000000000005399d94d2cab7c252a6034042e1917a0e5e17a18",
        "0x00000000000000000000000052e65b17fb6e5ba00ed806f37afcd2daa50271ca"],
      "data":"0x00000000000000000000000000000000000000000000000000000000007deef9",
      "blockNumber":"0x6eeccc2",
      "transactionHash":"0xfc94b068a5df32475fb8cb7dfa41046ab7923c7744d6109e08d84336bcfd811d",
      "transactionIndex":"0x2",
      "blockHash":"0x059a2e1e3be6967cd782145ac308039919d2037f70472e95c80bae0ca2c0dafd",
      "logIndex":"0x3",
      "removed":false},
     …],
   "logsBloom":"0x…",
   "status":"0x1",
   "to":"0x5399d94d2cab7c252a6034042e1917a0e5e17a18",
   "transactionHash":"0xfc94b068a5df32475fb8cb7dfa41046ab7923c7744d6109e08d84336bcfd811d",
   "transactionIndex":"0x2",
   "type":"0x2"}}

eth_getBalance

Gets the ETH an address holds. This one asks about the WETH contract.

Costs
20 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0x0bd7d308f8e1639fab988df18a8011f41eacad73","latest"]}'
{"jsonrpc":"2.0","id":1,"result":"0x7b7385722c29b31523b"}

eth_sendRawTransaction

Sends a transaction you have signed. The result is the transaction’s hash.

Costs
40 units
Against the speed
50 units
SIGNED="<a signed transaction, in hex>"

curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_sendRawTransaction","params":["'$SIGNED'"]}'
{"jsonrpc":"2.0","id":1,"result":"0x…"}

eth_blockNumber

Gets the number of the newest block.

Costs
10 units
curl $RPC/$KEY \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
{"jsonrpc":"2.0","id":1,"result":"0x6eece67"}