@0xintuition/iid
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 to hash atom bytes, primitives to select a representation, and iid-registry for meaning and provider plans. Parsing or passing validation does not prove a record exists at an external registry.
Install
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 and the runtime compatibility limits.
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.
Example
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.
Related concepts
- The Intuition Identifier (IID)
- Schemes and canonical form
- Representation profiles
- The identity ladder
See also offline quickstart.
Source
Package README at the pinned release.
Canonical grammar · Canonical normalization · Canonical representation profiles · Inspection implementation.
Applies to V2 · @0xintuition/iid 0.1.1