@me2em/core 0.6.0-alpha.1 β†’ 0.7.0-alpha.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # πŸ“¦ `@me2em/core` β€” Core Cryptographic Primitives
1
+ ## πŸ“¦ Core Cryptographic Primitives
2
2
 
3
3
  Core primitives for the Me2em authorization protocol: hierarchical
4
4
  deterministic identities (`Identity` β†’ `Handle` β†’ `SubHandle`), stateless
@@ -6,8 +6,8 @@ signed sessions, and parent-signed **attestation chains** for delegatable,
6
6
  externally verifiable authorization β€” all on Ed25519.
7
7
 
8
8
  [![npm version](https://img.shields.io/npm/v/@me2em/core.svg)](https://www.npmjs.com/package/@me2em/core)
9
- [![License](https://img.shields.io/npm/l/@me2em/core.svg)](https://github.com/me2em/core/blob/main/LICENSE)
10
- [![Docs](https://img.shields.io/badge/docs-docs.me2em.com-blue)](https://docs.me2em.com)
9
+ [![License](https://img.shields.io/npm/l/@me2em/core.svg)](./LICENSE)
10
+ [![Docs](https://img.shields.io/badge/docs-core.me2em.com-blue)](https://core.me2em.com)
11
11
 
12
12
  ## 🎯 Overview
13
13
 
@@ -23,6 +23,43 @@ externally verifiable authorization β€” all on Ed25519.
23
23
  derivation without storage.
24
24
  - **Secure Channels** β€” symmetric channel keys and X25519 shared
25
25
  secrets derived without key exchange.
26
+ - **BIP39 Passphrase** β€” optional "25th word" support: the
27
+ passphrase silently derives a different identity if changed.
28
+ - **UKS-Safe ECDH** β€” `deriveSharedSecret` binds both peers'
29
+ public keys into the KDF (`p2p-channel/v2`), preventing
30
+ unknown key-share attacks.
31
+
32
+ ---
33
+
34
+ ## πŸ“– Terminology
35
+
36
+ Protocol terms are **domain-neutral** β€” each use case assigns them
37
+ its own meaning. The five terms most relevant to this package:
38
+
39
+ | Term | Definition |
40
+ |------|------------|
41
+ | **Identity** | Root cryptographic identity derived from a seed phrase. Constant forever. |
42
+ | **Handle** | A derived, attested, named key representing a distinct identity context. |
43
+ | **SubHandle** | A leaf child of a Handle (MAX_DEPTH = 2). |
44
+ | **Attestation** | A parent-signed statement binding a child key to a name and a grant. |
45
+ | **Session** | A stateless signed authorization token. |
46
+
47
+ **Domain interpretations** β€” the same primitives, read through
48
+ different lenses:
49
+
50
+ | Use case | Handle is… | SubHandle is… |
51
+ |----------|------------|----------------|
52
+ | **AI Agent Delegation** (UC-1) | An AI agent acting on behalf of a user | β€” (the agent signs sessions directly) |
53
+ | **IoT Device Hierarchy** (UC-2) | A physical device | A component of that device |
54
+ | **Multi-Context Identity** (UC-3) | A user persona (work, personal) | Delegated access within a persona |
55
+ | **Multi-App SSO** (UC-4) | A per-app persona of the user | β€” |
56
+ | **Deterministic Password Manager** (UC-5) | A service context | β€” |
57
+ | **E2EE Messaging** (UC-6) | The user's messaging identity | An optional device identity |
58
+
59
+ Full glossary (including Channel and material-class terms):
60
+ see the [root README](../../README.md).
61
+
62
+ ---
26
63
 
27
64
  ## πŸ“¦ Installation
28
65
 
@@ -35,6 +72,13 @@ pnpm add @me2em/core
35
72
  **Dependencies:** `@noble/curves` (Ed25519/X25519), `@noble/ed25519`,
36
73
  `@noble/hashes` (HKDF, SHA-256), `@scure/bip39` (mnemonic handling).
37
74
 
75
+ > πŸ’‘ This package is self-contained. For E2EE channels, X3DH key
76
+ > agreement, and Argon2id use [`@me2em/crypto`](../crypto/README.md).
77
+ > For React hooks and seed phrase UX components use
78
+ > [`@me2em/react`](../react/README.md). The three packages are
79
+ > designed to work together β€” see the root
80
+ > [README](../../README.md) for the full package map.
81
+
38
82
  ## πŸš€ Quick Start
39
83
 
40
84
  ```typescript
@@ -82,9 +126,10 @@ const seedBytes = await get32ByteSeedFromMnemonic(phrase);
82
126
  const identity = await Identity.fromSeed(seedBytes);
83
127
  ```
84
128
 
85
- > ⚠️ Passphrases (BIP39 "25th word") are not yet supported β€” see
86
- > [BACKLOG](./BACKLOG.md) (BL-04). Importing a phrase that was
87
- > created with a passphrase will silently derive a *different* identity.
129
+ > ⚠️ Passphrases (BIP39 "25th word") ARE supported:
130
+ > `get32ByteSeedFromMnemonic(words, passphrase)`. The passphrase is
131
+ > case-sensitive, not recoverable, and silently derives a different
132
+ > identity if mistyped. Store it with the same care as the words.
88
133
 
89
134
  ## πŸ”— Attestations (verifiable delegation)
90
135
 
@@ -166,7 +211,7 @@ All failures throw `AttestationError` with `code` and `level`
166
211
  | `SCOPE_EXCEEDED`, `TTL_EXCEEDED`, `AUDIENCE_NOT_PERMITTED`, `SESSION_OUTLIVES_ATTESTATION` | SESSION |
167
212
  | `SUBJECT_MISMATCH` | ROOT, SUB_ATTESTATION |
168
213
 
169
- "Note on error types. Failures detected during token parsing β€” wrongshape, invalid Base64URL, payload over 4096 bytes, non-JSON payload,missing required fields β€” throw a plain Error, before any attestationlayer is consulted. Every failure after parsing throwsAttestationError. Integration code should handle both."
214
+ "Note on error types. Failures detected during token parsing β€” wrong shape, invalid Base64URL, payload over 4096 bytes, non-JSON payload, missing required fields β€” throw a plain `Error`, before any attestation layer is consulted. Every failure **after** parsing throws an `AttestationError`. Integration code should handle both."
170
215
 
171
216
  ### Verification modes
172
217
 
@@ -216,8 +261,7 @@ entire branch: current **and** future sessions under it.
216
261
 
217
262
  The modes coexist naturally: internal telemetry verified with Mode 1,
218
263
  external access granted via Mode 2 β€” see
219
- [USE_CASES.md](./USE_CASES.md) for full production scenarios (EV
220
- charging, drone fleets, corporate messenger).
264
+ [USE_CASES.md](./USE_CASES.md) for all nine production scenarios.
221
265
 
222
266
  ## πŸ“– API Reference
223
267
 
@@ -336,15 +380,18 @@ produce identical keys across platforms and entry points.
336
380
 
337
381
  ## 🎯 Core Use Cases
338
382
 
339
- 1. **Deterministic password manager** β€” derive secrets per service, store nothing.
340
- 2. **IoT fleets with encrypted channels** β€” devices operate fully offline.
341
- 3. **Stateless multi-device sync** β€” same seed β†’ same handles everywhere.
342
- 4. **Delegatable access control** β€” attestation chains grant scope- and
343
- time-limited access to components, verifiable by external parties.
383
+ Mapped to the official registry β€” see [USE_CASES.md](./USE_CASES.md):
384
+
385
+ - **UC-5 β€” Deterministic password manager** β€” derive secrets per service, store nothing.
386
+ - **UC-2 β€” IoT fleets with encrypted channels** β€” devices operate fully offline.
387
+ - **Stateless multi-device sync** β€” same seed β†’ same handles everywhere (spans UC-3/UC-4).
388
+ - **UC-1 / UC-2 β€” Delegatable access control** β€” attestation chains grant scope- and
389
+ time-limited access, verifiable by external parties.
344
390
 
345
- πŸ‘‰ **[USE_CASES.md](./USE_CASES.md)** β€” EV charging stations, drone fleet
346
- access marketplace, corporate messenger, and a production Redis
347
- `RevocationChecker`.
391
+ πŸ‘‰ **[USE_CASES.md](./USE_CASES.md)** β€” nine scenarios: AI agents, satellite capacity
392
+ marketplace, drone fleet management, multi-app SSO, multi-context identity, EV
393
+ charging, corporate messenger, password manager, E2EE messenger β€” plus a production
394
+ Redis `RevocationChecker`.
348
395
 
349
396
  ## πŸ” Cryptographic Details
350
397
 
@@ -373,7 +420,7 @@ access marketplace, corporate messenger, and a production Redis
373
420
  - Don't reuse Handles across unrelated contexts.
374
421
  - Don't log private keys or seed phrases.
375
422
  - Don't rely on zeroing buffers as a hard guarantee β€” GC/JIT may retain
376
- copies (tracked in [BACKLOG](./BACKLOG.md) BL-07).
423
+ copies (tracked in [BACKLOG](../../BACKLOG.md) BL-07).
377
424
 
378
425
  ## πŸ§ͺ Testing
379
426
 
@@ -381,20 +428,22 @@ access marketplace, corporate messenger, and a production Redis
381
428
  cd packages/core && pnpm test
382
429
  ```
383
430
 
384
- 166 tests cover: deterministic derivation and cross-entry-point key
431
+ 186 tests cover: deterministic derivation and cross-entry-point key
385
432
  consistency, name canonicalization, session lifecycle (create, verify,
386
433
  tamper, expiry, iat), revocation, SubHandle constraint enforcement,
387
434
  MAX_DEPTH leaf enforcement, attestation issue/decode/signature
388
435
  determinism and validation, and the full `verifyAttested` chain
389
436
  (20+ cases including nesting, wildcard permitting, revocation at every
390
- level, and signature robustness).
437
+ level, signature robustness, BIP39 passphrase derivation, and wordlist
438
+ validation).
391
439
 
392
440
  ## πŸ—ΊοΈ Roadmap
393
441
 
394
- Recommendations for further development β€” including BIP39 passphrase
395
- support, revocation lineage (`sid`), key zeroing, and attestation
396
- reference compression β€” live in [BACKLOG.md](./BACKLOG.md).
397
- The backlog is advisory and not part of the shipped API contract.
442
+ Passphrase support has shipped (0.7.0). Remaining recommendations β€”
443
+ session lineage (`sid`), key zeroing, attestation reference compression,
444
+ and the full package strategy (`@me2em/crypto`, `@me2em/messenger`,
445
+ `@me2em/iot`) β€” live in [BACKLOG.md](../../BACKLOG.md). The backlog is
446
+ advisory and not part of the shipped API contract.
398
447
 
399
448
  ## πŸ“œ License
400
449
 
@@ -1,4 +1,3 @@
1
- import { sha256 as nobleSha256 } from '@noble/hashes/sha2.js';
2
1
  /**
3
2
  * HKDF-SHA256 wrapper for me2em protocol
4
3
  *
@@ -9,5 +8,6 @@ import { sha256 as nobleSha256 } from '@noble/hashes/sha2.js';
9
8
  * @returns Derived key as Uint8Array
10
9
  */
11
10
  export declare function hkdf(ikm: Uint8Array, salt: Uint8Array, info: Uint8Array, length: number): Uint8Array;
12
- export { nobleSha256 as sha256 };
11
+ /** SHA-256 hash function. */
12
+ export declare function sha256(input: Uint8Array): Uint8Array;
13
13
  //# sourceMappingURL=hkdf.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["../../src/crypto/hkdf.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,GACb,UAAU,CAEZ;AAED,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["../../src/crypto/hkdf.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,GACb,UAAU,CAEZ;AAED,6BAA6B;AAC7B,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEpD"}
@@ -13,5 +13,8 @@ import { sha256 as nobleSha256 } from '@noble/hashes/sha2.js';
13
13
  export function hkdf(ikm, salt, info, length) {
14
14
  return nobleHkdf(nobleSha256, ikm, salt, info, length);
15
15
  }
16
- export { nobleSha256 as sha256 };
16
+ /** SHA-256 hash function. */
17
+ export function sha256(input) {
18
+ return nobleSha256(input);
19
+ }
17
20
  //# sourceMappingURL=hkdf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hkdf.js","sourceRoot":"","sources":["../../src/crypto/hkdf.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAClB,GAAe,EACf,IAAgB,EAChB,IAAgB,EAChB,MAAc;IAEd,OAAO,SAAS,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"hkdf.js","sourceRoot":"","sources":["../../src/crypto/hkdf.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAClB,GAAe,EACf,IAAgB,EAChB,IAAgB,EAChB,MAAc;IAEd,OAAO,SAAS,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,6BAA6B;AAC7B,MAAM,UAAU,MAAM,CAAC,KAAiB;IACtC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
package/dist/handle.d.ts CHANGED
@@ -113,29 +113,29 @@ export declare class Handle {
113
113
  */
114
114
  deriveSubHandle(name: string, metadata?: SubHandleMetadata): Promise<SubHandle>;
115
115
  /**
116
- * Issues an attestation for a derived SubHandle, binding its
117
- * derived key to the name and grant. Autonomous: requires only
118
- * this Handle's own key, no Identity and no network.
119
- *
120
- * The child key is derived internally, so the attestation's
121
- * `subjectId` always equals the key produced by
122
- * `identity.deriveSubHandle(this.name, subName)`.
123
- *
124
- * Note: this method does not check this Handle's own grant β€” it may
125
- * not have one (Mode 1). Nesting is enforced by verifiers in
126
- * `Session.verifyAttested` (a child grant exceeding the parent's is
127
- * rejected with `SCOPE_EXCEEDED`/`TTL_EXCEEDED` at level ROOT).
128
- *
129
- * @example
130
- * ```ts
131
- * const B = await station.attestSubHandle('connector-ccs', {
132
- * audiences: ['ev-app.com'],
133
- * scopes: ['charge:start', 'charge:stop'],
134
- * maxSessionTtl: 7200,
135
- * }, { ttlSeconds: 1800 });
136
- * // Ship [A.token, B.token] together with the session token.
137
- * ```
138
- */
116
+ * Issues an attestation for a derived SubHandle, binding its
117
+ * derived key to the name and grant. Autonomous: requires only
118
+ * this Handle's own key, no Identity and no network.
119
+ *
120
+ * The child key is derived internally, so the attestation's
121
+ * `subjectId` always equals the key produced by
122
+ * `identity.deriveSubHandle(this.name, subName)`.
123
+ *
124
+ * Note: this method does not check this Handle's own grant β€” it may
125
+ * not have one (Mode 1). Nesting is enforced by verifiers in
126
+ * `Session.verifyAttested` (a child grant exceeding the parent's is
127
+ * rejected with `SCOPE_EXCEEDED`/`TTL_EXCEEDED` at level ROOT).
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * const B = await station.attestSubHandle('connector-ccs', {
132
+ * audiences: ['ev-app.com'],
133
+ * scopes: ['charge:start', 'charge:stop'],
134
+ * maxSessionTtl: 7200,
135
+ * }, { ttlSeconds: 1800 });
136
+ * // Ship [A.token, B.token] together with the session token.
137
+ * ```
138
+ */
139
139
  attestSubHandle(subName: string, grant: AttestationGrant, opts?: {
140
140
  ttlSeconds?: number;
141
141
  expiresAt?: number;
@@ -174,14 +174,9 @@ export declare class Handle {
174
174
  *
175
175
  * @example
176
176
  * ```ts
177
- * // On the drone (Handle side):
178
- * const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
179
- * const encrypted = await encryptAESGCM(telemetry, channelKey);
180
- *
181
- * // On the control center (Identity side):
182
- * const droneHandle = await centerIdentity.deriveHandle('drone-001');
177
+ * // AES-GCM helpers are application-side; the protocol provides
178
+ * // only the key:
183
179
  * const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
184
- * const decrypted = await decryptAESGCM(encrypted, channelKey);
185
180
  * ```
186
181
  */
187
182
  deriveChannelKey(context: string): Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;A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AC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAgC1E"}
package/dist/handle.js CHANGED
@@ -128,29 +128,29 @@ export class Handle {
128
128
  return new SubHandleClass(subKey, normalizedName, path, metadata);
129
129
  }
130
130
  /**
131
- * Issues an attestation for a derived SubHandle, binding its
132
- * derived key to the name and grant. Autonomous: requires only
133
- * this Handle's own key, no Identity and no network.
134
- *
135
- * The child key is derived internally, so the attestation's
136
- * `subjectId` always equals the key produced by
137
- * `identity.deriveSubHandle(this.name, subName)`.
138
- *
139
- * Note: this method does not check this Handle's own grant β€” it may
140
- * not have one (Mode 1). Nesting is enforced by verifiers in
141
- * `Session.verifyAttested` (a child grant exceeding the parent's is
142
- * rejected with `SCOPE_EXCEEDED`/`TTL_EXCEEDED` at level ROOT).
143
- *
144
- * @example
145
- * ```ts
146
- * const B = await station.attestSubHandle('connector-ccs', {
147
- * audiences: ['ev-app.com'],
148
- * scopes: ['charge:start', 'charge:stop'],
149
- * maxSessionTtl: 7200,
150
- * }, { ttlSeconds: 1800 });
151
- * // Ship [A.token, B.token] together with the session token.
152
- * ```
153
- */
131
+ * Issues an attestation for a derived SubHandle, binding its
132
+ * derived key to the name and grant. Autonomous: requires only
133
+ * this Handle's own key, no Identity and no network.
134
+ *
135
+ * The child key is derived internally, so the attestation's
136
+ * `subjectId` always equals the key produced by
137
+ * `identity.deriveSubHandle(this.name, subName)`.
138
+ *
139
+ * Note: this method does not check this Handle's own grant β€” it may
140
+ * not have one (Mode 1). Nesting is enforced by verifiers in
141
+ * `Session.verifyAttested` (a child grant exceeding the parent's is
142
+ * rejected with `SCOPE_EXCEEDED`/`TTL_EXCEEDED` at level ROOT).
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * const B = await station.attestSubHandle('connector-ccs', {
147
+ * audiences: ['ev-app.com'],
148
+ * scopes: ['charge:start', 'charge:stop'],
149
+ * maxSessionTtl: 7200,
150
+ * }, { ttlSeconds: 1800 });
151
+ * // Ship [A.token, B.token] together with the session token.
152
+ * ```
153
+ */
154
154
  async attestSubHandle(subName, grant, opts) {
155
155
  const normalized = normalizeName(subName);
156
156
  const sub = await this.deriveSubHandle(normalized);
@@ -196,14 +196,9 @@ export class Handle {
196
196
  *
197
197
  * @example
198
198
  * ```ts
199
- * // On the drone (Handle side):
200
- * const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
201
- * const encrypted = await encryptAESGCM(telemetry, channelKey);
202
- *
203
- * // On the control center (Identity side):
204
- * const droneHandle = await centerIdentity.deriveHandle('drone-001');
199
+ * // AES-GCM helpers are application-side; the protocol provides
200
+ * // only the key:
205
201
  * const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
206
- * const decrypted = await decryptAESGCM(encrypted, channelKey);
207
202
  * ```
208
203
  */
209
204
  deriveChannelKey(context) {
@@ -1 +1 @@
1
- {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAyB,MAAM,kBAAkB,CAAC;AAoBtE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,MAAM;IACA,UAAU,CAAa;IACvB,SAAS,CAAa;IACtB,KAAK,CAAS;IACd,SAAS,CAAkB;IAE5C;;;;;;;;;OASG;IACH,YAAY,UAAsB,EAAE,IAAY,EAAE,QAAyB;QACzE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,EAAE,C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CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;CACF"}
@@ -84,29 +84,29 @@ export declare class Identity {
84
84
  */
85
85
  deriveSubHandle(handleName: string, subName: string, metadata?: SubHandleMetadata): Promise<SubHandle>;
86
86
  /**
87
- * Issues an attestation binding a derived Handle key to its name
88
- * and grant. The subject public key is always derived internally β€”
89
- * it is impossible to attest a foreign key, and the resulting
90
- * `subjectId` always matches the handle reconstructed via
91
- * {@link Identity.deriveSubHandle}.
92
- *
93
- * @param grant - Constraints verifiers will enforce for this handle
94
- * and (via `subNamePatterns`) for the SubHandles it may attest.
95
- * @returns An attestation signed by the Identity root key. Store it
96
- * with the Handle β€” it is a public artifact, not a secret.
97
- * @throws {Error} If the name is not canonicalizable.
98
- * @throws {AttestationError} If the grant is invalid.
99
- *
100
- * @example
101
- * ```ts
102
- * const A = await identity.attestHandle('station-001', {
103
- * audiences: ['ev-app.com'],
104
- * scopes: ['charge:start', 'charge:stop', 'charge:status'],
105
- * maxSessionTtl: 7200,
106
- * subNamePatterns: ['connector-*', 'meter-*'],
107
- * });
108
- * ```
109
- */
87
+ * Issues an attestation binding a derived Handle key to its name
88
+ * and grant. The subject public key is always derived internally β€”
89
+ * it is impossible to attest a foreign key, and the resulting
90
+ * `subjectId` always matches the handle reconstructed via
91
+ * {@link Identity.deriveSubHandle}.
92
+ *
93
+ * @param grant - Constraints verifiers will enforce for this handle
94
+ * and (via `subNamePatterns`) for the SubHandles it may attest.
95
+ * @returns An attestation signed by the Identity root key. Store it
96
+ * with the Handle β€” it is a public artifact, not a secret.
97
+ * @throws {Error} If the name is not canonicalizable.
98
+ * @throws {AttestationError} If the grant is invalid.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const A = await identity.attestHandle('station-001', {
103
+ * audiences: ['ev-app.com'],
104
+ * scopes: ['charge:start', 'charge:stop', 'charge:status'],
105
+ * maxSessionTtl: 7200,
106
+ * subNamePatterns: ['connector-*', 'meter-*'],
107
+ * });
108
+ * ```
109
+ */
110
110
  attestHandle(name: string, grant: AttestationGrant, opts?: {
111
111
  ttlSeconds?: number;
112
112
  expiresAt?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAWtE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;IAEvC,OAAO;IAKP;;;;;;;;;;;;OAYG;WACU,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBnE;;;;;;;;;;;;;;;;;OAiBG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAa5E;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,eAAe,CACnB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,SAAS,CAAC;IA8BrB;;;;;;;;;;;;;;;;;;;;;;;QAuBI;IACG,YAAY,CACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,gBAAgB,EACvB,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,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;IAYvB;;;;OAIG;IACH,YAAY,IAAI,UAAU;CAG3B"}
package/dist/identity.js CHANGED
@@ -127,29 +127,29 @@ export class Identity {
127
127
  return new SubHandle(subKey, subNameNorm, path, metadata);
128
128
  }
129
129
  /**
130
- * Issues an attestation binding a derived Handle key to its name
131
- * and grant. The subject public key is always derived internally β€”
132
- * it is impossible to attest a foreign key, and the resulting
133
- * `subjectId` always matches the handle reconstructed via
134
- * {@link Identity.deriveSubHandle}.
135
- *
136
- * @param grant - Constraints verifiers will enforce for this handle
137
- * and (via `subNamePatterns`) for the SubHandles it may attest.
138
- * @returns An attestation signed by the Identity root key. Store it
139
- * with the Handle β€” it is a public artifact, not a secret.
140
- * @throws {Error} If the name is not canonicalizable.
141
- * @throws {AttestationError} If the grant is invalid.
142
- *
143
- * @example
144
- * ```ts
145
- * const A = await identity.attestHandle('station-001', {
146
- * audiences: ['ev-app.com'],
147
- * scopes: ['charge:start', 'charge:stop', 'charge:status'],
148
- * maxSessionTtl: 7200,
149
- * subNamePatterns: ['connector-*', 'meter-*'],
150
- * });
151
- * ```
152
- */
130
+ * Issues an attestation binding a derived Handle key to its name
131
+ * and grant. The subject public key is always derived internally β€”
132
+ * it is impossible to attest a foreign key, and the resulting
133
+ * `subjectId` always matches the handle reconstructed via
134
+ * {@link Identity.deriveSubHandle}.
135
+ *
136
+ * @param grant - Constraints verifiers will enforce for this handle
137
+ * and (via `subNamePatterns`) for the SubHandles it may attest.
138
+ * @returns An attestation signed by the Identity root key. Store it
139
+ * with the Handle β€” it is a public artifact, not a secret.
140
+ * @throws {Error} If the name is not canonicalizable.
141
+ * @throws {AttestationError} If the grant is invalid.
142
+ *
143
+ * @example
144
+ * ```ts
145
+ * const A = await identity.attestHandle('station-001', {
146
+ * audiences: ['ev-app.com'],
147
+ * scopes: ['charge:start', 'charge:stop', 'charge:status'],
148
+ * maxSessionTtl: 7200,
149
+ * subNamePatterns: ['connector-*', 'meter-*'],
150
+ * });
151
+ * ```
152
+ */
153
153
  async attestHandle(name, grant, opts) {
154
154
  const normalized = normalizeName(name);
155
155
  const handle = await this.deriveHandle(normalized);
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAuB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAA0B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAyB,MAAM,kBAAkB,CAAC;AAEtE,SAAS,YAAY,CAAC,GAAW;IAC/B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,QAAQ;IACF,UAAU,CAAa;IACvB,SAAS,CAAa;IAEvC,YAAoB,UAAsB;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,C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,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QACjF,MAAM,SAAS,GAAG,IAAI,CACpB,MAAM,EACN,IAAI,CAAC,UAAU,EACf,IAAI,UAAU,CAAC,CAAC,CAAC,EACjB,UAAU,EACV,EAAE,CACH,CAAC;QAEF,uDAAuD;QACvD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CACtC,gBAAgB,CAAC,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CACpD,CAAC;QACF,MAAM,MAAM,GAAG,IAAI,CACjB,MAAM,EACN,SAAS,EACT,IAAI,UAAU,CAAC,CAAC,CAAC,EACjB,OAAO,EACP,EAAE,CACH,CAAC;QAEF,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACvC,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,YAAY,CAChB,IAAY,EACZ,KAAuB,EACvB,IAA8E;QAE9E,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACnD,OAAO,WAAW,CAAC,KAAK,CACtB,IAAI,CAAC,UAAU,EACf,MAAM,CAAC,YAAY,EAAE,EACrB,UAAU,EACV,KAAK,EACL,IAAI,IAAI,EAAE,CACX,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -29,5 +29,6 @@ export * as crypto from './crypto/index.js';
29
29
  * const signature = await handle.sign(new TextEncoder().encode('data'));
30
30
  * ```
31
31
  */
32
- export { generateSeedPhrase, normalizeSeedPhrase, validateSeedPhrase, get32ByteSeedFromMnemonic, type SeedStrength } from './seed.js';
32
+ export { generateSeedPhrase, normalizeSeedPhrase, validateSeedPhrase, get32ByteSeedFromMnemonic, type SeedStrength, type SeedValidationResult } from './seed.js';
33
+ export { wordlist } from '@scure/bip39/wordlists/english';
33
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9M,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,YAAY,EAClB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9M,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -30,4 +30,5 @@ export * as crypto from './crypto/index.js';
30
30
  * ```
31
31
  */
32
32
  export { generateSeedPhrase, normalizeSeedPhrase, validateSeedPhrase, get32ByteSeedFromMnemonic } from './seed.js';
33
+ export { wordlist } from '@scure/bip39/wordlists/english';
33
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAuB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAA0B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAoE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAoG,MAAM,kBAAkB,CAAC;AAC9M,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAuB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAA0B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAoE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAoG,MAAM,kBAAkB,CAAC;AAC9M,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EAG1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC"}