0

I'm a noob in web3 and blockchain, but could someone help me understand this:

  1. Can you store sensitive data within an NFT (ERC721)?
  2. If so, how would that data be stored?
  3. Within the token URI (IERC721 metadata), what data types can be stored (strings, objects, arrays, JSON)?

Sorry if this is really stupid, but the internet lacks good documentation on stuff like this.

1 Answer 1

1
  1. Yes, if you encrypt it before sending it to the blockchain. In that case the blockchain can't have the decryption key, otherwise anyone can use it to read the plaintext data. But otherwise you can't really have private data in the blockchain.

  2. Well this got answered already

  3. The URL can point to whatever address. That address contains the metadata JSON. The standard gives you a format for the metadata JSON, but it can also contain other arbitrary stuff. Also, the metadata typically also includes a link to an image for the NFT - this link can also point to whichever address

3
  • Thanks! Just to be clear, the tokenURI shouldn't contain a string or integer, only addresses? Commented Dec 23, 2021 at 13:54
  • And does tokenURI even have to be an address? What about sticking text in there? like just metadata? Commented Dec 23, 2021 at 14:46
  • Well you can put whatever there, but ready third party integrations expect it to be url. For example opensea expects it Commented Dec 23, 2021 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.