Skip to content

docs(docs): add FAQ entry for using multiple scopes in proofs - #1097

Open
bhanu964 wants to merge 1 commit into
semaphore-protocol:mainfrom
bhanu964:docs/multiple-scopes-faq
Open

bhanu964 wants to merge 1 commit into
semaphore-protocol:mainfrom
bhanu964:docs/multiple-scopes-faq

Conversation

@bhanu964

Copy link
Copy Markdown

Description

Summary

Adds a comprehensive FAQ entry in the Semaphore v4 documentation (apps/docs/versioned_docs/version-V4/faq.md) detailing how and when to use multiple scopes in Semaphore proofs.

Problem

As reported in #516, the documentation previously only described single-scope setups (e.g. using group ID as scope). Developers building applications where a user must generate multiple proofs in related contexts (such as multi-question polling ballots, round-based signaling, or multi-action interactions) lacked guidance on how nullifier derivation behaves across scopes, how unlinkability is preserved, and how to structure multiple scopes with the TypeScript SDK.

Implementation

  • Added section ## How and when can multiple scopes be used in Semaphore proofs? to apps/docs/versioned_docs/version-V4/faq.md.
  • Cryptographically explains the nullifier derivation nullifier = Poseidon(scope, secretScalar) from the Semaphore circuit.
  • Documents the behavioral contrast:
    • Same identity + same scope: Deterministic nullifier preventing double-action within that scope.
    • Same identity + different scopes: Unlinkable nullifiers preventing third-party correlation.
  • Outlines practical scenarios: multi-vote polling systems, round/epoch-based signaling, multi-action rate limiting, and cross-application replay protection.
  • Includes a complete, runnable TypeScript code example demonstrating multi-question poll proof generation using @semaphore-protocol/proof, @semaphore-protocol/group, and @semaphore-protocol/identity.
  • Explains verifier state tracking with standard nullifier mappings.

Testing

Executed local verification suite:

  • npx prettier -c apps/docs/versioned_docs/version-V4/faq.md: All files conform to Prettier code style.
  • yarn workspace semaphore-docs build: Production Docusaurus build generated static files for both en and es locales with 0 build errors.
  • yarn test:library proof: 11/11 unit tests passed for @semaphore-protocol/proof (Groth16 proof generation and verification).
  • npx commitlint: Passed conventional commit validation for docs(docs): ....

Scope

This PR focuses exclusively on documentation and developer guidance for Semaphore v4. It does not alter cryptographic circuits, contract logic, or package interfaces.

Related Issue(s)

Closes #516

Checklist

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • Documentation builds cleanly and accurately reflects Semaphore v4 APIs

Add detailed FAQ explanation on how and when to use multiple scopes in
Semaphore proofs, addressing issue semaphore-protocol#516. Covers nullifier uniqueness and
unlinkability derivation, practical scenarios such as multi-vote polling
systems, a complete TypeScript code example, and verifier state tracking
guidance.
@bhanu964
bhanu964 requested a review from a team as a code owner October 15, 2026 09:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add FAQ for using multiple scopes in Semaphore proofs

1 participant