Develop an NFT using Stellar Laboratory

Develop an NFT using Stellar Laboratory

In NFTs we trust!! ๐Ÿค–

ยท

5 min read

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 Stellar?

Stellar is a distributed ledger technology that allows anyone to build low-cost and fast financial services. Stellar has some of the best documentation and tutorials to help a blockchain developer get started quickly.

What is a lumen?

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

What is a Stellar Laboratory?

The Stellar Laboratory is a set of tools that enables people to try out and learn about the Stellar network. The laboratory can build transactions, sign them, and submit them to the network. It can also make requests to any of the Horizon 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 stellar testnet . We will make use of the Stellar 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

7. Explore the Accounts and NFT

Step 1: Creating two stellar keypair accounts

Firstly , let's go to the stellar laboratory link and make sure you are using testnet

Screenshot 2021-07-01 at 15.59.30.png

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

Screenshot 2021-07-01 at 16.06.56.png

In my case, these are the public keys for the two accounts I created. Make sure you don't mix up the two accounts ๐Ÿ˜œ๐Ÿ˜œ

Distributor
Public Key
GB4CQMAJEFBR4KWZHR4WY4SXIT5DXME6F4BUPNCIYTU4RIKLHU5XIYV6

Issuer
Public Key
GBT6JLUJ5JB2LVSRLR24EBQVIQAX23EMGJ4S7F3OF6B7GNOOCXWZTXDG

Step 2: Funding the two stellar keypair accounts

Next , we fund both accounts with 10,000 lumens on the test network using Friendbot.

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

Screenshot 2021-07-01 at 16.33.49.png

Screenshot 2021-07-01 at 16.34.04.png

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 Stellar 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 Stellar transaction on the Stellar Network.

Screenshot 2021-07-01 at 19.47.38.png

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" purple button below that field.

Screenshot 2021-07-01 at 16.38.54.png

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 "StellarNFT" and added the issuer account public Id. On the Source Account field, we added the distributor public Id.

Screenshot 2021-07-01 at 16.40.53.png

Step 4: Creating the Non-Funguiable Token

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

Screenshot 2021-07-01 at 20.48.35.png

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 StellaNFT. Then we add the issuer public id in the next field and lastly, we add the amount of token we want to create.

Screenshot 2021-07-01 at 16.43.44.png

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

Screenshot 2021-07-01 at 16.48.49.png

Quick one checkout IPFS and how it's used in the distributed web. The InterPlanetary File System (IPFS) is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. When building a real-world NFT I recommend using IPFS.

Screenshot 2021-07-01 at 16.47.11.png

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.

Screenshot 2021-07-01 at 16.50.10.png

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 in the Add Signer field and click Sign with BIP path button

Screenshot 2021-07-01 at 21.15.12.png

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

Screenshot 2021-07-01 at 21.11.14.png

Screenshot 2021-07-01 at 16.54.36.png

Screenshot 2021-07-01 at 16.56.50.png

Step 6: Exploring the stellar accounts and NFT

Screenshot 2021-07-01 at 16.52.33.png

You made it to the final step!! ๐Ÿค— Here we navigate to Stellar Explorer to check out all accounts . Feel free to play around using the public ids of the issue and distributor.

Screenshot 2021-07-01 at 16.57.20.png

Screenshot 2021-07-01 at 16.58.26.png

You also check out the NFT we created using this link stellar.expert/explorer/testnet/asset/Stell..

Screenshot 2021-07-01 at 16.58.47.png

Screenshot 2021-07-01 at 17.00.59.png

Conclusion๐Ÿค“

Check out my previous article on NFTs: How to create an NFT on Ethereum Blockchain

You have successfully built and deployed an NFT on the Stellar blockchain . ๐Ÿš€ . Congratulations!! .

But I recommend you start building something blockchain-related using stellar as quickly as possible ๐Ÿฆพ

๐Ÿ™Thanks to Stellar

๐Ÿ™Thank you for reading this -Follow me on Twitter

Checkout my website.

Buy Me A Coffee