---
title: '@0xintuition/iid'
description: Parse, canonicalize, validate, and derive identifier strings without network calls.
url: https://docs.intuition.systems/docs/reference/packages/iid
markdown_url: https://docs.intuition.systems/docs/reference/packages/iid.md
version: V2
llms_index: https://docs.intuition.systems/llms.txt
kind: reference
reader:
  - app
  - agent
packages:
  - '@0xintuition/iid@0.1.1'
---

## What it's for

IID implements identifier grammar, scheme canonicalization, normalization, recipe hashing, and declarative identity ladders. An IID names an entity; it is not the protocol atom ID of every representation of that entity.

## When to use it

Use `inspectIntuitionId` for a typed validity result and `SCHEMES` for explicit canonicalization. Use [ids](https://docs.intuition.systems/docs/reference/packages/ids) to hash atom bytes, [primitives](https://docs.intuition.systems/docs/reference/packages/primitives) to select a representation, and [iid-registry](https://docs.intuition.systems/docs/reference/packages/iid-registry) for meaning and provider plans. Parsing or passing validation does not prove a record exists at an external registry.

## Install

```sh
npm install @0xintuition/iid@0.1.1 viem@2.31.4
```

Use ESM `import` or CommonJS `require()` on Node 20+. Public subpaths work in both formats. See [installation and peer setup](https://docs.intuition.systems/docs/build/install) and the [runtime compatibility limits](https://docs.intuition.systems/docs/reference/compatibility#runtime-requirements).

## Entry points

| Subpath | Purpose                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------- |
| `.`     | Parsing, validation, inspection, scheme canonicalizers, NORM-1, gen1 derivation, and the declarative ladder engine. |

## Depends on and works with

Runtime dependencies: none.

Published peers: `viem ^2.0.0`.

## @0xintuition/iid - Example

```ts
import { inspectIntuitionId, SCHEMES } from '@0xintuition/iid';

const canonicalIsrc = SCHEMES.isrc.canonicalize('US-RC1-76-07839');
if (canonicalIsrc === undefined) throw new Error('Invalid ISRC');
const identifier = `int:isrc:${canonicalIsrc}`;
const inspection = inspectIntuitionId(identifier);
if (!inspection.valid) throw new Error(inspection.reason);
console.log({ iid: identifier, anchorEligible: inspection.anchorEligible });
```

This separate ISRC conformance example produces `int:isrc:USRC17607839`; it is not an identifier for the synthetic catalog recording. Canonicalization can return `undefined`. Inspection distinguishes a non-canonical spelling from an unknown or invalid scheme; a non-canonical result can offer a `canonical` value, but it is not a valid new anchor.

Validity and bare P0 eligibility are separate. Class C recipe-derived identifiers need P1 evidence. Bare polymorphic identifiers also require a typed envelope. The package implements additional identifier forms beyond the pinned canonical source; see the [specification differences](https://docs.intuition.systems/docs/reference/packages/iid-spec).

## Related concepts

- [The Intuition Identifier (IID)](https://docs.intuition.systems/docs/concepts/iid)
- [Schemes and canonical form](https://docs.intuition.systems/docs/concepts/iid-schemes)
- [Representation profiles](https://docs.intuition.systems/docs/concepts/representation-profiles)
- [The identity ladder](https://docs.intuition.systems/docs/concepts/identity-ladder)

See also [offline quickstart](https://docs.intuition.systems/docs/get-started/quickstart).

## Source

[Package README at the pinned release](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/iid/README.md).

[Canonical grammar](https://github.com/0xIntuition/intuition-identifier/blob/3e593247c0e7cb168b37368937167ed146d3868a/spec/02-grammar.md) · [Canonical normalization](https://github.com/0xIntuition/intuition-identifier/blob/3e593247c0e7cb168b37368937167ed146d3868a/spec/04-normalization.md) · [Canonical representation profiles](https://github.com/0xIntuition/intuition-identifier/blob/3e593247c0e7cb168b37368937167ed146d3868a/spec/07-representation-profiles.md) · [Inspection implementation](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/iid/src/parse.ts).

Applies to V2 · `@0xintuition/iid` 0.1.1
