Group Generators
Groups are a reusable tool used by Sismo to generate available groups for attesters.
You will find more information on what are groups in this section:
Generating groups and making them available for an attester require some infrastructures. We have developed a repository, the sismo-hub, to let anyone propose new groups, and make them available for the HydraS1Attester, with a simple PR.
You will be able to:
  • Create your own group
  • Deploy your own metadata/image for an associated ZK badge
=> Your ZK Badge will be available to mint on the Sismo UI.
Here is a complete tutorial describing all these steps: https://docs.sismo.io/sismo-docs/tutorials/create-your-zk-badge-in-15-minutes
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 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,
data: {
"0xF61CabBa1e6FC166A66bcA0fcaa83762EdB6D4Bd": 1,
"0x8ab1760889f26cbbf33a75fd2cf1696bfccdc9e6": 2,
},
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 corresponds to the execution of the generate function.
This group, my-simple-group, contains only 2 accounts, which has a value of 1 and 2, 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 discord.
Copy link
On this page
Generate Function
Generate your group