For the complete documentation index, see llms.txt. This page is also available as Markdown.

StarkNet (STRK)

GetBlock provides fast and reliable access to Starknet nodes via JSON-RPC API. Connect to the Starknet network without running your own infrastructure.

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 / pending tags

  • Dual Fee Tokens: Fees are payable in ETH or STRK; fee amounts carry a unit (WEI or FRI)

  • Two-Stage Finality: Transactions move from ACCEPTED_ON_L2 to ACCEPTED_ON_L1 once 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

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

1

Setup project

2

Install dependency

3

Add code

4

Run the script

5

Response

1

Setup project

2

Install dependency

3

Add code

4

Run the script

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:

See Also

Last updated

Was this helpful?