@agenticprimitives/agent-naming 1.0.0-alpha.5 → 1.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUDIT.md +52 -2
- package/CLAUDE.md +43 -64
- package/README.md +57 -54
- package/dist/abis.d.ts +1113 -11
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +184 -0
- package/dist/abis.js.map +1 -1
- package/dist/claim.d.ts +103 -0
- package/dist/claim.d.ts.map +1 -0
- package/dist/claim.js +131 -0
- package/dist/claim.js.map +1 -0
- package/dist/client.d.ts +36 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +197 -10
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +75 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +156 -4
- package/dist/constants.js.map +1 -1
- package/dist/custody.d.ts +149 -10
- package/dist/custody.d.ts.map +1 -1
- package/dist/custody.js +243 -13
- package/dist/custody.js.map +1 -1
- package/dist/dns.d.ts +186 -0
- package/dist/dns.d.ts.map +1 -0
- package/dist/dns.js +296 -0
- package/dist/dns.js.map +1 -0
- package/dist/federated.d.ts +31 -0
- package/dist/federated.d.ts.map +1 -0
- package/dist/federated.js +54 -0
- package/dist/federated.js.map +1 -0
- package/dist/grammar.d.ts +62 -0
- package/dist/grammar.d.ts.map +1 -0
- package/dist/grammar.js +165 -0
- package/dist/grammar.js.map +1 -0
- package/dist/hash.d.ts +14 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +22 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +17 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -8
- package/dist/index.js.map +1 -1
- package/dist/issuance.d.ts +70 -0
- package/dist/issuance.d.ts.map +1 -0
- package/dist/issuance.js +65 -0
- package/dist/issuance.js.map +1 -0
- package/dist/label.d.ts +10 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +39 -0
- package/dist/label.js.map +1 -0
- package/dist/namehash.d.ts +10 -23
- package/dist/namehash.d.ts.map +1 -1
- package/dist/namehash.js +11 -35
- package/dist/namehash.js.map +1 -1
- package/dist/normalize.d.ts +9 -17
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +11 -48
- package/dist/normalize.js.map +1 -1
- package/dist/price.d.ts +74 -0
- package/dist/price.d.ts.map +1 -0
- package/dist/price.js +65 -0
- package/dist/price.js.map +1 -0
- package/dist/records.d.ts +44 -3
- package/dist/records.d.ts.map +1 -1
- package/dist/records.js +203 -4
- package/dist/records.js.map +1 -1
- package/dist/types.d.ts +108 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/vertical.d.ts +43 -0
- package/dist/vertical.d.ts.map +1 -0
- package/dist/vertical.js +44 -0
- package/dist/vertical.js.map +1 -0
- package/docs/api.md +15 -1
- package/package.json +22 -13
package/AUDIT.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming — package audit
|
|
2
2
|
|
|
3
3
|
**Status:** Phase 1 (SDK skeleton + spec + pure helpers).
|
|
4
|
-
**Last refreshed:** 2026-
|
|
4
|
+
**Last refreshed:** 2026-11-10 (spec 445 hardening: NAME-8)
|
|
5
|
+
**Prior refresh:** 2026-06-01 (R9 substrate coverage references + R11.1 fail-hard audit + R11.3 public-surface cleanup)
|
|
5
6
|
**Prior refresh:** 2026-05-23
|
|
6
7
|
**Owner:** [security-auditor](../../docs/agents/security-auditor.md) +
|
|
7
8
|
[technical-architect-auditor](../../docs/agents/technical-architect-auditor.md).
|
|
@@ -57,6 +58,53 @@ on-chain authority paths, and demo integration land in Phase 3+.
|
|
|
57
58
|
- ✅ `AgentNamingClient` throws `NS Phase 4 — wire to …` from every
|
|
58
59
|
write method.
|
|
59
60
|
|
|
61
|
+
## Spec 445 — pre-launch hardening (2026-11-10)
|
|
62
|
+
|
|
63
|
+
**Root retirement (2026-11-10, owner decision).** `.impact` is removed from `LEGACY_TLDS`; `.agent` is the only
|
|
64
|
+
untyped legacy root. No alias or migration path: `alice.impact` is `unknown_tld` in `parseAgentName` / `namehash` /
|
|
65
|
+
`normalizeAgentName` (so it cannot be hashed, resolved or claimed), has no host, and reads as no name
|
|
66
|
+
(`test/grammar.test.ts` "a retired root fails closed"). The on-chain root on deployed networks is not removed by this.
|
|
67
|
+
Residual: `hostForName` / `dnsHostReadings` / `agentNameForHandle` take the bare roots from the CALLER and do not
|
|
68
|
+
check them against the root lists — a deployment still configured with a retired parent builds a string that then
|
|
69
|
+
fails at `namehash`.
|
|
70
|
+
|
|
71
|
+
Source: `docs/audits/2026-11-10-pre-launch-audit/reviewer-reports/09-ts-naming-registry-coordination.md`.
|
|
72
|
+
|
|
73
|
+
**NAME-8 (Medium) — the DNS host projection is injective and its inverse single-valued.** Typed names host at
|
|
74
|
+
`<label>-<type>.<zone>`, persons and untyped roots at `<label>.<zone>`. The rule, enforced where a host is made,
|
|
75
|
+
read and claimed (`src/dns.ts` header):
|
|
76
|
+
|
|
77
|
+
1. a bare-root label ending in `-<type>` **has no host** — `hostForName` → `null`, `dnsHostForHandle` throws
|
|
78
|
+
`label_reads_as_type` — for LEGACY roots as well as persons (before: person-only, and only in `validateTypedClaim`);
|
|
79
|
+
2. a type suffix is one hyphen-free word (`registerVerticalAgentTypes` refuses a hyphen), so `<label>-<type>` splits
|
|
80
|
+
one way (`typeSuffixOfLabel`);
|
|
81
|
+
3. a reserved label has no host and reads back as no name;
|
|
82
|
+
4. the SDK claim helpers refuse both (`labelClaimViolation` in `buildSubregistryRegisterCall` — an omitted `root` is
|
|
83
|
+
judged a bare root — `buildRegisterSubnameCall` under a known root, `buildTypedClaimCalls`, `buildPricedClaimCalls`);
|
|
84
|
+
5. every inverse is a HINT: `confirmDnsHost` resolves EVERY reading of a host on chain and returns `ambiguous` when two
|
|
85
|
+
agents hold it — a router refuses, it never picks by precedence.
|
|
86
|
+
|
|
87
|
+
| Test (`test/dns.test.ts`, `test/claim.test.ts`) | Twin |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| "twin: legacy `foo-org` and typed `foo.org` do not share a host" | the audit PoC rows |
|
|
90
|
+
| "property: forward is injective for one bare root, and inverse∘forward is the identity" (+ two more properties) | > 5 000 generated names × every root |
|
|
91
|
+
| "twin: a host that reads two ways on chain is AMBIGUOUS, never a pick" | victim legacy name + attacker typed claim |
|
|
92
|
+
| "twin: a reserved label has no host…" / "…through every SDK claim helper is refused" | `www`, `api`, type words |
|
|
93
|
+
| "twin: a hyphenated vertical suffix is refused" | `x.house-guild` vs `x-house.guild` |
|
|
94
|
+
|
|
95
|
+
**Contract half — generation 4 / B2 (2026-11-10, spec 445).** `AgentNameRegistry.register` (so every subregistry
|
|
96
|
+
path) reverts `ReservedLabel` (`ws www mtls edge api well-known` = `CHAIN_SEEDED_RESERVED_LABELS`, plus each INITIALIZED
|
|
97
|
+
typed root's label) and, under a bare-host root, `LabelReadsAsTypedName`; the SDK stays the stricter pre-check (all type
|
|
98
|
+
words statically). Mirrored: REG-5 commit-reveal (`buildSubregistryCommitCall` → wait ≥10 s → reveal with the client's
|
|
99
|
+
secret; `subregistryCommitment` golden), REG-6 parent-only `buildRenewNameCall`, REG-4 epoch/REG-11/initializer ABI.
|
|
100
|
+
Tests: `test/generation4-b2.test.ts` (REG-5 ×6, NAME-8 on chain ×2, REG-6, REG-11). Routing still uses `confirmDnsHost`.
|
|
101
|
+
|
|
102
|
+
**Open — residual.** An estate serving several bare roots shares `<label>.<zone>` between them by configuration;
|
|
103
|
+
`confirmDnsHost` reports it unless one agent holds both. A grandfathered bare name ending in `-<type>` still answers
|
|
104
|
+
at its old host while no typed claim reads the same (`projectable: false`); once one does, the host answers for
|
|
105
|
+
neither. NAME-18 (ABI mirrors outside `check:abi-sync`) and NAME-20's chain-id comparison for `AgentNamingClient`
|
|
106
|
+
are not taken here (the gate script is root-owned; the client has ~20 read paths and needs its own change).
|
|
107
|
+
|
|
60
108
|
## Audit events this package emits (Phase 2+)
|
|
61
109
|
|
|
62
110
|
| Action | When | Severity in audit context |
|
|
@@ -85,11 +133,13 @@ client doesn't yet take an `auditSink`; Phase 2 will add the optional
|
|
|
85
133
|
| Date | Wave | What changed |
|
|
86
134
|
| --- | --- | --- |
|
|
87
135
|
| 2026-05-23 | NS Phase 1 | Initial audit. AN-1/2/3 open; security invariants verified by unit tests. |
|
|
136
|
+
| 2026-11-10 | spec 445 | NAME-8: injective DNS projection, `confirmDnsHost`, claim-helper refusals, hyphen-free vertical suffixes; `handleForDnsHost` exported. |
|
|
137
|
+
| 2026-11-10 | spec 445 / generation 4 / B2 | REG-4/5/6/11 + NAME-8-on-chain mirrors; `buildTypedClaimCalls` → `{ commit, claim }` (BREAKING: `chainId`, `secret`). |
|
|
88
138
|
|
|
89
139
|
## R9 substrate coverage (2026-06-01)
|
|
90
140
|
|
|
91
141
|
- Locked by R6.2 + R6.8 contract-side hardening:
|
|
92
|
-
- `AgentNameRegistry.initializeRoot` cannot be frontrun (
|
|
142
|
+
- `AgentNameRegistry.initializeRoot` cannot be frontrun (one initializer; gen 4: one-shot relinquishing `transferInitializer`→`acceptInitializer`) — H7-C.4 / CON-NAMING-001.
|
|
93
143
|
- `PermissionlessSubregistry.register` is `nonReentrant` — R6.2 / CON-SUBREGISTRY-003.
|
|
94
144
|
- Pause coverage: 7 mutating functions (register, backfillLabel, setOwner, setResolver, setSubregistry, renew, setPrimaryName) are `whenNotPaused` — R6.8.
|
|
95
145
|
- ADR-0012 / ADR-0013: NO `eth_getLogs` in product read paths; `reverseResolveString` is the canonical single-call.
|
package/CLAUDE.md
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming — Claude guide
|
|
2
2
|
|
|
3
3
|
## Naming facet, not identity
|
|
4
|
-
Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)). Forced-unique labels: [spec 220 § 5](../../specs/220-agent-identity-bootstrap.md). `addr` + `nativeId`
|
|
4
|
+
Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)). Forced-unique labels: [spec 220 § 5](../../specs/220-agent-identity-bootstrap.md). `addr` + `nativeId` SHOULD reference the same SA — no read path here checks it (audit NAME-20); a consumer that relies on it compares them.
|
|
5
5
|
|
|
6
6
|
## What this package owns
|
|
7
7
|
|
|
8
|
-
- The
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- `
|
|
12
|
-
|
|
8
|
+
- The **typed TLD registry** (`AGENT_TLDS` = `me org team svc workspace treasury registry church circle`, alias `ws`,
|
|
9
|
+
legacy `agent`; `.impact` retired ⇒ `unknown_tld`) — a suffix names the DERIVED agent type, never a root, a role or the
|
|
10
|
+
hierarchy ([ADR-0061](../../docs/architecture/decisions/0061-derived-agent-types-and-typed-name-suffixes.md),
|
|
11
|
+
[spec 346](../../specs/346-typed-agent-naming-and-registry.md)). `derivedTypeForTld` / `rootClassForTld`.
|
|
12
|
+
- The name **grammar** (`parseAgentName`): `x.t` canonical, `x.t@c.u` context-issued (path form
|
|
13
|
+
`c.u/x.t`, on-chain form `x.t.c.u`), type-nodes, roots, legacy. One context level in v1.
|
|
14
|
+
- Name normalization (`normalizeAgentName`) — NFC + lowercase + label validation + alias rewrite;
|
|
15
|
+
returns the canonical display form.
|
|
16
|
+
- The **federated reference** (`federatedAgentName` → `FederatedAgentNameV1 { name, chain }`, `displayAgentName` —
|
|
17
|
+
bare only inside the home chain, qualified everywhere else; spec 346 §3.7, ap-federation spec 440 §C). The chain is
|
|
18
|
+
a record beside the name, never a name component: `alice.me@faithchain` is refused by the grammar.
|
|
19
|
+
- The **DNS/A2A projection** (`dnsHostForHandle`/`hostForName`, zone caller-supplied — ADR-0021) + the two protocol paths. Injective (spec 445 / NAME-8):
|
|
20
|
+
a bare-root label ending in `-<type>` and a reserved label have NO host; host → name is a HINT — route via `confirmDnsHost` (`ambiguous` ⇒ refuse).
|
|
21
|
+
- **Claim-time validation** (`validateTypedClaim`, `findUniqueLabel`, `buildDeclareAgentTypeCalls`,
|
|
22
|
+
`buildTypedClaimCalls`): the suffix is a CLAIM, the SA-keyed on-chain `atl:agentType` record is
|
|
23
|
+
the authority; a mismatch fails closed (`resolveTyped` → `null`, `checkTypedName` → reason).
|
|
24
|
+
- `labelhash` + `namehash` for identifier nodes.
|
|
13
25
|
- Record schemas (`AgentNameRecords`) and predicate constants
|
|
14
26
|
(subpath `/records`).
|
|
15
27
|
- `AgentNamingClient` — read API (resolve / reverse-resolve / get
|
|
16
28
|
records) + write API skeleton (Phase 1 writes throw `NS Phase 2`).
|
|
17
|
-
-
|
|
18
|
-
into custody-policy ceremonies (subpath `/custody`).
|
|
29
|
+
- Call builders for name-owner rotation (subpath `/custody`).
|
|
19
30
|
|
|
20
31
|
## What this package does NOT own
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
We expose call builders only — never import.
|
|
27
|
-
- Delegation / caveat / mint → [`delegation`](../delegation).
|
|
28
|
-
- Passkey ceremonies → [`connect-auth`](../connect-auth).
|
|
29
|
-
- MCP / A2A transport → demo apps + future `a2a-runtime`.
|
|
30
|
-
- Contract source — that lives in `packages/contracts/src/naming/`
|
|
31
|
-
(Phase 3+); this package ships ABIs + client only.
|
|
33
|
+
Smart-account internals → `agent-account`; custody policy → `account-custody` (call builders only,
|
|
34
|
+
never imported); delegation → `delegation`; passkeys → `connect-auth`; MCP/A2A transport → apps;
|
|
35
|
+
contract source → `packages/contracts/src/naming/` (ABIs + client only here); the composed typed
|
|
36
|
+
resolver / invitation flows → `registry-resolution` (spec 346 §6.3).
|
|
32
37
|
|
|
33
38
|
## Vocabulary
|
|
34
39
|
|
|
35
40
|
**Owns:** `AgentName`, `Label`, `Node` (namehash), `NameRecord`,
|
|
36
41
|
`AgentNamingClient`, `Subregistry`, `Resolver`, `PrimaryName`,
|
|
37
|
-
`
|
|
42
|
+
`AgentTld`, `ParsedAgentName`, `TypedNameRecord`.
|
|
38
43
|
**Disambiguation:**
|
|
39
44
|
|
|
40
45
|
- **"resolver"** here = our on-chain registry + resolver. Distinct from
|
|
@@ -42,23 +47,20 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
42
47
|
- **"registry"** here = `AgentNameRegistry` contract. Distinct from
|
|
43
48
|
the factory deploy-registry in `agent-account`.
|
|
44
49
|
- **"primary name"** = reverse-record on a Smart Agent address.
|
|
45
|
-
|
|
46
|
-
**Does not use:** `Delegation`, `Caveat`, `Steward`, `Custodian`,
|
|
47
|
-
`Trustee`, `KMS`, `RiskTier`, `JtiStore`, MCP / A2A transport.
|
|
48
|
-
See `capability.manifest.json:forbiddenTerms`.
|
|
50
|
+
**Does not use:** see `capability.manifest.json:forbiddenTerms`.
|
|
49
51
|
|
|
50
52
|
## Read these first (in order)
|
|
51
53
|
|
|
52
54
|
1. `capability.manifest.json` — boundary.
|
|
53
55
|
2. `src/index.ts` — public API.
|
|
54
|
-
3. `../../specs/
|
|
55
|
-
4. `src/namehash.ts
|
|
56
|
-
5. `src/client.ts` — the client skeleton.
|
|
56
|
+
3. `../../specs/346-typed-agent-naming-and-registry.md` §2–§5 — the typed model (spec 215 = records/contracts prior art).
|
|
57
|
+
4. `src/namehash.ts`, `src/normalize.ts`, `src/client.ts`.
|
|
57
58
|
|
|
58
59
|
## Stable public exports
|
|
59
60
|
|
|
60
|
-
**Constants + helpers:** `
|
|
61
|
-
`labelhash`, `namehash
|
|
61
|
+
**Constants + helpers:** `AGENT_TLDS`, `derivedTypeForTld`, `rootKindForTld`, `parseAgentName`,
|
|
62
|
+
`formatAgentName`, `normalizeAgentName`, `labelhash`, `namehash`, `dnsHostForHandle`,
|
|
63
|
+
`findUniqueLabel`, `validateTypedClaim`, `federatedAgentName`, `displayAgentName`.
|
|
62
64
|
**Types:** `AgentNameRecords`, `RegisterSubnameInput`,
|
|
63
65
|
`SetPrimaryNameInput`, `SetAgentRecordsInput`,
|
|
64
66
|
`SetSubregistryInput`.
|
|
@@ -68,6 +70,8 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
68
70
|
**Subpaths:**
|
|
69
71
|
|
|
70
72
|
- `/records` — predicate constants + encoders/decoders.
|
|
73
|
+
Includes `cardDigest` (bytes32 sha256 of the RELEASED A2A Agent Card) + `cardUri` — spec 347 §8.3; the AP Naming
|
|
74
|
+
projection writes them, `resolve()` reads them, `registry-resolution` surfaces `bindings.cardDigest`. Evidence, never authority.
|
|
71
75
|
- `/custody` — pure encoded call builders for custody-gated name
|
|
72
76
|
rotation (no `@agenticprimitives/account-custody` import).
|
|
73
77
|
|
|
@@ -100,33 +104,14 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
100
104
|
in [`custody`](../account-custody). Compose via `agent-naming/custody`
|
|
101
105
|
call builders here without importing.
|
|
102
106
|
- "Add a passkey ceremony" — **STOP.** Belongs in [`connect-auth`](../connect-auth).
|
|
103
|
-
- "Reach for an MCP transport" — **STOP.** Out of scope.
|
|
104
|
-
- "
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
`
|
|
111
|
-
- Adding resolver reads? Start in `src/client.ts`.
|
|
112
|
-
- Adding name rotation calls? Start in `src/custody.ts`; do not import
|
|
113
|
-
`@agenticprimitives/account-custody`.
|
|
114
|
-
- Adding passkey behavior? Stop. Route to `connect-auth`.
|
|
115
|
-
- Adding delegation or caveat behavior? Stop. Route to `delegation`.
|
|
116
|
-
- Adding MCP/A2A transport? Stop. Route to app/runtime packages.
|
|
117
|
-
|
|
118
|
-
## Before you write code
|
|
119
|
-
|
|
120
|
-
- [ ] Is the change in the resolver-records / namehash / normalize /
|
|
121
|
-
client surface?
|
|
122
|
-
- [ ] Did I avoid importing from `delegation`, `account-custody`,
|
|
123
|
-
`mcp-runtime`, `tool-policy`, `key-custody`, `audit`?
|
|
124
|
-
- [ ] Did I keep `normalize` deterministic (NFC + lowercase + label
|
|
125
|
-
validation)?
|
|
126
|
-
- [ ] Did I write golden-vector tests for any namehash / labelhash
|
|
127
|
-
change?
|
|
128
|
-
- [ ] Did I update `specs/215-agent-naming.md` if the public API or
|
|
129
|
-
records schema changed?
|
|
107
|
+
- "Reach for an MCP transport" or "auto-resolve via a worker hook" — **STOP.** Out of scope; app integration.
|
|
108
|
+
- "Infer the agent type from the suffix / the DNS label" or "let the suffix
|
|
109
|
+
override `atl:agentType`" — **STOP.** ADR-0061 §5: the record is the
|
|
110
|
+
authority; `checkTypedName` fails closed on a mismatch.
|
|
111
|
+
- "Bake a zone / hostname into `dns.ts`" — **STOP.** ADR-0021: the zone is
|
|
112
|
+
caller-supplied; `check:no-domain-in-packages` enforces it.
|
|
113
|
+
- "Add `'team'`/`'treasury'` to `AgentKind`" — **STOP.** Roots are closed;
|
|
114
|
+
the derived type is `DerivedAgentType` on the SA subject.
|
|
130
115
|
|
|
131
116
|
## Security invariants (DO NOT BREAK)
|
|
132
117
|
|
|
@@ -161,15 +146,9 @@ pnpm check:forbidden-terms
|
|
|
161
146
|
|
|
162
147
|
## Capabilities this package participates in
|
|
163
148
|
|
|
164
|
-
- **Agent identity + service discovery** —
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
(`a2a-endpoint`, `mcp-endpoint`) without hardcoded URLs.
|
|
168
|
-
- **Audit / forensics trail** — emits (via consumer-supplied
|
|
169
|
-
`AuditSink`): `agent-naming.{resolve,register,records.update,
|
|
170
|
-
primary-name.update,subregistry.update}`.
|
|
171
|
-
- Index of cross-cutting capabilities:
|
|
172
|
-
[`docs/architecture/cross-cutting-capabilities.md`](../../docs/architecture/cross-cutting-capabilities.md).
|
|
149
|
+
- **Agent identity + service discovery** — which Smart Agent answers to which typed name, and the
|
|
150
|
+
DNS/A2A binding projected from it. Index: [`cross-cutting-capabilities.md`](../../docs/architecture/cross-cutting-capabilities.md).
|
|
151
|
+
- **Audit trail** — emits `agent-naming.{resolve,register,records.update,primary-name.update,subregistry.update}` via a consumer-supplied `AuditSink`.
|
|
173
152
|
|
|
174
153
|
## Documentation map
|
|
175
154
|
|
package/README.md
CHANGED
|
@@ -1,44 +1,40 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
|
|
4
4
|
|
|
5
|
-
The
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
**The name is a facet. The address is the identity.** Agent naming is being settled right now — GoDaddy launched an Agent Naming Service, ERC-8004 put agent registries on mainnet, and every discovery stack needs an answer to "which agent answers to this name?" Most naming systems get the dependency backwards: the name becomes the identity, and losing the name (or the registrar) means losing everything attached to it. Here, every person, org, service agent, and treasury is a canonical ERC-4337 Smart Agent address — and a `.agent` name is a replaceable record pointing *at* that address ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)). Rotate the name, keep the identity. Rotate your credentials, keep the name. Nothing downstream breaks.
|
|
6
|
+
|
|
7
|
+
Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
8
|
+
|
|
9
|
+
Use this package to resolve names like `alice.agent` and `treasury.acme.agent` to Smart Agent addresses, read typed service-discovery records (A2A endpoint, MCP endpoint, CAIP-10 `nativeId`), and build encoded calls for name-management transactions. Names are hierarchical — orgs hand out subnames under their own subregistry — and normalization is deterministic and on-chain-verifiable.
|
|
8
10
|
|
|
9
11
|
> **Layer:** Discover — a naming **facet** (not canonical identity — that is `agent-account`).
|
|
10
12
|
> **Canonical key:** the Smart Agent address the name resolves to.
|
|
11
13
|
|
|
12
|
-
Use this
|
|
13
|
-
`treasury.acme.agent` to Smart Agent addresses, read typed service-discovery
|
|
14
|
-
records, and build encoded calls for name-management transactions.
|
|
15
|
-
|
|
16
|
-
## Use This When
|
|
14
|
+
## Use this when
|
|
17
15
|
|
|
18
|
-
- You need forward resolution: `alice.agent
|
|
19
|
-
- You need reverse resolution from a Smart Agent address to its primary name.
|
|
20
|
-
- You need typed records such as `displayName`, `a2aEndpoint`, `mcpEndpoint`,
|
|
21
|
-
|
|
22
|
-
- You need pure call builders for name registration, resolver updates, primary
|
|
23
|
-
name updates, or owner rotation.
|
|
16
|
+
- You need forward resolution: `alice.agent → 0x…`.
|
|
17
|
+
- You need reverse resolution from a Smart Agent address to its primary name — with a round-trip check, so a name is only trusted when it resolves back to the same address.
|
|
18
|
+
- You need typed records such as `displayName`, `a2aEndpoint`, `mcpEndpoint`, `nativeId`, or `metadataUri` — service discovery without hardcoded URLs.
|
|
19
|
+
- You need pure call builders for name registration, resolver updates, primary-name updates, or owner rotation that compose into custody-policy ceremonies.
|
|
24
20
|
|
|
25
|
-
## Do
|
|
21
|
+
## Do not use this for
|
|
26
22
|
|
|
27
|
-
- Passkey ceremonies or auth flows
|
|
28
|
-
- Smart-account deployment or UserOps
|
|
29
|
-
- Account safety policy and approval scheduling
|
|
30
|
-
- Permission-token minting or attenuation
|
|
31
|
-
- MCP/A2A transport wiring
|
|
23
|
+
- Passkey ceremonies or auth flows — `@agenticprimitives/connect-auth`.
|
|
24
|
+
- Smart-account deployment or UserOps — `@agenticprimitives/agent-account`.
|
|
25
|
+
- Account safety policy and approval scheduling — `@agenticprimitives/account-custody`.
|
|
26
|
+
- Permission-token minting or attenuation — `@agenticprimitives/delegation`.
|
|
27
|
+
- MCP/A2A transport wiring — demo apps or runtime packages.
|
|
32
28
|
|
|
33
29
|
## Install
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
Workspace-internal; not yet published.
|
|
36
32
|
|
|
37
33
|
```bash
|
|
38
34
|
pnpm add @agenticprimitives/agent-naming
|
|
39
35
|
```
|
|
40
36
|
|
|
41
|
-
## 60-
|
|
37
|
+
## 60-second quickstart
|
|
42
38
|
|
|
43
39
|
```ts
|
|
44
40
|
import {
|
|
@@ -64,22 +60,28 @@ const primaryName = await naming.reverseResolve('0x00000000000000000000000000000
|
|
|
64
60
|
const records = await naming.getRecords('treasury.acme.agent');
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
##
|
|
63
|
+
## How it's different
|
|
64
|
+
|
|
65
|
+
The reference points are **ENS and Unstoppable Domains** — both excellent at what they do, both built around a different center of gravity:
|
|
66
|
+
|
|
67
|
+
- **Name-as-asset vs. name-as-facet.** ENS and Unstoppable treat the name as the prized object; identity accretes around it. Here the Smart Agent address is canonical and forced-unique names are assigned at identity bootstrap ([spec 220 §5](../../specs/220-agent-identity-bootstrap.md)) — the name is a pointer, replaceable without identity loss, and `addr` + `nativeId` must reference the same Smart Agent.
|
|
68
|
+
- **Agent-native records.** Typed predicates for `a2aEndpoint`, `mcpEndpoint`, CAIP-10 `nativeId`, and a public-safe passkey credential digest — the records an agent economy actually resolves, not a TXT free-for-all. Unknown predicates are ignored on decode and rejected by typed encoders.
|
|
69
|
+
- **Custody-governed rotation.** Name-owner rotation ships as pure encoded call builders (`/custody` subpath) that compose into the owner Smart Agent's custody-policy ceremonies — quorums and trustees, not a private key that can be phished once.
|
|
70
|
+
- **Disciplined reads.** Product reads use `readContract` only — no `eth_getLogs` walks, no silent fallbacks ([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md), [ADR-0013](../../docs/architecture/decisions/0013-no-silent-fallbacks.md)). Reverse resolution is a single on-chain `reverseResolveString` read, then a forward round-trip before it is trusted.
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
The `.agent` TLD is the naming protocol; which names a given deployment registers is app-layer configuration — this package stays generic.
|
|
73
|
+
|
|
74
|
+
## Main concepts
|
|
75
|
+
|
|
76
|
+
- **Canonical SA**: the ERC-4337 address every name must reference (`addr`, `nativeId`). Owned by `agent-account`, not this package.
|
|
71
77
|
- **AgentName**: a normalized dotted name under `.agent` (a facet label).
|
|
72
|
-
- **Label**: one segment
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **Resolver**: stores typed records for a node.
|
|
76
|
-
- **Primary name**: reverse record for a Smart Agent address.
|
|
77
|
-
- **Records**: typed data such as endpoints, display name, CAIP-10 `nativeId`,
|
|
78
|
-
and public-safe passkey credential digest.
|
|
78
|
+
- **Label / Node**: one segment (`treasury`); the recursive `namehash(name)`.
|
|
79
|
+
- **Registry / Resolver**: name records (owner, resolver, parent, subregistry); typed records for a node.
|
|
80
|
+
- **Primary name**: the reverse record for a Smart Agent address.
|
|
79
81
|
|
|
80
82
|
See [`docs/concepts.md`](docs/concepts.md).
|
|
81
83
|
|
|
82
|
-
## Common
|
|
84
|
+
## Common recipes
|
|
83
85
|
|
|
84
86
|
```ts
|
|
85
87
|
import {
|
|
@@ -102,40 +104,37 @@ const decoded = decodeRecords({
|
|
|
102
104
|
});
|
|
103
105
|
```
|
|
104
106
|
|
|
105
|
-
More examples:
|
|
107
|
+
More examples: [`examples/basic.ts`](examples/basic.ts) · [`examples/records.ts`](examples/records.ts) · [`examples/custody-rotation.ts`](examples/custody-rotation.ts)
|
|
108
|
+
|
|
109
|
+
## Released A2A card records (spec 347 §8.3)
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
111
|
+
`atl:cardDigest` (bytes32 = sha256 of the released A2A Agent Card's RFC 8785 bytes) and `atl:cardUri` (only when the
|
|
112
|
+
card is not at the a2a host's `/.well-known/agent-card.json`) are ordinary name-node records: `encodeRecords({ cardDigest,
|
|
113
|
+
cardUri })`, read back by `resolve()`. A verifier fetches the card and compares digests; the record proves nothing by
|
|
114
|
+
itself. Existing deployments register the terms with `contracts/script/AddCardPredicates.s.sol`.
|
|
110
115
|
|
|
111
|
-
## Runtime
|
|
116
|
+
## Runtime support
|
|
112
117
|
|
|
113
|
-
Pure helpers and record encoders work in browser, Node, and Workers. The client
|
|
114
|
-
uses `viem` public and wallet clients and requires an RPC URL for chain reads or
|
|
115
|
-
transaction submission.
|
|
118
|
+
Pure helpers and record encoders work in browser, Node, and Workers. The client uses `viem` public and wallet clients and requires an RPC URL for chain reads or transaction submission.
|
|
116
119
|
|
|
117
|
-
## Subpath
|
|
120
|
+
## Subpath exports
|
|
118
121
|
|
|
119
122
|
- `@agenticprimitives/agent-naming` — public helpers, client, ABIs, and types.
|
|
120
|
-
- `@agenticprimitives/agent-naming/records` — predicate ids and typed
|
|
121
|
-
|
|
122
|
-
- `@agenticprimitives/agent-naming/custody` — pure encoded call builders for
|
|
123
|
-
name-management transactions.
|
|
123
|
+
- `@agenticprimitives/agent-naming/records` — predicate ids and typed record encode/decode helpers.
|
|
124
|
+
- `@agenticprimitives/agent-naming/custody` — pure encoded call builders for name-management transactions.
|
|
124
125
|
|
|
125
|
-
## Security
|
|
126
|
+
## Security invariants
|
|
126
127
|
|
|
127
|
-
-
|
|
128
|
-
([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md)).
|
|
129
|
-
`reverseResolve` string reconstruction is transitional log debt — do not copy.
|
|
130
|
-
- Name normalization is deterministic.
|
|
128
|
+
- Name normalization is deterministic — equal normalizations produce equal namehashes.
|
|
131
129
|
- Reverse resolution must round-trip before it is trusted.
|
|
132
130
|
- Unknown predicates are ignored on decode and rejected by typed encoders.
|
|
133
|
-
- Raw passkey credential IDs are never stored.
|
|
131
|
+
- Raw passkey credential IDs are never stored — only a digest.
|
|
134
132
|
- Endpoint records are discovery hints, not proof of endpoint control.
|
|
133
|
+
- Product reads use `readContract`; no `eth_getLogs` in hot paths ([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md)).
|
|
135
134
|
|
|
136
135
|
See [`docs/security.md`](docs/security.md) and [`AUDIT.md`](AUDIT.md).
|
|
137
136
|
|
|
138
|
-
## Documentation
|
|
137
|
+
## Documentation map
|
|
139
138
|
|
|
140
139
|
- [`docs/concepts.md`](docs/concepts.md) — naming model and vocabulary.
|
|
141
140
|
- [`docs/api.md`](docs/api.md) — human-readable public API guide.
|
|
@@ -153,6 +152,10 @@ pnpm check:public-exports
|
|
|
153
152
|
pnpm check:forbidden-terms
|
|
154
153
|
```
|
|
155
154
|
|
|
155
|
+
## Status
|
|
156
|
+
|
|
157
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root [`README.md`](../../README.md#status--honest-version) — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
|
158
|
+
|
|
156
159
|
## License
|
|
157
160
|
|
|
158
161
|
UNLICENSED.
|