Casper

Casper is a proof-of-stake Layer 1 that finalizes blocks with the Zug consensus protocol and runs smart contracts compiled to WebAssembly.

Casper executes smart contracts in a WebAssembly runtime, and most contracts are written in Rust. Accounts are identified by public keys and by a 32-byte account hash derived from them. Execution is metered in gas, and fees are charged in CSPR, priced in motes, where one CSPR equals one billion motes. Casper 2.0 introduced a transaction model that replaces deploys, and it moved the JSON-RPC API out of the node into a separate sidecar service.

Casper RPC endpoints

NetworkInterfaceEndpoint
MainnetJSON-RPChttps://casper-mainnet.gateway.tatum.io
TestnetJSON-RPChttps://casper-testnet.gateway.tatum.io

HTTP requests take your API key in the x-api-key header. See Authentication.

For example, this request sends info_get_status to Casper Mainnet through the JSON-RPC interface:

curl 'https://casper-mainnet.gateway.tatum.io' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"info_get_status","params":[],"id":1}'

Don't have an API key?

Sign up to Dashboard and create your API keys today. Get higher limits and use debugging tools.

Get API keyFor free. No commitment.

Casper RPC at a glance

Try Casper RPC

Get the latest Casper block

Sends info_get_status to Casper Mainnet through Tatum RPC Gateway and shows the latest block number.

Get the Casper node version

Sends info_get_status to Casper Mainnet through Tatum RPC Gateway and shows the node version and status.

To try more Casper methods, open the Casper Postman collection, set the gateway-api-key variable of the Tatum Gateway environment to your API key, and send any request.

Casper RPC methods

Methods each Casper interface supports, listed live from Tatum RPC Gateway.

JSON-RPC

17 methods on Mainnet and Testnet. What each one does: Casper JSON-RPC methods.

  • account_* (1): account_put_deploy
  • chain_* (5): chain_get_block, chain_get_block_transfers, chain_get_era_info_by_switch_block, chain_get_era_summary, chain_get_state_root_hash
  • info_* (6): info_get_chainspec, info_get_deploy, info_get_peers, info_get_status, info_get_transaction, info_get_validator_changes
  • query_* (2): query_balance, query_global_state
  • state_* (3): state_get_account_info, state_get_auction_info, state_get_dictionary_item

Every endpoint also lists its methods at runtime: /_methods (JSON) and /llms.txt (text), for example Casper Mainnet /_methods.

Method unavailable?

If you need a method we don't support yet, contact support.

Related

Testing without an API key? Free public endpoints are listed on Casper RPC at FREERPC.com.