Building an NFT Marketplace
In the year since NFTs rocketed in popularity we’ve been working towards ring fencing a development team to work internally on creating an experimental framework for our own NFT marketplace. We love to set ourselves a challenge, not only to improve our own skill sets as a team, but to also be in a position to be technically capable for any client requirements.
So for this post we’ll take an introductory look at NFTs as well as share some thoughts surrounding our efforts and experience in building our own NFT marketplace.
So what are NFTs?
NFTs or Non-Fungible Tokens are unique, one of a kind digital assets that can’t be replaced with something else. They can be anything digital including art, music, old photographs and tweets for example.
NFTs enable the user (anyone who is registered in the marketplace) or owner (registered users who own an NFT in the marketplace) to mint their own tokens in a marketplace they trust. The item they receive would be authentic since the NFTs unique ID matches up with either the original issuer of the item or the service that performs the authenticity checks.
Users or owners can also buy or sell their own NFT in a marketplace by creating a crypto-wallet and bidding on a fixed price for the NFTs.
What is an NFT Marketplace?
A NFT marketplace is a blockchain-based online platform built to sell and buy non-fungible tokens (NFTs). These platforms, alongside the increasing popularity of NFTs, are also gaining traction resulting in businesses and developers building their own marketplaces to sell or buy NFTs worldwide.
With the use of a crypto wallet required to store and trade NFT tokens, users must create an account via a marketplace to upload their digital assets in order to trade. Most NFT marketplaces have a storefront that functions as a dashboard to enable trading, as well as provide real time data including information on new bids, status changes and new posts for example - plus offer access to 24/7 user support.
Key functionality within a Marketplace
The NFT marketplace offers a range of core functionality for buyers and sellers of digital assets and we’ve listed these below:
Minting - is the process of transforming a media asset into a blockchain-based digital asset (NFT) that can be purchased and sold.
IPFS - The Interplanetary File System is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. Built around a decentralised system of user operators who hold a portion of overall data - creating a secure system for file storage and sharing.
Smart contracts - NFT smart contracts is a mechanism for implementing a sale agreement between the NFT owner and the buyer. Self-executing, it can automatically check that the contract terms have been met, as well as execute the terms without the need for an intermediary or central authority.
Building our own NFT Marketplace
So with an introduction into NFTs and marketplaces done, let’s move onto our own experience of building a NFT marketplace.
Our initial focus was on achieving fast and low-cost transactions in our marketplace and we used Flow Blockchain for this purpose. Flow is a user-friendly, developer-oriented blockchain with an innovative scaling approach initially designed for gaming purposes. Flow Blockchain's network consists of nodes that perform specialised tasks that are performed by a single validator among several networks.
We chose Flow Blockchain as it uses a modified version of the proof-of-stake mechanism to achieve consensus. This means that the cryptocurrency transactions are validated in our NFT marketplace. In addition, the divided work done by its nodes also ensures faster verification of blocks on the blockchain and increases network efficiency.
To create user accounts and dummy tokens for a range of transactions, we used Blocto - a cross-chain smart contract wallet that works as the inter-connective link between the wallet and the users.
The NFT marketplace website was built using ReactJS, which allowed us to quickly develop a robust user interface. We uploaded this via Flow Testnet, which enabled us to simulate the production environment of the chain without requiring real currency to buy tokens and instead use dummy tokens to test the entire range of possible transactions.
To help deploy smart contacts in the NFT marketplace we used Cadence - a high-level resource oriented programming language. It allowed us to pair linear types with object capabilities which in turn helped create a secure declarative model for digital ownership of NFTs. Ultimately it made it easier for our programmers to write code through Flow Blockchain.
During the process of building our marketplace we focused on incorporating these key features listed below:
- New NFT creation: The aim was to allow the admin to add new NFTs to the platform by submitting video content which the IPFS system receives and stores.
- NFT minting: We designed a method to allow either an administrator or a registered user to upload, mint and store NFTs on the blockchain - making them accessible to other chain users.
- Marketplace: Our aim was to create a marketplace where users have visibility of all NFTs available for purchase. Via an in-depth search function, all users’ public addresses and available NFTs can simply be accessed.
- Selling an NFT: We needed to create a system that allowed users and administrators to sell their NFTs by assigning a certain price to them. Additionally contracts had to be easily uploaded via the marketplace in order to transfer ownership and payment through blockchain from seller to buyer. Our NFT platform uses smart contracts to tokenize, store, and make the inventor the initial owner of the NFTs in the blockchain ledgers.
- Purchasing an NFT: It was important that any user has the ability to purchase NFTs that are listed for sale in our marketplace and we used Flow Token - Flow Blockchain's default currency.
- Unlisting an NFT: Finally we made sure that all users had the option to remove their NFTs from the marketplace at any time.
During the development process we faced a couple of main challenges. Firstly getting up to speed quickly with Cadence as a programming language in order to write code through Flow Blockchain proved challenging. Although reliable and secure, the team had to spend time researching and learning the language as it is relatively new to market.
Secondly for similar reasons, finding the right resources within the Flow community also wasn’t as straightforward as we anticipated. As it is a relatively fresh community, we found very few resources to help us integrate certain functionality and features without having very specific experience and knowledge.
With some thorough R&D and persistence we overcame these issues without any major impact on development time and this is exactly the reason why we develop and experiment with our own concepts at Studio Graphene. It helps us develop our skill sets and capabilities, gaining the hands-on experience required.
Within one month our team has successfully developed a fully functioning NFT marketplace giving users the ability to mint, buy and sell NFTs. We created an intuitive and simple to use platform with an accessible dashboard for users to view and store their own NFT collections and the ability to search for NFTs for sale via unique IDs.
spread the word, spread the word, spread the word, spread the word,
spread the word, spread the word, spread the word, spread the word,