> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notareum.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verification

# TypeScript: Verification

`VerificationClient` drives the verification lifecycle. Owners request verification at a level (Basic, Enhanced, or Institutional), validators submit attestations, and on quorum the resource's on-chain verification level is raised. Access the client as `ntm.verification`.

## Verification levels

```typescript theme={"system"}
enum VerificationLevel {
  BASIC = 0,
  ENHANCED = 1,
  INSTITUTIONAL = 2,
}
```

| Level         | Quorum | Notary requirement                      | Typical fee |
| ------------- | ------ | --------------------------------------- | ----------- |
| BASIC         | 3 of 5 | Any active validator                    | Low         |
| ENHANCED      | 5 of 7 | Professional tier or higher             | Medium      |
| INSTITUTIONAL | 7 of 9 | Enterprise tier or higher, KYC required | High        |

See [Verification Engine](../../protocol/verification-engine.md) and [Fee Model](../../protocol/fee-model.md) for exact parameters.

## Write methods

### `requestVerification`

Called by the resource owner. Emits a `VerificationRequested` event that notaries pick up. The sender pays the protocol fee for the chosen level in NOTA (requires prior ERC-20 approval to `VerificationEngine`):

```typescript theme={"system"}
async requestVerification(
  resourceId: string,
  level: VerificationLevel
): Promise<string>
```

Returns the transaction hash. The associated request ID is emitted in the event logs.

### `submitAttestation`

Called by active validators. `approved = true` votes in favor of the resource being legitimate at the requested level; `approved = false` votes against. Quorum is hit when the configured threshold of approvals is reached:

```typescript theme={"system"}
async submitAttestation(
  resourceId: string,
  approved: boolean
): Promise<string>
```

Validators who vote with the majority accrue rewards; minority voters may be slashed (see [Slashing](../../protocol/slashing.md)).

## Read methods

### `getVerificationRequest`

Fetches a request by its numeric ID:

```typescript theme={"system"}
async getVerificationRequest(
  requestId: bigint | number
): Promise<VerificationRequest>
```

`VerificationRequest` fields include `resourceId`, `requester`, `level`, `status`, `approvalCount`, `rejectionCount`, `createdAt`, and `resolvedAt`.

### `getVerificationFee`

Returns the current fee in NOTA (wei units, 18 decimals) for a given level:

```typescript theme={"system"}
async getVerificationFee(level: VerificationLevel): Promise<bigint>
```

## End-to-end example

```typescript theme={"system"}
import { Notareum, VerificationLevel, ResourceType } from "@notareum/sdk";
import { parseUnits } from "ethers";

const ntm = Notareum({ provider, signer, contracts });

// 1. Check fee
const fee = await ntm.verification.getVerificationFee(VerificationLevel.BASIC);

// 2. Approve NOTA spend for the VerificationEngine
const notaAbi = ["function approve(address,uint256) returns (bool)"];
const nota = new (await import("ethers")).Contract(
  contracts.notaToken,
  notaAbi,
  signer
);
await (await nota.approve(contracts.verificationEngine, fee)).wait();

// 3. Compute the resource ID and request verification
const resourceId = ntm.registry.computeResourceId(
  ResourceType.ADDRESS,
  1n,
  await signer.getAddress()
);

const txHash = await ntm.verification.requestVerification(
  resourceId,
  VerificationLevel.BASIC
);
console.log("Verification requested:", txHash);
```

## Notary side: attesting

A validator monitors `VerificationRequested` events, loads the referenced `.nota` file (typically from the requester or IPFS), runs its policy checks, and submits an attestation:

```typescript theme={"system"}
const txHash = await ntm.verification.submitAttestation(
  resourceId,
  true  // approved
);
```

On quorum, the registry's `verificationLevel` is updated automatically and the attesting validators become eligible for fee distribution in the next epoch.

## Related

* [Validator Network](../../protocol/validator-network.md)
* [Staking client](staking.md) for joining as a validator
* [Requesting Verification guide](../../guides/requesting-verification.md)
