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

Possibilities of NFT #26

Open
cedricfung opened this issue Sep 23, 2020 · 5 comments
Open

Possibilities of NFT #26

cedricfung opened this issue Sep 23, 2020 · 5 comments

Comments

@cedricfung
Copy link
Contributor

Is it possible to support NFT in Mixin Messenger?

@cedricfung
Copy link
Contributor Author

cedricfung commented Mar 20, 2021

It's possible to make ERC721 or even ERC1155 work on Mixin Messenger without changes on the Kernel.

Every NFT of ERC721 has a distinct uint256 ID, we can make the ERC721 contract as a normal Kernel asset. The messenger API will only allow a whole and single NFT transfer, the transfer will make a transaction on the Kernel with a single UTXO, and the uint256 ID is included in the extra.

The ERC721 account API is the same as a normal fungible asset account. Let's say the ERC721 account has a balance of 7, then it must own 7 UTXO with 7 distinct uint256 ID extra. Beside the basic account API, list an account of ERC721 can return all the UTXOs. And to make a transfer for this kind of account, the UTXO ID must be included.

ERC1155 is no different either, just allow an account has multiple UTXOs with the same uint256 ID extra.

So this NFT feature is carefully enabled by Mixin Messenger and other wallets, if they have bad implementations, they may destroy their NFT tokens. It's the consensus of wallets, without any Mixin Kernel changes.

@cedricfung
Copy link
Contributor Author

@cedricfung
Copy link
Contributor Author

For some popular NFT operations: e.g. mint a new unit, burn a unit, it's easy to make it free on Mixin Messenger.

event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);

We could make an ERC721 contract:

  1. it creates a huge amount of units, e.g. 1000, then deposit them all to the MTG through a single contract calls.
  2. that deposits emits 1000 Transfer events on Mixin Domain and create 1000 UTXOs.
  3. then the MTG can mint new unit to its users free and fast on Mixin Network without Ethereum calls.
  4. when running out of those 1000, the MTG can request and mint new to the Mixin Domains.

The IMPORTANT thing is Mixin Messenger API should never allow these special UTXOs being seperated, and always retain the UTXO extra data.

@cedricfung
Copy link
Contributor Author

How do we handle those expirable tokens, e.g. ENS?

@cedricfung
Copy link
Contributor Author

How do we handle those expirable tokens, e.g. ENS?

A NFT UTXO should include both the token ID and deposit address in the extra. Thus every NFT is bind to the address. Whenever the NFT on an address expires, it doesn't affect others to deposit again.

And we also must ensure that a NFT token ID can't have more than 1 copy for 1 address. e.g. a domain cedric.eth on address A and B are different, and on address A, you can only have on domain cedric.eth.

And we should never mark an NFT dead or inactive or frozen, because the expired one can be reactivated at any time without change the amount.

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

1 participant