solana-web3jsmetaplexcandy-machine

Update Hidden Settings After Initial Upload


I'd like to change my Candy Machine from having hidden settings to no longer be hidden.

Initially, the Candy Machine is created with hidden settings like these:

hiddenSettings: {
  name: "Name",
  uri: "uri..."
  hash: '44kiGWWsSgdqPMvmqYgTS78Mx2BKCWzd',
}

I have attempted updating the candy machine to set the value of hidden settings to null, but this does not change any of the NFTs' metadata or seem to do anything at all.

Is there a way to unhide the assets after initializing them to have hiddenSettings?


Solution

  • Very late but answering for others who may have the same question... Unfortunately it's not that simple. The "hidden" settings for a candy machine determines how the NFTs are uploaded. With it set, all NFTs will be uploaded with the same URI - the placeholder image and metadata.

    Once an NFT is uploaded and minted, the candy machine does not control its metadata. Even if you could remove the "hidden settings" field, this would not reveal your NFTs. In fact you need to keep the hidden settings (in particular the hash) for a reason listed below. Instead, you need to update the NFTs themselves, setting the new URI to the actual metadata file.

    The tool which makes this easier is Metaboss. It that can explore the blockchain and make changes for you. In particular, you can find the mint accounts of the NFTs which have been minted, and update the URIs. Updating will require your keypair for the wallet with the update authority for the collection.

    After installing Metaboss, the command

    metaboss snapshot mints -c [YourCandyMachineAddress] --v2
    

    will output an array of the mint accounts to ./[YourCandyMachineAddress]_mint_accounts.json

    You can change the output destination with the -o flag. Then for a given NFT you can find the metadata using

    metaboss decode mint -a [MintAddress]
    

    which will output the metadata to ./[MintAddress]. Again the output destination can be changed. You will see that this metadata has the URI of your placeholder. The name field, like "SomeCollection #1", identifies which NFT this is. By changing the URI to the actual URI for that NFT, you reveal it. Then wallet and marketplace apps will see the real NFT. You can do this with

    metaboss update uri -k [/path/to/keypair.json] -a [MintAddress] -u [https://somestorage.com/realurifornft1]
    

    All these commands have good nested documentation with --help. Obviously doing this manually for a large collection is very impractical. I have uploaded a bash script for this here. Read the script for usage info.

    Now you may be thinking "isn't editing the NFT metadata like this shady? Couldn't someone use this to maliciously change my NFT?" You would be correct. To prevent this, the hash field from the hidden settings is very important. This should be the MD5 hash of the cache file created when you launched your candy machine, which contains the "real" metadata URIs. If you were to change the metadata to a different URI, you could totally change the NFT. This hash field exists so that users can confirm after reveal that the real URIs have not been changed, by reconstructing that cache file and comparing the MD5 hashes. Hence you should not remove your hidden settings - without that hash, your collection cannot be trusted.