- new
Group (members?): Group Creates a new instance of the Group. Optionally, a list of identity commitments can be passed as a parameter. Adding members in chunks is more efficient than adding them one by one with the

`addMember`

function.#### Parameters

- members: BigNumber[] = []
A list of identity commitments.

#### Returns Group

- members: BigNumber[] = []

leanIMT: default<bigint>

- get depth(): number
Returns the depth of the tree.

#### Returns number

The tree depth as a number.

- get members(): bigint[]
Returns the members (i.e. identity commitments) of the group.

#### Returns bigint[]

The list of members of the group.

- get root(): bigint
Returns the root hash of the tree.

#### Returns bigint

The root hash as a string.

- get size(): number
Returns the size of the tree (i.e. number of leaves).

#### Returns number

The tree size as a number.

- generate
Merkle (index): MerkleProofProof Creates a proof of membership for a member of the group.

#### Parameters

- index: number
The index of the member.

#### Returns MerkleProof

The MerkleProof object.

- index: number

`Static`

import
The Semaphore group is a LeanIMT (Lean Incremental Merkle Tree), i.e. an optimized version of the incremental binary Merkle tree used by Semaphore V3. The new tree does not use zero hashes, and its depth is dynamic. The members of a Semaphore group, or the leaves of a tree, are the identity commitments. Thanks to the properties of Merkle trees, it can be efficiently demonstrated that a group member belongs to the group. This class supports operations such as member addition, update, removal and Merkle proof generation and verification. Groups can also be exported or imported.