Creating NFTs with Hedera and ProvenDB
NFTs — non-fungible tokens — are unique cryptocurrency tokens that are associated with a real-world object. In some cases, they represent a “digital twin” of a physical object which can be tracked within a blockchain-mediated system. In other cases, they represent ownership or custodianship of some digital or real-world assets. Some NFTs can be considered “collectibles” — they represent something rare and unique in their own right.
NFTs are a big deal — sales of NFTs exceeded $2 billion in the first quarter of 2021!
Hedera offers the Hedera Token Service — an economical, efficient and easy to use solution for token generation and transfer. ProvenDB offers blockchain verified storage of digital data that is too large to be stored on a ledger. The two technologies together offer a perfect solution for NFTs. HTS lets you create the tokens and manipulate them, while ProvenDB lets you store unlimited amounts of metadata relating to the token. The metadata is anchored to the Hedera blockchain and so cannot be tampered with or falsified after token creation.
Tokenizing my Dog
I’m going to start by creating a collectible Token for my dog Oberon. Obi is a breeding stud at our home JAGABOO Kennels, and the NFT will represent a commemorative coin celebrating his magnificence. Of course, we need to associate the coin with some absolute proof of Obi’s identity. We will use his pedigree, registration and DNA profile.
Firstly I upload all the information pertaining to Obi into ProvenDB Compliance Vault. I can upload data manually using Web or email gateway or programmatically using our REST API. I then create a Share link for that documentation — Anyone with a ProvenDB account can view Obi’s DNA profile together with the details of a HEDERA consensus service transaction that proves the integrity of the document.
Now that Obi’s details are securely and immutably anchored to Hedera, let’s go on to create the Token.
Creating the Token
I’m going to create the Token using the Hedera JavaScript SDK. There are other ways, we could use the Go or Java SDKs, or even a non-programmatic service such as GoMint. However, I’m comfortable in JavaScript and wanted to check out the API.
First, we need to create a Token “family” for the NFT. In this case, the family is JAGABOO zkennels, since we might be minting coins for each of our breeding dogs and puppies. The following code creates a non-fungible token identifier that will be used to issue NFTs for each dog in the kennel:
You’ll note that the token symbol is “JAGABOO” and the type is NonFungibleUnique.
The Token ID we just generated can now be used to mint NFTs for each of our Dogs.
Now let’s mint a coin for Obi. The link between the code above and the code below is the MY_TOKEN_ID variable, which was printed out by the routine above, and which I placed in a .env
file:
You’ll notice that we specify as the metaData the share URL for the Compliance Vault document containing Obi’s DNA and pedigree. This token is now immutably associated with that record. Both the token and the metadata are anchored to the Hedera blockchain.
By associating a Hedera NFT with a ProvenDB compliance Vault document, we have a token that contains detailed information about its real-world object. The information in the Compliance Vault is immutable and secured by Hedera Consensus Service proofs.
Just the beginning
The potential for NFTs are limitless, and we think that the combination of ProvenDB and the Hedera Token service are similarly endless. ProvenDB can store arbitrarily complex data structures as well as the familiar documents typically stored in the Compliance Vault. By allowing NFTs to carry pointers to immutable database records, all backed by the Hedera blockchain, we can unlock the potential for NFTs to be true “digital twins” of complex real-world objects.
ProvenDB uses Blockchain technology to provide the world’s first entirely trustworthy database. Immutable versions of database state are anchored to the Blockchain, delivering an unparalleled level of data integrity. ProvenDB allows developers to build high-performance applications that include cryptographic proof of data integrity and provenance without having to understand Blockchain programming complexities. Setup a free account today at ProvenDB.com.