project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

MagicPrivateCollector

Private and secure NFTs in any form including images, music, video, literature, and more!

MagicPrivateCollector

Created At

ETHOnline 2022

Project Description

Magic Private Collector (MPC) is your one stop shop for creating, browsing, and buying private NFTs. It is a chain agnostic solution requiring no custom token to function. With an easy to use interface, MPC enables users with just a cryptocurrency wallet to create or buy NFTs which can be kept, shared, or sold. However, each NFT requires a user to provide proof of ownership via their wallet in order to use and view. There are myriad use cases for MPC including any secure content, time or quantity limited NFTs, content one wishes to only privately share or sell, and more.

About Magic Wizard Tech MWT builds tools to democratize access to Blockchains and power the future of Web3. We are a team of engineers and product developers based in New York City dedicated to creating easy access for everyone to the Web3 ecosystem.

How it's Made

We are enabling users to create NFTs with private content. This private content can only be accessed by the owner(s) of the NFT. We are accomplishing this by:

  1. A user buys an NFT with private content. The NFT is then transferred to her wallet.
  2. Whenever she wants to see the private content, she needs to log into Metamask and sign a transaction. This transaction is calling a function in our smart contract called showPrivateContent(tokenId)
  3. The smart contract verifies that this NFT is still owned by this address and sends back true or false.
  4. The frontend receives the transaction hash and the information if the address still owns the NFT. It then waits until the transaction is confirmed on the blockchain.
  5. It then sends a request to our backend with the transaction hash, tokenId and address. The backend verifies individually that this transaction has been made, was successful, is valid and has been performed in a timely manner (seconds ago). It then sends the private content and one-time private content url to the frontend. This content is now visible in the current frontend session. Once the frontend session is destroyed, the content is gone. The post request can only be used once. The backend keeps track of expired transaction hashes in order to prevent from delivering the content multiple times (this might not be necessary, because the timestamp might be enough for this).

We started building out the frontend first. This was mainly what Ned was working on because he has the most frontend experience. It’s built with a NextJS server, ReactJS and Typescript, and Tailwind CSS. The first challenge was to connect to Metamask and make sure the user stays logged in while navigating the page. The default implementation of the Metamask onboarding module starts the MetaMask window immediately after loading the page. We changed this to an on click after attempting a number of different implementations. We worked together on the project 50% pair programming 3-4 times a week together and the rest of the time separately from home offices. We discovered Live Share in VS code and this made it easier to share the screen and help each other when we got stuck. The frontend is hosted on Vercel and gets auto-deployed from github when we push to the main branch. We both created forks and did pull requests and code reviews of each other's code. Daniela built out the backend endpoints with Serverless, AWS lambda, API Gateway, Typescript and DynamoDB. We discovered that we need to save a lot of the NFT information and data in our own database (DynamoDB) because it is impossible to query the blockchain real-time for NFT data. Therefore we saved everything on POST in our DynamoDB tables. Our backend gets automatically deployed with a yaml script through CircleCi and it is sending a notification to our Slack channel when it’s done. We have been communicating mostly on Slack because we both find it more intuitive than Discord. We then build a smart contract with Solidity based on ERC1155 and with OpenZeppelin modules. We compiled and tested this locally with Hardhat and QuickNode. We had to figure out how to set the approval for a transfer of an NFT from one address to another in order to make a sale. This now happens when the mint is performed. Another challenge was to figure out how to generate a private url for the private content. We decided to do this directly inside of the contract with a private key that is generated each time a user wants to access the private content.

background image mobile

Join the mailing list

Get the latest news and updates