class · Browser and Node

# MembershipVerifier

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

Import:

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

## Constructor

This class has no public constructor. Use its public factory methods below to create an instance.

## Methods

### `vkHashes`

Signature:

```ts
vkHashes(): string[];
```

No parameters.

#### Returns

`string[]`

### `verify`

Verifies in the zero-knowledge mode. With `expected`, also requires the statement to equal it exactly.

Signature:

```ts
verify(proof: unknown, expected?: Statement): Promise<VerifyResult>;
```

#### Parameters

- **`proof` (required)**: `unknown`
- **`expected` (optional)**: `Statement | undefined`

#### Returns

`Promise<VerifyResult>`

### `destroy`

Signature:

```ts
destroy(): Promise<void>;
```

No parameters.

#### Returns

`Promise<void>`

### `static create`

`artifacts` are the circuits this verifier accepts, pinned by vkHash. Default: the bundled one.

Signature:

```ts
create(opts?: BackendOptions & {
    artifacts?: CircuitArtifacts[];
}): Promise<MembershipVerifier>;
```

#### Parameters

**`opts` (optional)**

`BackendOptions & { artifacts?: CircuitArtifacts[]; }`

Default: `{}`

**Fields of `opts`**

**`threads` (optional)**

`number | undefined`

Worker threads for bb.js. Default: all cores up to 16 where threads are possible, else 1.

**`crs` (optional)**

`CrsSource | undefined`

Default: the CRS bundled with this package.

**`artifacts` (optional)**

`CircuitArtifacts[] | undefined`

#### Returns

`Promise<MembershipVerifier>`

[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/MembershipVerifier/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
