March 9, 2023

xNFT – What is an xNFT (Executable NFT)?

Table of Contents

There is a new breed of tokens set to be the next game changer for the Solana ecosystem. We’re talking about executable NFTs (xNFTs). By assigning executable code, an xNFT becomes more than just an asset; it becomes an application. Additionally, with the next-gen Web3 wallet known as “Backpack”, a user can execute their xNFT inside their wallet, eliminating the need for external applications. However, what exactly is an xNFT? In short, it’s a standard, asset, and application, all in one package. Sounds complicated? Read on as we explore the ins and outs of the next era of non-fungible tokens! 

The concept of executable NFTs is, without a doubt, quite interesting. However, whether this concept is or isn’t a huge game-changer is yet to be determined. As Coral – the project behind xNFTs – nicely stated in their post from June 14, 2022, xNFT is “an experiment“. Keep this in mind as you learn and perhaps decide to create xNFTs, as they are still an experiment. 

On the other hand, vetted NFT standards (e.g., ERC-721, ERC-1155, and SPL) are past their experimental phases. If you wish to build dapps (decentralized applications) featuring NFTs with these standards on Solana, Ethereum, or any other leading chain, the Moralis NFT API is the tool to use. Just sign up with Moralis and start BUIDLing!  

What is an executable NFT (xNFT)? - Learn with Moralis

Overview

Throughout the upcoming sections, you will have a chance to learn all you need to know about what the “xNFT” concept entails. You’ll find out exactly what this new token standard is, how it works, and explore the team behind it. As such, you’ll get better acquainted with Coral, Backpack, and Anchor. Nonetheless, we’ll even touch base with Solana Mobile Stack (SMS), which also fits into the xNFT picture.  

However, as mentioned, xNFTs are an experiment that limits you to a specific xNFT operating system (Backpack) and the Solana chain. Therefore, it might be better to focus on building dapps around existing NFTs. If that sounds interesting, we also have a bonus section in this article with a video tutorial showing you how to create a neat cross-chain NFT explorer in less than ten minutes.  

Title - xNFT

What is xNFT?

XNFT is a novel type of blockchain token standard on the Solana network. It functions as executable tokenized code that embodies ownership rights for its use. In a way, the xNFT standard combines the power of NFTs and applications in one tokenized asset. Essentially, an xNFT (a token created following the xNFT standard) can serve as a foundation for operable Web3 applications (a.k.a. dapps).

The code for xNFTs is integrated directly into the digital assets they represent. This enables users to access their assets without the need for third-party software or linking their wallets to any website. However, it does require users to use a special kind of Web3 wallet that supports xNFTs. 

Coral, the team behind xNFTs, believes this revolutionary xNFT framework represents a significant breakthrough for Solana. Moreover, this team has been testing the frameworks, tools, and platforms that utilize xNFTs since the summer of 2022, and they have a lot to show for it.

Title - What is xNFT?

How Do Executable NFTs Work?

You probably know that NFTs (non-fungible tokens) have unique chain IDs and are perfect for representing unique on-chain and off-chain items. The good thing is that xNFTs adopt the same properties; however, they add extra features by using executable programming scripts as NFT-representing files. So, the final asset incorporates the asset and the code. This design enables xNFTs to run inside a special kind of wallet.

Graph Showing xNFT Process

These tokens also have unique metadata, and they can be bought, sold, and traded. Also, their transfers/ownership is managed by smart contracts, just like with traditional NFTs. However, to experience xNFTs’ use cases, users do not need a third-party dapp. Instead, they can execute the code that powers the dapp that is a part of the xNFTs. Hence, a wallet that fully supports xNFTs enables users to access those dapps without connecting to other Web3 sites. Moreover, a special wallet or an operating system supporting xNFT functionality is Backpack. 

xNFT Maintained By the Backpack Wallet

Backpack and xNFTs

It’s not wrong to view xNFTs as special apps. From that perspective, Backpack is an operating system for deploying, discovering, and executing these apps.  

Coral devoted the initial xNFT experiment phase (Phase 0: Operation Dora) to creating a better wallet. They saw existing Web3 wallets as gatekeepers of blockchain ecosystems that are closer to Web2 than Web3. In their opinion, there should be a better way for new protocols than “to lobby for integrations” with wallets. As such, Coral imagined a wallet that uses all crypto assets and enables users to manage various DeFi tools natively in a single interface. This is the goal of Backpack: to be more than a wallet, to be an xNFT operating system.

For now, xNFTs are limited to the Solana network and the Backpack wallet. This is rather limiting; however, if we are to see the expansion of xNFTs to other leading chains, this new type of crypto asset could become a huge deal. So, like with any new blockchain twist, there’s a lot of speculation with xNFTs for now. Still, if you are a Solana fan, you should explore xNFTs further or even create your own xNFT. In that case, you’ll want to get your Backpack extension:

Installing the Backpack xNFT Extension

With your Backpack ready, you can use the xNFT library to explore existing xNFTs:

xNFT Library Interface Landing Page

At the bottom of the xNFT library page, you can use the “Get started” button if you wish to publish your code as an xNFT:

Landing Page to Publish Code as an xNFT

Backpack as a Framework

You can think of Backpack as a new Solana wallet. However, it is also an xNFT application management platform. Thus, Coral’s definition of Backpack – “an operating system that supports xNFT” – is spot-on. In addition, Coral also created React xNFT, which is a framework for building executable NFTs. 

In many ways, React xNFT is similar to React. It includes JSX, functional components, hooks, and browser APIs. However, it comes with a major twist. Using React xNFT, apps run within an isolated browser sandbox. As such, they don’t have access to the DOM. This means that whenever you want to render something, you need to utilize the components provided by “react-xnft“. The latter handles all communication with the host environment to render components safely. Hence, devs get to build decentralized UIs with a native look and feel.

To help you better understand the React xNFT framework, let’s look at the minimum viable xNFT program:

import ReactXnft, { AnchorDom, View, Text } from "react-xnft";

ReactXnft.render(
  <AnchorDom>
    <App />
  </AnchorDom>
);

const App = () => {
  return (
    <View>
      <Text style={{ color: 'blue' }}>Hello, World!</Text>
    </View>
  );
};

The lines of code above represent a classic “Hello, World!” app but as an xNFT. To build such basic and even more advanced xNFTs, you want to use Backpack. There, you’ll be able to mint those apps and run them as native programs.

Note: To learn more about working with React xNFT, visit the Backpack API docs:

Backpack is also coming to mobile devices:

When it comes to the Solana ecosystem on mobile phones, Solana Mobile Stack (SMS) plays an important role. 

Solana Mobile Stack (SMS) Basics

Solana Mobile Stack (SMS) debuted on June 23, 2022, when Solana Labs’ subsidiary, Solana Mobile, announced this open-source software toolkit (SDK) for Android. The SMS SDK enables native Android dapps on Solana. It includes Seed Vault (a secure custody protocol), which plays an important part as it facilitates instant transaction signing. Essentially, SMS is a set of libraries for wallets and apps that allow developers to create mobile experiences on the Solana blockchain. It offers secure private key management and is optimized for Web3.

Additionally, the Solana dapp store provides a distribution channel for apps without platform fees. Nonetheless, Solana Mobile also created Saga, an Android mobile phone with features tightly integrated with Solana. All in all, SMS provides a platform for minting NFTs, transacting goods and services, playing Web3 games, and managing trading risk while on the go. Of course, SMS also gives devs the tools to work with Backpack and xNFTs on mobile devices. 

Coral - team behind xNFT - Website

The Community Behind xNFTs and Backpack: Coral

There is little information on the “coral.community” website. One of the reasons for that might be the community’s desire not to be tainted by some of its team members’ former relations with FTX and Alameda Research. After all, according to Alchemy (November 4, 2022), a former software engineer at Alameda Research (Armani Ferrante) and FTX’s head of strategy (Tristan Yver) are leading the Coral community. 

The Coral community created Anchor, a popular open-source framework for Solana app development in Rust. This framework also inspired Seahorse (Python) and Anchor Registry for Solana program code. However, the Coral team is currently devoting most of its attention to xNFTs, Backpack, and CoralOS. They have also released official documentation for building xNFTs with React. With support from some large crypto organizations, Coral aims to build a Solana ecosystem of products, protocols, and primitives.

Note: Do not mistake Ancor – Solana’s Sealevel runtime framework – with the Anchor protocol.

The Moralis NFT API and More

As pointed out previously, xNFTs are an experiment. While we must agree that things look promising, it’s too early to draw any conclusions regarding how much of an impact this new token standard will have on the Web3 industry and whether or not it will be introduced to other chains.

That said, you may want to focus on traditional NFTs for now and build NFT marketplaces, NFT auction sites, NFT authentication modals, etc. In that case, you want to use Moralis’ ultimate NFT API, which is part of the fastest Web3 API fleet:

Web3 API vs Alchemy API Table

In fact, this Alchemy NFT API alternative is so good that even Alchemy themselves list Moralis as the highest-rated NFT API on the market:

Alchemy NFT API Graph Chart vs Competitors

The ultimate NFT API is just one of many Web3 APIs offered by Moralis. This enterprise-grade Web3 provider also offers the Moralis Streams API and Authentication API. The former enables you to listen to smart contracts and wallets and use on-chain events as triggers for your dapps and bots. With the Authentication API, you can solve Web3 authentication with minimum effort. If you prefer to build on Solana, know that Moralis’ cross-chain DNA offers the best Solana API. So, when/if xNFTs prove themselves, you can expect to find support for these types of tokens in there as well. 

Tutorial: Build Your Cross-Chain NFT Explorer in Minutes

The best way to experience the power of Moralis is to take its Web3 APIs for a spin. You can do that by accessing the API reference pages that await you in the Moralis documentation. If you need some guidance with that, make sure to use the video tutorial below. The latter focuses on the NFT API endpoint to get NFT metadata. The video also shows you how to build a neat NFT explorer across multiple EVM-compatible chains in less than ten minutes using Python and React.   

What is an xNFT? – Summary

In today’s article, you learned that xNFTs are executable NFTs created based on the xNFT token protocol. Unlike traditional NFTs, their NFT-representing content comes in the form of code. Users can execute that code within the supported environment. You also found out that the xNFT protocol is limited to the Solana chain and the Backpack operating system. We also showed you how you can get your instance of this special Web3 wallet for Chrome and start building your own NFTs.

In addition, we also quickly covered the gist of the Coral community, which is the team behind this token standard. Nonetheless, you also got acquainted with SMS (Solana Mobile Stack). Last but not least, we did an overview of the Web3 API products from Moralis. This is where you could follow along with our simple video tutorial and build your own NFT explorer dapp.

If you wish to dive right into building killer dapps, make sure to use our Web3 documentation. All you need are your legacy programming skills and some Web3 basics! However, in case you want to explore other blockchain development topics, visit the Moralis YouTube channel and the Moralis blog. There, you can find many excellent tutorials and explanations to help you master Web3 development. For instance, some of our latest articles focus on the Solana devnet, Web3 marketplace development, building a Polygon portfolio tracker, and much more.

NFT API
Unlock the full potential of your NFT projects with this industry-leading NFT API! Fast, easy, and free.
NFT API
Related Articles
March 3, 2023

How to Build a Polygon Portfolio Tracker

April 10, 2024

How to Get All Owners of an ERC20 Token 

September 7, 2022

How to Build a Solana NFT Explorer

January 24, 2023

Solana Python API – How to Use the Solana API in Python

November 6, 2022

Web3 Provider – Why Blockchain Developers Should Use One

August 22, 2022

How to Integrate Backend Web3 Authentication Functionality

March 21, 2023

Get Crypto Data Using a Python API for Cryptocurrency

February 10, 2023

How to Build a Web3 ChatGPT Dapp

November 9, 2022

Blockchain Discord Bot – Build a Discord Bot for On-Chain Events