-
Notifications
You must be signed in to change notification settings - Fork 84
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
feat: add NFT standard #3
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.
Thanks so much for putting this together @friedger!
I am pretty hesitant to support too many display-oriented functions in this standard. I am much more in favor of a separate trait that does a great job at returning display data for an NFT.
For example, you have a mandatory function for icon-url (uint)
, but I can imagine many NFTs that wouldn't want this. For example, NFTs that represent ownership of an asset (like a house), or an NFT that denotes membership of something.
Plus, if we wanted to really support easily displaying NFTs, this seems too limited. Why not have name
, description
, etc.
I would love a standard that does the job, while supporting flexibility and easy implementation. In my opinion, we only need:
get-balance
transfer?
get-owner?
I am curious to hear your opinion on defining standard error codes for transfer?
and get-owner?
. I believe that could go a long way towards a good experience for clients.
There is already a discussion about error types. For
|
@hstove We don't really need |
@friedger agreed that we don't need Another thing that we should do, and make as a best practice for this kind of SIP, is to require an example implementation. A simple repo with the trait and an implementation would be perfect. Bonus points for (simple) JS code, especially to demonstrate error handling. All opinions my own, of course - would love to get more eyes on this. |
@hstove example implementations are a great idea. my thinking would be to create a monorepo under the org that holds all implemented SIP examples, though through drafts they would be held by the implementer. |
@xelamade Friedger added a reference implementation in this PR: https://github.com/friedger/clarity-smart-contracts/blob/master/contracts/sips/nft-trait.clar |
Hey @friedger - have been doing some reading around ERC721 implementations. The standard includes a function This returns a URL which includes JSON metadata that clients can use to embed information about the NFT. I believe we should follow a similar practice. What do you think about adding this function:
Additionally, it would likely be best to build off of the existing JSON schema used in the ERC721 standard: {
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents"
},
"description": {
"type": "string",
"description": "Describes the asset to which this NFT represents"
},
"image": {
"type": "string",
"description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
}
}
} |
@hstove I like Is the length long enough? Why 256? Should we limit the asset meta data to images? I suggest using "uri" and "mime-type". We discussed immutability, therefore, I suggest to include a hash in the contract (This is all about the meta data and should go in a separate section of the standard and it should be optional.) |
Well, if this is a URI, do you think 256 is not long enough? It's not for storing on-chain data - this method must return a resolvable URI (although it could be on http, ipfs, etc). Supporting For example, the JSON schema I linked is for image-based NFTs, but in ETH there are now more semi-formal standards for other NFTs - like 3d objects, videos, etc. I also like simply using an off-chain pointer because there is no need to access this data on-chain.
This is an interesting idea - this would be a hash of the JSON metadata? I like it - it's light enough and clients can choose how they respond to an invalid hash. However, if you wanted immutability, you could just use an IPFS-resolving URI, which are immutable.
Agreed that all the JSON schema stuff should be left out of this strict standard. I'm mainly advocating for the URI method, as that'll be quite important to support a decentralized ecosystem of NFT apps. |
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.
Addresses some comments, more to come
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.
Looks good to me! Once you feel ready and all the remaining comments are addressed, let's advance this to activation-in-progress
. Once the trait definition is on mainnet, can you add its address to the Activation
section?
We can always keep working on the text content. However, it looks like the reviewers here feel that the trait definition itself is ready. If so, then let's advance this SIP.
@muneebm I try to incorporate your comments. |
The trait has been deployed to testnet and mainnet! |
Awesome! This SIP is now in activation-in-progress status. |
Given our earlier discussion and stacksgov/grants-program#73, are we on the same page about only a |
@hstove Yes, sip has been updated, new version deployed to mainnet, new beeple nft published. |
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.
all looks good. ready for launch! 🚀
@friedger and @markmhx what do you think about making one more change to this trait? Perhaps follow a similar line for this NFT trait: (re)deploying it with the |
@314159265359879 The name is not part of the sip, IMHO. You can deploy them using any name and as often as you want. I think in the future, we will have some better referencing to sip trait contracts, e.g. via BNS names. |
Should this be merged as the sip is activated? |
And it's official! Congratulations @friedger! |
Thanks to everyone who helped review and get this ready! |
Added Cyle.btc to Editor Committee
This PR adds a SIP for the Non-fungible standard.
It fixes #2