0087 XLS-87d: Token Pre-Authorization #258
mvadari
started this conversation in
XLS Proposals
Replies: 1 comment 1 reply
-
|
Why would we support both arrays of credentials as well as Permissioned Domains.... the pattern set by the DEX seems to be permissioned domains are always used to group credentials and apply restrictions - why don't we just stick to that? TBH i would also probably not support individual accounts for this sort of thing ... what happens once the single onboarding occurs, does the Preauth object just sit there and potentially there is some expectation the issuer later deletes it (assumedly through deauthorizing)? Separately - is the type of DomainID in TrustSet and MPTokenAuthorize supposed to be string / Hash256, or am i missing something? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Token Pre-Authorization
Abstract
Managing the authorization of tokens on the XRP Ledger is a complex task. This complexity is compounded when issuers use highly secure, locked-up keys, as frequent interactions to authorize trustlines or MPT holders can undermine the security benefits of these keys. Each authorization requires deliberate action by the issuer, making it impractical at scale and creating friction for both issuers and token holders. Without a streamlined mechanism to pre-approve or manage token authorizations efficiently, issuers face a tradeoff between operational efficiency and maintaining the security and decentralization principles of the ledger. This gap underscores the need for a robust solution that streamlines and simplifies the operational overhead of token authorization while preserving the integrity of issuer keys.
This spec proposes a solution to this problem by allowing issuers to pre-authorize token holders, either by authorizing specific accounts or by authorizing certain credentials/domains (which essentially allows them to move the burden of authorization to another account). By integrating token pre-authorization into the XRPL's existing trustline and MPT frameworks, issuers can establish robust controls over token distribution while maintaining a user-friendly process for holders. This allows issuers to manage their assets more effectively without compromising on security.
1. Overview
This feature mirrors the Deposit Authorization functionality, but for token authorization instead of payments.
We propose:
TokenPreauthledger objectTokenPreauthtransaction typeTrustSettransaction typeMPTokenAuthorizetransaction typeThis feature will require an amendment, tentatively titled
TokenPreauth. It also depends on XLS-70d, On-Chain Credentials and XLS-80d, Permissioned Domains (though it can be adjusted to avoid those dependencies).1.1. Background: Authorized Trustlines
Authorized trustlines allow issuers to control who can hold their issued tokens. By enabling the
RequireAuthflag on their account, an issuer can enforce a policy where trustlines to that issuer must be explicitly authorized before any tokens can be held. Once authorized, the trustline functions as "normal" and the token holder can send, receive, or hold the issuer's tokens, subject to the usual rules of trustline limits and balances.However, approving each trustline requires a signed
TrustSettransaction from the issuer for each trustline to authorize.1.2. Background: Authorized MPTs
Authorized MPTs function very similarly to authorized trustlines. The main differences are that the
RequireAuthflag lives on theMPTokenIssuanceobject instead of the account object, and theMPTokenAuthorizetransaction is used to authorize tokens instead.2. On-Ledger Object:
TokenPreauthThis object mirrors the
DepositPreauthobject post-XLS-70d in fields.2.1. Fields
The fields of this object mirror the fields of
DepositPreauth, including changes made in XLS-70d.LedgerEntryTypestringUInt16TokenPreauth).AccountstringAccountIDCurrencystringCurrencyMPTokenIssuanceIDstringUInt192HolderstringAccountIDCredentialsarraySTArrayDomainIDstringHash256OwnerNodestringUInt64Account.PreviousTxnID.PreviousTxnIDstringHash256PreviousTxnLgrSeqnumberUInt322.1.1. Object ID
The ID of this object will be a hash of the
Accountand either theHolder,Credentials, orDomainIDfields (whichever of those fields is included in the object), combined with the unique space key forTokenPreauthobjects, which will be defined during implementation.If a
CurrencyorMPTokenIssuanceIDis included, that will also be included in the hash.2.2. Account Deletion
The
TokenPreauthobject is not a deletion blocker.3. Transaction:
TokenPreauthThis transaction mirrors the
DepositPreauthtransaction post-XLS-70d in fields.3.1. Fields
FlagsnumberUInt32CurrencystringCurrencyMPTokenIssuanceIDstringUInt192HolderstringAccountIDCredentialsarraySTArrayDomainIDstringHash256Exactly one of the
Holder,Credentials, andDomainIDfields must be included.3.1.1.
FlagstfUnauthorize0x00000001TokenPreauthobject will be deleted as a result (if the transaction is successful).3.1.2.
CurrencyandMPTokenIssuanceIDAt most one of these fields can be provided.
If either
CurrencyorMPTokenIssuanceIDis provided, then this pre-authorization will only apply to that token.3.2. Failure Conditions
Holder,Credentials, andDomainIDare included (i.e. there must be exactly one of these fields included).TokenPreauthobject, if authorizing a new account/credential/domain.tfUnauthorizeflag is set, the account is not currently authorized.tfUnauthorizeflag is unset:tfUnauthorizeflag is set, the credentials are not currently authorized.tfUnauthorizeflag is unset, the credentials are already authorized.tfUnauthorizeflag is set, the domain is not currently authorized.tfUnauthorizeflag is unset, the domain is already authorized.MPTokenIssuanceIDisn't issued byAccount.3.3. State Changes
If authorizing:
TokenPreauthobject is created, with the provided fields.If unauthorizing:
TokenPreauthobject is deleted.4. Transaction:
TrustSetThe
TrustSettransaction already exists on the XRPL. We propose a slight modification to support token pre-authorization.4.1. Fields
As a reference, here are the fields that the
TrustSettransaction currently has.LimitAmountobjectAmountLimitAmount.currencystringAmount.currency)LimitAmount.valuestringAmount.value)LimitAmount.issuerstringAmount.issuer)QualityInnumberUInt32QualityOutnumberUInt32We propose these additions:
CredentialIDsarrayVector256DomainIDstringHash256No more than one of the
CredentialIDsandDomainIDfields must be included.4.2. Failure Conditions
TrustSetwill still be obeyed.CredentialIDsandDomainIDare included.CredentialIDsis included:CredentialIDs:Credentialobject.Credentialobject.Accountsending the transaction.CredentialIDsis not authorized by the destination (or isn't authorized for this token).CredentialIDs.DomainIDis included:DomainIDfield is not a domain.DomainIDis not authorized by the destination (or isn't authorized for this token).4.3. State Changes
If the issuer has the
lsfRequireAuthflag set, and the user is pre-authorizedin some way (either themselves or via credentials/domains), thelsfLowAuth/lsfHighAuthflag on the trustline will be enabled. This will be true even when editing an existing trustline, not just when creating a new one.5. Transaction:
MPTokenAuthorizeThe
MPTokenAuthorizetransaction already exists on the XRPL - it is the transaction that allows an account to opt-in to holding a token, and also can be used by issuers who have authorization turned on to approve token holders.We propose a slight modification to support token pre-authorization.
5.1. Fields
As a reference, here are the fields that the
MPTokenAuthorizetransaction currently has.AccountstringAccountIDTransactionTypeobjectUInt16MPTokenIssuanceIDstringUInt256MPTokenHolderstringAccountIDFlagsstringUInt32We propose these additions:
CredentialIDsarrayVector256DomainIDstringHash256No more than one of the
CredentialIDsandDomainIDfields must be included.5.2. Failure Conditions
MPTokenAuthorizewill still be obeyed.CredentialIDsandDomainIDare included.CredentialIDsis included:CredentialIDs:Credentialobject.Credentialobject.Accountsending the transaction.CredentialIDsis not authorized by the destination (or isn't authorized for this token).CredentialIDs.DomainIDis included:DomainIDfield is not a domain.DomainIDis not authorized by the destination (or isn't authorized for this token).5.3. State Changes
If the issuer has the
lsfMPTRequireAuthflag set, and the user is pre-authorized in some way (either themselves or via credentials/domains), thelsfMPTAuthorizedflag on theMPTokenobject will be enabled. This will be true even when editing an existingMPToken, not just when creating a new one.6. Examples
In this example, Rowan is an RWA issuer, and there are certain legal criteria that must be met before a customer can hold his token (for example, they may need to be an accredited investor). A trusted issuer, Isabel, is issuing a credential that indicates that Alice meets these criteria.
6.1.
TokenPreauthTransactionNote: Rowan already has the
lsfRequireAuthflag set on his account and thelsfMPTRequireAuthflag set on hisMPTokenIssuance.6.2.
TokenPreauthLedger Object6.3.
TrustSetTransactionThis transaction will result in Alice's trustline with Rowan automatically being authorized.
This transaction will succeed, but the trustline will remain unauthorized.
This transaction will fail, since the attached credential isn't Bob's.
6.4.
MPTokenAuthorizeThis transaction will result in Alice being authorized to hold Rowan's RWA issuance.
This transaction will fail, since Alice didn't provide her credential. She can re-submit with the credential attached (like above).
This transaction will fail, since the attached credential isn't Bob's.
7. Invariants
A
TokenPreauthledger object always has exactly one of theHolder,Credentials, andDomainIDfield, and has at most one of theCurrencyandMPTokenIssuanceIDfields.If the
Credentialsfield is included, the array contains between 1 and 10 credentials.8. Security
8.1. Trust Assumptions
Issuers need to trust a credential issuer to only be issuing valid credentials, and to not delete a credential without a legitimate reason.
Issuers need to trust a domain issuer to only be allowing legitimate credentials into their domain.
Appendix
Appendix A: FAQ
A.1: Can I still authorize accounts that haven't been pre-authorized in any way?
Yes. The existing authorization flow will still work for those accounts.
A.2: What will happen during existing authorization flows if a holder has been pre-authorized?
A holder will be authorized on trustline/
MPTokencreation, essentially. So attempting to re-authorize the holder will have the same effect as attempting to re-authorize a holder in existing flows.A.3: Why doesn't this use the existing Deposit Auth flow?
This would be a problem for issuers who want to authorize token holders but don't want those token holders to be able to send funds to their address (for compliance reasons).
Beta Was this translation helpful? Give feedback.
All reactions