DEV Community

Cover image for XRPL Batch Transactions Testing Report
Panos Mekras for Anodos Labs

Posted on

XRPL Batch Transactions Testing Report

As a key XRPL contributor and UNL validator within the XRP Ledger ecosystem, Anodos Labs is committed to advancing the protocol's capabilities. We have conducted a series of successful tests on the Atomic/Batch Transactions amendment (XLS-56), which is currently under vote on the mainnet. This report shares the positive results of our devnet testing, validates the amendment's technical soundness, and provides a clear, evidence-based recommendation for our fellow validators and the broader developer community.

1. The Strategic Importance of Batch Transactions

Protocol amendments are essential for the long-term health, competitiveness, and evolution of the XRP Ledger. Each proposal must be carefully weighed for its technical merits and its strategic impact on the ecosystem. From our analysis and testing, Batch Transactions stand out as a pivotal upgrade with far-reaching benefits for both developers building on the network and the end-users they serve. Its importance can be understood through two primary strategic benefits.

A) Foundation for a Sustainable Developer Ecosystem

For the first time on the XRP Ledger, Batch Transactions will provide a native mechanism for platforms and interfaces to charge fees for the services they provide. By allowing a developer to bundle a service fee transaction alongside a user's primary transaction, it creates a viable path to monetization.

Currently, most projects on the XRPL cannot generate revenue directly from their onchain services, making it difficult to build sustainable business models. This amendment rectifies that fundamental challenge. By enabling developers to monetize their applications, we can foster a more robust and self-sustaining ecosystem. This capability is crucial for attracting and retaining top-tier development talent, encouraging innovation, and ensuring the long-term viability of the projects that bring value to the network. This economic foundation is a prerequisite for the sustained development of sophisticated, user-friendly applications that can compete for mainstream adoption.

B) Enhancing the End-User Experience

Beyond developer sustainability, batch transactions will significantly streamline multi-step user workflows by abstracting away network complexities. Many common user actions on the XRPL require multiple distinct transactions, creating friction and potential points of failure. Batch Transactions allow these multi-step processes to be combined into a single, atomic submission.

A clear example is a user wanting to acquire a token for which they do not yet have a trust line. Today, this is a two-step process: first, submit a TrustSet transaction, and second, submit a swap (Payment or OfferCreate transaction). With Batch, an application can bundle the trust line creation and the token swap into a single click for the user. The entire sequence either succeeds or fails together, eliminating the frustration of incomplete actions. This simplification reduces the operational friction of onchain interactions, bringing the user experience closer to the standards of mature web applications.

These dual benefits—creating economic sustainability for builders and simplifying interactions for users—are foundational to accelerating the XRPL's growth and realizing its potential for mainstream adoption.

2. Devnet Test Results: Functionality Confirmed

TX ID: https://devnet.xrpl.org/transactions/6FA28E0F3E945224BF3DB9FF8B855A07DFBBF65CF9D210AD9DF0A31B46314D6B/simple

This section from our devnet testing confirms that Batch functions in accordance with its specification. The following tests validate its stability, atomicity, and readiness for mainnet activation upon successful passage of the vote. The following examples illustrate the structure of the batch transactions we successfully tested on the devnet:

{
"TransactionType": "Batch",
"Account": "r...",
"Fee": "50",
"Sequence": 101,
"RawTransactions": [
{
"Transaction": {
"TransactionType": "Payment",
"Account": "r...",
"Destination": "r...",
"Amount": "1000000",
"Fee": "0",
"Sequence": 102
}
},
{
"Transaction": {
"TransactionType": "Payment",
"Account": "r...",
"Destination": "r...",
"Amount": "500000",
"Fee": "0",
"Sequence": 103
}
}
],
"TransactionResult": "tesSUCCESS"
}


{
"TransactionType": "Batch",
"Account": "r...",
"Fee": "75",
"Sequence": 250,
"RawTransactions": [
{
"Transaction": {
"TransactionType": "TrustSet",
"Account": "r...",
"LimitAmount": {
"currency": "USD",
"issuer": "r...",
"value": "10000"
},
"Fee": "0",
"Sequence": 251
}
},
{
"Transaction": {
"TransactionType": "Payment",
"Account": "r...",
"Destination": "r...",
"Amount": {
"currency": "USD",
"issuer": "r...",
"value": "50"
},
"Fee": "0",
"Sequence": 252
}
},
{
"Transaction": {
"TransactionType": "Payment",
"Account": "r...",
"Destination": "r...",
"Amount": "1000000",
"Fee": "0",
"Sequence": 253
}
}
],
"TransactionResult": "tesSUCCESS"
}

The tesSUCCESS result for both submissions confirms that the network correctly processed these batches. This validates the core functionality—bundling both identical and distinct transaction types into a single atomic unit.

3. Anatomy of a Batch Transaction

To better illustrate the structure and efficiency of this new transaction type, this section provides a detailed breakdown of a successfully executed batch transaction. Using the more complex example from our tests, we can deconstruct its core components.

The Outer Transaction: The entire submission is wrapped in a top-level object with TransactionType:"Batch". This outer layer contains the primary Account, Fee, and Sequence number. Critically, the Fee specified here is the only network fee paid for the entire group of transactions, making the process both simple and cost-effective.

The Inner RawTransactions Array: This array is the core of the batch, containing the individual, ordered transactions to be executed.

Execution Mode: ALLORNOTHING

For the testing examples provided, the batch was executed using the ALLORNOTHING mode. This mode requires that every inner transaction must succeed for the entire batch to be committed to the ledger. If any single Payment or TrustSet within the batch fails, the entire submission is rejected, and no changes are made to the ledger state. This atomic guarantee is crucial for applications that must ensure related actions (like setting a trust line and making an initial payment) are never executed partially.

Mandatory Flag for Inner Transactions:

For a transaction to be recognized and processed as an inner batch transaction, it must include the global flag tfInnerBatchTxn (Hex Value: 0x40000000 or Decimal Value: 1073741824). This flag, which is stored in the inner transaction’s Flags field, is essential for two reasons:

It signals to the ledger that the transaction is not to be processed independently.

It confirms that the transaction is not signed, as the signature is provided by the outer batch transaction.

Fee Abstraction: A key design feature is that all inner transactions have their "Fee" set to "0". This demonstrates a powerful abstraction. Developers no longer need to calculate and assign fees for each individual step. The network fee is handled entirely at the batch level, simplifying the construction of complex, multi-step actions.

Sequence Numbering: Note that the inner transactions have their own Sequence numbers (251, 252, 253), which follow sequentially from the main batch transaction's Sequence number (250). This confirms that the ledger correctly processes the inner transactions in the specified order within the atomic batch, ensuring predictable outcomes.

In summary, the structure of a Batch transaction is logical, efficient, and successfully abstracts complexity away from the developer and end-user. Our tests confirm this structure works as intended and is ready for mainnet deployment.

Conclusion

Our devnet testing confirms that the Batch amendment is technically sound, functions as designed, and is ready for mainnet activation. Furthermore, our strategic analysis concludes that its benefits are profound and far-reaching. By creating a viable path for developer monetization and simplifying the end-user experience, this amendment will directly contribute to a more sustainable, innovative, and accessible XRP Ledger ecosystem.

The core functionality validated by Anodos Labs in the ALLORNOTHING mode, specifically the atomic bundling of TrustSet and Payment transactions, proves the amendment's immediate utility. This capability ensures that foundational user actions, such as acquiring a new token, are completed in one secure step.

Therefore, Anodos Labs formally advocates for the successful passage of the Batch amendment. We encourage all fellow XRPL UNL validators, developers, and the wider community to cast a "yes" vote to unlock this critical functionality for the network. We look forward to building the future of onchain finance together on an even more capable and efficient XRP Ledger.

Top comments (0)