Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
## Example

<CodeGroup>
```bash Standard (latest) lines wrap expandable

Check warning on line 32 in docs/base-chain/api-reference/ethereum-json-rpc-api/eth_getBalance.mdx

View workflow job for this annotation

GitHub Actions / Docs Style / Conformance

Docs style

[codeblock/highlight] Consider `highlight={}` to draw attention to key lines
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
Expand All @@ -41,7 +41,7 @@
}'
```

```bash Flashblocks (pending, ~200ms) lines wrap expandable

Check warning on line 44 in docs/base-chain/api-reference/ethereum-json-rpc-api/eth_getBalance.mdx

View workflow job for this annotation

GitHub Actions / Docs Style / Conformance

Docs style

[codeblock/highlight] Consider `highlight={}` to draw attention to key lines
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
Expand All @@ -61,3 +61,17 @@
}
```
</CodeGroup>

## Read Balances for Many Addresses

`eth_getBalance` returns the balance of one address per call. To produce a balance snapshot across a set of addresses, such as every wallet your platform operates:

1. **Keep your own address list.** Base has no registry that maps addresses to the organization that controls them, so the list comes from your own records, for example the accounts your wallet or custody provider created for you.
2. **Pin one block number.** Read every balance at the same block so the snapshot reflects a single chain state. For reports, look up the `finalized` block with [`eth_getBlockByNumber`](/base-chain/api-reference/ethereum-json-rpc-api/eth_getBlockByNumber) and pass its number to every read.
3. **Batch the reads.** Call the [`Multicall3`](/specifications/base-protocol/execution/preinstalls#multicall3) preinstall at `0xcA11bde05977b3631167028862bE2a173976CA11` with [`eth_call`](/base-chain/api-reference/ethereum-json-rpc-api/eth_call) at the pinned block. Use `getEthBalance(address)` for ETH and the token contract's `balanceOf(address)` for ERC-20 balances.

To report balances over time, for example a time-weighted average, repeat the snapshot at fixed block intervals. Reading state at older blocks requires a node that retains historical state. A Reth full node keeps only a recent window of blocks; an archive node keeps all history. See [Snapshots](/specifications/node-operators/snapshots) for the difference.

<Note>
A balance snapshot is a set of RPC reads, not an attestation. Base does not provide a service that attests, audits, or certifies balances across an organization's wallets.
</Note>
Loading