Finality
Finality provides the block data needed to determine whether a transaction included in a block has reached a final state that cannot be reversed. On EVM chains, you can query the finalized block over RPC to determine finality. On other chains, you can calculate confirmation depth from the difference between the latest block (ledger) number and the block number that contains the transaction.
A transaction included in a block can become invalid if a chain reorganization (reorg) occurs. Crediting a deposit to a customer balance before finality risks letting the invalidated amount be withdrawn, so you can use Finality to set a finality threshold and credit only deposits that reach it.
Use Cases
- Finance & AccountingConfirm deposits
Set a confirmation depth threshold per amount tier and credit only deposits that reach the threshold to customer balances. Applying a threshold suited to each amount size lets you manage the loss risk from reorgs.
- Withdrawal OpsComplete withdrawals
Switch a withdrawal to completed once the block containing the withdrawal transaction reaches the finalized block or the confirmation depth threshold. This prevents marking a withdrawal as completed before finality and then missing one that needs to be resent after a reorg.
- InfrastructureCross-check data freshness
Compare the latest block number with your own node or another source to check block lag. This prevents judging finality from data that does not yet reflect the latest state.
Available APIs
Block Queries — RPC
- RPC
eth_blockNumberRetrieves the latest block number10 CU - RPC
eth_getBlockByNumberRetrieves block information by block number or tag31 CU - RPC
eth_getBlockByHashRetrieves block information by block hash32 CU - RPC
eth_getBlockTransactionCountByNumberRetrieves the number of transactions in a block by block number13 CU - RPC
eth_getBlockTransactionCountByHashRetrieves the number of transactions in a block by block hash14 CU
Block Queries — Data API
- Data API
Get Block by Hash or NumberRetrieves a block by hash or number30 CU - Data API
Get Blocks Within RangeRetrieves blocks in a specified range at once150 CU - Data API
Get Ledger by Hash or IndexRetrieves an XRPL ledger by hash or index30 CU - Data API
Get Ledgers Within RangeRetrieves XRPL ledgers in a specified range at once150 CU