Venly API

How to mint an NFT?

This page describes the entire flow in minting an NFT.

NFT creation Flow

1. Create the contract / NFT collection

A first step in creating your NFT is creating the smart contract on the blockchain that will hold all your NFTs.
You can compare the smart contract with a "Collection" of NFTs. This contract will accomodate all your created NFTs. On NFT marketplaces, the NFTs belonging to one contract are typically visualised as one collection. For example, our very own Metaring-smart contract is represented on different marketplaces as follows:
Therefore, decide carefully on how you want to "group" your NFTs. For each group or collection, you can create a new smart contract.
Creating the contract is done by using the POST /contracts endpoint.
Our contracts are created according to the ERC-1155 standard. This standard allows to mint fungible- as well as non-fungible tokens.
Each contract creation will result in a deployment on the blockchain (and therefore be visible on the blockchain). Your contract will receive a unique address.
The following address is for example the address of the Metaring collection: 0xba8c3db050dd99cbe7f980f3d8f48084c6dcc20b
The smart contract that we deploy is a Fully Audited Token Contract (by Least Authority and Nonce Audit) and is battle-tested in the field.

2. Create the token-type / template

A second step is defining the NFTs that you want to create in the collection. Here you define the images, media, attributes, etc. for the tokens that you which to create. This means that, for each NFT with a distinct image and attributes, you need to create a separate token-type.
For each token-type, you can mint one or more NFTs.
A basic token-type configuration consists of:
  • A name
  • A description
  • A main image
  • Indication of fungible or non-fungible
  • Additional attributes
See this list for the complete configuration possibilities.
Creating the token-type is done by using the POST /token-type endpoint.
NOTE: The token-type only defines the tokens. They are not yet created / minted on the blockchain. The last minting-step still needs to be done.
In the token-type, you will need to define if you want to create fungible or non-fungible tokens.
When minting a non-fungible token, it will always be represented as one unique item on the blockchain. Each mint (of the same token-type) is distinguishable from the other mint. More specifically: each minted token will receive a unique token-id on the blockchain.
On the other hand, fungible token-mints are indistinguishable to one another. They all have the same token-id.
In summary:
  • A non-fungible token is a truly unique token. Use these if you really need to know the difference between two minted items.
  • A fungible token is something you have a lot of, and do not need to distinguish from each-other. Use these, if the difference between two minted items does not matter.
    • e.g. minting 100.000 "fish"-tokens, used to heal your character in a game.

3. Minting tokens

The last step in NFT-creation is the actual minting of the tokens. These create a token on the blockchain, using the template (token-type) defined in the previous step.
When minting an NFT, you can immediately provide a destination. The freshly created NFT will be immediately send to the requested destination.
The destination can be a wallet address or email address.
Minting is done by using the POST /tokens endpoint.
You can mint multiple tokens for one token-type. All will "look" the same (they have the same image and properties as defined in the token-type). However, if you are minting non-fungible tokens, each token will receive a unique token-id and mint number (on chain).