You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: XLS-0035-uritoken/README.md
+90-89Lines changed: 90 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
14
14
# Problem Statement
15
15
16
-
XLS-20 is a Non-Fungible Token standard that is currently active and in-use on the XRP Ledger main-net. Despite this, many developers and users of the XRPL remain unsatisfied by its complexity, unusual edge-cases, lack of first-class object NFTs, and general difficulty to understand and write integrations for. We therefore propose a light-weight alternative: *URIToken*.
16
+
XLS-20 is a Non-Fungible Token standard that is currently active and in-use on the XRP Ledger main-net. Despite this, many developers and users of the XRPL remain unsatisfied by its complexity, unusual edge-cases, lack of first-class object NFTs, and general difficulty to understand and write integrations for. We therefore propose a light-weight alternative: _URIToken_.
17
17
18
18
# Amendment
19
19
@@ -24,70 +24,69 @@ The amendment adds:
24
24
A new type of ledger object: `ltURI_TOKEN`
25
25
A new serialized field: `URITokenID`
26
26
Five new transaction types:
27
-
*`URITokenMint`
28
-
*`URITokenBurn`
29
-
*`URITokenBuy`
30
-
*`URITokenCreateSellOffer`
31
-
*`URITokenCancelSellOffer`
27
+
28
+
-`URITokenMint`
29
+
-`URITokenBurn`
30
+
-`URITokenBuy`
31
+
-`URITokenCreateSellOffer`
32
+
-`URITokenCancelSellOffer`
32
33
33
34
## New Ledger Object Type: `URIToken`
34
35
35
-
The `ltURI_TOKEN` object is an owned first-class on-ledger object which lives in its owner's directory. It is uniquely identified by the combined hash of its `Issuer` (minter) and the `URI`. Therefore an issuer can only issue one `URIToken` per URI. Upon creation (minting) the Issuer is the object's first Owner. You cannot mint on behalf of a third party. As with other first class objects, each URIToken locks up an owner reserve on the account that currently owns it. Disposing of a URIToken frees up these reserved funds.
36
+
The `ltURI_TOKEN` object is an owned first-class on-ledger object which lives in its owner's directory. It is uniquely identified by the combined hash of its `Issuer` (minter) and the `URI`. Therefore an issuer can only issue one `URIToken` per URI. Upon creation (minting) the Issuer is the object's first Owner. You cannot mint on behalf of a third party. As with other first class objects, each URIToken locks up an owner reserve on the account that currently owns it. Disposing of a URIToken frees up these reserved funds.
36
37
37
38
The object has the following fields:
38
39
39
-
| Field | Type | Required | Description |
40
-
| --- | --- | --- | --- |
41
-
| sfIssuer | AccountID | ✔️ | The minter who issued the token. |
42
-
| sfOwner | AccountID | ✔️ | The current owner of the token. |
43
-
| sfURI | VL blob | ✔️ | The URI the token points to. |
44
-
| sfFlags | UInt32 | ✔️ | A flag indicating whether or not the URIToken is burnable, and whether or not it is for sale. |
45
-
| sfDigest | Hash256 | ❌ | An sha512half integrity digest of the contents pointed to by the URI |
46
-
| sfAmount | Amount | ❌ | If the URIToken is for sale, then this is the amount the seller is asking for. |
47
-
| sfDestination | AccountID | ❌ | If the URIToken is for sale and this field has been set then only this AccountID may purchase the token. |
| sfURI | VL blob | ✔️ | The URI the token points to.|
67
+
| sfDigest | Hash256 | ❌ | An SHA512-Half integrity digest of the contents pointed to by the URI |
68
+
| sfFlags | UInt32 | ❌ | tfBurnable (0x00000001) or 0 or absent|
69
69
70
70
If `sfDigest` is specified then the minted token will contain the hash specified by this field. For the end user this means they can verify the content served at the URI against this immutable hash, to ensure, for example that the properties of the NFT are not maliciously altered by changing the content at the URI. It may also be desirable to have a dynamic NFT where the content is intended to be altered, in which case simply omit `sfDigest` during minting, and the resulting URIToken will not contain this field.
71
71
72
-
‼️ If `sfFlags` is present and set to tfBurnable then the URIToken may be later burned by the Issuer. If the Hooks amendment is active on the chain this flag also indicates that the Issuer is a *strong transactional stakeholder*. In this event the Issuer's hooks will be executed whenever an attempt to buy or sell this URIToken occurs, and those hooks may reject the transaction and prevent it from happening if their own internal logic is not satisfied. It is therefore highly advisable to check whether or not a URIToken has `tfBurnable` set before purchasing or accepting it in trade.
72
+
‼️ If `sfFlags` is present and set to tfBurnable then the URIToken may be later burned by the Issuer. If the Hooks amendment is active on the chain this flag also indicates that the Issuer is a _strong transactional stakeholder_. In this event the Issuer's hooks will be executed whenever an attempt to buy or sell this URIToken occurs, and those hooks may reject the transaction and prevent it from happening if their own internal logic is not satisfied. It is therefore highly advisable to check whether or not a URIToken has `tfBurnable` set before purchasing or accepting it in trade.
## New Transaction Type: `URITokenCreateSellOffer`
109
108
110
-
A user may offer to sell their URIToken for a preset amount. A given URIToken may have at most one current sell offer. There are no buy offers. If a user executes a URITokenBuy then it must immediately cross an existing sell offer.
109
+
A user may offer to sell their URIToken for a preset amount. A given URIToken may have at most one current sell offer. There are no buy offers. If a user executes a URITokenBuy then it must immediately cross an existing sell offer.
111
110
112
111
To offer the URIToken for sale: specify its `URITokenID`, an `Amount` to sell for, and optionally a `Destination`. If Destination is set then only the specified account may purchase the URIToken. If the Amount is 0 then a Destination must be set. (This prevents an accidental "transfer to anyone" scenario.)
113
112
114
113
If a previous sell offer was present on the URIToken then it is simply replaced with the new offer.
115
114
116
-
| Field | Type | Required | Description |
117
-
| --- | --- | --- | --- |
118
-
| sfURITokenID | Hash256 | ✔️ | The Keylet for the URIToken object being offered for sale |
119
-
| sfAmount | Amount | ✔️ | The minimum amount a buyer must pay to purchase this URIToken. May be an IOU or XRP. |
120
-
| sfDestination | AccountID | ❌ | If provided then only this account may purchase the URIToken. |
@@ -139,52 +138,53 @@ Whether a URIToken is for sale is indicated by the presence of the `Amount` fiel
139
138
140
139
To purchase the URIToken, a user specifies its `URITokenID` and a purchase `Amount`. The purchase amount must be at least the amount specified in the sell offer (but may also exceed if the user wishes to tip the seller.) The purchase amount must be the same currency as the amount in the sell offer. No pathing is allowed in this transaction. The user must have sufficient currency available to cover the purchase.
141
140
142
-
| Field | Type | Required | Description |
143
-
| --- | --- | --- | --- |
144
-
| sfURITokenID | Hash256 | ✔️ | The Keylet for the URIToken object being purchased. |
145
-
| sfAmount | Amount | ✔️ | The purchase price the buyer is willing to send. Must be the same currency as the sell offer. May not be less than the sale amount. |
| sfURITokenID | Hash256 | ✔️ | The Keylet for the URIToken object being purchased.|
144
+
| sfAmount | Amount | ✔️| The purchase price the buyer is willing to send. Must be the same currency as the sell offer. May not be less than the sale amount. |
## New Transaction Type: `URITokenCancelSellOffer`
159
158
160
159
When a user has offered their URIToken for sale and later changes their mind, they may perform a clear operation. A clear operation simply clears the current sell offer from the URIToken.
161
160
162
-
| Field | Type | Required | Description |
163
-
| --- | --- | --- | --- |
164
-
| sfURITokenID | Hash256 | ✔️ | The Keylet for the URIToken object being cleared of any active sell offer. |
The URI pointed to by a URIToken should resolve to a JSON document that follows the below schema.
179
178
180
-
This schema may be extended over time as additional categories and use-cases present themselves.
179
+
This schema may be extended over time as additional categories and use-cases present themselves.
181
180
182
-
‼️ Note that the `Digest`, if provided during Minting, is the hash of this JSON document **not** the content pointed to by the JSON document. The `Digest` is calculated by taking the SHA-512 Half of the stringified, whitespace trimmed content JSON.
181
+
‼️ Note that the `Digest`, if provided during Minting, is the hash of this JSON document **not** the content pointed to by the JSON document. The `Digest` is calculated by taking the SHA-512 Half of the stringified, whitespace trimmed content JSON.
0 commit comments