GithubHelp home page GithubHelp logo

ethnyc's Introduction

Semaphore icon. Semaphore Boilerplate

A simple Next.js/Hardhat privacy application with Semaphore.

Github license Next.js Hardhat

The code can be divided into contracts, frontend and backend.

  • Greeters.sol contains the root of an offchain Merkle tree to represent the greeters (tree leaves), i.e. the identity commitments generated using the first 3 Ethereum accounts of the Hardhat testing wallet. It also contains a simple function to allow greeters to greet, only once and only if they create a valid Semaphore proof.
  • The frontend code allows greeters to create a Semaphore identity with a signed Metamask message (using one of the first 3 Hardhat accounts) and a valid zero-knowledge proof.
  • The backend code is an API that sends a greet transaction signed by the contract owner with the zero-knowledge proof of a greeter.

๐Ÿ›  Install

Clone this repository and install the dependencies:

git clone https://github.com/cedoor/semaphore-boilerplate.git
cd semaphore-boilerplate
yarn

๐Ÿ“œ Usage

1. Compile & test the contract

yarn compile
yarn test

2. Run Next.js server & Hardhat network

yarn dev

3. Deploy the contract

yarn deploy --network localhost

4. Open the app

You can open the web app on http://localhost:3000.

5. Install Metamask and connect the Hardhat wallet

You can find the mnemonic phrase here.

6. Create your proof

You must use one of the first 3 Hardhat accounts.

ethnyc's People

Contributors

base0010 avatar johhonn avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

urbanhak dnalob

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.