EN

One package, four modes

4 minDifficulty Checked 2026-11-10
Key takeaways
  • A Batch holds two to eight inner transactions from one or more accounts.
  • The mode decides which inner transactions apply: all, the first success, until failure, or each alone.
  • The outer Batch can succeed while inner transactions fail. Check each inner result.

Picture a shopping cart. You put several items in and pay once at the register. A Batch does the same for transactions. You pack two to eight of them into one package, sign it, and submit it.

The package needs a rule for what happens when one item fails. The XRP Ledger offers four rules, called modes:

  • All or nothing. Every transaction must work, or none of them count. This suits a swap where both sides must happen.
  • Only one. The ledger tries them in order and keeps the first that works. This suits trying several prices.
  • Until failure. The ledger applies them in order and stops at the first failure.
  • Independent. The ledger tries every one. A failure does not stop the others.

Each transaction inside the package is an inner transaction. The package itself is the outer transaction.

One trap catches people. The outer package can report success even when inner transactions failed. The outer result only says the package was accepted and paid for. Each inner transaction has its own result, and that result tells you what happened.

Inner transactions can come from different accounts. Two people can trade tokens in one all-or-nothing Batch. Neither side can take the other's half and walk away.

Check yourself3 questions
1. A Batch uses all-or-nothing mode. The third of four inner transactions fails. What happens?
2. Which mode fits trying three offers at different prices and keeping only the first that works?
3. The outer Batch shows tesSUCCESS. What does that prove?
Next lessonSigning and fees4 min