toip.tools

interface · Browser and Node

GroupRoot

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

@toip-tools/anon-membershipView source
TypeScriptImport
import { type GroupRoot } from "@toip-tools/anon-membership";

Declaration

TypeScriptinterface
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

idrequired
string
typerequired
"anon-membership/root"
vrequired
1
issuerrequired
string
grouprequired
string

"#".

groupIdrequired
string

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

circuitrequired
string
periodrequired
number

Seconds per epoch: 86400 for daily roots.

epochrequired
string

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

seqrequired
number

0 for the group's first root.

prevrequired
string | null

rootDocHash of the previous root, or null.

rootrequired
string
lengthrequired
number

The next leaf index.

sizerequired
number

Non-zero leaves.

snapshotHashrequired
string

Hex SHA-256 of the snapshot bytes.

issuedAtrequired
string
extoptional
Record<string, unknown> | undefined

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

proofoptional
Record<string, unknown> | undefined

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