Ethereum
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Ethereum
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
"Is this transaction final?" is the question every exchange, bridge, and payment flow has to answer before it moves money. The instinct carried over from Bitcoin is to count confirmations — how many blocks have piled on top. Post-Merge Ethereum gives you something stronger and more honest: Casper FFG finality. Validators justify and then finalize checkpoints, and once a block is finalized it cannot be reverted unless a third of all staked ETH is slashed. That's a cryptoeconomic guarantee, not a probability that improves block by block.
This guide shows how to verify transactions safely on chain 1 the way the protocol actually works: reading the finalized and safe block tags rather than tallying raw confirmations, sizing your safety bar to the value at risk, and handling the short head reorgs that can still invalidate a transaction before it finalizes. By the end you'll know which tag to trust for which kind of action and how to wire it into a verification flow.
currentBlock - txBlockNumber. Each new 12-second slot adds one. But on Ethereum that count is only a proxy for the real thing — finality, which the consensus layer tracks explicitly via the safe and finalized tags.safe tag (a justified checkpoint) is usually enough. For settlement, withdrawals, or anything you can't claw back, wait for finalized — reached after about two epochs (~12.8 minutes), and irreversible short of a third of staked ETH being slashed. The higher the value, the stronger the guarantee you should demand.finalized/safe tags work identically there. The difference is economic weight: testnet ETH has no real value, so a finalized testnet block carries none of the slashing-backed security of a finalized mainnet block. Test the logic on Sepolia, but don't read its finality as equivalent to chain 1's.latest, a moderate transfer can trust safe, and an irreversible payout should wait for finalized. The cleanest rule is to read the block by tag and confirm your transaction's block number is at or below the finalized height before you commit.latest and finalized can widen beyond the usual ~2 epochs. Network congestion and a high base fee can also delay your transaction's inclusion in the first place. Watch the finalized tag itself rather than assuming a fixed minute count.newHeads over the WebSocket endpoint and, on each block, recompute how far your pending transaction is from the current finalized height. Surface that distance to users as a progress indicator, and alert internally if the finalized tag stops advancing — that stall is itself a signal worth catching.