0074 XLS-74d: Account Permissions #217
mvadari
started this conversation in
XLS Proposals
Replies: 1 comment
-
|
Per the XLS Contributing process, it is my opinion that we have reached a "well-refined standard." As such, I propose that we move this discussion to a file (via #257) and work on final changes using additional PRs, for better change-tracking. Please comment here if you would like to object to moving this spec/discussion forward in the process into a DRAFT spec. (Note that per the Contributing guidelines, moving a spec into the DRAFT state does not mean any kind of endorsement, nor does it mean that this specification will become adopted. It is solely meant as a mechanism to enable better change tracking using PRs.) |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Account Permissions
Abstract
This document formalizes different types of transaction-based account permissions. Permissions include all transactions, a single transaction, or a subset of a transaction's capabilities.
1. Overview
XLS-49d proposed transaction-type-level permissions. These types of permissions can be used for multiple signer lists, as explained in XLS-49d, but could also be used in conjunction with other features.
Currently, it's all or nothing - global signer lists and regular keys can do all transactions. Sometimes you want to provide an account permissions to a subset of features, like with
NFTokenMinter- maybe a few transaction types (e.g. all AMM transaction), or a single transaction type (e.g.NFTokenMint), or even some portion of a transaction type (e.g. authorizing trustlines).This standard formalizes those transaction-type permissions, and also adds more granular permission options.
1.1. Background: Integer Types
An integer is a whole number, a number with no decimals. It is usually shortened to
intin programming languages.Lower-level languages, such as C++ (the language that
rippledis written in), have two main types of integers: unsigned and signed. An unsigned integer represents only nonnegative integers (positive integers and 0), while a signed integer represents both positive and negative integers (and 0, which is neither).The XRPL supports many types of integers, all of which are unsigned. The difference between the different types is the size: the number of bits used to represent the number. A bit is a value that can be either$n$ bits can represent $2^n$ possible values ($0$ to $2^n-1$ ).
0or1, the lowest level of data that a computer supports; all other data types are implemented as bits at their lowest level. One bit can only have two values (0and1), but two bits can have four values (00or0,01or1,10or2,11or3). So0100or001or110or211or3000or0001or1010or2011or3100or4101or5110or6111or7And so on.
An integer type name includes information about what type of integer it is (signed vs. unsigned) and how many bits it uses. So a
UInt8is an unsigned integer that uses 8 bits (theUstands for "unsigned"), and anInt16is a signed integer that uses 16 bits (if theUis omitted, it's a signed integer).The integer types that the XRPL supports are as follows:
UInt8sfTransactionResultUInt16sfTransactionTypeUInt32sfSequenceUInt64sfExchangeRateUInt96UInt128sfEmailHashUInt160sfTakerPaysCurrencyUInt192sfMPTokenIssuanceIDUInt256sfNFTokenIDUInt384UInt512The
sfin the above table stands for "Serialized Field".2. Permissions
A permission is represented by a
UInt32.2.1. Global Permission
The global permission value is already used in existing signer lists; they have a
SignerListIDvalue of0. This is being retroactively redefined to mean that the signer list has global permissions (i.e. can submit any transaction on behalf of an account).0: all permissions2.2. Transaction Type Permissions
A transaction type is represented by a
UInt16.Transaction type permissions were previously defined in XLS-49d, section
2.1.1.1to65536(UInt16)Adding a new transaction type to the XRPL will automatically be supported by any feature that uses these permissions.
2.2.1.
BatchTransactionsThe one exception to this rule is
Batchtransactions (XLS-56d). They will not have a separate permission, sinceBatchtransactions on their own do not do anything. In order to execute aBatchtransaction with a permission, the user will need to have permissions for all the inner transactions.2.3. Granular Permissions
These permissions would support control over some smaller portion of a transaction, rather than being able to do all of the functionality that the transaction allows.
We are able to include these permissions because of the gap between the size of the
UInt16and theUInt32(the size of theSignerListIDfield).65537TrustlineAuthorize65538TrustlineFreeze65539TrustlineUnfreeze65540AccountDomainSet65541AccountEmailHashSetEmailHashof an account.65542AccountMessageKeySetMessageKeyof an account.65543AccountTransferRateSet65544AccountTickSizeSet65545PaymentMint65546PaymentBurn65547MPTokenIssuanceLockMPTIssuanceSettransaction to lock (freeze) a holder.65548MPTokenIssuanceUnlockMPTIssuanceSettransaction to unlock (unfreeze) a holder.2.4. Adding Additional Granular Types
Many other granular permissions may be added. There is capacity for a total of 4,294,901,759 granular permissions, given the limits of the size of the
UInt32vs. the size of theUInt16(for transaction types).Some other potential examples include:
SponsorFee- the ability to sponsor the fee of another account (from XLS-68d)SponsorReserve- the ability to sponsor the fee of another account/object (from XLS-68d)2.4.1. Limitations
The set of permissions must be hard-coded. No custom configurations are allowed. For example, we cannot add permissions based on specific currencies - the best you could theoretically do on that front is XRP vs. issued currency.
In addition, each permission needs to be implemented on its own in the source code, so adding a new permission requires an amendment.
3. Security
Giving permissions to other parties requires a high degree of trust, especially when the delegated account can potentially access funds (the
Paymentpermission) or charge reserves (any transaction that can create objects). In addition, any account that has permissions for the entireAccountSet,SetRegularKey, orSignerListSettransactions can give themselves any permissions even if this was not originally part of the intention.With granular permissions, however, users can give permissions to other accounts for only parts of transactions without giving them full control. This is especially helpful for managing complex transaction types like
AccountSet.Appendix
Appendix A: FAQ
A.1: Could we add additional permission values for different groups of transactions, like all NFT transactions or all AMM transactions?
Theoretically, yes. However, that can also easily be handled with a group of transaction-level permissions. If you think there is a need for this that isn't already addressed by having a group of permissions, please explain in a comment below.
Beta Was this translation helpful? Give feedback.
All reactions