Starknet - Cairo-Powered Validity Rollup Documentation
Complete guide to Starknet integration with Dwellir RPC. Learn how to build on Cairo-powered Starknet, access JSON-RPC methods, and deploy scalable dApps with STARK proof security.
Starknet RPC
With Dwellir, you get access to our global Starknet network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
Get your API keyWhy Build on Starknet?
Starknet is the leading validity rollup (zk-rollup) that executes Cairo smart contracts with STARK proof security, offering unparalleled scalability while maintaining Ethereum-grade security:
Revolutionary Cairo Performance
- Native account abstraction - Every account is a programmable smart contract
- Cairo VM execution - Provable computation with mathematical guarantees
- Sub-second finality - Fast transaction confirmation with L1 security
- 99%+ cost reduction compared to Ethereum mainnet
STARK Proof Security
- Zero-knowledge proofs - Cryptographically secure state transitions
- Ethereum settlement - Inherits L1 security with validity proof verification
- Decentralized proving - Robust network with permissionless participation
Developer-First Ecosystem
- Cairo language - Safe, powerful programming language for contracts
- Rich tooling - starknet.js, starknet.py, Protostar, Scarb, and more
- Growing DeFi - Leading protocols like Avnu, Ekubo, Nostra, JediSwap
- Account abstraction native - Flexible wallet experiences out of the box
Quick Start with Starknet
Connect to Starknet in seconds with Dwellir's optimized endpoints:
curl -sS -X POST https://api-starknet-mainnet.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots> \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'import { JsonRpcProvider } from 'ethers';const provider = new JsonRpcProvider( 'https://api-starknet-mainnet.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>');const latest = await provider.getBlockNumber();console.log('block', latest);import requestsurl = 'https://api-starknet-mainnet.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>'payload = { 'jsonrpc': '2.0', 'id': 1, 'method': 'eth_blockNumber', 'params': []}resp = requests.post(url, json=payload)print(resp.json())package mainimport ( "bytes" "fmt" "io" "net/http")func main() { url := "https://api-starknet-mainnet.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>" payload := []byte(`{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}`) resp, err := http.Post(url, "application/json", bytes.NewBuffer(payload)) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body))}Installation & Setup
# Get latest block number
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_blockNumber",
"params": [],
"id": 1
}'
# Get chain ID
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_chainId",
"params": [],
"id": 1
}'
# Call a contract function (ETH balance)
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_call",
"params": [
{
"contract_address": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e",
"calldata": ["0x1234..."]
},
"latest"
],
"id": 1
}'Network Information
| Parameter | Value | Details |
|---|---|---|
| Chain ID | SN_MAIN | 0x534e5f4d41494e |
| Block Time | ~10 seconds | STARK proof batches |
| Native Token | ETH | Fee token |
| Account Model | AA Native | Smart contract accounts |
Network Details
| Parameter | Value | Details |
|---|---|---|
| Mainnet Chain ID | 0x534e5f4d41494e (SN_MAIN) | |
| Testnet (Sepolia) Chain ID | 0x534e5f5345504f4c4941 (SN_SEPOLIA) | |
| Fee Tokens | ETH (primary), STRK (governance, future staking) | |
| Finality | L2 confirmation (~10s), L1 finality (~1-4 hours) | |
| TPS | 50+ current, 100+ roadmap with parallel execution |
API Reference
Starknet implements its own JSON-RPC namespace (starknet_*) with Cairo-specific functionality. Access all Starknet methods with STARK proof security.
Common Integration Patterns
Account Management
import { Account, RpcProvider } from 'starknet';
const provider = new RpcProvider({
nodeUrl: 'https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY'
});
const account = new Account(provider, accountAddress, privateKey);
const nonce = await account.getNonce();Token Operations
// Get token balance
const { result } = await provider.callContract({
contractAddress: tokenAddress,
entrypoint: 'balanceOf',
calldata: [accountAddress]
});Contract Calls
// Execute contract function
const call = {
contractAddress: contractAddress,
entrypoint: functionName,
calldata: [param1, param2]
};
const { transaction_hash } = await account.execute(call);Resources & Tools
Official Resources
Block Explorers
- Voyager Explorer - Comprehensive block explorer
- Starkscan - Alternative explorer with rich features
Developer Tools
- Starknet.js - TypeScript SDK
- Starknet.py - Python SDK
- Scarb - Cairo package manager
- Starknet Foundry - Testing framework
- Protostar - Cairo development toolchain
Ecosystem Projects
- Avnu - DEX aggregator
- Ekubo Protocol - Concentrated liquidity AMM
- Nostra - Money market protocol
Need Help?
- Email: support@dwellir.com
- Docs: You're here!
- Dashboard: dashboard.dwellir.com
- Community: Starknet Discord
Start building on Starknet with Cairo-powered smart contracts using Dwellir's enterprise-grade RPC infrastructure. Get your API key

