最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

blockchain - How to securely update an ERC-721 NFT’s metadata URI after a transfer while excluding owners? - Stack Overflow

programmeradmin2浏览0评论

I'm building a sneaker trading platform using Solidity, where each sneaker is represented as an ERC-721 NFT. The NFT’s metadata contains a QR code that needs to update whenever the sneaker is transferred to a new owner.

Current Approach: Each sneaker has a Token URI that stores its metadata. The smart contract emits a Transfer event when an NFT is traded. An off-chain backend listens to these events and updates the metadata accordingly.

Problem: I need to securely update the Token URI after every transfer, but I want to ensure that only authorised parties (e.g., the platform itself) can update it. The current and previous owners should not be able to modify the metadata, as they might manipulate it in unintended ways.

Would it be best to handle this by:

Using the platform’s owner account to approve metadata updates? Implementing a whitelist of authorized updaters within the smart contract? Leveraging an EIP-4906-like mechanism to standardize metadata updates?

What I’ve Tried: Researching EIP-721 and EIP-4906 to see if there’s a standardized way to handle metadata updates.

Considering an off-chain backend that listens for transfer events and updates the metadata, but unsure how to securely enforce authorization.

Looking into on-chain metadata storage, but it's too expensive for frequent updates. How can I securely manage metadata updates so that only authorized parties (excluding current/previous owners) can modify the Token URI? Are there any best practices or alternative approaches?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论