dNFT, Metadata-Enabled

Nico Pei
Blockchain Capital Blog
12 min readAug 23, 2022

--

We need more complex and dynamic metadata for NFT to play a bigger role in the future of open & decentralized financial system

Acknowledgement comes first: Special thanks to Kinjal Shah, Yuan Han Li, Spencer Bogart, Michael Blau from A16Z, Knowerofmarkets, 0xBoFan from Dragonfly, Richard Chen from 1Confirmation for valuable conversations/feedback

Background

When mentioning NFTs, the first thing that comes to mind for most people is likely still a Bored Ape or a Punk that is worth millions of dollars — rising from barely worth anything in 2020. From early 2021 to 2022, brands like Nike, LVMH, Tiffany & Co either launched their own NFT projects or acquired their NFT partners.

As we are almost a year and a half into the meteoric rise of NFT’s trading volumes, the curious crowd might be asking: What else can this technology enable?

Let’s take a step back and think through what NFT is really doing on-chain. While fungible tokens map a user to a balance, an NFT maps a token to a user (user → balance vs nft_id → user). So to evaluate the potential of NFTs, it seems like the right question to ask here is: how many of our financial instruments are non-fungible?

tl;dr: A LOT.

Non-Fungibility

To evaluate what asset classes are non-fungible, let’s take a look at the balance sheet of a large corporation — Walmart.

To be clear, fungibility refers to the interchangeability of assets — my BTC is just the same as your BTC. Non-fungibility, if defined strictly, means assets that are one of one. It’s important to note that there exists a whole spectrum between truly non-fungible (e.g. a piece of art, or a house) and truly fungible (e.g. BTC/USD/common shares of APPL).

Some assets/liabilities can be non-fungible because they are defined by expiry dates, rates, strike prices, underlying assets, counter-parties etc. However, fractions/shares of these assets/liabilities can also be traded — which brings liquidity and thus more efficient price discovery to these otherwise purely non-fungible assets. They are usually negotiated and structured through banks and traded OTC. They usually have less liquidity than fungible assets. Obvious examples of non-fungible assets can be real estate, OTC options, OTC futures, exotic derivatives negotiated between two parties, art & collectibles etc.

On the other hand, fungible assets refer to assets/liabilities defined by simple underlying assets/cash and cash equivalents. They are usually issued by governments, large corporations, or are cash and cash equivalents; traded through exchanges but can also be traded OTC; and have significant liquidity due to market making.

Here’s a breakdown of how much of these assets/liabilities on Walmart’s balance sheet are non-fungible.

With so many non-fungible financial instruments in the world, how would one represent these positions on-chain in an open & decentralized financial system? Are NFTs the solution?

The short answer is yes, but we need to embrace more complex and dynamic forms of metadata.

NFTs as Data Containers

NFTs essentially consist of two integral parts: tokenID and metadata. The tokenID is an unique identifier that represents ownership. Metadata are objects correlated to NFT. Metadata can include names, descriptions, CID which stores the media file, or any other properties that can be integer, string, or object. The media file under the CID stores the content of the NFT — it can be a picture, a video, a website, a piece of code (e.g., in the case of generative art), or any piece of arbitrary data.

The easiest to understand example of metadata would be when you view an NFT on OpenSea, the name and description shown on the OpenSea page is not manually specified by the creator nor the OpenSea team — it’s queried from the metadata.

NFT can interact with protocols in ways specified in smart contracts, and metadata contains all the critical data that defines the asset. Thus, taking NFTs beyond art & collectibles by adding more programmability and functionality requires changes in how we make use of metadata.

Most existing NFTs’ metadata contain names, descriptions, and CID pointing towards the media file. However, due to the flexibility of metadata described above, metadata can be used to specify a lot of things: expiry dates, underlying assets, strike prices, maturity dates, fees earned, counter-parties, fixed rates, depreciation rates, in-game levels, token-gated content accessibility etc. Metadata can also contain functional properties such as specifying the level of the character for an in-game token, or recording number of times a QR code has been scanned on a membership pass, or specifying details of a non-fungible financial position.

For example, Uniswap v3 uses NFTs to represent Liquidity Providers’ (LP) positions. The NFT specifies LP’s fee tier, range, poolID, position size, and fee earned in its metadata. Below is the code from the Uniswap v3 contract that defines the metadata for NFTs that represent LP’s position.

Uniswap v3 NFT opens up the world of NFT beyond art & collectibles: NFT can be a receipt for non-fungible financial positions. The NFT serves as the receipt for liquidity provided in the liquidity pool as well as fees earned by the provided liquidity. When users sell the NFT, they are selling their position. When users send the NFT back to Uniswap protocol, they can reclaim what the protocol has owned them — their provided liquidity and fees earned throughout the cycle.

With static NFT, metadata is defined when the token is minted and there’s no prescribed change within the metadata afterwards. The bored ape NFT contains the bored ape picture and that’s not open to change. Having static metadata is great for art & collectibles NFTs.

However, in order to build a robust and open system of NFTs beyond art & collectibles, many properties within the metadata need updates. For example, fees earned accumulate throughout the liquidity providing cycle, underlying assets of a position might be changed, players’ performance in games impact the levels of their characters, and holders might want to push the expiry date by paying a premium.

Dynamic NFT comes into play here.

Introducing Dynamic NFT (dNFT)

Dynamic NFT, some dubbed as NFT 2.0, are NFTs whose metadata can change based on instructions written in smart contracts and external conditions or actions. Dynamic NFTs (dNFTs) have unique and static tokenID (ownership) and dynamic metadata (or other dynamic elements such as certain external conditions trigger minting / burning). The unique tokenIDs serve as dNFTs’ identifiers while their dynamic metadata can change based on external conditions, including on-chain or off-chain events, actions, results, or data updates.

dNFTs essentially need two pieces of information to know how to update the metadata:

  1. instructions to the underlying NFT regarding when and how its metadata should change
  2. access to relevant external data sources

Instructions are written in smart contracts and data sources come from on-chain data or off-chain data fed by tamper-proof oracles.

dNFTs can be updated in various ways based on external conditions. These upgrades include description updates, financial position size and liquidity range updates, hidden traits unlock and upgrades, change of images, changes of utility and granted access etc, most of which can be very useful for financial positions NFT, on-chain games, and utility NFTs for ticketing and token-gated content and communities.

Dynamic elements besides metadata changes can also exist. For example, dNFTs can be minted based on certain external conditions, such as when a hidden spot is found in the virtual world or when an in-real-life sports team wins the game. dNFTs can also contain “hidden traits” manifested through user interactions instead of within the metadata. For example, the transfer function might be disabled after a QR code is scanned, which is useful for using NFT as tickets.

Examples that demonstrate dNFT can do a lot more than ERC-20 and static NFT

Solv Protocol — dNFT applied in Financial Vouchers

Solv Protocol uses a very dynamic version of dNFTs based on ERC-3525 standard, which are dubbed Semi-Fungible Tokens, to allow anyone with specific issuance needs, be it protocols that are looking to raise capital or institutions that want to sell structured products, to buy and sell derivatives with flexible configurations.

Solv has launched three products: vesting voucher, convertible voucher, and bond voucher. Vesting vouchers allow ERC-20 tokens to be locked within the issued NFTs and vested by owners overtime. Convertible voucher and bond voucher allow protocols to issue zero-coupon bonds with fixed yields or embedded call options.

Using dNFTs to represent these positions has numerous advantages.

First, it brings a much better developer experience. If using ERC-20 range tokens instead of dNFTs, each change of parameters would require deploying a new ERC-20 contract. Meanwhile, a single NFT contract (collection) can contain many NFTs with different parameters (different range tokens for different underlyings and ranges). Unlike ERC-20 tokens, dNFT with configurative parameters allows for no-code creation and deployment, which significantly improves the developer experience.

Second, it creates a much better experience for end-users. The SVG files of these dNFTs clearly state all useful information about the positions, and they can be directly traded on all NFT marketplaces. The SVG image is not statically attached but dynamically generated based on on-chain data and oracle feeds, guaranteeing the authenticity of displayed information. Moreover, just like an account, ERC-3525 tokens can also receive, store and send out tokens. This allows each of these NFTs in the collection to then be fractionalized — enhancing liquidity just like using ERC-20 tokens.

Swell Network — dNFT used in liquid staking

Swell Network allows users to stake eth and receive swETH with swNFT. While swETH is the liquid version of staked eth, similar to stETH from Lido, swNFT contains users’ swETH and can be used to enter swell vaults to get the most yield out of the eth staked.

Using both swETH and swNFT have many benefits. swNFT allows users to buy and sell eth staked and swell vault positions without closing the vault position or unstake their eth. For large positions in vaults, it’s preferred to buy existing positions instead of opening new positions because all vault positions are in competition with each other for staking rewards. While swETH makes the price ratio variance of swETH and ETH apparent, swNFT makes the price ratio variance of ETH and swNFT less apparent, decreasing liquidity while keeping the market relatively stable.

dNFT in Gaming

dNFT can do a lot more than ERC-20 tokens or static NFTs, and we are starting to see some innovatives approaches in gaming. In a way, gaming is a low-risk environment for builders to explore what can be enabled by cutting-edge technologies. I really appreciate this quote:

“Gaming is a leading indicator on up-and-coming technologies since they are a technically demanding yet relatively low-stakes environment to explore scalability and usability problems early in a technology platform’s lifecycle: security and compliance concerns in games are less critical compared to more “serious” commercial or financial applications, often allowing for faster iteration loops. So while the untrained eye might dismiss a platform with “just” a bunch of games as frivolous, the discerning will recognize that this state is a valuable testing ground. How many mobile interaction patterns and habits have their roots in early mobile games like Doodle Jump, Cut the Rope, and Angry Birds?”

— Gubsheep, Creator of Dark Forest, in The Strongest Crypto Gaming Thesis

Wolf Game

Wolf Game was a popular NFT game in late 2021. It implemented NFTs that can steal or tax other NFTs based on rules and parameters specified in the smart contract.

Merge by Pak (The Game of Extinction)

Merge was a NFT / Gaming project by anonymous designer Pak. It implemented NFTs that automatically merge together if they are in the same wallet. Two masses merge together to become one bigger mass. The size is reflected in the visual of the NFT as well as the metadata. Once merged, the mass cannot be separated.

Existing Problems

Display of Metadata

In the early days of Uniswap v3 NFT (May 2021), there were often unfortunate events like someone selling large LP positions for very little. This was partly due to the fact that some people weren’t aware that these NFTs represent their positions. However, it was also due to the fact that current metadata display on NFT marketplaces isn’t suitable for displaying non-fungible financial positions or complex utility-based NFTs.

As we see more and more use-cases of dNFT in defi and gaming, displaying important, feature-defining metadata will be much needed. However, different types of dNFT require displaying different metadata, which often involves some calculations around metadata and getting price-related data from oracle. Thus, we might see market segmentation in the NFT marketplace — different marketplaces for different types of NFTs. This might also go down a route similar to e-commerce — one platform starts as a dominant, single-category store and gradually expand to all categories because of the network effect of customers (liquidity in NFT marketplace’s case)

The Separation Between Metadata and On-chain Data

If a Uniswap v3 LP position was traded for x, y, and z prices and holders updated their ranges for multiple times based on market conditions, just having timestamp data with x, y, and z prices isn’t enough — we need to know how x, y and z prices are mapped to different ranges holders picked (i.e associate on-chain transaction data with the dynamic metadata to extract insights). Right now, there’s no connectivity between on-chain data and the dynamic metadata. A lot of analysis cannot be done because of this.

Other examples to demonstrate this problem:

1/ We are using dNFTs as in-game characters that can be upgraded or downgraded based on in-game activities. The grade (Level 1 — Level 10) is stored on-chain and is incessantly updated while the NFTs are incessantly traded. Without metadata snapshots at each mutation of metadata, it’s impossible to get the average sales price of each level.

2/ Membership passes that have x number of access to the gym. Every time it’s used, the metadata records the usage by subtracting 1 from x. x is stored on-chain and is incessantly updated while the membership passes are incessantly traded. We want to get the average sales price of passes with x number of access left in order to evaluate fluctuation in market interests. It’s impossible to correlate transaction data with x due to the lack of metadata snapshot at each mutation of x.

dNFTs currently aren’t traded much in the secondary market so the problem is less obvious. However, if NFT becomes more complex and the dynamic metadata thesis holds true, this problem must be solved. Thus, we need to store a snapshot of the metadata after every significant mutation and make the metadata snapshots easy to query from.

Security & Cost Tradeoffs

Having dynamic metadata definitely introduces more challenges from a security standpoint. Since the metadata defines the asset, securing metadata is as important as securing ownership. The most common question to consider is where to host the metadata. Hosting metadata on a centralized server is cheaper but prevents the metadata from being openly accessible. Hosting the metadata on-chain can be costly since every significant mutation of the metadata incurs gas fee. Also, all forms of descriptive properties need to be stored on-chain (except numerical properties), which is expensive.

Conclusion

1/ NFT as data container can be a lot more than art & collectibles ERC-721 or ERC-20 tokens, and the magic lies in complex and dynamic metadata

2/ A lot within the financial system is non-fungible, and dNFT can play a vital role in tokenizing these non-fungible assets and liabilities

3/ We need marketplaces that better serve the need of complex metadata display and tools that support metadata and on-chain transaction data analysis

Hope you enjoy this piece. If you have any projects you are working on or thoughts you want to discuss, don’t hesitate to reach out at nicopei_eth on twitter.

References

--

--