Sismo Docs
  • Welcome to Sismo
    • What is Sismo?
  • Build with Sismo Connect
    • Overview
    • Installation
    • Sismo Connect Cheatsheet
    • Tutorials
      • Get Your appId - Create a Sismo Connect App
      • Onchain Tutorial (1/2): Code Your Airdrop Contract With Privately-Aggregated Data
      • Onchain Tutorial (2/2): Deploy Your Airdrop Contract
    • Technical Documentation
      • Sismo Connect Configuration
      • Auths
      • Claims
      • Signature
      • Packages
        • Sismo Connect Client: Request
        • Sismo Connect React: Request
        • Sismo Connect Server: Verify Offchain
        • Sismo Connect Solidity Library: Verify Onchain
    • FAQ
  • Data Groups
    • Overview
    • Tutorials
      • Factory Guide: Create a Data Group in 5 Minutes
      • Sismo Hub Guide: Create Data Groups Programmatically
      • Sismo Hub Guide: Add a Data Provider to the Sismo Factory
    • Sismo Hub
      • Sismo Hub Repository
        • Group Generators
        • Data Providers
        • Data Operators
        • Command Line Interface
      • Accounts Registry Tree
  • Data Vault
    • Overview
    • Vault Identifiers
    • Proving Schemes
      • Hydra-S1
      • Hydra-S2
    • Commitment Mapper
  • Resources
    • Deployed Contract Addresses
    • Sismo API
      • API Links
      • Query From a Client
      • Group
        • Get groups
        • Get group snapshots
      • Common Parameters
      • Advanced Filtering
      • Transaction
  • Links
    • Sismo Landing Page
    • Sismo Factory
    • Sismo App Store
    • Sismo Builder Resources
    • GitHub
    • Discord
    • Twitter
    • Blog
Powered by GitBook
On this page
  • Generate Function
  • Generate your Group
  1. Data Groups
  2. Sismo Hub
  3. Sismo Hub Repository

Group Generators

PreviousSismo Hub RepositoryNextData Providers

Last updated 1 year ago

Groups are a reusable tool used by Sismo to generate available Data Groups for .

You will find more information on what are groups in this section:

Generating Data Groups and making them available for proving schemes requires some infrastructure. We have developed a repository, the , to let anyone propose new Data Groups and make them available for Hydra proving schemes with a simple PR.

You will be able to create your own group of accounts (Ethereum addresses, Github accounts and Twitter accounts) and then use it in a Sismo Connect app.

Here is a complete tutorial describing all the group creation process steps:

The following documentation aims to describe the code in a more theoretical way, we strongly recommend doing the tutorial to understand what the code below is for, especially for newcomers.

Generate Function

const generator: GroupGenerator = {
  generationFrequency: GenerationFrequency.Once,

  generate: async (context: GenerationContext): Promise<GroupWithData[]> => {
    // add you code here
    return [];
  },
};

export default generator;

A group generator is a tool that allows us to easily generate groups and store them in scalable infrastructure.

The GroupGenerator object is made of a generate function which will be executed at a specific GenerationFrequency.

Here the GenerationFrequency is Once. That means it will be executed just one time. It is an Enum that accepts Daily, Weekly or Monthly value.

Let's improve our group generator to return a very simple group:

const generator: GroupGenerator = {
  generationFrequency: GenerationFrequency.Once,

  generate: async (context: GenerationContext): Promise<GroupWithData[]> => {
    return [
      {
        name: "my-simple-group",
        timestamp: context.timestamp,
        description: "description of my-simple-group"
        specs: "specs"
        data: {
          "0xF61CabBa1e6FC166A66bcA0fcaa83762EdB6D4Bd": 1,
          "0x8ab1760889f26cbbf33a75fd2cf1696bfccdc9e6": 1,
          "dhadrien.sismo.eth" : 1,
          "dhadrien.lens": 1,
          "github:leosayous21": 2,
          "github:dhadrien": 4,
          "twitter:dhadrien_": 3,
          "telegram:pelealexandru": 1
        },
        valueType: ValueType.Info,
        tags: [Tags.Mainnet, Tags.User],
      },
    ];
  },
};

export default generator;

In the above example, the group generator will create a group named my-simple-group. Its timestamp will correspond to the execution of the generate function.

This group, my-simple-group, contains 7 accounts, four Ethereum addresses (two addresses as you know them, one ENS handle and one Lens handle) which all have a value of 1, two GitHub accounts with values of 2 and 4 and one Twitter account with a value of 3 as you can see in the data field.

  • Tags are used to easily retrieve groups once they are generated.

Learn how to query data easily:

Learn how to combine groups easily:

Generate your Group

You can find all the groups that can be generated in the group-generators/generators folder. This is where you need to reference your group to see it generated in the future.

import ensVoters from "./ens-voters";
import ethereumDevelopers from "./ethereum-developers";
import ethereumMostTransactions from "./ethereum-most-transactions";
import ethereumPowerUsers from "./ethereum-power-users";
...
import sismoLensFollowers from "./sismo-lens-followers";
import sismoMasqueradeLensFollowers from "./sismo-masquerade-lens-followers";

import { GroupGeneratorsLibrary } from "topics/group-generator";

export const groupGenerators: GroupGeneratorsLibrary = {
  "ens-voters": ensVoters,
  "ethereum-developers": ethereumDevelopers,
  "ethereum-most-transactions": ethereumMostTransactions,
  "ethereum-power-users": ethereumPowerUsers,
  ...
  "sismo-lens-followers": sismoLensFollowers,
  "sismo-masquerade-lens-followers": sismoMasqueradeLensFollowers,
};

For more information or help, Join us on .

proving schemes
Overview
sismo-hub
Sismo Hub Guide: Create Data Groups Programmatically
Data Providers
Data Operators
Discord
Page cover image