|
| 1 | +<pre> |
| 2 | + XLS: XLS-23d |
| 3 | + Title: 0023 XLS-23d: Lite Accounts (lower reserve, less features) |
| 4 | + Author: Wietse Wind (WietseWind) |
| 5 | + Created: 2021-08-27 |
| 6 | + Status: Stagnant |
| 7 | + Category: Amendment |
| 8 | +</pre> |
| 9 | +# LiteAccounts Amendment |
| 10 | + |
| 11 | +By @RichardAH, @WietseWind |
| 12 | + |
| 13 | +## Introduction |
| 14 | + |
| 15 | +The XRP Ledger is a fast consensus-based blockchain which, unlike competing chains, maintains its user's balances as persistent state rather than as a graph of unspent transaction outputs. This imposes unique per-account storage costs on the network. These costs are passed on to the user. |
| 16 | + |
| 17 | +The cost of creating an account on the ledger is, at time of writing, `5 XRP` with an additional lockup of `15 XRP` (which is redeemable if the account is later deleted). Collectively this is known as the Account Reserve. It has been argued the Account Reserve acts as a barrier to entry for new users and remains a major impedement to the expansion of the ecosystem. |
| 18 | + |
| 19 | +The `AccountRoot` ledger object represents the authoritative state of an XRPL account. |
| 20 | + |
| 21 | +It contains the following fields: |
| 22 | + |
| 23 | +Field | Type | Bytes | Required | Lite Account |
| 24 | +-- | -- | -- | -- | -- |
| 25 | +sfLedgerEntryType | UInt16 | 3 | ✅ | ✅ |
| 26 | +sfFlags | UInt32 | 5 | ✅ | ✅ |
| 27 | +sfAccount | AccountID | 22 | ✅ | ✅ |
| 28 | +sfSequence | UInt32 | 5 | ✅ | ✅ |
| 29 | +sfBalance | Amount | 9 | ✅ | ✅ |
| 30 | +sfOwnerCount | UInt32 | 5 | ✅ | ✅ |
| 31 | +sfPreviousTxnID | UInt256 | 33 | ✅ | ✅ |
| 32 | +sfPreviousTxnLgrSeq | UInt32 | 5 | ✅ | ✅ |
| 33 | +sfAccountTxnID | UInt256 | 33 | | |
| 34 | +sfRegularKey | AccountID | 22 | | |
| 35 | +sfEmailHash | UInt128 | 17 | | |
| 36 | +sfWalletLocator | UInt256 | 33 | | |
| 37 | +sfWalletSize | UInt32 | 5 | | |
| 38 | +sfMessageKey | Blob | 33 | | |
| 39 | +sfTransferRate | UInt32 | 5 | | |
| 40 | +sfDomain | Blob | at most 256 | | |
| 41 | +sfTickSize | UInt8 | 4 | | |
| 42 | +sfTicketCount | UInt32 | 6 | | |
| 43 | +sfSponsor^^ | AccountID | 22 | | ✅ |
| 44 | + |
| 45 | +^^ Part of this proposal |
| 46 | + |
| 47 | +An XRPL Account which owns no on-ledger objects (i.e: does not have any trustlines, escrows, offers, etc.), does not specify a `regular key` and does not set any of its other optional fields has a serialized size of `87 bytes` (excluding storage overhead.) |
| 48 | + |
| 49 | +We propose that any such *minimal* account root imposes such a small burden on the ledger that it should be able to be treated differently to *full* account roots. |
| 50 | + |
| 51 | +## Lite Accounts |
| 52 | + |
| 53 | +We propose that a **lite account** is an XRPL Account with: |
| 54 | + |
| 55 | +- a *minimal* account root |
| 56 | +- the *new* `asfLiteAccount` account flag set, and, |
| 57 | +- (optionally) the *new* `sfSponsor` field set. |
| 58 | + |
| 59 | +#### Lite accounts have an Account Reserve of `1/5th` the ledger's object reserve (i.e. `1 XRP` at time of writing.) |
| 60 | + |
| 61 | +## ⚠️ Restrictions |
| 62 | + |
| 63 | +A lite account **cannot**: |
| 64 | + |
| 65 | +- Own on-ledger objects, and thus cannot: |
| 66 | + - Hold or create Trustline balances |
| 67 | + - Have non-default limits on incoming trustlines |
| 68 | + - Create Offers |
| 69 | + - Create Escrows |
| 70 | + - Create Checks |
| 71 | + - Create Payment Channels |
| 72 | + - Create or install Hooks (pending amendment) |
| 73 | + - Set or use a Signer List |
| 74 | + - Create Tickets |
| 75 | + - Require or use Deposit Authorizations |
| 76 | + - Set or use a Regular Key |
| 77 | +- Become a sponsor for another lite account |
| 78 | +- Perform `AccountSet` on any fields except `sfSponsor` and `sfFlags` |
| 79 | + |
| 80 | +## New Fields and Flags |
| 81 | + |
| 82 | +The following changes are made to fields and flags. |
| 83 | + |
| 84 | +1. `sfSponsor` — a new optional *AccountID* field on the acount root which indicates that another account owns the reserve for the account root. |
| 85 | +2. `tfSponsor` — a new transaction flag that indicates the intent of the sender to create and sponsor a new lite account. |
| 86 | +3. `asfLiteAccount` — a new account flag that can be set and unset subject to certain conditions, which indicates that the account is a lite account and subject to the restrictions of a lite account. |
| 87 | + |
| 88 | +These are explained in further detail below. |
| 89 | + |
| 90 | +## Sponsorship |
| 91 | + |
| 92 | +Lite accounts may be *sponsored*. Sponsorship provides that another account pays the account reserve and, subject to conditions, is entitled to recover the entire account reserve should the lite account be later deleted. *Full* accounts cannot be sponsored, only accounts with `asfLiteAccount` flag can be sponsored. |
| 93 | + |
| 94 | +To sponsor a new account creation: |
| 95 | +A `ttPAYMENT` transaction is created and successfully submitted, which: |
| 96 | + |
| 97 | +1. Specifies an unfunded destination account, |
| 98 | +2. Specifies the (new) `tfSponsor` flag, and |
| 99 | +3. Sends at least as much `XRP` as the lite account reserve. |
| 100 | + |
| 101 | +There is no way for an already established XRPL account (full or lite) to subsequently become a sponsored account. Sponsorship can only occur through account creation. |
| 102 | + |
| 103 | +## Reclamation |
| 104 | + |
| 105 | +A **sponsor** is entitled to *reclaim* the Account Reserve on a lite account (for which they are the sponsor) subject to certain conditions: |
| 106 | + |
| 107 | +### Scenario 1: AccountDelete |
| 108 | + |
| 109 | +If a sponsored lite account: |
| 110 | + |
| 111 | +- contains less than two times the lite account reserve, and |
| 112 | +- does not sign and submit any transaction that results in a `tesSUCCESS` on a validated ledger for more than `1 million` ledgers, |
| 113 | + |
| 114 | +Then the account's sponsor may recover the Account Reserve via an `AccountDelete` transaction. The spsonsor also receives the remaining balance in the lite account. |
| 115 | + |
| 116 | +The `AccountDelete` transaction specifies the lite account as the `sfAccount` field but is signed by the sponsor. |
| 117 | + |
| 118 | +### Scenario 2: AccountSet |
| 119 | + |
| 120 | +If a sponsored lite account, at any time: |
| 121 | + |
| 122 | +- contains at least two times the lite account reserve |
| 123 | + |
| 124 | +Then the account's `sponsor` may recover the Account Reserve via an `AccountSet` transaction that *clears* the `sfSponsor` field. |
| 125 | + |
| 126 | +The `AccountSet` transaction specifies the lite account as the `sfAccount` field but is signed by the sponsor and can only be used to delete the `sfSponsor` field. |
| 127 | + |
| 128 | +Doing so results in a balance mutation on both the lite account and the sponsor account to reflect the return of the lite Account Reserve. |
| 129 | + |
| 130 | +## Upgrading |
| 131 | + |
| 132 | +The owner of a lite account can upgrade their account twice: |
| 133 | + |
| 134 | +### Scenario 1: Removal of Sponsor |
| 135 | + |
| 136 | +The owner of a lite account may unilaterally unsponsor his or her own account by: |
| 137 | + |
| 138 | +- ensuring the account contains at least twice the lite Account Reserve, and |
| 139 | +- creating and successfully submitting an `AccountSet` transaction that *clears* the `sfSponsor` field. |
| 140 | + |
| 141 | +Doing so results in a balance mutation on both the lite account and the sponsor account to reflect the return of the lite Account Reserve. |
| 142 | + |
| 143 | +### Scenario 2: Full Account |
| 144 | + |
| 145 | +The owner of an unsponsored lite account may upgrade the account to a *full* account by: |
| 146 | + |
| 147 | +- ensuring the account contains at least the Full Account Reserve (at time of writing `20 XRP`) |
| 148 | +- creating and successfully submitting an `AccountSet` transaction that *clears* the `asfLiteAccount` flag. |
| 149 | + |
| 150 | +## Downgrading |
| 151 | + |
| 152 | +The owner of a *full* account may opt to downgrade their account to a lite account by: |
| 153 | + |
| 154 | +- creating and successfully submitting an `AccountSet` transaction that *sets* the `asfLiteAccount` flag. This action frees up the difference between the full Account Reserve and the lite Account Reserve. |
| 155 | + |
| 156 | +## Deletion of Lite Accounts |
| 157 | + |
| 158 | +The owner of a lite account may delete their account subject to certain conditions: |
| 159 | + |
| 160 | +### Scenario 1: Send all to Sponsor |
| 161 | + |
| 162 | +If the lite account is sponsored then the owner of the lite account may: |
| 163 | + |
| 164 | +- create and successfully submit an `AccountDelete` transaction, which |
| 165 | +- specifies the account `sponsor` as the `Destination` field |
| 166 | + |
| 167 | +### Scenario 2: Upgrade and Delete |
| 168 | + |
| 169 | +If the lite account is sponsored then the owner of the lite account may upgrade their account to an unsponsored account. |
| 170 | +Once the lite account is unspsonsored, the user may proceed with a normal `AccountDelete` operation (with the proceeds going to any desired `Destination`). |
0 commit comments