1/10

The counter that stops replays

Every account carries a sequence number. A transaction must state current + 1, and the ledger increments it on inclusion — so a signed transaction can never be replayed (its number is spent), and two transactions from the same account can't race into the same slot.

That last one has a practical edge. If your backend signs two transactions from the same account at the same moment, both claim current + 1 — and exactly one wins. The other comes back tx_bad_seq, which does not mean "malformed"; it means someone else moved your counter first — rebuild and resign.

The usual fix is not a retry loop. It is a channel account: a separate account that supplies sequence numbers, so parallel work never fights over one counter.