StarkNet (STRK)
Starknet is a permissionless validity (ZK) rollup that settles to Ethereum, executing contracts on the Cairo VM and proving that execution with STARK proofs verified on Ethereum L1. It is not EVM-compatible: contracts are Cairo classes, values are felt252 field elements expressed as hex, and every account is itself a contract under Starknet's native account abstraction. Blocks are addressed by a block_id that is either an object (a block number or block hash) or a tag (latest, pending). The JSON-RPC surface is the standard starknet_* method set: block and state reads, transaction and receipt lookups, contract calls and class/storage reads, event queries, fee estimation, and the invoke/declare/deploy-account write methods.
Key Features
- Validity Rollup: Execution is proven with STARK proofs and verified on Ethereum L1, inheriting L1 security
- Cairo VM: Contracts are Cairo classes compiled to Sierra, not EVM bytecode; values are felt252 field elements
- Native Account Abstraction: Every account is a contract; signature schemes and validation are programmable
- block_id Addressing: Reads accept a block number, block hash, or the
latest/pendingtags - Dual Fee Tokens: Fees are payable in ETH or STRK; fee amounts carry a unit (
WEIorFRI) - Two-Stage Finality: Transactions move from
ACCEPTED_ON_L2toACCEPTED_ON_L1once settled on Ethereum - Classes and Instances: A class is declared once by hash, then deployed to many contract addresses
TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.
GetBlock's RPC API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The canonical and normative specification for the Starknet JSON-RPC interface is maintained and published by StarkWare and the Starknet community through the official documentation at docs.starknet.io and the OpenRPC specification in the starknet-specs repository. This resource constitutes the sole authoritative reference for the starknet_ JSON-RPC methods.*
Network Information
| Property | Value |
|---|---|
| Network Name | Starknet |
| Chain ID | 0x534e5f4d41494e (SN_MAIN) |
| Native Fee Tokens | ETH, STRK |
| Decimals | 18 |
| Virtual Machine | Cairo VM (felt252) |
| Settlement Layer | Ethereum L1 (STARK validity rollup) |
| Account Model | Native account abstraction |
| Finality | L1-backed after proof settlement |
Base URL
bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/Supported Networks
| Network | Chain ID | JSON-RPC | WSS | GraphQL | MEV protected (WebSocket) | MEV protected (JSON-RPC) | Frankfurt, Germany | New York, USA | Singapore, Singapore |
|---|---|---|---|---|---|---|---|---|---|
| Mainnet | SN_MAIN | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ |
Quickstart
Setup project
bash
mkdir starknet-api-quickstart && cd starknet-api-quickstart && npm init --yesInstall dependency
bash
npm install axiosAdd code
index.js
javascript
const axios = require('axios'); const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'; const payload = { jsonrpc: '2.0', method: 'starknet_blockNumber', params: [], id: 'getblock.io' }; axios.post(url, payload, { headers: { 'Content-Type': 'application/json' } }) .then(response => { console.log('Latest block:', response.data.result); }) .catch(error => console.error(error));Run the script
bash
node index.jsResponse
bash
{ "jsonrpc": "2.0", "result": 14293145, "id": "getblock.io" }
Setup project
bash
mkdir starknet-api-quickstart && cd starknet-api-quickstart python -m venv venv && source venv/bin/activateInstall dependency
bash
pip install requestsAdd code
main.py
python
import requests import json url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/" payload = json.dumps({ "jsonrpc": "2.0", "method": "starknet_blockNumber", "params": [], "id": "getblock.io" }) headers = { 'Content-Type': 'application/json' } response = requests.post(url, headers=headers, data=payload) print(response.text)Run the script
bash
python main.py
Available API Methods
Chain & Client Info
| Method | Description |
|---|---|
| starknet_specVersion | Version of the Starknet JSON-RPC spec served |
| starknet_chainId | Chain ID of the connected Starknet network |
| starknet_syncing | Sync status, or false when fully synced |
| starknet_blockNumber | Latest accepted block number |
| starknet_blockHashAndNumber | Latest block hash and number together |
Blocks & State
| Method | Description |
|---|---|
| starknet_getBlockWithTxHashes | Block header plus transaction hashes |
| starknet_getBlockWithTxs | Block header plus full transaction bodies |
| starknet_getBlockWithReceipts | Block with transactions and their receipts |
| starknet_getBlockTransactionCount | Number of transactions in a block |
| starknet_getStateUpdate | State diff applied by a block |
Transactions
| Method | Description |
|---|---|
| starknet_getTransactionByHash | Transaction body by hash |
| starknet_getTransactionByBlockIdAndIndex | Transaction by block and index |
| starknet_getTransactionStatus | Finality and execution status of a transaction |
| starknet_getTransactionReceipt | Execution receipt of a transaction |
Contracts, Accounts & State
| Method | Description |
|---|---|
| starknet_call | Call a contract view function (no transaction) |
| starknet_getStorageAt | Raw storage value at a contract key |
| starknet_getNonce | Account nonce at a block |
| starknet_getClassHashAt | Class hash deployed at an address |
| starknet_getClass | Contract class definition by class hash |
| starknet_getClassAt | Contract class deployed at an address |
| starknet_getEvents | Filtered events with pagination |
Fee Estimation
| Method | Description |
|---|---|
| starknet_estimateFee | Estimate the fee for transactions |
| starknet_estimateMessageFee | Estimate the fee for an L1-to-L2 message |
Write API
| Method | Description |
|---|---|
| starknet_addInvokeTransaction | Submit a signed invoke transaction |
| starknet_addDeployAccountTransaction | Deploy a new account contract |
| starknet_addDeclareTransaction | Declare a new contract class |
Support
For technical support and questions:
- Support: support@getblock.io