Skip to main content
Version: V4

Benchmarks

Semaphore v4 introduces new features and performance improvements. Detailed changes are available in the release changelog.

The primary changes in benchmark values are driven by the two major protocol updates:

New Identity schema​

Semaphore v4 includes a new schema for the identities allowing the creation and verification of signatures.

Although the new Identity package is slightly slower than the one in Semaphore v3 (by just a few milliseconds), the trade-off is minimal considering the included functionality.

The new identity schema adds additional constraints to the Semaphore v4 circuit; however, this does not negatively impact overall performance of the protocol.

LeanIMT​

Semaphore v4 uses the LeanIMT data structure for group operations, an improvement over the IMT used in v3.

For further details, see the LeanIMT paper.

The LeanIMT offers dynamic depth, resulting in faster and more cost-effective group operations, across Node.js, browser and smart contracts.

Semaphore v4 support tree depths from 1 to 32, while v3 supports depths from 16 to 32, both for proof generation and verification.

System Specifications and Software environment​

All the benchmarks were run in an environment with these properties:

System Specifications

Computer: MacBook Pro

Chip: Apple M2 Pro

Memory (RAM): 16 GB

Operating System: macOS Sequoia version 15.0.1

Software environment

Node.js version: 20.18.0

Browser: Google Chrome Version 130.0.6723.92 (Official Build) (arm64)

Running the benchmarks​

Javascript and Circom​

GitHub repository to the run Node.js, browser and Circom benchmarks: https://github.com/vplasencia/semaphore-benchmarks

Solidity​

GitHub repository to run the Solidity benchmarks: https://github.com/semaphore-protocol/semaphore

Node.js benchmarks​

Identities​

Identities

Create Group​

Create group, either empty or with initial members.

Create Group

Add Member​

Add a member to groups with different sizes.

Add Member

Generate Proof​

Generate a proof using groups with different numbers of members.

Generate Proof

Verify Proof​

Verify a proof using groups with different numbers of members.

Verify Proof

Browser benchmarks​

Main functions used in the browser.

Browser benchmarks

Circuit benchmarks​

Semaphore V3​

Circuit benchmarks Semaphore v3

Semaphore V4​

Circuit benchmarks Semaphore v4

Contracts​

Contract Benchmarks

Semaphore V3 gas report​

Contracts benchmarks Semaphore v3

Semaphore V4 gas report​

Contracts benchmarks Semaphore v4