Skip to content

6 min read

How Bitcoin and Litecoin confirmations work in a checkout

From the mempool to final: how many confirmations 402pay waits for, why the quote stops at first sight, and what happens when a transaction is replaced or dropped.

Two chains over the same span, a few large blocks above and many small ones below, each ending in greenTwo chains over the same span, a few large blocks above and many small ones below, each ending in green
On this page

Bitcoin and Litecoin are the two networks in 402pay's checkout where a customer can reasonably wait several minutes for a payment to finish. Blocks come about every 10 minutes on Bitcoin and every 2.5 minutes on Litecoin, a transaction can sit unconfirmed for a while if its fee is low, and an unconfirmed transaction can still be replaced.

This post explains what a confirmation is on these two chains, how many 402pay waits for and why, what the customer sees while they wait, and how checkout handles the cases that are specific to them: the quote clock, slow blocks, replaced or dropped transactions, and payments split across several transfers.

Outputs, not balances

Bitcoin and Litecoin don't keep account balances. A transaction spends earlier outputs and creates new ones, each locking an amount to an address[1]. A payment to a checkout is an output that locks coins to that checkout's address, and a single transaction can carry several outputs to different recipients.

Every 402pay checkout gets an address of its own, a native SegWit address derived from your wallet's public key along the standard BIP 84 path[2]: bc1… on Bitcoin and ltc1… on Litecoin. Our servers hold the public key only, so they can make the next address but never spend from it. The post on addresses covers how that works. For confirmations, the point is simpler: any output that lands at that address belongs to that checkout, whatever the amount and whenever it arrives.

From broadcast to confirmed

When the customer sends, their wallet broadcasts the transaction to the network. It waits in the mempool, the set of valid transactions not yet in a block, until a miner includes it. At that point it has one confirmation, and every block mined on top adds one more[3]. Each extra block makes the transaction harder to reverse, because undoing it would mean replacing that many blocks.

402pay watches both stages. It picks up the transaction while it's still in the mempool, at zero confirmations, so checkout can tell the customer their payment was seen within a couple of minutes of sending it. It then follows the count until the payment's network reaches its threshold:

Bitcoin1 confirmation, usually about 10 minutes.
Litecoin2 confirmations, usually about 5 minutes.

The two numbers differ for a reason. Litecoin blocks come about four times as often as Bitcoin's, and a single Litecoin block is replaced by a competing one more often, so we wait for two. On Bitcoin, a reversal after even one block is rare and costly, so a single confirmation balances safety against the customer's wait. The thresholds are set per network, not per business, so every merchant gets the same threshold for when a payment is final.

Watching past the finish line

A payment succeeds at its threshold, but 402pay keeps watching the transaction for several more blocks. If a block holding it were ever replaced after that point, the payment stays succeeded and nothing moves on its own: the case is flagged for our team to review.

The quote clock stops when the transaction is seen

A crypto checkout locks its exchange rate for a fixed time, 15 minutes unless the business changes it. On a fast chain the payment is final long before that matters. On Bitcoin a customer can send with eight minutes left, and the first block can take twenty.

So the quote is judged by when the transaction was first seen, not when it confirmed. Once the transaction is in the mempool, the checkout moves to confirming, and a confirming checkout has no deadline. A transaction first seen before the quote ran out counts as on time however long its block takes, even if our scan picks it up a moment after the clock reached zero.

A timeline of a Bitcoin or Litecoin payment: the rate is locked, the customer sends, the transaction is seen in the mempool, then gets its first confirmation, and reaches the network's threshold; the span from mempool to threshold is confirming, with no deadline.A timeline of a Bitcoin or Litecoin payment: the rate is locked, the customer sends, the transaction is seen in the mempool, then gets its first confirmation, and reaches the network's threshold; the span from mempool to threshold is confirming, with no deadline.
The quote clock stops once the transaction is seen in the mempool. From there the checkout is confirming, however long the blocks take.
The customer is on time when they send, not when a miner gets to it.

A transaction first seen after the quote expired is late. The money is in your wallet, but the locked rate no longer applies, so the payment is marked as needing review and you decide whether to accept it. See payments that need review.

Low fees and slow blocks

The customer's wallet chooses the fee, and miners favor transactions that pay more per byte. A transaction sent with a low fee during a busy period can wait several blocks before a miner picks it up. Block times are also averages: a Bitcoin block can arrive in one minute or forty.

Checkout helps on both fronts. Before the customer sends, it shows an estimate of the network fee in US dollars, worked out from the fee rate the network currently needs to confirm within a few blocks, for a typical native SegWit transaction. It's paid by the customer's wallet on top of the amount, never taken out of it. While they wait, checkout counts confirmations for them, links the transaction on a block explorer, and tells them they can close the page and come back.

Replaced and dropped transactions

Until a transaction is in a block, it isn't final. A sender can replace it with a higher-fee version, a mechanism called replace-by-fee[4], which may or may not pay the same address. A transaction can also fall out of mempools if its fee stays too low, or lose to a conflicting transaction that spends the same coins.

402pay treats all of these the same way, since from the outside they look the same: the transaction stops being known to the network. Each unfinished transfer is checked by its hash after every scan, and one that is missing on consecutive checks spanning about ten minutes is given up:

  • Its amount is taken back off the payment, and the checkout returns to underpaid or to waiting for payment, or expires if its quote has already run out.
  • A replacement that pays the same address shows up as a new transfer and counts on its own.
  • A dropped transaction is checked again for two weeks, and restored if it reappears.

None of this needs your attention while it happens, and payment.succeeded is only sent once every transfer still counted has reached its confirmations.

Several transfers to one address

Customers paying from an exchange sometimes send in parts, or send a second transaction after the first came up short. Because the address belongs to one checkout, every output to it counts toward the same payment:

  • Each output is its own transfer, and what arrived is the sum of them.
  • A total short by no more than the business's tolerance, 0.5% by default, counts as paid in full.
  • Further short, the payment is underpaid, and checkout asks for the rest at the same address with a fresh quote window.
  • The payment succeeds only once every counted transfer has reached the network's threshold, and checkout shows the slowest one's count.

What your server sees

Confirmations don't produce webhooks of their own. Each sighting and each new confirmation is recorded on the payment's timeline, which you can read in the dashboard or with GET /payments/{id}, while the payment stays pending. When the last confirmation lands, your endpoint receives payment.succeeded, and that's the event to fulfill on. A shortfall arrives as payment.underpaid and a late transfer as payment.needs_review.

On the customer's side, the QR code holds a BIP 21 URI[5], bitcoin: or litecoin: with the address and exact amount, so a wallet fills in both. Card payments delivered to your wallet on either network wait for the same confirmations, and checkout shows the same count.

Moving Bitcoin and Litecoin out

Payments on both networks land in your wallet like any other, but the dashboard can't send from them yet. Moving them means restoring your recovery phrase in a wallet app. See move funds on Tron, Bitcoin, and Litecoin.

Common questions

  • 1 confirmation on Bitcoin and 2 confirmations on Litecoin, usually about 10 and 5 minutes. The counts are the same for every business.
  • No. The quote stops counting down once the transaction is seen in the mempool. A transaction first seen before the quote expired counts as on time however long its block takes.
  • Once the network no longer knows the transaction, its amount is taken back off the payment and checkout asks for it again. A replacement paying the same address counts as a new transfer, and a dropped transaction that reappears is restored.
  • No. Confirmations are recorded on the payment's timeline, and payment.succeeded is sent once the last required confirmation lands.

References

  1. [1]Transactions. Bitcoin Developer Guide.
  2. [2]BIP 84: Derivation scheme for P2WPKH based accounts. Bitcoin Improvement Proposals.
  3. [3]Block chain. Bitcoin Developer Guide.
  4. [4]BIP 125: Opt-in Full Replace-by-Fee Signaling. Bitcoin Improvement Proposals.
  5. [5]BIP 21: URI Scheme. Bitcoin Improvement Proposals.

See what 402pay can do for you.

Discover how 402pay helps your business accept any card and get paid in crypto, straight to a wallet you control.