Skip to content

Add PermissionedDomain to LoanBroker#484

Open
Tapanito wants to merge 5 commits into
masterfrom
tapanito/lending-domain
Open

Add PermissionedDomain to LoanBroker#484
Tapanito wants to merge 5 commits into
masterfrom
tapanito/lending-domain

Conversation

@Tapanito
Copy link
Copy Markdown
Collaborator

High Level Overview of Change

Introduces access control for the Lending Protocol via Permissioned Domains. A LoanBroker can be configured as private at creation time, restricting loan issuance to Borrowers with valid credentials.

Changes:

  • Add DomainID field and lsfLoanBrokerPrivate flag to the LoanBroker ledger entry
  • Add tfLoanBrokerPrivate transaction flag to LoanBrokerSet
  • Add failure conditions for credential validation on LoanSet
  • Add Access Control section (3.1.13) documenting the feature behavior
  • Add invariants for the private flag and domain relationship
  • The domain can be changed or cleared after creation; the private flag is immutable
  • Credential checks do not apply to LoanPay, Borrowers can always repay

Context of Change

Type of Change

  • New XLS Draft
  • XLS Update (changes to an existing XLS)
  • XLS Status Change (e.g., Draft → Final, Draft → Stagnant)
  • Process/Meta (changes to CONTRIBUTING.md, XLS-1, templates, etc.)
  • Infrastructure (CI, workflows, scripts, website)
  • Documentation (README updates, typo fixes)

@Tapanito Tapanito changed the title Tapanito/lending domain Add PermissionedDomain to LoanBroker Feb 26, 2026
Comment thread XLS-0066-lending-protocol/README.md Outdated
Comment thread XLS-0066-lending-protocol/README.md
Comment thread XLS-0066-lending-protocol/README.md Outdated
Comment thread XLS-0066-lending-protocol/README.md Outdated
@ximinez ximinez self-requested a review March 4, 2026 22:11
Copy link
Copy Markdown
Collaborator

@ximinez ximinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my concerns have been addressed.

2. The submitter `AccountRoot.Account != LoanBroker(LoanBrokerID).Owner`. (`tecNO_PERMISSION`)
3. The transaction `VaultID` does not match `LoanBroker(LoanBrokerID).VaultID`. (`tecNO_PERMISSION`)
4. `DebtMaximum` is being reduced to a non-zero value below the current `DebtTotal`. (`tecLIMIT_EXCEEDED`)
5. `DomainID` is provided, is non-zero and `LoanBroker.lsfLoanBrokerPrivate` flag is not set. (`tecNO_PERMISSION`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we allow the case where LoanBroker.lsfLoanBrokerPrivate flag is not set, and domainID is provided as zero?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! I think if LoanBroker.lsfLoanBrokerPrivate flag is not set, and DomainID is provided in any form, the TX should fail with tecNO_PERMISSION. What do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants