Skip to content
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

NFT xcm draft design #300

Open
shaunxw opened this issue Oct 9, 2020 · 1 comment
Open

NFT xcm draft design #300

shaunxw opened this issue Oct 9, 2020 · 1 comment

Comments

@shaunxw
Copy link
Member

shaunxw commented Oct 9, 2020

The MultiAsset representation of NFT.

NFT in ORML is represented by MultiAsset::ConcreteNonFungible:

  • class: MultiLocation::X2(Junction::Parachain, Junction::GeneralIndex).
    • The parachain id is the id of reserve parachain.
    • The general index is from ClassId in orml-nft.
  • instance: AssetInstance::Index.
    • The index is from TokenId in orml-nft.

Sending NFT

Send cross-chain NFT have different scenarios. We use A as parachain 1, B as parachain 2, and R as the reserve chain where NFT issued.

  • From chain R to chain A.
    • On reserve chain R:
      • The NFT could only be transferred if not on a chain reserve account (not sent to another chain).
      • The NFT would be transferred from owner to A's reserve account.
    • On A, a NFT could be created under the dest, and a mapping of IDs on R to A would be stored.
  • From chain A back to chain R.
    • On A, the created NFT would be removed, along with the mapping.
    • On R, the NFT would be transferred from A's reserve account to dest.
  • From chain A to chain B (via R).
    • On A, the created NFT would be removed, along with the mapping.
    • On R, the NFT would be transferred from A's reserve account to B's.
    • On B, a NFT would be created under the dest, and a mapping of IDs on R to B would be stored.

Pseudo XCM

For all cross-chain sending, Alice is the sender and Bob is the receiver.

From chain R to chain A.

Alice.WithdrawAsset {
    assets: nft,
    effects: DepositReserveAsset {
        assets: all,
        dest: A,
        effects: DepositAsset {
            assets: all,
            dest: Bob
        }
    }
}

From chain A to chain R.

Alice.WithdrawAsset {
    assets: nft,
    effects: InitiateReserveWithdraw {
        assets: all,
        reserve: R,
        effects: DepositAsset {
            assets: all,
            dest: Bob
        }
    }
}

From chain A to chain B.

Alice.WithdrawAsset {
    assets: nft,
    effects: InitiateReserveWithdraw {
        assets: all,
        reserve: R,
        effects: DepositReserveAsset {
            assets: all,
            dest: B,
            effects: DepositAsset {
                assets: all,
                dest: Bob
            }
        }
    }
}
@xlc
Copy link
Member

xlc commented Apr 19, 2021

Will wait for paritytech/polkadot-sdk#327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants