Giter Club home page Giter Club logo

verite-minter-allowlist's Introduction

Verite Minter Allowlist Example App

This example app shows how a project might use verifiable credentials to add people to a minting allow list. Today, projects often manage allow lists on-chain. This is expensive, but it's secure. Verite + VCs should allow for off-chain allow list management.

Getting Started

  1. Create a file named config.json in the root directory. Enter the following contents to simulate the settings of the backend (whitelisting) service.
{
  "addressesForAllowlist": ["<YOUR ETHEREUM ADDRESS>"],
  "contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
  "chainId": 1337
}
  1. Install and run the backend service
cd backend
npm install
npm run dev
  1. In a new terminal, install and run the front service
cd frontend
npm install
npm run dev
  1. Run the contract code (TODO)

How does it work?

This is just an example - a production implementation would need to take additional security precautions.

In this example, a project runs a client and a server. The server includes a file system database for managing delegated keys. The flow looks like this:

  1. Project creates a list of wallet addresses that should be on the allow list.
  2. User comes to the project's frontend site and signs in with Ethereum.
  3. User requests a VC representing that they should be on the allow list.
  4. If the user is supposed to receive the VC, the project generates the credential on the server and returns it to the client.
  5. The credential is stored in local storage
  6. When the user is ready to mint (during the pre-sale, for example), the mint function will first make a call to the server with the verifiable credential.
  7. The server will verify the credential.
  8. If the credential is valid, the server will generate an EIP712-compliant message including the user's wallet address and a nonce.
  9. This message will be signed with the project's private key (in the example, it's the same key used to deploy the smart contract, but this is not the best option in production).
  10. The user, through a function on the frontend, will call the minting contract with all the parameters to mint PLUS the signature provided by the server.
  11. The smart contract will verify the signature, make sure the recovered address matches the expected address (in this case, it's the contract deployer, but again there are better options in production).
  12. If the addresses match, the contract will verify the signature is not being re-used.
  13. If the signature is not being re-used, the contract will allow the user to mint.

verite-minter-allowlist's People

Contributors

polluterofminds avatar kimdhamilton avatar

Stargazers

Odo Emmanuel chidiebere  avatar J H avatar i.am_pi3 avatar  avatar  avatar Gábor Mihálcz avatar krgko avatar  avatar

Watchers

Brice Stacey avatar Matt Venables avatar  avatar  avatar  avatar i.am_pi3 avatar

verite-minter-allowlist's Issues

issuer.json

What is there in issuer.json
I am having trouble running the project without it

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.