

Sequence numbers and Tickets
Each transaction takes the next number in line. Tickets let you skip the line.
Key points
- Each transaction must use the account's next sequence number.
- A transaction that fails with a tec code still uses its number.
- Tickets set numbers aside, to send later in any order.
The lesson
Every account has a , like a counter at a deli. Each transaction must use the next number. That stops anyone from playing the same transaction twice.
Numbers go strictly in order. If number 7 never gets in, 8 has to wait. The account is stuck until 7 is used. Fix it by sending something, even a tiny no-op, with number 7.
A failed transaction can still use its number. If it fails with a tec code, it is written into the ledger anyway. Its number is spent and its fee is burned.
Tickets fix the waiting. A
TicketCreatesets numbers aside now. Later, a transaction can use any Ticket, in any order. That helps when signers need days to sign one, or when you send many.Each Ticket you hold locks a small owner reserve until you use it.
Sequence.
Sequencemust equal the account's currentSequencein itsAccountRoot. Each transaction that gets into a validated ledger adds one, whatever its result. AtesSUCCESSand atecboth count. Atem,teforterresult does not apply, so the number stays free.A stuck account. A transaction that never applies leaves a gap. Later ones wait in the queue or fail with
terPRE_SEQ. Fill the gap: send anAccountSetwith no changes, using the missing number. A number already used fails withtefPAST_SEQ..
TicketCreatewithTicketCount1 to 250 uses its ownSequence. It sets aside the next numbers asTicketentries.- An account can hold at most 250 Tickets. Each counts as one owned object: 0.2 XRP of .
- To use one, set
Sequenceto0andTicketSequenceto the Ticket's number. Any Ticket, any order, once each. - Using a Ticket deletes it and frees its reserve. The normal
Sequenceis unaffected. - List them with
account_objectsandtype: "ticket".
Multi-signing uses Tickets well: one transaction can collect signatures while others go out.
Related: When the ledger is busy, Batch transactions.

