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

NEP-11 properties method inconsistency #141

Open
vincentgeneste opened this issue Sep 29, 2021 · 5 comments
Open

NEP-11 properties method inconsistency #141

vincentgeneste opened this issue Sep 29, 2021 · 5 comments

Comments

@vincentgeneste
Copy link

I believe the NEP-11 standard could use some clarification when it comes to the properties method.

The official standard (here: https://github.com/neo-project/proposals/blob/master/nep-11.mediawiki) states that for the properties method:

Returns a serialized NVM object containing the properties for the given NFT. The NVM object must conform to the "NEO NFT Metadata JSON Schema"

It also shows a signature like this

{
  "name": "properties",
  "safe": true,
  "parameters": [
    {
      "name": "tokenId",
      "type": "ByteString"
    }
  ],
  "returntype": "Map"
}

So this is the first issue, it's inconsistent, in one case it says a serialized NVM object, in the other it says a Map.

Also, I think for ease of use by wallets and dapps, one way to make it easier would be to allow the properties method to return a serialized json object, as it is way easier to deal with that, than to deal with a map / nvm objects directly (to avoid having to convert all base64 etc). A serialized json object also technically conforms to the standard since it is technically an NVM object, that also conforms with the json standard.

Thoughts?

@hal0x2328
Copy link
Contributor

I agree. I think that for the sake of adoption, a serialized JSON string should be the return type for properties.

There are likely to be numerous casual third-party NFT tools created, and if every developer of those tools has to learn how to deserialize NVM objects, many will be discouraged if they don't already have a background in low-level smart contract VM interaction.

The Map object return is only slightly better since they still have to base64-decode every field individually before they can utilize the data.

NFTs can bring a lot of new interest in Neo. We should make it easy for anyone who has mostly only experience working with fetching JSON objects in a front-end application to interact with Neo NFTs.

@mfbz
Copy link

mfbz commented Sep 29, 2021

I totally agree with this. A serialized JSON string would be so much accessible.
No base64 parsing, no low-level interaction, just data ready to be used.

The easier it is for devs to interact with NFTs, the more we'll see NFTs based DApp on NEO, and I think that this proposal goes perfectly in that direction.

@ediopia
Copy link

ediopia commented Sep 30, 2021

I agree. I've tested both ways and JSON string is much simpler. I couldn't even find a way to deserialize NVM at frontend.

I was lost because some NGD sample nft contracts don't follow the standard description.

@steven1227
Copy link
Member

Try to solve in the neo-project/neo-modules#651

@devhawk
Copy link
Contributor

devhawk commented Oct 20, 2021

If we are going to consider changes to NEP11, can we also consider solving neo-project/neo-devpack-dotnet#647 and neo-project/neo-modules#629?

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

6 participants