interface · Browser and Node

# GroupRoot

A signed group root. One per epoch, hash-chained.

`@toip-tools/anon-membership` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/anon-membership/src/roots.ts#L12)

Import:

```ts
import { type GroupRoot } from "@toip-tools/anon-membership";
```

## Declaration

interface:

```ts
interface GroupRoot {
  id: string;
  type: typeof ROOT_TYPE;
  v: 1;
  issuer: string;
  /** "<issuer DID>#<name>". */
  group: string;
  /** The group as the circuit sees it: groupFieldOf(group), hex. */
  groupId: string;
  circuit: string;
  /** Seconds per epoch: 86400 for daily roots. */
  period: number;
  /** The epoch: a UTC day ("2026-11-06") for daily roots, else the period's start time. */
  epoch: string;
  /** 0 for the group's first root. */
  seq: number;
  /** rootDocHash of the previous root, or null. */
  prev: string | null;
  root: string;
  /** The next leaf index. */
  length: number;
  /** Non-zero leaves. */
  size: number;
  /** Hex SHA-256 of the snapshot bytes. */
  snapshotHash: string;
  issuedAt: string;
  /** Application fields the issuer signs with the root, such as attribute counts. */
  ext?: Record<string, unknown>;
  /** The eddsa-jcs-2022 Data Integrity proof from trust-core's signDocument. */
  proof?: Record<string, unknown>;
}
```

## Properties

**`id` (required)**

`string`

**`type` (required)**

`"anon-membership/root"`

**`v` (required)**

`1`

**`issuer` (required)**

`string`

**`group` (required)**

`string`

"#".

**`groupId` (required)**

`string`

The group as the circuit sees it: groupFieldOf(group), hex.

**`circuit` (required)**

`string`

**`period` (required)**

`number`

Seconds per epoch: 86400 for daily roots.

**`epoch` (required)**

`string`

The epoch: a UTC day ("2026-11-06") for daily roots, else the period's start time.

**`seq` (required)**

`number`

0 for the group's first root.

**`prev` (required)**

`string | null`

rootDocHash of the previous root, or null.

**`root` (required)**

`string`

**`length` (required)**

`number`

The next leaf index.

**`size` (required)**

`number`

Non-zero leaves.

**`snapshotHash` (required)**

`string`

Hex SHA-256 of the snapshot bytes.

**`issuedAt` (required)**

`string`

**`ext` (optional)**

`Record<string, unknown> | undefined`

Application fields the issuer signs with the root, such as attribute counts.

**`proof` (optional)**

`Record<string, unknown> | undefined`

The eddsa-jcs-2022 Data Integrity proof from trust-core's signDocument.

[Usage guide](https://toip.tools/toolkit/anon-membership/#usage) · [Error handling](https://toip.tools/toolkit/anon-membership/#errors) · [All exports](https://toip.tools/toolkit/anon-membership/api/)

---

This is the Markdown version of https://toip.tools/toolkit/anon-membership/api/GroupRoot/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
