-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 Module #4046
Comments
Thanks for creating this issue @okwme and brining light to NFTs in the SDK. This is something I would love to see come from a community contribution but is also something I think we can plan into a future milestone. Some thoughts, I really do enjoy the ERC-721 open standard. I think it's very well documented and has numerous implementations already (e.g. 0x, CryptoKitties, Trust Wallet, etc...). I haven't actually read ERC-1155 in it's entirety yet, but it seems that there is continuing discourse on its adoption (correct me if I'm wrong). Essentially, I think we can adopt and incorporate a lot of useful concepts from ERC-721. My initial thoughts are that NFTs should not be incorporated into the existing bank module, but instead should be their own module(s). NFTs can be separate by domains in which case each domain would be it's own NFT module (e.g. What are your thoughts @okwme? |
I really really like the idea of using existing standards here. Lets not reinvent the wheel if we don't have to. |
I agree on both accounts that it should follow the work done on 721 that's already been tested as useful. Most of 1155 is about increasing the gas efficiency of 721 and opinions about combining registries of erc-20 and erc-721. These features don't really apply to an SDK NFT. I think the biggest change between an Ethereum based NFT and an SDK NFT is the ability to store much more Metadata on chain. Because storage on ETH is shared across all participants it's expensive and so the solution was to put metadata off chain and just include a I think this feature should be supported by modifying the 721 spec where the The following methods from the 721 standard would need to become Msg Types:
The following queriers would need to be created from the 721 spec:
The Metadata spec is actually separated from the required fields of the NFT. This might also be good to make optional with a reference to whether or not they exist. Something like EIP 165 would be needed for that and should also be considered. In the mean time we could expect the following queriers for metadata:
It might also be useful to have more Cosmos specific information per NFT. Maybe a parameter for Curious as to other attributes that may be useful for NFTs in the context of Cosmos, anyone else have some ideas? |
Some thoughts as we build the draft implementation here: #4118
|
Some really great discussion related to this topic over at #4153 |
Unless there's an existing pattern around having name and symbol as top-level queries (forgive me, I know nothing about cosmos), it could make sense to put those as part of the |
If the purpose of
and call it a day. I'd also make the metadata spec enforce the presence of |
There's one more property of ERC-721 that is widely used in practice - namely, the corresponding smart contract address. It is basically used as an authentication: this NFT was issued by CryptoKitties smart contract ergo it's a cryptokittie and can be accepted/traded on a decentralized marketplace. Cosmos-based NFT should have some easily accessed authenticated data field too, like |
Maybe the |
Love this discussion! Some thoughts on the points from @shrugs and @vshvsh:
A question I still have with regard to organizing Go code and extending modules in the SDK:
Maybe @rigelrozanski has opinions on this? |
I think chain-id won't cut it. Suppose there is an NFT marketplace that has a whitelist of issuers that are allowed to trade; whitelist is enforced in module/smart contract using onchain data only. It's a very realistic scenario. There is a need for some field that can authenticate an issuer: in ethereum it's smart contract address. In more general sense it can be digital signature or any bytestring that can be linked to issuer through cryptography or onchain state machine. I'd say add |
I think I agree - does this basically entail that we allow the meta-data to optionally be stored on-chain or off-chain on a platform like IPFS (whereby the protocol would retrieve the metadata from the 3rd party)?
Absolutely
I'm not sure either way. What would the purpose be really of having multiple denoms? Wouldn't each NFT potentially cary drastically different rulesets? It may be worth to simply allow for multiple NFT wallets under the same key. But I'm not sure, just curious.
I'm inclined to say that each NFT should be able to define custom mint and burn logic which could occur on a blockly basis, and be able to register that logic through the NFT interface. In this way Mint and Burn rules would typically be defined at the App level then registered with NFT - during the NFT endblock or beginblock custom registered logic would be executed RE: between type Approval struct {
Address sdk.Address
TokenID sdk.Int
}
SetApprovals(approvals ...Approval) { . . . }
RejectApprovals(approvals ...Approval) { . . . } |
Just a few notes, and please forgive me that I am not fully a user of Cosmos (yet). I would generally recommend that fungibles and non-fungibles have separate user interfaces. You keep assets in a bank and you keep collectables with a custodian. This is a great simplification, and ignores two important distinctions, first do you have custody of the tokens or your assignee?, and second what do these tokens represent? In this instance, like many other, a detailed use case study is the best way to choose the appropriate end-user experience. (Which, of course, guides the decisions for SDKs and other levers of decisions.)
Regarding metadata. Yes. It is a very simple and powerful way to connect tokens to the real world (i.e. things with URIs). |
Good intro to these tokens, fulldecent. As a purely non-fungible token, ERC-1155 might seem like it has some complexity, but there are actually a couple of ways to do NFTs with it: We've been using ERC-1155 for non-fungibles intensively by separating the token ID bits into a base ID and an index, please see the section on this here: On the other hand, a very simple way to do non-fungibles with ERC-1155 is to simply give each non-fungible token ID a quantity/supply of 1. This means that each token ID is very naturally either a fungible or non-fungible token based on if it has a quantity > 1. This exactly mirrors the real world. Unique items are naturally one-of-a-kind, while mass-produced items may be created in runs of thousands. |
I think the "semi-fungible" aspects of tokens on the SDK is easily solved with a simple NFT module and the traditional bank module. If some NFTs needs to be fungible there should be an app-specific method to do so. You could simply "burn" the NFTs and mint new fungible tokens that represent them. They can be bought and sold in quantities as fungible tokens and then redeemed for NFTs later on if need be. |
Reposting from issue #1980
|
In favor of fungible yet ERC-721-like tokens. Essentially like rewards points with equal value, but different meta data like expiration, transferability date etc. |
Summary
Either an extension to the bank module to support non-fungible tokens or a new module specifically for non-fungible tokens.
Problem Definition
There is currently no simple solution for supporting non-fungible tokens which make up a large and growing category of decentralized applications.
Proposal
Request for comment about the best way to implement this feature and what exactly this feature should entail. Questions include:
For Admin Use
The text was updated successfully, but these errors were encountered: