In short
A transaction goes from processed to finalized in well under a second, and once finalized it can’t be reversed. Confirmed reports the same block as finalized.You’ve used this in: Payments Step 3 Pay-per-call Step 3 Trade settlement Step 4
Commitment levels
When you send a transactionTransactionsA transaction is a signed request to change the shared ledger. It either fully happens or doesn't happen at all, and once confirmed anyone can look it up.Learn more (Transactions: A transaction is a signed request to change the shared ledger. It either fully happens or doesn’t happen at all, and once confirmed anyone can look it up.), the network does not answer “done” once. Validators vote on the block that contains it, and RPC methods let you choose how much of that progress to wait for. That choice is the commitment level.| Level | What has happened | Typical time after sending | Can it still be reversed? |
|---|---|---|---|
processed | The RPC node has seen the transaction in its most recent block. | A few hundred milliseconds | Yes. The block can still be skipped. |
confirmed | The same as finalized. | Under a second | No. |
finalized | Validators holding at least 80% of stake (in one round) or 60% (in two rounds) have certified the block. | Under a second | No. |
confirmed and finalized arrive together. confirmed remains available so
existing code keeps working and is planned for removal in a later release;
point new code at finalized.
Settlement and finality explains how
finality works.
If a method or subscription accepts commitment and you leave it out, the
default is usually finalized. See
configuring state commitment in the
RPC reference.
Which level to wait for
| You want to | Wait for |
|---|---|
| Show progress in a UI, such as “payment sent” | processed |
| Ship an order, unlock content, or answer a paid API request | finalized |
| Credit a large deposit or settle a trade that cannot be undone | finalized |
processed
and then read balances at finalized, the read can return the state from
before your transaction.
Check a payment at a commitment level
The checkout tutorial confirms each payment on the server before it ships the order. It fetches the transaction atconfirmed, then checks that it succeeded
and moved the right amount. The output below is from a local Surfpool network.
checkout/verify-payment.ts
Output of verifyPayment() with the right and a wrong amountLocal test network (Surfpool)
await verifyPayment({ ...order, signature, mint: USDC_MINT }){ paid: true }
await verifyPayment({ ...order, amount: 2_000_000n, signature, mint: USDC_MINT }){
paid: false,
reason:
'amount mismatch: expected 2000000, received 1000000'}
Right amount: paidWrong amount: refused
getSignatureStatuses, which returns each
signature’s confirmationStatus, or subscribe with
signatureSubscribe.
Expiry
Every transaction includes a recent blockhash. If the transaction has not landed in a block before that blockhash is more than 150 blocks old, about 30 seconds at 200ms slots, the network drops it and it can never be processed. That makes retries safe: when a send times out, wait until the blockhash has expired, then rebuild the transaction with a fresh blockhash and send it again.- Transaction confirmation and expiration explains how expiry works and lists best practices for each commitment level.
- Retry transactions covers custom retry logic.
- Durable nonces let you sign a transaction now and submit it later without it expiring.