The Elegance of the NFT Provenance Hash solution

0
31
Photo by Denis Stefanides on Unsplash

How it works and why it matters.

For all those who have wondered what the NFT Provenance Hash is and how it works, this article is for you.

Introduction

The NFT space has seen considerable growth in the past few months, with successful NFT collections reaching all-time highs. This has led to an explosive growth in the number of upcoming projects coming up. For both aspiring and long-term NFT enthusiasts, there is an increasing need to be able to discern the good projects from the bad.

For a typical NFT drop, NFTs within the collection come with different traits and rarities, with some being ultra rare or even legendary. NFTs with higher tiers of rarity are hence worth much more than the more common versions. Fair distribution and transparency is hence extremely important during the NFT launch, as this directly impacts the confidence and value of the NFT collection post-mint. The NFT Provenance Hash, done correctly, ensures the fairness of a project’s NFT distribution during and post mint.

A BAYC NFT. The Gold Standard in NFT Provenance Hash

Personally, I do believe that the Bored Ape Yacht Club implementation of the NFT Provenance Hash solution is the gold standard. Click here to see it on their website!

What is an NFT Provenance Hash?

The Problem

To understand the NFT Provenance Hash, we must first understand the problems that it was developed to solve. When minting NFT collections, the order in which the NFT tokens are assigned to the NFT artwork and metadata is important. If the order of assignment (Token 1 to Image 1… Token n to Image n) is hidden prior to the mint, NFT buyers have no guarantee that the projects will not manipulate the assignment post-mint for their own benefits. Yet, if the NFT Token URI is set to the final list of metadata and images, savvy NFT buyers will be able to see the metadata and images for the entire collection even before the mint is completed. This allows them to target mint around a range of numbers to try and get the collection’s rarest NFTs.

This poses a paradoxical problem to the developers. How can we protect the NFT metadata during launch, and prove that the Token assignment was truly fair post-mint?

The Solution

  1. NFT projects should not release the final Token URI until the final NFT has been minted, to prevent savvy snipers from acquiring the best ones in the collection.
  2. Developers need a way to prove that the order of the Token Image and metadata was set pre-mint, and was not manipulated.
  3. Developers need to generate a fair random number post-mint to start the distribution of the NFT from that number.

This is where the Provenance Hash comes in.

Explanation

Hashing the Images

So what is a hash? A hash is simply a one-way conversion of data to a string, that is extremely difficult to reverse(read here for how much time it takes to brute force a 256 Hash). Think of it as a giving a piece of data a unique fingerprint!

You can use the fingerprint to match it to a person who gives you their fingerprint, but you cannot derive how this person looks like simply from having his fingerprint. In this same way, we can:

  1. Generate a hash from an image which cannot be reverse engineered.
  2. Prove that the hash belongs to the original image if we have the original image.

Image to Hash demonstration

First, we read our image as a string. I’ll be using art from my upcoming NFT collection, Tasty Toastys as examples.

Next, we use a SHA-256 hashing algorithm to generate a hash of our image, using the bytes data of our image.

SHA-256 algorithm to generate Image Hash

Voila! We have our first Image fingerprint!

But that’s not all!

Hashing the Hashes

We can go one step further, and create a hash of the hashes, to prove that the order of the images have been predetermined on the creation of the hash. We can achieve this by combining the hashes of the images in a sequential order, and hash this new string! The order is immutable since changing the order in which the hashes were combined will result in a different hash. We call this final hash the Provenance Hash.

Hashes to Hash demonstration

For Images 1 to N, we can generate all their individual hashes:

Toastys and their respective hashes

Next, we combine the hash strings of each image in the correct sequence.

A basket of Tasty Toastys in a sequence

Combined Hash String:

042e97dff4a63b7f02ca70dee51dcf1c0bba45f720f98ae48f68ee890a2683d8dc7ed7513cdb74f5dd338ea670aec2774057e396d04086070fb86b618a252a80612cd5877ce5176494d60078e272e479f9fc693dc4b19f106c54fe8d2aece05

We then hash this new string to create our provenance hash!

Basket 1 Provenance Hash:

f056aca1a9bd62f1e5a37fa7edfbc79527f4ff0efe7ba08fccb6ebf297cbfa46

If we changed the order we sequenced the NFT images, we will get a totally different Provenance Hash.

Basket 2 example

Combined Hash String:

042e97dff4a63b7f02ca70dee51dcf1c0bba45f720f98ae48f68ee890a2683d8612cd5877ce5176494d60078e272e479f9fc693dc4b19f106c54fe8d2aece05cdc7ed7513cdb74f5dd338ea670aec2774057e396d04086070fb86b618a252a80

Basket 2 Provenance Hash:

72d176866081ac054f3b94d5d533718c9f48c1901bd6d076ce947598f24d02dd

With the provenance hash, NFT projects can prove to the community that the NFT images and metadata were pre-determined beforehand, without having to expose their metadata before launch!

Starting Number

Last but not least, developers can prove that the starting number used to begin assigning tokens to their images was not manipulated. We can do this in the minting smart contract. By taking the block number of the last minted NFT in the collection, and dividing it by the total supply of the NFT and taking the remainder, we can generate a number that cannot be manipulated by the developers. Buyers have no incentive to manipulate this number as well, since the starting sequence of the NFT Images and metadata are unknown to them.

A warning

One thing to note is that the Provenance Hash should be released prior to the launch of the mint, so that it is clear that the order of the images and metadata were determined before token ids were distributed to the buyers. If the provenance hash is disclosed post-mint, this means that it is possible that the order was determined post-mint.

In summary

The NFT Provenance Hash solution is able to solve the paradoxical needs of a successful NFT drop; ensure image and metadata privacy during launch, and ensure post-mint transparency and fairness in the distribution.

A simple and elegant solution indeed.

Why this matters

  1. For NFT buyers, it is important to see if upcoming projects will be implementing this. Implementing the Provenance Hash solution is a public commitment to fairness and transparency.
  2. For NFT projects, doing a Provenance Hash will increase buyer confidence and clear any potential doubts that the distribution of the NFTs was manipulated or unfair.

I hope that this article has helped you understand the NFT Provenance Hash better, and builds awareness and transparency in the NFT community moving forward.

If you liked this article, and want to find out more about my upcoming NFT drop, Tasty Toastys, you can contact me in our Discord forum or follow the project on Twitter.

Also, remember to follow me on Medium as I will be writing more about the NFT space in the coming weeks!

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read


The Elegance of the NFT Provenance Hash solution was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.