Git Product home page Git Product logo

privacy-enabled-erc721's Introduction

User-Mintable Privacy-Enabled NFTs

Build Status

This repo is a sample implemtation of user-mintable, privacy-enabled NFTs showing the mint process using an on-chain anchor registry as backing for document verification.

The General Idea

The goals of a user-mintable, privacy-enabled NFT are

  • Mint an NFT that represents an off-chain asset consisting of structured data
  • Allow anyone to mint the NFT who can provide a proof that they should be allowed to mint this NFT
  • Proofs are validate on-chain against an "anchor registry" that holds the merkle root hash of the off-chain document
  • Thus turning off-chain assets into on-chain assets, represented as an ERC-721 token

The mint method

The ERC-721 registry exposes a mint method that allows anyone to mint an NFT, provided they can supply a proof that they should be allowed to do so. Specifically, the registry allows minting NFTs for off-chain datasets/assets utilizing merkle proofs that are supplied to the mint method.

The mint method is called with plaintext fields and their corresponding proofs. The NFT registry checks the validity of the data & merkle proof against an on-chain anchor registry. The anchor registry contains a mapping of document identifier to the merkle root of the respective document (the off-chain asset). If the merkle proof that was supplied to the mint method validates correctly, the NFT registry mints the token that represents the off-chain asset.

NFT registry flow

Utilizing precise-proofs

The sample implementation utilizes the precise-proofs library to generate merkle trees and proofs for structured off-chain data.

precise-proofs supports multiple hashing algorithms. This NFT implementation uses keccak256 as the hashing algorithm for the merkle tree/proof generation.

Please read the paper on User-Mintable, Privacy-Enabled NFTs for more background on the on-chain and off-chain components and the minting process.

Development

Tinlake uses dapp.tools for development. Please install the dapp client.

Install Dependencies

dapp update

Run Tests

The tests for Tinlake are written in Solidity.

Run all tests

dapp test

Run a specific tests

A regular expression can be used to only run specific tests.

dapp test -r <REGEX> 

Community

Join our public slack channel to discuss development, ask questions and contribute: Centrifuge Slack

privacy-enabled-erc721's People

Contributors

lucasvo avatar pstehlik avatar charleenfei avatar xmxanuel avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.