0054 XLS-54d: Add DestinationTag to NFTokenCreateOffer transaction and NFTokenOffer object #152
Replies: 1 comment
-
This proposal solves a problem for those folks who custody NFTs for others. And I think it's a reasonable approach. This approach also has the advantage that it works very much like Something to pay attention to in the implementation is that this interacts with the The details of enforcing the flag will be fiddly. You'll need to think through both kinds of offers:
You'll also need to think through all three ways of accepting offers:
I had some initial thoughts on what the rules should be, but they are more complicated than I initially thought. So it's better that you puzzle them out than have me leading you down the wrong path. |
Beta Was this translation helpful? Give feedback.
-
Challenge Overview
My team is working with multiple partners who build on the XRP Ledger.
The majority of those partners mention the cost associated with the XRP reserves (base + owner) which can quickly become high.
Some projects use NFTs and they need to create hundred, thousand... of accounts. Those projects custody the key for their end users.
As an example, an NFT project recently needed to create 4000 accounts requiring approximately 60,000 XRP for it (10 base + ~5 to cover transaction fees and owner reserves).
1. Proposed solution
To streamline this process and minimize costs, we propose a technical solution by modifying one ledger object and one transaction:
Those changes will require an amendment.
2.
NFTokenOffer
ledger objectOne new field is added to the object:
DestinationTag
.2.1. Fields
As a reference, the
NFTokenOffer
object has the current fields (in addition to the common fields):DestinationTag
would be added to that object with the following specifications:3.
NFTokenCreateOffer
transactionThis transaction already exists and one field would be added to it:
DestinationTag
.3.1. Fields
The current fields of that transaction are:
buy
offerDestinationTag
would be added to that transaction with the following specifications:3.2. Usage
Once the transaction is submitted and validated by the XRPL, the
DestinationTag
is stored in theNFTokenOffer
object and will then be used by the NFT project backend to give ownership of a specific NFT to one of their user.4. Flow, how would you use such
DestinationTag
for NFTs?Let’s start this explanation by analyzing first a payment flow with an exchange like Coinbase for example.
We will then see how it can be expanded to NFTs.
Let’s say we have three people:
If Alice wants to send Doug 500 XRP, Alice logs on to Coinbase, enters Doug's
r...
address & the amount, and clicks send. Coinbase's balance decreases, Doug's increases. A Payment transaction is sent on the XRPL. No problem.If Doug wants to send Bob 500 XRP, first Doug needs to find Bob's destination tag for Coinbase. Bob logs on, finds the number, gives it to Doug, and Doug sends a transaction where the destination is Coinbase's r... address, and the destination tag is the number Bob gave Doug.
Doug's balance decreases, and Coinbase's balance increases. But there's an extra step - Coinbase has to examine that transaction, extract the destination tag, look it up in their own database, and then credit Bob with the XRP.
Now what if Bob wants to send Alice 750 XRP? If Coinbase submits a payment transaction from their own r... address with Bob's SenderTag to their own r... address with Alice's DestinationTag, the transaction will fail as malformed (
temREDUNDANT
)!There's no point in having such a transaction on the ledger. Coinbase simply needs to update their own records to move the balance from Bob to Alice - there's no point in involving the XRPL.
Now let's expand this example to include NFTs.
An NFT project, such as the one mentioned at the top of the page that wants to create 4,000 wallets, might envision, for each NFT, to do the following:
destination
set to the new wallet.Step 4, though, implies that they control the secret key of the "custodied" wallet and submit transactions on its behalf.
Technically the NFT project buys and sells NFTs among their customers
Now they're starting to sound like Coinbase.
Using the exchange-like approach, the process for each NFT would be:
Now, whenever one of their internal customers wants to buy or sell the NFT to another internal customer, there is no point in involving the XRPL, just like Bob paying Alice on Coinbase.
If an external wallet wants to buy one of the NFTs, they create an offer for it. They don't even necessarily have to know the destination tag of who owns it - but the NFT project doesn't submit an automated NFTokenAcceptOffer transaction until the current internal owner accepts it manually.
If one of the NFT Project users wants to buy an external NFT, that is when
DestinationTag
comes in.The NFT project submits a buy NFTokenCreateOffer which includes the user's destination tag.
When the offer is accepted, the NFT project looks at the
NFTokenAcceptOffer
transaction metadata, which includes the offer being deleted (in theDeletedNode
object), gets theDestinationTag
from there, and credits ownership of the NFT to that account.Now if an external wallet would like to sell an NFT to a specific user of that NFT project, that specific user will give his destination tag to the seller.
The seller submits a sell NFTokenCreateOffer with the NFT project’s
r…
address as the destination, and the user's destination tag. Similarly as the buy scenario above, once the sell NFTokenCreateOffer is accepted, the NFT project will credit ownership of the NFT to that specific user.5. Additional Notes
The destination tag is NOT added to the NFToken object itself. There's no need for it. It's the project's responsibility to internally update ownership of an NFT just like it's Coinbase's responsibility to update their customer's account balance when receiving a payment.
This proposal would interact with the
lsfRequireDestTag
flag on anAccountRoot
. TheNFTokenCreateOffer
andNFTokenAcceptOffer
transactors should enforce the behavior of that flag.6. Benefits
DestinationTag
, the NFT Project mentioned at the top of the page would only need one account (~200 XRP including base + NFT reserves) instead of 4000 accounts (~60,000 XRP).Beta Was this translation helpful? Give feedback.
All reactions