Secret Network: Create an NFT on Secret Network with Data Stored on IPFS
Learn how to create a Secret Network NFT with assets stored on IPFS.
Secret Network is a decentralized network built on top of the Cosmos SDK that enables private computation and confidential smart contracts. Secret Network allows developers to create applications with privacy-preserving features such as encrypted data storage, private transactions, and private smart contract execution. This opens up a range of use cases, including financial services, supply chain management, healthcare, and more, where privacy and security are paramount.
Read below to learn how to create a Secret Network NFT with assets stored on IPFS.
- Have an IDE or text editor for making changes to snippets of code.
To do this, navigate to console.filebase.com. If you don’t have an account already, sign up, then log in.
Select ‘Create Bucket’ in the top right corner to create a new bucket for your NFTs.

Bucket names must be unique across all Filebase users, be between 3 and 63 characters long, and can contain only lowercase characters, numbers, and dashes.


Once uploaded, it will be listed in the bucket.

Choose the method you prefer, and take note of the IPFS CID for your image. We will reference this later.

Private Metadata:
{
"description" : "Filebase NFT.",
"image" : "https://ipfs.filebase.io/ipfs/FILEBASE_IPFS_CID",
"name" : "Filebase Robot"
}
Public Metadata:
{
"attributes" : [ {
"trait_type" : "Type",
"value" : "Robot"
}, {
"trait_type" : "Eye color",
"value" : "Blue"
} ],
"description" : "Filebase NFT.",
"image" : "https://ipfs.filebase.io/ipfs/FILEBASE_IPFS_CID",
"name" : "Filebase Robot"
}
Replace FILEBASE_IPFS_CID with the Filebase IPFS CID you took note of previously. Then save both of these as
private-metadata.json
and public-metadata.json
respectively. Upload these files to Filebase in the same manner you used to upload the image file, then take note of each of their unique CID values.git clone https://github.com/secretchaingirl/secret-contracts-guide.git
cd secret-contracts-guide
docker run -it --rm \\
-p 26657:26657 -p 26656:26656 -p 1317:1317 \\
--name secretdev enigmampc/secret-network-sw-dev:v1.0.2
docker exec -it secretdev /bin/bash
secretcli keys list --keyring-backend test
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup default stable
rustup target list --installed
rustup target add wasm32-unknown-unknown
rustup install nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
cargo generate --git https://github.com/enigmampc/secret-template --name nft-ipfs
git clone https://github.com/baedrik/snip721-reference-impl
mv snip721-reference-imp/src nft-ipfs/src
cd nft-ipfs
cargo wasm
{
"mint_nft": {
"token_id": "optional_ID_of_new_token",
"owner": "optional_address_the_new_token_will_be_minted_to",
"public_metadata": {
"token_uri": "https://ipfs.filebase.io/ipfs/FILEBASE_IPFS_CID",
"extension": {
"...": "..."
}
},
"private_metadata": {
"token_uri": "https://ipfs.filebase.io/ipfs/FILEBASE_IPFS_CID",
"extension": {
"...": "..."
}
},
"serial_number": {
"mint_run": 3,
"serial_number": 67,
"quantity_minted_this_run": 1000,
},
"royalty_info": {
"decimal_places_in_rates": 4,
"royalties": [
{
"recipient": "address_that_should_be_paid_this_royalty",
"rate": 100,
},
{
"...": "..."
}
],
},
"transferable": true | false,
"memo": "optional_memo_for_the_mint_tx",
"padding": "optional_ignored_string_that_can_be_used_to_maintain_constant_message_length"
}
}
Replace the following values to match your configuration:
- Token_id: Optional unique ID for the token.
- Owner: Your wallet address.
- Public Metadata -> token_URI: Your Filebase IPFS link to the public metadata file.
- Private Metadata -> token_URI: Your Filebase IPFS link to the private metadata file.
- Royalties -> Recipient: Wallet address that will receive crypto royalties from this token.
This smart contract uses the SNIP-721 standard, which mints a single token and can only be used by an authorized minting address.
docker run --rm -v "$(pwd)":/contract \\
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \\
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\
enigmampc/secret-contract-optimizer
If you have any questions, please join our Discord server, or send us an email at [email protected]
Last modified 2mo ago