Deploy your NFT on XinFin Hybrid Blockchain within a few seconds and with an extremely Low-cost fee.

Vinn
5 min readFeb 5, 2022

A Non-Fungible Token (NFT) is a digital asset that represents real-world objects like art, music, in-game items and videos. That can be bought and sold using this blockchain technology.

Cryptocurrencies, which use a digital public record of transactions called a blockchain, are fungible.

How Does an NFT Work?

Specifically, NFTs are typically held on the blockchain, Here I am Deploying it on XinFin Blockchain.

An NFT is created, or “minted” from digital objects that represent both tangible and intangible items, including Art, GIFs, Videos etc.

Use of NFTs:

Blockchain technology and NFTs afford artists and content creators a unique opportunity to monetize their wares. For example, artists no longer have to rely on galleries or auction houses to sell their art. Instead, the artist can sell it directly to the consumer as an NFT, which also lets them keep more of the profits.

Let’s add the image to IPFS

Here I have referred the Ruslan Wing’s article to add the image to IPFS and the Deployment of the NFT contract.

First, download and install IPFS CLI based on your Operating system by following the installation guide in IPFS docs.

Follow the steps to add the file to IPFS.

Step 1: Once you have downloaded the go-ipfs file, extract the folder, Open it.

Step 2: Once you are Open the folder, you will see all the files that are in the below screenshot.

Step 3: Now open your command prompt and Start the IPFS repository by entering the command “ipfs init” and press ENTER.

Step 4: Start the IPFS Daemon by entering “ipfs daemon” and press ENTER.

Step 5: Now I am going to add the image to IPFS, by entering the command “ipfs add filename”

Note:

  • The filename should be with extensions like jpg, jpeg, png etc.
  • Before entering the Add command, make sure you have that file in the same directory.

Step 6: Now copy the hash “QmUwSJv19saHirhaKMDKzoyCq2VfrkADEA5MFRzH4U2d9b” and add the “https://ipfs.io/ipfs/” prefix to it

The final URL will be: “https://ipfs.io/ipfs/QmUwSJv19saHirhaKMDKzoyCq2VfrkADEA5MFRzH4U2d9b”

Step 7: Add JSON file to IPFS, Create a JSON file XDC.json and save it in the same directory as the image.

JSON file format should be:

{

“name”: “XDC NFT”,

“description”: “XDC NFT”,

“image”: “https://ipfs.io/ipfs/QmUwSJv19saHirhaKMDKzoyCq2VfrkADEA5MFRzH4U2d9b XDC.jpg”,

}

Now add the JSON file, by entering the command “ipfs add XDC.json”

Do the same as Step 6, Copy the IPFS hash and the “https://ipfs.io/ipfs/” prefix to it.

The final URL for JSON will be: “https://ipfs.io/ipfs/QmWNFBaFraLDuJoDHnDUbvsuFvMSFUQfGnKKX2qqfNxnUF”

Save this URL, need to mint the NFT.

Token Creation

Visit XinFin Remix and create a new file, I am creating the “NFT.sol”

Here I am using the Contract code from Ruslan Wing’s GitHub repository.

Github Repo: https://github.com/RuslanWing/Smartcontracts/blob/main/XRC-721.sol

You can visit the referred article to know more about the Contract code.

Compile the Smart contract and deploy it using Injected Web3.

Note: Make sure to select Apothem network on XDCPay before compiling the contract, and also you should have Test XDC in your account.

You can get the Testnet XDC from XDC Faucet.

For Deployment, you need to Confirm the transaction through XDCPay.

Here is my Deployed contract(XNFT): https://explorer.apothem.network/address/xdcb8379b82c7445ab7db4faaf78945f6976f739c1d

Once Deployed, go to the “Deployed Contracts” section in XinFin Remix and expand the deployed contract.

Now, expand the mint function and add the following parameters:

  • Add your XDCPay address in the “_to” field.
  • Enter any number value in the “_tokenId” field (Here I am using 1, since it’s the first).
  • Add the URI of the JSON file in the “_uri” field, which is in Step number 7.

Click on transact and confirm the transaction from XDCPay.

You can check the details of the deployed contract like name, symbol, owner, or token URI by entering the token id we entered previously i.e. “1”.

So this is how I have created my own NFT with an Image, with extremely low gas fees, within a few seconds.

For initial stage storage before converting art, music, in-game, and videos into NFT, I would advise storing in decentralized cloud storage such as StorX Drive where files are encrypted and split into pieces client-side — then distributed across our network of high-performance Storage Nodes, making it virtually impossible for your data to be compromised.

Mint your NFT’s on XinFin Network and explore it.

--

--