Semaphore Protocol

repository·main·Indexed 22 days ago

https://github.com/semaphore-protocol/semaphore

A zero-knowledge privacy layer for anonymous group membership proofs and signalling across EVM-compatible blockchains. The protocol includes the @semaphore-protocol/circuits package for generating and verifying proofs, smart contracts for group management, and various integration templates for Foundry, Hardhat, and Next.js. It also provides subgraphs for querying Semaphore.sol contract data across multiple networks including Ethereum, Optimism, Arbitrum, and Polygon.

Tokens
25K
Snippets
106
Records
124
Agent score
77%

What's inside semaphore-protocol

  1. Overview of Semaphore Protocol packages

    main

    Semaphore Protocol is composed of several specialized packages for identity, group management, proof generation, and smart contract interaction. Depending on your use case, you may need one or more of the following:

    • @semaphore-protocol/core: Core logic.
    • @semaphore-protocol/contracts: Smart contract implementations.
    • @semaphore-protocol/identity: Identity management.
    • @semaphore-protocol/group: Group management functionality.
    • @semaphore-protocol/proof: Proof generation and verification.
    • @semaphore-protocol/data: Data handling utilities.
    • @semaphore-protocol/hardhat: Hardhat integration for testing and deployment.
    • @semaphore-protocol/cli: Command line interface.
    • @semaphore-protocol/utils: General utility functions.
  2. Overview of Semaphore Protocol

    main

    Semaphore is a generic privacy layer that leverages zero-knowledge technology. It allows users to prove membership in groups and send messages (such as votes or endorsements) off-chain or across EVM-compatible blockchains without revealing their personal identity.

    The protocol consists of three main components:

    1. Circuit Logic: The core zero-knowledge circuit logic.
    2. Solidity Contracts: On-chain components for verification.
    3. JavaScript Libraries: Tools to facilitate off-chain proof creation and verification.
  3. Explore Semaphore Packages

    main

    The Semaphore repository is a monorepo containing several specialized packages:

    • @semaphore-protocol/circuits: Core circuit logic.
    • @semaphore-protocol/contracts: Solidity smart contracts.
    • @semaphore-protocol/core: Core protocol logic.
    • @semaphore-protocol/cli: Command Line Interface tools.
    • CLI Templates (for scaffolding projects):
      • @semaphore-protocol/cli-template-contracts-foundry: Semaphore Foundry Template.
      • @semaphore-protocol/cli-template-contracts-hardhat: Semaphore Hardhat template.
      • @semaphore-protocol/cli-template-monorepo-ethers: Semaphore Hardhat + Next.js + SemaphoreEthers template.
      • @semaphore-protocol/cli-template-monorepo-subgraph: Semaphore Hardhat + Next.js + SemaphoreSubgraph template.
  4. Install the Semaphore CLI

    main

    You can install the Semaphore CLI globally using npm or run it on-demand using npx. The CLI is used to scaffold Semaphore projects and retrieve on-chain group data.

    # Install globally
    npm i -g @semaphore-protocol/cli
    
    # Run without global installation
    npx @semaphore-protocol/cli create my-app