-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XNFT PoC] xnft module - XCM asset transactor for module nft #2649
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good except the token deposit. But should be fine for an MVP with very limited usage.
Strangely, it didn't build in the CI. I tested it before the last push. Will fix. |
not 100% sure why the e2e-tests are failing. I will take a look |
can you do a merge master to fix the e2e-tests issue |
We can't drop local NFTs' data if we use reserve-based transfers. Because Karura is the reserve location for these NFTs, Karura is the only source of truth of any aspect of these assets. We had a long thread about this on the Polkadot forum. Here is Keith's post. Karura, as the reserve location, can't trust another chain with Karura's own NFTs' data. Our team has been thinking about the NFT metadata issue, and we concluded that metadata operations and transfers are separate classes of operations (at least concerning reserve-based transfers). The result of the R&D is the presentation at the Sub0 conference where I explained this in detail with several examples. At the conference, I mentioned only these new hypothetical XCM instructions:
Yet we need one more: |
This PR adds a new
xnft
module.This module serves as a PoC of the XCM NFT Asset Transactor on Karura. This code will be used as a base to implement a more general Asset Transactor for Substrate chains.
Foreign Collection Registration
xnft.registerAsset
extrinsic. In the future, we need to come up with a mechanism that will allow an owner of an original collection on a remote chain to register the corresponding foreign collection themselves without involving a governance body.Notes:
xnft
holds the mapping between the XCM identification of an NFT asset and the local identification in thenft
module.The mapping is bidirectional, though only one side is used now. The backward mapping can be used in the future for extrinsics like
xtokens.transfer
where we identify assets using parachain-local IDs.xnft
pallet account serves as the location for NFTs when they are located in the Holding Register to avoid burning an NFT and losing the associated data.xnft
pallet account will hold a derivative of an NFT when the original NFT is transferred elsewhere instead of burning the derivative. This serves two goals:ReserveAssetDeposited
containing an NFT that was already present on Karura. In that case, it will fail due to the failed transfer from the xnft module account to the beneficiary because the derivative NFT will belong to someone else's account, avoiding creating a duplicate.Tests
The common tests are located in the xnft-tests repository.