Inspiration

While NFTs are readily bought and sold, tools and services for producing derivative works of the original NFTs such as physical merchandise for the NFT owners and creators to share with their fans and community are scarce. Automating this could generate more revenue and engagement for NFT owners without having to sell their original NFT and still provide additional royalties to their creators.

In the past, our team has worked together building fitness-club-management software. When we heard about the Hedera22 Hackathon, we decided to adapt this club-management software for the NFT world to create our contest entry.

What It Does

The merchandise items are derivative works of an underlying NFT artwork collection, and we've coined the term "subNFTs" to describe them. A subNFT has two components: 1) a physical item with a private key embedded in a visibly printed QR code on the item, and 2) an NFT minted by the club owner which is transferred to the member’s HashPack wallet with the name “Certificate of Authenticity.”

In the app, a fan-club member may bid on at item such as a coffee mug bearing the NFT design which is part of a limited edition of mugs. If they win the item, then they will see in their HashPack wallet an NFT with the name "Certificate of Authenticity." When they receive the mug, they may verify that it is authentic by scanning its QR code printed on the side. In the event that they want to sell the mug to someone else, they can prove that their mug is authentic. This is because they are also in possession of the subNFT token which was minted using Solidity code. To transfer their ownership, they would pass the NFT from their wallet to the wallet of the transferee. Then, they would deliver the mug to the transferee. The transferee could then use the app to scan the QR code and determine that they have the corresponding, unique certificate of authenticity token. This maintains a record of the chain-of-title of the item on a decentralized network, thus verifying its authenticity.

This works by the use of public and private keys. A private key is a long string of random characters with a fixed length. A public key is a one-way hash, or deterministic scrambling, of a private key based on a published, scrambling pattern. Anyone with a private key may derive the associated public key by running it through the hashing algorithm. In this case, the private key is stored in a QR code on the item. When the user scans the mug’s QR code, the app obtains the mug’s private key, which is the private key for an account on the Hedera network. That key is hashed to obtain the public key. The app then queries the HashPack wallet to determine whether an NFT with a matching public key in its metadata is in the wallet. If it is, then the app reports that the mug is authentic.

Features provided to the app Owner include seeing all users in the club and their profiles. The app Owner may also view an accounting of all purchases in a table format which can be exported to csv format.

How It Is Built

The user interface of this iOS app is built using Swift and UI Kit in Xcode running on a Mac. There are three supporting backend servers:

  • Node.js on Digital Ocean running libraries including the Hedera SDK,
  • Firebase/Google Cloud, and
  • WordPress running on Hostgator.

The Node server is responsible for interfacing with the Hedera network and executing the Solidity code that runs on the EVM. The subNFT tokens were minted using Solidity Smart Contracts 2.0. Strato and JavaScript were used to upload the Solidity code for the smart contracts. Responses from the Hedera network are stored in Google Cloud Firestore. Sign-in is made through an email account, Google Gmail account, or Apple ID as these are supported by Google Firebase Authentication. Firebase also hosts JavaScript Cloud Functions and it provides for the Remote Configuration of parameters that update the app. To connect to a HashPack wallet, HashConnect is used. The Coinmarketcap API returns a current hbar price. Hbars are requested from the paired HashPack wallet to purchase Comm tokens used in auction bidding. Solidity code is used to transfer the 10% royalty payment to the NFT Creator when Comm tokens, the internally currency of the app, are purchased. When an auction is won, the on-demand manufacturer, Gelato, is engaged to ship the physical item to the winner.

Challenges We Ran Into

The biggest challenge was creating an App that would be functional for the Hedera network dealing with Hbar transfers, NFTs, auctions of subNFTs, and also complying with Apple’s requirements to have the app published.

We had to implement some specific features such as allowing the purchase of our internal Comm tokens via Apple In-App purchases as well as HBAR for Apple to approve. Doing this, we realized we also had to set a flat-rate for our internal token and adjust the amount of HBAR dynamically. So for instance, we sell one Comm Token for $4.99 as an in-app purchase and also for however many HBAR that $4.99 is at that very moment.

Some technical challenges we ran into included pairing with the HashConnect wallet and providing the best user experience. We had to create some custom Firebase functions to properly trigger in real-time when a user pairs their wallet (which can be at any time). Same with sending HBAR transfer requests using their HashPack wallet so we don’t have to have any access to a User’s private keys.

We realized we had to modify the HashConnect library slightly to work with native iOS Apps as their library was mainly meant to work with web-based frameworks such as React.

Accomplishments That We're Proud Of

We’re proud that we’ve had our app approved by Apple. We set the scope of what we wanted to do for the hackathon with the Hedera network, Solidity Smart Contracts, and the HashPack wallet so that it could include all these elements while also being a useful public-facing mobile app on the Apple App Store. We felt that if our app could be approved there, then the reach for our project could be enormous as well as very accessible to those who have Apple iOS devices.

We’re happy to have our Node.js backend server with all of our Hedera and Smart Contract related code working seamlessly with a published mobile app as well as a secure Google Firebase/Cloud backend database.

What We Learned

We learned much about the HashGraph, HashPack and HashConnect, Strato and many other related technologies within the Hedera network and the Hedera community.

We also saw many uses cases with what we built and other potential ways we can leverage Hedera’s network for similar projects in the future.

Roadmap: What's Next for the NFT Fan Club App

Next we would like to:

Automate the flow of auctions to send physical merchandise to those who win. We want to make it easy for Owners to customize what they want to sell. We may pick different types of subNFTs to sell, for instance, we we'd like to customize merchandise such as t-shirts and mouse pads.

Time auctions with Public NFT Drops so NFT Creators have many more ways of selling and managing sales with their fans and community.

Next we plan to expand to:

Browser-based versions, e.g., Safari and Chrome.

An Android app published to the Google Play Store.

Integrating NFTs into the U.S. Copyright Office registration system, see link.

Built With

Share this project:

Updates