XRP Ledger Standards
XLS-66.7.2 Draft Amendment

Private Loan Broker

Adds a private LoanBroker that only lends to members of a Permissioned Domain

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.2 Private Loan Broker

1. Abstract

Under LendingProtocolV1_2, a LoanBroker can be created as private. A private LoanBroker names a Permissioned Domain in DomainID, and LoanSet succeeds only if the Borrower holds an accepted credential that the domain accepts. The owner can change or clear the domain later, but cannot make a public LoanBroker private or a private one public.

2. Motivation

A Loan Broker that must lend only to vetted Borrowers has no on-ledger way to enforce that in the parent protocol; every LoanSet co-signed by the broker owner is accepted. Binding the broker to a Permissioned Domain makes the Borrower's eligibility a ledger check.

3. Specification

This patch changes the parent XLS-66 sections named below. All other parent behavior is unchanged.

3.1 Ledger Entry: LoanBroker

3.1.1 Fields

The following field is added to parent §3.1.2:

Field Name Constant Required JSON Type Internal Type Default Value Description
DomainID No No string HASH256 None The ID of the Permissioned Domain whose members may borrow from a private LoanBroker. Never zero.

3.1.2 Flags

Flag Name Flag Value Modifiable? Description
lsfLoanBrokerPrivate 0x00010000 No If set, LoanSet requires the Borrower to be a member of the LoanBroker.DomainID.

3.1.3 Invariants

Under LendingProtocolV1_2, after every transaction:

  • LoanBroker.DomainID is present only if lsfLoanBrokerPrivate is set.
  • LoanBroker.DomainID is not zero.
  • No flag other than lsfLoanBrokerPrivate is set on a LoanBroker.
  • LoanBroker.Flags does not change after creation.

3.2 Transaction: LoanBrokerSet

3.2.1 Fields

The following field is added to parent §3.3.1. It requires both LendingProtocolV1_2 and PermissionedDomains; otherwise a transaction with DomainID fails with temDISABLED.

Field Name Required JSON Type Internal Type Default Value Description
DomainID No string HASH256 None On creation, the domain of a private LoanBroker. On update, the new domain, or zero to remove the domain from a private LoanBroker.

3.2.2 Flags

Flag Name Flag Value Description
tfLoanBrokerPrivate 0x00010000 Creates the LoanBroker as a private broker.

Before LendingProtocolV1_2, any flag other than the universal flags fails with temINVALID_FLAG.

3.2.3 Failure Conditions

Added to parent §3.3.3.1 (data verification):

  • LoanBrokerID is specified and tfLoanBrokerPrivate is set. (temINVALID)
  • LoanBrokerID is not specified and DomainID is zero. (temMALFORMED)
  • LoanBrokerID is not specified, DomainID is specified, and tfLoanBrokerPrivate is not set. (temINVALID)

Added to parent §3.3.3.2 (protocol-level failures):

  • LoanBrokerID is specified, the LoanBroker does not have lsfLoanBrokerPrivate set, and DomainID is specified. (tecNO_PERMISSION) This check runs after parent check 10.
  • DomainID is specified and not zero, and no PermissionedDomain with that ID exists. (tecOBJECT_NOT_FOUND) This check runs before parent check 11.

3.2.4 State Changes

When creating a LoanBroker (parent §3.3.4 step 1): if tfLoanBrokerPrivate is set, set lsfLoanBrokerPrivate and, if DomainID is specified, set LoanBroker.DomainID.

When updating a LoanBroker (added after parent §3.3.4 step 7): if DomainID is specified and not zero, set LoanBroker.DomainID; if it is zero, remove LoanBroker.DomainID.

3.2.5 Example JSON

{
  "TransactionType": "LoanBrokerSet",
  "Account": "rDNs1puRWQh4ezekGfVmtoEHAJ6fWbqCEA",
  "VaultID": "4AF1FD30BFAB1CDF10CF6783B37BA96873CBB7C4CE5DDFC89D9B8DB50BD29F54",
  "Flags": 65536,
  "DomainID": "3B61A239626565A3FBEFC32863AFBF1AD3325BD1669C2C9BC92954197842B564",
  "Fee": "1",
  "Sequence": 3964022
}

3.3 Transaction: LoanSet

3.3.1 Failure Conditions

Added to parent §3.8.5.2, checked after the LoanBroker, Vault, Borrower and broker pseudo-account are loaded and before the Vault's available assets are checked:

    • LendingProtocol (parent): The check does not apply.
    • LendingProtocolV1_2: The LoanBroker has lsfLoanBrokerPrivate set, and:
      • LoanBroker.DomainID is absent. (tecNO_AUTH)
      • The PermissionedDomain does not exist. (tecOBJECT_NOT_FOUND)
      • The Borrower holds no accepted, unexpired credential accepted by the domain. (tecNO_AUTH, or tecEXPIRED if a matching credential has expired)

4. Rationale

The domain is set at creation and can be changed or removed by the owner, but the private flag is fixed, so a public broker's Borrowers are never restricted after the fact. A private broker whose domain is removed accepts no new Loans until a domain is set again. Existing Loans are not affected by any domain change, because the check runs only in LoanSet.

5. Security Considerations

Domain membership is checked only when a Loan is created. A Borrower who later loses the credential keeps the Loan and its obligations. Deleting or changing the domain cannot be used to reject payments on existing Loans.