Optimism
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Optimism
Free tier covers personal projects. Pay-as-you-go scales without a card.
On OP Mainnet, a transaction included by the sequencer appears almost instantly — blocks come every ~2 seconds — but "included" is not the same as "final". OP Mainnet is an optimistic rollup (chain ID 10) that settles to Ethereum L1, so a block's strongest guarantee comes only once its L1 batch is finalized; before that, recent blocks can still be reorged. That gap between fast inclusion and true finality is exactly why confirmation counting matters: act too early and you risk treating a transaction as settled when it could still vanish. This guide enables you to measure confirmations against the OP Mainnet head, pick safe thresholds by transaction value, and verify finality so your application commits irreversible actions only when it is truly safe.
getConfirmations example shows. At ~2s per block, confirmations accrue quickly.blockNumber is null or it moved to a new block), roll back any state you derived from it and re-evaluate it against the new canonical chain ID 10 history before acting again.