0

I have a question in terms of servicing NFT.

In solana's move to earn service stepN app service, there are NFT shoes which have levels btw 1 to 30.

we can buy the shoes both from the app and from the opensea, and users can upgrade the levels of those shoes.

so what I wonder is that, does those nft shoe's level metadata always updated whenever user upgrades the shoe level in the game?

or, is that metadata actually updated whenever user uploads the shoe to the marketplace? (fetching from the database, and updates the metadata)

I think updating those metadata is also a cost, so I think the latter would be efficient for the service.

how does stepN or another nft based game dealing with this issue?

appreciate in advance.

2
  • please update the description with an expansion of "m2e" and try to narrow the scope to a single question. i modified the the title in this vein, but am tempted to vote to close for lack of focus
    – trent.sol
    Commented Jul 23, 2022 at 8:57
  • @trent.sol thanks for changing the title. m2e stands for "move to earn", so I changed it. and I also narrowed down the question.
    – koo
    Commented Jul 23, 2022 at 10:11

2 Answers 2

2

Answering for the general case: updating values that are already allocated (so for example incrementing an existing level) doesn't cost anything in Solana. You pay for storage (by depositing enough SOL to make the account rent exempt), so you pay for space to be allocated for the level in the metadata, but changing the number stored there from 19 to 20 doesn't increase the storage used. That update does need to be in a transaction which will have a fee as usual, but assuming the user is paying for the upgrade with something on-chain there will already be a transaction. So it would be most efficient to just increment the level as part of that transaction for no extra cost.

Again in general, you'd want to have this update stored on-chain right away because you don't control all clients that might be interested in it. An NFT creator doesn't control the marketplace their NFTs can be listed on, so it's hard to run code when an NFT is uploaded to a marketplace and update things at that point. You could also imagine someone having their own spreadsheet or something tracking their NFT collection, they'd expect to be able to read accurate data on-chain. They might want to look at their NFTs in their wallet and see accurate metadata.

0

The total costs of updating metadata depends on your infrastructure.

For another project I'm working on, we're storing image and metadata on NFT.Storage (which is free, for the most part). Since you've already created the metadata account, the only costs you are incurring here would be the update instruction, which is your typical transaction fee as of July 2022 (0.00001 SOL). You can even have the user sign this transaction as the payer so you're not actually incurring anything.

With the current state of the Token Metadata Program, you cannot access or change the manifest off-chain. Therefore, you'd need some kind of API for your application, where an event triggers the change of a particular field on the manifest, then uploads that manifest, then updates the metadata URI field on-chain (or passes the transaction to the user to sign as the payer).

Another solution would be to create your own metadata-like program for your application, where you can have a variety of dynamic fields (all on a PDA assigned to a specific token mint). Assuming you created a function to update this metadata, you can then simply trigger this update on-chain. Note, though, that these attributes wouldn't be seen by any wallet service such as Phantom, because again, it's your custom program and not the standard Token Metadata Program.

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.