Inspiration

With NFTs being the buzzword of the year, and questions being raised around the legitimacy of their offerings, I started thinking of ways to adding value to these tokens whilst taking advantage of what they currently offer. That's where Masquerade has come in - a way to embed confidential information into the standard NFT (ERC721) format token. Using this platform, a user can own the confidential data inside an NFT - which could have wider applications than digital art. Writers could embed short stories and poetry, digital goods could be encoded in the form of gift cards or steam keys. All this could be done whilst operating within the current boundaries of the ERC721 standard.

What it does

The Masquerade platform consists of a web app, external adapter and smart contract to mint and burn tokens with confidential information encoded. A user provides metadata information (title, description, image) and a secret to the minting portal and starts the minting process. Information is encoded using Chainlink external initiators/adapters and is minted on the Polygon network. The NFT can then be freely traded on NFT platforms (i.e. opensea).

To redeem, a user visits the redemption portal and provides the owned NFT to burn and the private chat ID between the Masquerade Delivery Bot and themselves on Telegram.

How I built it

  • External Adapter & Telegram webhook as Google Cloud Function (Node.js).
  • External Initiator as Express Server on Google Compute Instance (Node.js).
  • ERC721 Smart Contract with Chainlink interactions.
  • Front-end in React using create-eth-app as base.
  • Deployed on Polygon for practical NFT minting/burning costs.
  • Data encryption using steganography and Google KMS.

Challenges I ran into

The major hurdle that I ran into was constructing a transaction to mint NFTs using Chainlinks ethTx core adapter. The plan was to pass the data params. of a raw transaction into this adapter to mint NFTs and have the Chainlink node pay for this minting. Unfortunately I could not get this to work (believe it was a limitation of the bytes32 response from an adapter) so had to implement a web3 signer inside the external adapter.

I also had issues when constructing the metadata for viewing on Opensea. Originally, all of the metadata was on-chain but after some research it was clear that this would not be compatible with Opensea. Modification were made to host the metadata off-chain and it all worked well from there.

Accomplishments that I'm proud of

Launching a working demo on the Mumbai testnet, achieving all that I set out to do. At the last hackathon my time management wasn't great and was unable to get a complete demo up and running, so am happy that I got it deployed for people to try!

Also had never used a lot of the tooling and components before (ethers/hardhat/polygon/NFTs & external initiators) and was concerned the learning curve may slow down development. Luckily that wasn't the case and it was simple to build and implement.

What I learned

I learned how to use lots of new tooling for Ethereum and how to deploy and interact with Layer 2s. Also learned some new ways to integrate with Chainlink nodes (external initiators). Learned to manage my time much better, now understanding how much work is required to pull off a working hackathon submission!

What's next for Masquerade

  • Find an alternative message encryption scheme to Google KMS - ideally something which could be shared amongst multiple nodes.
  • Redesign architecture to allow for a greater number of nodes to be safely used, currently restricted to a single node.
  • More elaborate front-end which could allow users to better manage and graphically customise their NFTs.
Share this project:

Updates