Skip to content

Latest commit

 

History

History
75 lines (48 loc) · 7.09 KB

README.md

File metadata and controls

75 lines (48 loc) · 7.09 KB

MasterclassNFT

This DApp rewards participants of the “Phoenix Guild” masterclasses with an NFT, which later can be used to access exclusive content.

Screenshot of the front-end

“The Phoenix Guild” (TPG) is a female blockchain-community, educating womxn in web3 development. This DApp was built as part of a soliditiy bootcamp of TPG. The Phoenix guild is regularly holding “masterclasses” for its community, inviting blockchain developers to provide a workshop about different web3-coding topics.

The idea of an on-chain CV becomes more and more popular, the unique nature of NFTs allows them to be used as a certification. NFT-diplomas are transparent and less susceptible to counterfeiting and manipulation. Additionally, the certificate can’t get lost or destroyed.

The idea

That makes NFTs a suitable tool for our purpose: We chose to implement an NFT-certificate for the TPG-masterclasses. An NFT would be an easy way to verify attendance of the sessions. To make sure, the certification can’t be sold or forwarded to another person, the NFTs are non-transferrable (sometimes referred to as “soul-bound” tokens).

However, in this case, the NFT-certificate has to be issued by a trusted authority, to make sure only the actual participants get the NFT-certificate. The mentors or admins of the masterclasses will collect the addresses of the attendees and map them in the smart contract, so the NFTs can later be requested by these “whitelisted” accounts.

At the same time, the NFTs could have additional advantages linked to it, either in a form of reward (”NFT perks/goodies”) or special access (”gate-keeping”). Later, these NFTs could serve as a ticket for the next masterclasses, allow access to permitted resources or guarantee a discount for paid events. Just like with certificates, NFT tickets can reduce fraud, false identities, duplication or expensive reselling.

Like this, the NFTs have more than one use case, making sure that loyal participants get rewarded and stay encouraged during their web3 learning-journey. Therefore, the smart contract has to check for the respective NFT when requesting a ticket or a discount.

In this case, we decided to use "Lit Protocol" (https://litgateway.com/apps) (a decentralized access control protocol) to whitelist the NFT holders for exclusive resources. We deposited the contract address at Lit, which allows users with at least one Token generated by this specific contract to access specific content. For this test-DApp, the masterclass-NFT owners will be able to see a resource on google drive.

A simple walkthrough

  1. After attending a masterclass, the participants can go on the DApp website and connect their browser wallet (Meta Mask).
  2. The provided address is checked (participants’ addresses are whitelisted), then a message is displayed if they are eligible for the NFT.
  3. If so, it appears a “minting” button, which triggers the creation of the NFT. The user will have to sign a transaction and pay the gas fee for the minting.
  4. The new NFT is transferred to the connected wallet. The address is no longer whitelisted.
  5. Then, the new NFT owner can access exclusive resources by clicking the "get access" button. They will be redirected to the Lit Protocol and have to connect their wallet to see restricted content.

Resources

Future implementations

There are many things in the process that could be added or improved later.

  • We didn't manage to implement the whitelisting-functionality correctly (so just addresses added by an admin of the masterclasses can mint), due to difficulties to call return value of isParticipant(). Another idea was to emit an event so the frontend can access the value, however gas fees had to be paid when calling that function (see branch front-end2). This would be the first thing to fix.

  • One of the first additional steps would be to connect the NFT to a picture on IPFS, so it has a visible representation. Then, we would implement a message with a link in case of a successful mint, leading to the NFT on rinkeby-opensea.

  • Our original idea was to implement dynamic NFTs (sort of “upgradeable” NFTs using Chainlink Keepers) to show the participation in TPG masterclasses & bootcamps, so every time a masterclass was attended, the NFT picture would evolve, for example in form of a rising phoenix. Because of the difficulty level, we didn’t realize this (yet).

  • The NFT-minting could be extended beyond the masterclasses, for example for other events, grant winners or contributors / donors. Every group would get it’s own design. Of course, the associated rewards could also be expanded, also outside the Phoenix guild community.

  • There could be more implemented more wallet providers next to Meta Mask, some users might use other providers.

  • Due to the nature of a certification on the blockchain, the NFTs are non-transferrable. However, there are situations, where users would transfer to another of their addresses (for ex. because they want to accumulate their NFTs in one wallet or their are security risks for a wallet, one day the current address format could become vulnerable). In this case, the must be a mechanism to verify the sender and the receiver address of the NFT have the same owner. However, such a backdoor can be a security risk.

  • In the current implementation, the address of one masterclass instructor submits the eligible addresses in the contract. Instead, to reduce the degree of centralization, we could link a multi-sig of instructors and mentors of the masterclass.

How to run the DApps locally (as well as the unit tests)

  1. Clone the repository

  2. Run hardhat https://hardhat.org/tutorial

    npx hardhat
    
  3. Compile and deploy the contracts

    npx hardhat compile
    npx hardhat run scripts/deploy.js
    
  4. Open the "index.html" file with live server in VSCode (install plugin if neccessary)

  5. Running unit tests

    npx hardhat test