Post

NFT

How to develop an NFT using XDBChain Blockchain

Key Definitions

What is an NFT?

A non-fungible token (NFT) is a unit of data stored on a digital ledger, called a blockchain, that certifies a digital asset to be unique and therefore not interchangeable. NFTs can be used to represent items such as photos, videos, audio, and other types of digital files.

What is a XDB?

XDBs are the tokens used by the wider XDBChain Network, to send sums of money and convert currency.

What is a XDBChain Laboratory?

The XDBChain Laboratory is a set of tools that enables people to try out and learn about the XDBChain network. The laboratory can build transactions, sign them, and submit them to the network. It can also make requests to any of the Frontier endpoints.

Foolish Assumptions

  1. You have an internet connection
  2. You have a laptop
  3. You are eager to learn

Quick Summary

We will build a Non-Fungible Token using two keypair accounts issuer and distributor on the XDBChain futurenet. We will make use of the XDBChain laboratory to make the learning experience accessible and awesome.🤗

These are the steps that we will cover

1. Create a 2 keypair accounts

2. Fund the accounts

3. Create a trustline

4. Create the NFT

5. Lock Issuing account

6. Sign and Submit blockchain transaction

Step 1: Creating two XDBChain keypair accounts

Firstly, let’s go to the XDBChain laboratory link and make sure you are using futurenet.

lab

Click the Generate Keypair blue button to generate the first key pair. Repeat the process to create the second keypair account.

gen_key

In my case, these are the public keys for the two accounts I created. Make sure you don’t mix up the two accounts 😜😜

1
2
3
4
5
Distributor
Public Key	GBYIJUGETN5NFORVIRM563KGOLM72EZTNPTGOJFTT6A7AB6F2IRGOGAP

Issuer
Public Key	GAHPAZ4LHGAXW6OQQ2PICM2XSOSCZBWFE4JDGU5TTIEAXO3JL3ABV2YH

Step 2: Funding the two XDBchain keypair accounts

Next, we fund both accounts with 10,000 XDB on the futurenet network using Friendbot.

Just add the public key for the account you want to fund and click on Get futurenet network XDBs.

fund1

fund1

Step 3: Creating a trustline between the issuer and distributor

In the third step let’s set up a trustline between the issuer and the distributor. A Trustline in XDBChain explicitly implies that the distribution account trusts the issuing account with the handling of the assets issued.

Firstly , we go to the transaction builder tab. The transaction builder lets us build a new XDBChain transaction on the XDBChain Network.

builder

Let’s add the public of the issuer in Source account field and generate the Transaction Sequence Number by clicking Fetch next sequence number for account starting with "GBT6JLUJ5J" blue button below that field.

builder1

Next, let’s go to the Operation Type field and select Change Trust option from the dropdown. On the Asset field, we named our asset "DBitsNFT" and added the issuer account public Id. On the Source Account field, we added the distributor public Id.

builder2

Step 4: Creating the Non-Funguiable Token

In this step , we create the NFT we start by adding another operation below the trustline operation.

add-operation

This will be our second operation and we select the Payment operation as the operation type from the dropdown. Add the distributor account public Id in the destination field .

Next , we create our asset by selecting alphanumeric 12 and adding our Asset code in this case it’s DBitsNFT. Then we add the issuer public id in the next field and lastly, we add the amount of token we want to create.

builder3

Lastly , we add metadata to our NFT which in this case is an image from Imgur . Lol we are a bit lazy to do anything complex but this is enough to get the point across

builder4

Step 5: Locking the issuing account

In step 5 , we go on the Operation Type field and select the Set Options option from the dropdown. Let’s go to the Master Weight field and add a value of 0 .This will prevent the issuer from minting more tokens in the future and it’s optional.

builder5

Step 6: Signing and Submitting Transaction

Firstly , we click the Sign in Transaction Signer button near the footer of the page and this will give us a transaction overview and Signatures fields.

Below is the Signatures field where we add the issuer secret id and distributor secred id in the Add Signer fields.

signature

Lastly, we submit the transaction as shown by the images below:

signed1

Conclusion 🤓

You have successfully built and deployed an NFT on the XDBChain blockchain 🚀 . Congratulations!! .

But I recommend you start building something blockchain-related using XDBChain as quickly as possible 🦾

This post is licensed under CC BY 4.0 by the author.