Skip to content

Proposal: Semaphore ERC7579 Validator Module #72

Closed
@jimmychu0807

Description

@jimmychu0807

PSE Acceleration Program

Project Overview 📄

Overview

Semaphore is a zero knowledge component that allows users to prove their group membership and send signals without revealing their original identity.

With the recent development of Account Abstraction ERC-4337 and Minimal Modular Smart Account ERC-7579, these advancements allow a smart account to install modules to gain extra functionalities.

The objective of this accelerator program proposal is to develop a Semaphore ERC-7579 validator module so when this module installed, the smart account allows Semaphore group members of that particular account to sign transactions on behalf of the account. We will also achieve multi-sig wallet functionality by requiring a threshold number of Semaphore signatures before a transaction can be validated. This threshold number is configurable by the wallet owner / Semaphore group admin.

One advantage of this setup compared to a normal multi-sig wallet is that signers' privacy is preserved. Semaphore protocol hides which user identity actually signs the transaction, only guaranteeing the signature must come from one of the group members who have not signed before, thus preventing double-signing too. Together with the smart account interaction model that the actor making on-chain transactions is not the Semaphore group member, but a bundler, we are able to deliver a smart account plugin that cannot trace who the original transaction signers with only on-chain inspection.

Project Details

The idea of this project has been explored by Saleel, and is documented in his blogpost. It was built at a time when the tool stack was still primitive. In this proposal, I aim to formalize this and solve semaphore-protocol/semaphore#345. When a smart account owner install this Semaphore ERC-7579 module to a smart account, a new Semaphore group is created. The user becomes the admin of the group and can manage the members inside. Any members in the Semaphore group will be able to send a zk proof of transaction on behalf the smart account. This is like a 1/N mult-sig wallet, with N being the number of members in the Semaphore group. We will also store the signatures to allow it behaves as a M-of-N multi-sig wallet. This module will be built using ModuleSDK framework.

At the end of the proposal, the following will be delivered:

  1. Semaphore ERC7579 validator module, making it a 1-of-N wallet.
  2. Extend its feature making it a M-of-N wallet.
  3. End-to-end test code for testing the following behaviors:
    • installing the module to a smart account
    • admin adding/removing members, switching admins
    • sending transactions with M of N member signatures
    • uninstalling the module from the smart account
  4. Inline code documentation.
  5. A front-end demo allowing users to install this module to their smart accounts, add members (identity commitments) to the semaphore group, and sending zk proofs, all happening on a chosen testnet.
  6. A writeup to introduce what has been done and give a technical overview of the module, and demonstrate the Semaphore group signer privacy is preserved.

Team 👥

Team members

Team Website

website: https://jimmychu0807.hk/

Team's experience

I participated in the PSE Core Program 2024 - Taiwan, and delivered a capstone project of a zero-knowledge Number Guessing Game, built upon Semaphore boilerplate.

I previously worked in Parity as Polkadot developer advocate and CESS as developer advocate advisor. Other prior experience can be seen in my GitHub profile.

Team Code Repos

https://github.com/jimmychu0807

Development Roadmap 🔩

Overview

  • Total Estimated Duration: 5 weeks
  • Full-time equivalent (FTE): 1
  • Expected Start Date:
  • Expected End Date:

Milestone 1: M-of-N Semaphore validator module

  • Estimated Duration: 2.5 weeks
  • FTE: 1
  • Estimated delivery date:

Deliverables and Specifications

1. Semaphore ERC7579 validator module

It will be a module in ModuleKit validator. Semaphore and related contracts will be deployed to be used in the validator module. With this module, the smart account behave like an 1-of-N multi-sig wallet.

2. Extend the feature to M-of-N multi-sig wallet
3. End-to-end test code

Both hardhat and foundry test will be written to cover 85% of the Solidity code for unit tests. Local development environment can also be spin up by Docker-compose to run end-to-end test of the module.

4. Inline code documentation

All public functions of the module contract will be documented according to NatSpec format.

Milestone 2: Front-end demo, deployment scripts, and writeup

  • Estimated Duration: 2.5 weeks
  • FTE: 1
  • Estimated delivery date:

Deliverables and Specifications

5. Front-end demo & deployment scripts

A front-end demo will be able to spin up locally with a single yarn command. Because it relies on existing EntryPoint singleton and Paymaster contract to work, the locally running front end will need to connect to a testnet in order to execute all the functionality of the module.

Deployment scripts will be developed for front end being deployed to Vercel hosting and smart contracts deployed on a chosen testnet.

6. Writeup

A writeup will be submitted for review giving a technical overview of the project, and demonstrate the Semaphore group signer privacy is preserved.

Additional Information ➕

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions