Skip to main content
Version: V3

Subgraph

The Graph is a protocol for indexing networks like Ethereum and IPFS. Site owners publish subgraphs that expose site data for anyone to query. Semaphore's subgraph allows you to retrieve data from the Semaphore.sol smart contract.

tip

The Graph protocol uses the GraphQL query language. For examples, see the GraphQL API documentation. Visit the subgraph repository to see the list of Semaphore subgraphs.

Schema​

MerkleTree​

  • id: unique identifier among all MerkleTree entities,
  • depth: Merkle tree depth,
  • root: Merkle tree root,
  • zeroValue: Merkle tree zero value,
  • numberOfLeaves: total number of tree leaves,
  • group: link to the Group entity.

Group​

  • id: unique identifier among all Group entities,
  • merkleTree: link to the MerkleTree entity,
  • timestamp: block timestamp,
  • admin: admin of the group,
  • members: list of group members.
  • verifiedProofs: list of group proofs.

Member​

  • id: unique identifier among all Member entities,
  • identityCommitment: Semaphore identity commitment,
  • timestamp: block timestamp,
  • index: index of the tree leaf,
  • group: link to the Group entity.

VerifiedProof​

  • id: unique identifier among all VerifiedProof entities,
  • signal: user's signal,
  • merkleTreeRoot: Merkle tree root,
  • nullifierHash: nullifier hash,
  • externalNullifier: external nullifier,
  • timestamp: block timestamp,
  • group: link to the Group entity.