1

Given a policy with a list of non-fungible tokens,

  • Could a smart contract update the metadata of all NFTs in the collection, under certain conditions?
  • If not, could this be done "manually" by a node?

On a side note, does my question make any sense or am I missing a fundamental aspect on how the whole protocol works?

4
  • On-chain metadata can't be changed, I think the answers in this post may help answer your questions.
    – Myles
    Apr 4, 2022 at 22:49
  • Great link resource, but as far as I know on-chain metadata can be changed depending on how you mint it. If you use timelocks native scripts or plutus you can indeed change NFT's metadata - just burn and remint them with new metadata attached. That's been done before. If you really want to ensure immutability right from the beginning you will have to use plutus and the UTxO based approach to mint NFTs one-time-shot. That was part of the PPP lecture 5/6 I believe
    – Will
    Apr 8, 2022 at 10:19
  • Depends on what you count as metadata, if you're talking about a datum in a smart contract that changes based on who owns an NFT for example yes metadata can change. Of course you can burn and re-mint but that's not changing the metadata in-place on the chain of an NFT, you're burning that NFT and minting a new NFT entirely.
    – Myles
    Apr 8, 2022 at 17:29
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes or disappears.
    – Glorfindel
    Apr 11, 2022 at 6:56

2 Answers 2

2

If the policy allows you to mint and burn those same tokens (or NFTs) again, you can update the linked metadata for those NFTs by creating a new minting transaction with the updated metadata and then burning those newly minted tokens.

According to CIP-25 the "valid" metadata for an NFT is that of the latest minting transaction, so just by creating and deleting an exact copy of an NFT you will have "updated" its metadata, since metadata is always connected to transactions, and not to the token itself.

https://cips.cardano.org/cips/cip25/#updatemetadatalinkforaspecifictoken

1

So one way you could do it is by minting NFTs that have a URL in their metadata that links to your server hosting the corresponding metadata - not IPFS. Then you can easily change the metadata independently of what's on-chain.

It is not very decentralized, since if you're server goes down the NFT's corresponding metadata is not accessible but it gives you the ability to update them without having to create another transaction.

Alternatively, you can use a so called time-lock based minting policies which allows you to change or update tokens up to a certain deadline. That way you could burn and re-mint a given NFT in the future to update its metadata. But again, trust is required since you basically are in control of the NFTs at all times.

2
  • This re-minting is allowed in any policy which is not locked yet? I thought locking policies would only limit more NFTs to be added in the policy Apr 7, 2022 at 12:12
  • 1
    The time based lock just uses some slot deadline - once that slot has passed any tokens minted under that policy are immutable. No further changes can be made to existing token's metadata etc. + no burns/ additions of tokens
    – Will
    Apr 8, 2022 at 10:13

Your Answer

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

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