Lending Transactions in Batch
Allows the Lending Protocol transactions as Batch inner transactions
- Author
- Vytautas Vito Tumas
- Created
- 2026-11-25
- Updated
- 2026-11-25
- Discussion
- XRPLF/XRPL-Standards/discussions/190
- Amendment
LendingProtocolV1_2- Patch of
- XLS-0066: Lending Protocol
66.7.3 Lending Transactions in Batch¶
1. Abstract¶
Before LendingProtocolV1_2, a Batch that contains any Lending Protocol transaction as an inner transaction fails with temINVALID_INNER_BATCH. Under LendingProtocolV1_2, the nine Lending Protocol transactions can be Batch inner transactions and are subject to the normal Batch checks. The Vault transactions are allowed by the same amendment; see XLS-65.7.2.
2. Motivation¶
Lending workflows combine several transactions, for example creating a LoanBroker and depositing its first-loss capital, or creating a Loan and making a payment. Batch lets these run atomically.
3. Specification¶
This patch changes the parent XLS-66 sections named below. No fields are added or removed.
3.1 Transaction: Batch¶
3.1.1 Failure Conditions¶
The following transaction types are the Lending Protocol transactions:
LoanBrokerSetLoanBrokerDeleteLoanBrokerCoverDepositLoanBrokerCoverWithdrawLoanBrokerCoverClawbackLoanSetLoanDeleteLoanManage-
LoanPay -
LendingProtocol (parent): ABatchwith an inner transaction of one of these types fails withtemINVALID_INNER_BATCH. LendingProtocolV1_2: The check does not apply. The inner transaction is subject to theBatchinner transaction checks of XLS-56. A failure of the inner transaction's own data verification fails theBatchwithtemINVALID_INNER_BATCH.
3.2 Transaction: LoanSet¶
3.2.1 Failure Conditions¶
Under LendingProtocolV1_2, when LoanSet is a Batch inner transaction:
CounterpartySignatureis not required. If it is present, it must not containTxnSignatureorSigners, and itsSigningPubKeymust be empty, as for the inner transaction's own signature fields.- Parent §3.8.5.1 check 3 applies: if
Counterpartyis not specified, the inner transaction fails withtemBAD_SIGNERand theBatchfails withtemINVALID_INNER_BATCH. - The
Counterparty, if it is not the outerBatchaccount, must be one of theBatchsigners, as for any inner transaction with aCounterpartyfield.
3.2.2 Transaction Fee¶
A Batch inner transaction has a fee of zero. The additional fee for the counterparty's signatures in parent §3.8.1.1 is paid through the outer Batch fee.
4. Rationale¶
The Lending Protocol transactions were excluded from Batch until their behavior inside a Batch was specified. The counterparty of a LoanSet signs the outer Batch instead of the inner transaction, as every other inner signer does.
5. Security Considerations¶
A LoanSet inside a Batch is authorized by the Batch signatures. The counterparty must still sign, because the Batch requires a signature from every inner Counterparty other than the outer account.