7Block Labs
Blockchain Technology

ByAUJay

Web3 API Essentials: How Dapps Talk to Chains in 2025

In 2025, production-grade dapps rely on a richer, faster, and more standardized Web3 API stack than even a year ago. This guide distills what actually changed (and why it matters), and shows concrete patterns you can ship today across reads, writes, indexing, real-time delivery, and reliability.

TL;DR (description)

Ethereum’s Dencun (EIP‑4844) and maturing standards like EIP‑1193/6963 changed the API surface dapps use every day; meanwhile, decentralized RPCs and indexing pipelines (The Graph Substreams, QuickNode Streams) now deliver exactly-once, reorg-aware data. This post gives decision-makers precise implementation guidance, provider trade‑offs, code snippets, and 2025‑ready best practices.


1) What actually changed since 2024

  • Blob transactions are now live on mainnet (EIP‑4844 via Dencun, shipped Mar 13, 2024). They add type‑3 “blob” transactions with new fields for blob gas pricing and commitments, dramatically lowering L2 data costs. Practically, your tooling, fee logic, and transaction builders must understand maxFeePerBlobGas and blobVersionedHashes. (theblock.co)
  • Block tags gained first‑class “safety.” Most JSON‑RPC methods accept “safe” and “finalized” block tags (EIP‑1898): use these when correctness beats freshness (e.g., settlements, finance). (eips.ethereum.org)
  • Frontend wallet/provider integration is standardized. EIP‑1193 defines a minimal request/event model; EIP‑6963 enables discovering multiple injected providers to end wallet‑extension conflicts. Your app should support both. (eips.ethereum.org)
  • Fee APIs expanded. eth_feeHistory is the canonical way to set EIP‑1559 fees; on chains with blobs, you’ll also see baseFeePerBlobGas and blobGasUsedRatio in responses. (quicknode.com)
  • The Graph fully sunset its Hosted Service in 2024 and migrated core activity to Arbitrum; Substreams/Firehose matured with new chains and better performance. If you still read from the old hosted endpoints, you’re in the past. (thegraph.com)

What that means: your API layer needs EIP‑4844/1559‑aware fee logic, “safe/finalized” reads when needed, modern wallet discovery, and indexing/streaming that can handle reorgs and high throughput.


2) The API surface you actually use (and how to use it safely)

  • Reads (eth_call, eth_getBalance, eth_getCode, eth_getStorageAt) should specify a block parameter with either:
    • a concrete blockHash/number (object per EIP‑1898), or
    • the “safe”/“finalized” tags for deterministic results. (eips.ethereum.org)

Example: read a contract state at the last finalized block:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_call",
  "params": [
    { "to": "0xYourContract", "data": "0xabcdef..." },
    { "blockTag": "finalized" }
  ]
}
  • Logs (eth_getLogs) have practical limits. Providers enforce block‑range and payload caps; design paginated, incremental crawlers:
    • QuickNode: 10,000‑block range on paid plans (5 on free trials). (quicknode.com)
    • Chainstack: 100–10,000 depending on plan; also network‑specific best‑practice ranges (e.g., 5k Ethereum, 3k Polygon). (docs.chainstack.com)
    • Alchemy documents per‑chain ranges and caps responses at 150MB. (alchemy.com)

Paginated getLogs (illustrative):

async function* rangeLogs(client, filter, from, to, step=5000) {
  for (let start = from; start <= to; start += step) {
    const end = Math.min(start + step - 1, to);
    const logs = await client.request({
      method: 'eth_getLogs',
      params: [{...filter, fromBlock: `0x${start.toString(16)}`, toBlock: `0x${end.toString(16)}`}]
    });
    yield logs;
  }
}
  • Gas fees (EIP‑1559 & blobs). Use eth_feeHistory to compute a tip (priority fee) and set maxFee; on blob‑chains, also compute maxFeePerBlobGas. (eips.ethereum.org)

3) Sending transactions in a post‑4844 world

  • Type‑3 blob transactions include:
    • max_fee_per_blob_gas (uint256)
    • blob_versioned_hashes (KZG commitment hashes)
    • They cannot be contract creations (to must be a 20‑byte address). (eips.ethereum.org)
  • The network form for eth_sendRawTransaction must include the payload body plus blobs, commitments, and proofs. Ensure your SDK handles this. (docs.web3j.io)

Minimal build (pseudocode):

// Outline: set EIP-1559 (maxFeePerGas, maxPriorityFeePerGas)
// and EIP-4844 fields (maxFeePerBlobGas, blobVersionedHashes)
const tx = {
  type: '0x03',
  chainId,
  to: L2BatchPoster,
  maxPriorityFeePerGas,
  maxFeePerGas,
  gas: 250000,
  data: postCalldata,
  maxFeePerBlobGas,
  blobVersionedHashes: [hash1, hash2],
  accessList: []
};
// Sign & sendRawTransaction with SDK that supports blob sidecars.

Operational note: blobs gossip via the consensus client sidecar; execution clients only see references. Your monitoring must link tx receipts with blob sidecar stats (blob_gas_used, excess_blob_gas in headers). (blocknative.com)


4) Real‑time data: WebSockets, webhooks, and “exactly‑once”

  • eth_subscribe is WebSocket‑only; use it for newHeads/logs/pending tx. Some providers expose variants and may restrict certain subscriptions; always check provider docs. (geth.ethereum.org)
  • Push beats polling for scale. QuickNode Webhooks delivers serverless, filter‑based, reorg‑safe push notifications; Streams provides exactly‑once delivery in finality order, plus historical backfills and traces. These are production‑ready building blocks for trading bots, wallets, and analytics. (blog.quicknode.com)

Key implementation detail: set up reorg handling and sequential processing on your destination; Streams won’t advance until your system acknowledges delivery, ensuring consistency. (quicknode.com)


5) Indexing and analytics: Subgraphs, Substreams, and where The Graph is now

  • The Graph’s Hosted Service is shut down (June 12, 2024). Queries run on the decentralized network; many network operations (rewards) moved to Arbitrum in 2024 to cut costs and speed up. (thegraph.com)
  • Substreams + Firehose (by StreamingFast) changed the game: high‑throughput, stream‑first indexing with new chains shipping through 2025; recent updates introduced Substreams RPC v3 and more sinks (e.g., SQL with nested message support). If you’re still hand‑rolling indexers, evaluate Substreams first. (forum.thegraph.com)

Tip: Use Substreams for heavy lifts (DEX swaps, TVL, multi‑contract joins), and expose a thin API to your app. Keep your subgraphs for query flexibility, Substreams for throughput.


6) Wallets, smart accounts, and Account Abstraction (ERC‑4337)

  • ERC‑4337 adds UserOperations, an alt‑mempool, and an on‑chain EntryPoint—unlocking gas sponsorship (paymasters), session keys, and batched UX without L1 protocol changes. (docs.erc4337.io)
  • What to standardize in 2025:
    • Bundler RPC (eth_sendUserOperation, estimateUoGas, getUserOperationReceipt).
    • Paymasters for sponsorship or ERC‑20 gas payments.
    • Modular smart accounts (ERC‑6900) for plugins (multi‑owner, session keys). (docs.erc4337.io)

Production options:

  • Alchemy Account Kit (v4) ships audited Light/Modular Accounts, Rundler (Rust) bundler, and Gas Manager with enterprise tooling and EIP‑1193/viem compatibility. (alchemy.com)
  • Pimlico provides public test bundlers and verifying/ERC‑20 paymasters; check rate limits and surcharges in production. (docs.pimlico.io)
  • Biconomy offers sponsorship and ERC‑20 paymasters with dashboard “gas tanks,” plus SDK methods for fee quotes. (docs.biconomy.io)

Minimal bundler client (Pimlico public):

import { createSmartAccountClient } from "permissionless";
import { createPimlicoClient } from "permissionless/clients/pimlico";
// ...
const bundler = createPimlicoClient({ transport: http("https://public.pimlico.io/v2/8453/rpc") });
// smartAccountClient.sendTransaction({ calls: [...] });

(docs.pimlico.io)


7) Traces, simulations, and when to go beyond vanilla JSON‑RPC

  • Traces (trace_block, trace_transaction) are invaluable for debugging, compliance, and analytics—but they’re heavy and often gated. Erigon exposes a rich trace_ module; many providers enable it behind a plan or add‑on. (docs.erigon.tech)
  • Provider examples: QuickNode exposes trace_* across many chains with plan requirements. Budget for throughput and storage if you’re ingesting traces at scale. (quicknode.com)
  • Simulations: Tenderly integrates transaction simulation via RPC and an extended tenderly_* namespace; Virtual TestNets add admin “cheatcodes,” and pricing is explicit in Tenderly Units (TU). Use simulations for pre‑trade previews, safety checks, or user confirmations. (blog.tenderly.co)

8) Reliability, performance, and correctness in production

  • Multi‑provider fallback. Use an SDK that supports fallback transports with ranking, retries, and batching (e.g., viem’s fallback transport). You’ll reduce tail latency and spread rate‑limit risk. (viem.sh)
  • Rate‑limit hygiene. Design for 429 handling with exponential backoff and jitter; monitor provider‑specific headers when available. Alchemy documents retry patterns; many RPCs emit 429 with guidance. (alchemy.com)
  • Choose “safety” for critical reads. Use blockTag “finalized” or “safe” for settlement steps; combine with EIP‑155 chainId replay protection and, if relevant, CHAINID opcode in contracts. (eips.ethereum.org)

Production checklist:

  • For reads: use EIP‑1898 objects or safe/finalized tags.
  • For logs: slice ranges, cap payloads, and checkpoint progress.
  • For writes: EIP‑1559 fee policy via eth_feeHistory; on blob chains include maxFeePerBlobGas.
  • For UX: EIP‑1193 provider, EIP‑6963 discovery, and AA where it improves conversion.
  • For resilience: multi‑provider fallback + exponential backoff + observability.

9) Decentralized RPCs: where they fit in 2025

  • Pocket Network’s Shannon upgrade (June 3, 2025) transformed Pocket into a Cosmos‑native, permissionless API network with usage‑based economics and support for data sources beyond RPC; it targets enterprise‑grade QoS via gateways and staking economics. Consider it for censorship resistance, geographic diversity, and vendor‑neutrality. (docs.pocket.network)
  • Lava Network’s v5 introduced on‑chain QoS/Reputation and pairing lists with latency/availability/sync‑freshness scoring; its architecture routes to top‑performing providers per epoch. Evaluate when multi‑chain, reputation‑weighted routing matters. (docs.lavanet.xyz)
  • Infura’s Decentralized Infrastructure Network (DIN) is progressing toward an EigenLayer AVS, broadening decentralized gateway supply across 12+ chains; useful when you want Consensys‑backed governance with decentralized operator sets. (prnewswire.com)

10) Architecture blueprints (copy‑paste mental models)

  • Real‑time trading/alerts:
    • Streams/Webhooks (exactly‑once, finality order) → queue → risk engine → Tenderly simulate → send tx via primary RPC with viem fallback to secondaries. Use newHeads + logs subscriptions for immediate signals; reconcile via finalized Streams. (quicknode.com)
  • Consumer app (AA wallets):
    • EIP‑6963 + EIP‑1193 in frontend → Alchemy Account Kit for smart accounts + Rundler → optional Pimlico/Biconomy paymaster for gasless flows → read consistency with safe tags for balances/allowances. (eips.ethereum.org)
  • Analytics/indexing:
    • Substreams (Firehose) for high‑volume decode → warehouse sink (SQL/Parquet) → BI. Keep subgraphs for flexible GraphQL queries. Avoid giant eth_getLogs pulls. (firehose.streamingfast.io)

11) Code snippets: fees, safety, logs

Fee policy (EIP‑1559 + blobs):

// Get recent fee stats; pick percentiles for tip
const res = await client.request({
  method: 'eth_feeHistory',
  params: [10, 'latest', [25, 50, 75]]
});
// baseFeePerGas -> next block base fee
// reward[?] -> priority tip percentiles
// On blob-enabled chains, also read baseFeePerBlobGas.

(quicknode.com)

Safe/finalized call (EIP‑1898):

{
  "method": "eth_getBalance",
  "params": ["0xAddress", {"blockTag":"finalized"}]
}

(eips.ethereum.org)

Provider fallback with viem:

import { createPublicClient, fallback, http } from 'viem';
const client = createPublicClient({
  transport: fallback([
    http('https://mainnet.providerA.io/v3/...'),
    http('https://eth-mainnet.g.alchemy.com/v2/...'),
    http('https://rpc.ankr.com/eth')
  ], { retryCount: 5, retryDelay: 200 })
});

(viem.sh)


12) Procurement questions to ask RPC/indexing vendors in 2025

  • Data correctness:
    • Do you support EIP‑1898 blockHash objects and “safe/finalized” tags across eth_call/getProof/getLogs? (eips.ethereum.org)
  • Throughput and limits:
    • What are your eth_getLogs block‑range limits per chain/plan? Are response payloads capped by size? (alchemy.com)
  • Trace/simulation:
    • Which trace_* and debug_* methods are enabled (and on what clients)? Do you offer built‑in simulation (e.g., Tenderly namespace) and cost metrics? (docs.erigon.tech)
  • Real‑time:
    • Do you provide exactly‑once, finality‑ordered streams, and how do you handle reorgs/backfills? (quicknode.com)
  • Decentralization/SLA:
    • Can you route via decentralized backends (Pocket/Lava/DIN) or attest to multi‑region redundancy and verifiable QoS? (docs.lavanet.xyz)

Final takeaways for decision‑makers

  • Align your reads/writes with 2025‑era standards:
    • EIP‑1193/6963 in the browser, EIP‑1898 for reads, EIP‑1559 + (where applicable) EIP‑4844 for writes. (eips.ethereum.org)
  • Prefer streams + indexing over brute‑force polling. Adopt QuickNode Streams/Webhooks and The Graph Substreams for scale and reorg‑safety. (quicknode.com)
  • Engineer for failure. Multi‑provider fallback, exponential backoff, and safe/finalized reads will save incidents and money. (viem.sh)
  • Revisit decentralization and vendor risk. Pocket, Lava, and DIN give you new knobs—use them where governance, neutrality, or regional resilience matters. (docs.pocket.network)

If you’re architecting or modernizing your stack in Q4 2025–H1 2026, make these changes first: upgrade your SDKs for blob tx support; refactor reads to EIP‑1898 with safety tags; switch heavy polling to streams/Substreams; and standardize on EIP‑1193/6963 in the frontend. That’s how dapps talk to chains—reliably—in 2025.

Like what you're reading? Let's build together.

Get a free 30‑minute consultation with our engineering team.

Related Posts

7BlockLabs

Full-stack blockchain product studio: DeFi, dApps, audits, integrations.

7Block Labs is a trading name of JAYANTH TECHNOLOGIES LIMITED.

Registered in England and Wales (Company No. 16589283).

Registered Office address: Office 13536, 182-184 High Street North, East Ham, London, E6 2JA.

© 2025 7BlockLabs. All rights reserved.