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

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.
Files changed (70) hide show
  1. package/README.md +293 -546
  2. package/dist/attestation.d.ts +151 -0
  3. package/dist/attestation.d.ts.map +1 -0
  4. package/dist/attestation.js +279 -0
  5. package/dist/attestation.js.map +1 -0
  6. package/dist/canonical-name.d.ts +3 -0
  7. package/dist/canonical-name.d.ts.map +1 -0
  8. package/dist/canonical-name.js +12 -0
  9. package/dist/canonical-name.js.map +1 -0
  10. package/dist/crypto/derivation-paths.d.ts +41 -0
  11. package/dist/crypto/derivation-paths.d.ts.map +1 -0
  12. package/dist/crypto/derivation-paths.js +50 -0
  13. package/dist/crypto/derivation-paths.js.map +1 -0
  14. package/dist/crypto/ed25519.d.ts +48 -8
  15. package/dist/crypto/ed25519.d.ts.map +1 -1
  16. package/dist/crypto/ed25519.js +63 -8
  17. package/dist/crypto/ed25519.js.map +1 -1
  18. package/dist/crypto/hkdf.d.ts.map +1 -1
  19. package/dist/crypto/hkdf.js +1 -0
  20. package/dist/crypto/hkdf.js.map +1 -1
  21. package/dist/crypto/index.d.ts +1 -0
  22. package/dist/crypto/index.d.ts.map +1 -1
  23. package/dist/crypto/index.js +2 -0
  24. package/dist/crypto/index.js.map +1 -1
  25. package/dist/crypto/init.d.ts.map +1 -1
  26. package/dist/crypto/init.js +1 -0
  27. package/dist/crypto/init.js.map +1 -1
  28. package/dist/handle.d.ts +147 -28
  29. package/dist/handle.d.ts.map +1 -1
  30. package/dist/handle.js +178 -33
  31. package/dist/handle.js.map +1 -1
  32. package/dist/identity.d.ts +99 -19
  33. package/dist/identity.d.ts.map +1 -1
  34. package/dist/identity.js +128 -32
  35. package/dist/identity.js.map +1 -1
  36. package/dist/index.d.ts +5 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +4 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/seed.d.ts +22 -35
  41. package/dist/seed.d.ts.map +1 -1
  42. package/dist/seed.js +26 -36
  43. package/dist/seed.js.map +1 -1
  44. package/dist/session.d.ts +207 -17
  45. package/dist/session.d.ts.map +1 -1
  46. package/dist/session.js +428 -11
  47. package/dist/session.js.map +1 -1
  48. package/dist/subhandle.d.ts +126 -0
  49. package/dist/subhandle.d.ts.map +1 -0
  50. package/dist/subhandle.js +158 -0
  51. package/dist/subhandle.js.map +1 -0
  52. package/dist/util.d.ts +9 -0
  53. package/dist/util.d.ts.map +1 -0
  54. package/dist/util.js +34 -0
  55. package/dist/util.js.map +1 -0
  56. package/package.json +3 -3
  57. package/src/attestation.ts +364 -0
  58. package/src/canonical-name.ts +12 -0
  59. package/src/crypto/derivation-paths.ts +56 -0
  60. package/src/crypto/ed25519.ts +82 -8
  61. package/src/crypto/hkdf.ts +2 -0
  62. package/src/crypto/index.ts +3 -1
  63. package/src/crypto/init.ts +1 -0
  64. package/src/handle.ts +226 -36
  65. package/src/identity.ts +164 -35
  66. package/src/index.ts +5 -1
  67. package/src/seed.ts +41 -54
  68. package/src/session.ts +637 -24
  69. package/src/subhandle.ts +230 -0
  70. package/src/util.ts +35 -0
package/README.md CHANGED
@@ -1,23 +1,28 @@
1
1
  # πŸ“¦ `@me2em/core` β€” Core Cryptographic Primitives
2
2
 
3
- > Core primitives for the Me2em authorization protocol: `Identity`, `Handle`, and secure channel derivation with Ed25519 cryptography.
3
+ Core primitives for the Me2em authorization protocol: hierarchical
4
+ deterministic identities (`Identity` β†’ `Handle` β†’ `SubHandle`), stateless
5
+ signed sessions, and parent-signed **attestation chains** for delegatable,
6
+ externally verifiable authorization β€” all on Ed25519.
4
7
 
5
8
  [![npm version](https://img.shields.io/npm/v/@me2em/core.svg)](https://www.npmjs.com/package/@me2em/core)
6
- [![License](https://img.shields.io/npm/l/@me2em/core.svg)](https://github.com/me2em-org/me2em-protocol/blob/main/LICENSE)
9
+ [![License](https://img.shields.io/npm/l/@me2em/core.svg)](https://github.com/me2em/core/blob/main/LICENSE)
7
10
  [![Docs](https://img.shields.io/badge/docs-docs.me2em.com-blue)](https://docs.me2em.com)
8
11
 
9
- ---
10
-
11
12
  ## 🎯 Overview
12
13
 
13
- `@me2em/core` provides the cryptographic foundation for the Me2em protocol β€” a decentralized multi-context identity system. It enables:
14
-
15
- - **Hierarchical Deterministic Identities**: One seed β†’ multiple isolated Handles
16
- - **Zero-Knowledge Password Management**: Deterministic password derivation without storage
17
- - **Secure Channel Communication**: Encrypted channels between Identity and Handles without key exchange
18
- - **Stateless Authentication**: Cryptographic proof without server-side session storage
19
-
20
- ---
14
+ - **Hierarchical Deterministic Identities** β€” one seed β†’ isolated
15
+ `Handle`s and `SubHandle`s (MAX_DEPTH = 2), derived offline via HKDF.
16
+ - **Stateless Authentication** β€” self-contained signed session tokens,
17
+ verified without server-side storage, with optional revocation.
18
+ - **Attestations** β€” a parent cryptographically binds a child key to a
19
+ name and a grant (audiences, scopes, TTL caps, name patterns). Chains
20
+ are verified **offline by third parties using only the root public
21
+ key** β€” the root private key never leaves its owner.
22
+ - **Zero-Knowledge Password Management** β€” deterministic password
23
+ derivation without storage.
24
+ - **Secure Channels** β€” symmetric channel keys and X25519 shared
25
+ secrets derived without key exchange.
21
26
 
22
27
  ## πŸ“¦ Installation
23
28
 
@@ -25,632 +30,374 @@
25
30
  npm install @me2em/core
26
31
  # or
27
32
  pnpm add @me2em/core
28
- # or
29
- yarn add @me2em/core
30
33
  ```
31
34
 
32
- **Dependencies:**
33
- - `@noble/ed25519` β€” Ed25519 signatures
34
- - `@noble/hashes` β€” HKDF, SHA-256
35
-
36
- ---
35
+ **Dependencies:** `@noble/curves` (Ed25519/X25519), `@noble/ed25519`,
36
+ `@noble/hashes` (HKDF, SHA-256), `@scure/bip39` (mnemonic handling).
37
37
 
38
38
  ## πŸš€ Quick Start
39
39
 
40
- ### Basic Usage
41
-
42
40
  ```typescript
43
- import { Identity, Handle } from '@me2em/core';
41
+ import { Identity, Session } from '@me2em/core';
44
42
 
45
- // 1. Create Identity from seed (32 bytes)
46
- const seed = new Uint8Array(32).fill(42); // Replace with your secure seed
43
+ // 1. Create an Identity from a 32-byte seed
44
+ const seed = new Uint8Array(32).fill(42); // use a CSPRNG in production
47
45
  const identity = await Identity.fromSeed(seed);
48
46
 
49
47
  // 2. Derive a contextual Handle
50
- const workHandle = await identity.deriveHandle('work', {
51
- displayName: 'Alice @ Work',
52
- avatar: 'https://example.com/avatar.png'
48
+ const station = await identity.deriveHandle('station-001', {
49
+ displayName: 'Station Berlin #001',
53
50
  });
54
51
 
55
- // 3. Use Handle for cryptographic operations
56
- const message = new TextEncoder().encode('Hello, world!');
57
- const signature = await workHandle.sign(message);
58
- const isValid = await Handle.verify(signature, message, workHandle.getPublicKey());
52
+ // 3. Derive a SubHandle with constraints
53
+ const connector = await station.deriveSubHandle('connector-ccs', {
54
+ allowedAudiences: ['ev-app.com'],
55
+ allowedScopes: ['charge:start', 'charge:stop'],
56
+ maxSessionTtl: 7200,
57
+ });
59
58
 
60
- console.log('Handle ID:', workHandle.getId()); // base64url(publicKey)
61
- console.log('Signature valid:', isValid); // true
62
- ```
59
+ // 4. Create a stateless session (signed by the SubHandle)
60
+ const session = await Session.create(connector, {
61
+ audience: 'ev-app.com',
62
+ scopes: ['charge:start'],
63
+ ttl: 1800,
64
+ });
63
65
 
64
- ### Integration with BIP39 (Recommended)
66
+ console.log(session.token); // base64url(payload).base64url(signature)
67
+ ```
65
68
 
66
- For production applications, use BIP39 mnemonic phrases. `@me2em/core` provides built-in utilities to handle generation, validation, and conversion to the required 32-byte Ed25519 seed.
69
+ ### Integration with BIP39 (recommended)
67
70
 
68
71
  ```typescript
69
- import {
70
- Identity,
71
- generateSeedPhrase,
72
- get32ByteSeedFromMnemonic,
73
- validateSeedPhrase
72
+ import {
73
+ Identity, generateSeedPhrase,
74
+ get32ByteSeedFromMnemonic, validateSeedPhrase,
74
75
  } from '@me2em/core';
75
76
 
76
- // 1. Generate a 12-word phrase (use 256 for 24 words)
77
- const phrase = generateSeedPhrase(128);
78
- console.log('Your seed:', phrase.join(' '));
79
-
80
- // 2. (Optional) Validate a user-provided phrase
81
- const validation = validateSeedPhrase(phrase);
82
- if (!validation.isValid) throw new Error(validation.error);
77
+ const phrase = generateSeedPhrase(128); // 12 words (256 β†’ 24 words)
78
+ const check = validateSeedPhrase(phrase);
79
+ if (!check.isValid) throw new Error(check.error);
83
80
 
84
- // 3. Convert to 32-byte seed and create Identity
85
81
  const seedBytes = await get32ByteSeedFromMnemonic(phrase);
86
82
  const identity = await Identity.fromSeed(seedBytes);
87
83
  ```
88
84
 
89
- **Why is this better?**
90
- BIP39 produces a 64-byte seed, but Ed25519 requires exactly 32 bytes. The `get32ByteSeedFromMnemonic` utility handles the SHA-256 hashing deterministically and safely, so you don't have to write boilerplate crypto code.
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.
91
88
 
89
+ ## πŸ”— Attestations (verifiable delegation)
92
90
 
93
- ---
91
+ An **attestation** is a parent-signed statement:
94
92
 
95
- ## πŸ“– API Reference
96
-
97
- ### `Identity` Class
98
-
99
- The root cryptographic identity, derived from a seed phrase.
100
-
101
- ```typescript
102
- class Identity {
103
- // Create Identity from seed (32-byte Uint8Array)
104
- static fromSeed(seed: Uint8Array): Promise<Identity>;
93
+ > "the public key `K` belongs to the name `N` and is valid within grant `G`".
105
94
 
106
- // Derive a new Handle with optional metadata
107
- deriveHandle(name: string, metadata?: HandleMetadata): Promise<Handle>;
95
+ Chains (`root β†’ handle β†’ subhandle β†’ session`) let **third parties verify
96
+ sessions offline using only the root *public* key** β€” with grant
97
+ constraints enforced at verification time, not just at creation.
108
98
 
109
- // Get root public key (for verification, never share private key)
110
- getPublicKey(): Uint8Array;
111
- }
99
+ ```text
100
+ Identity ──attestHandle──▢ Handle (e.g. a charging station, issued once)
101
+ β”‚ offline, no Identity, no network:
102
+ β”œβ”€ deriveSubHandle('connector-ccs')
103
+ β”œβ”€ attestSubHandle('connector-ccs', grant)
104
+ └─ Session.create(subHandle, ...)
105
+ β–Ό
106
+ third-party verifier: verifyAttested(token, rootPublicKey, [A, B], audience)
112
107
  ```
113
108
 
114
- #### `Identity.fromSeed(seed)`
115
-
116
- Creates an Identity from a 32-byte seed.
109
+ ### Issuing
117
110
 
118
111
  ```typescript
119
- const seed = new Uint8Array(32);
120
- crypto.getRandomValues(seed); // Generate secure random seed
121
- const identity = await Identity.fromSeed(seed);
122
- ```
123
-
124
- **Security:** The seed must be kept secret. Never log, transmit, or store it in plaintext.
125
-
126
- #### `Identity.deriveHandle(name, metadata?)`
127
-
128
- Derives a new Handle deterministically from the Identity.
112
+ // Root owner (once per handle lifetime):
113
+ const A = await identity.attestHandle('station-001', {
114
+ audiences: ['ev-app.com'],
115
+ scopes: ['charge:start', 'charge:stop', 'charge:status'],
116
+ maxSessionTtl: 7200,
117
+ subNamePatterns: ['connector-*', 'meter-*'], // wildcard: trailing '*' only
118
+ });
129
119
 
130
- ```typescript
131
- const handle = await identity.deriveHandle('google', {
132
- displayName: 'Alice Personal',
133
- avatar: 'https://example.com/alice.png'
120
+ // Handle (autonomous, offline, per subhandle):
121
+ const B = await station.attestSubHandle('connector-ccs', {
122
+ audiences: ['ev-app.com'],
123
+ scopes: ['charge:start', 'charge:stop'],
124
+ maxSessionTtl: 7200,
134
125
  });
135
126
  ```
136
127
 
137
- **Parameters:**
138
- - `name`: Unique identifier for this Handle (case-insensitive, trimmed)
139
- - `metadata`: Optional public data attached to the Handle
140
-
141
- **Returns:** A `Handle` instance with its own keypair, derived deterministically from the Identity.
142
-
143
- **Key Properties:**
144
- - πŸ” **Deterministic**: Same seed + same name β†’ same Handle (always)
145
- - πŸ”— **Isolated**: Each Handle has its own keypair; compromise of one does not affect others
146
- - πŸ”’ **One-way**: Cannot derive Identity key from Handle key
147
-
148
- ---
149
-
150
- ### Seed Utilities
128
+ The attested public key is always **derived internally** β€” a parent
129
+ cannot attest a foreign key, and `B.subjectId` always equals the key
130
+ reconstructed via `identity.deriveSubHandle('station-001', 'connector-ccs')`.
151
131
 
152
- Built-in helpers for human-friendly key generation and validation.
132
+ ### Verifying (on any third-party server)
153
133
 
154
134
  ```typescript
155
- // Generate a new phrase (128 bits = 12 words, 256 bits = 24 words)
156
- function generateSeedPhrase(strength: 128 | 256 = 128): string[];
157
-
158
- // Normalize input (handles extra spaces, lowercase)
159
- function normalizeSeedPhrase(input: string | string[]): string[];
160
-
161
- // Validate word count, wordlist, and BIP39 checksum
162
- function validateSeedPhrase(words: string[]): { isValid: boolean; error?: string };
163
-
164
- // Convert validated mnemonic to a secure 32-byte Uint8Array for Ed25519
165
- async function get32ByteSeedFromMnemonic(phrase: string | string[]): Promise<Uint8Array>;
135
+ import { Session, AttestationError } from '@me2em/core';
136
+
137
+ try {
138
+ const s = await Session.verifyAttested(
139
+ session.token,
140
+ rootPublicKey, // Uint8Array β€” public key only
141
+ [A.token, B.token], // chain, root first; length 1 for handle sessions
142
+ 'ev-app.com',
143
+ revocationChecker?, // optional; checks attestation and session jti
144
+ );
145
+ await startCharging(s.path![1]);
146
+ } catch (e) {
147
+ if (e instanceof AttestationError) {
148
+ console.error(e.code, e.level); // e.g. SCOPE_EXCEEDED / SESSION
149
+ }
150
+ throw new Error('Unauthorized');
151
+ }
166
152
  ```
167
153
 
168
- βœ… **Benefit**: Developers don't need to manually manage `@scure/bip39` imports or remember to hash the 64-byte output. Everything is handled securely within the protocol.
169
-
170
- ---
154
+ ### Error model
155
+
156
+ All failures throw `AttestationError` with `code` and `level`
157
+ (`ROOT | HANDLE_ATTESTATION | SUB_ATTESTATION | SESSION | FORMAT`):
158
+
159
+ | code | levels |
160
+ |---|---|
161
+ | `MALFORMED`, `CHAIN_INCOMPLETE` | FORMAT |
162
+ | `BAD_SIGNATURE` | ROOT, HANDLE_ATTESTATION, SESSION |
163
+ | `EXPIRED`, `NOT_YET_VALID`, `REVOKED` | ROOT, HANDLE_ATTESTATION, SESSION |
164
+ | `PATH_MISMATCH` | ROOT, HANDLE_ATTESTATION, SESSION |
165
+ | `NAME_NOT_PERMITTED`, `SCOPE_EXCEEDED`, `TTL_EXCEEDED` | ROOT |
166
+ | `SCOPE_EXCEEDED`, `TTL_EXCEEDED`, `AUDIENCE_NOT_PERMITTED`, `SESSION_OUTLIVES_ATTESTATION` | SESSION |
167
+ | `SUBJECT_MISMATCH` | ROOT, SUB_ATTESTATION |
168
+
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."
170
+
171
+ ### Verification modes
172
+
173
+ The library provides two ways to verify a session token. Both answer the
174
+ same question β€” *"is this signature valid, unexpired, unrevoked, and what
175
+ does it allow?"* β€” but they differ in **who is able to verify** and in
176
+ **what is actually enforced**.
177
+
178
+ **Mode 1 β€” `Session.verifyStateless` (direct verification).**
179
+ The verifier re-derives the signer's public key from the token's
180
+ `hNm`/`hPath` using an `Identity` instance and checks the signature.
181
+ Re-derivation requires the **private root key**, so Mode 1 is only
182
+ available to the key holder itself or to backend infrastructure trusted
183
+ with the root. Scopes, audience, TTL and revocation are checked from the
184
+ token itself β€” but SubHandle *constraints* (`allowedScopes`,
185
+ `maxSessionTtl`, …) are enforced only at session **creation**. A party
186
+ that has obtained a SubHandle private key can sign a session with any
187
+ scopes and TTL, and Mode 1 verification will accept it.
188
+
189
+ **Mode 2 β€” `Session.verifyAttested` (attestation-chain verification).**
190
+ The verifier checks the session signature against the key bound by a
191
+ parent-signed attestation, and each attestation against its parent's
192
+ signature, up to the root **public** key. Because every chain link
193
+ carries a signed grant, the verifier **enforces grants at verification
194
+ time**: session scopes must fit the grant, TTL caps and audiences hold,
195
+ and child grants must nest inside parent grants. This makes delegation
196
+ externally verifiable β€” a partner service verifies sessions with the
197
+ root public key only β€” and revoking an attestation `jti` disables the
198
+ entire branch: current **and** future sessions under it.
199
+
200
+ **Which mode should I use?**
201
+
202
+ | Situation | Mode |
203
+ |---|---|
204
+ | Verifier is your own trusted backend that already holds the root key | Mode 1 |
205
+ | Verifier is a third party / partner / customer who must not receive the root private key | Mode 2 |
206
+ | You need branch revocation (disable a device, an employee, a sold deal entirely) | Mode 2 |
207
+ | SubHandle constraints must be *enforced*, not just advisory | Mode 2 |
208
+
209
+ | | `Session.verifyStateless` (Mode 1) | `Session.verifyAttested` (Mode 2) |
210
+ |---|---|---|
211
+ | Verifier needs | `Identity` (**private** root) | root **public** key + chain |
212
+ | Trust model | verifier is the root owner | any third party |
213
+ | SubHandle constraints | enforced at creation only | **enforced at verification** |
214
+ | Revoke a handle/branch | per-session `jti` only | revoke attestation `jti` |
215
+ | Use when | closed perimeter, own services | external audiences, delegation, selling access |
216
+
217
+ The modes coexist naturally: internal telemetry verified with Mode 1,
218
+ 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).
171
221
 
172
- ### `Handle` Class
222
+ ## πŸ“– API Reference
173
223
 
174
- A derived Ed25519 keypair representing a specific context (work, personal, IoT device).
224
+ ### `Identity`
175
225
 
176
226
  ```typescript
177
- class Handle {
178
- // Get public identifier (safe to share)
179
- getId(): string; // base64url-encoded public key
180
-
181
- // Sign arbitrary data with Handle's private key
182
- sign(data: Uint8Array): Promise<Uint8Array>;
183
-
184
- // Verify a signature using a public key (static method)
185
- static verify(signature: Uint8Array, data: Uint8Array, publicKey: Uint8Array): Promise<boolean>;
186
-
187
- // Deterministically derive a password/secret for a specific context
188
- derivePassword(context: string, length?: number): string;
189
-
190
- // Derive a symmetric channel key for encrypted communication
191
- deriveChannelKey(context: string): Uint8Array;
192
-
193
- // Accessors
194
- getName(): string;
195
- getMetadata(): HandleMetadata | undefined;
227
+ class Identity {
228
+ static fromSeed(seed: Uint8Array | string): Promise<Identity>; // 32 bytes or 64-char hex
229
+ deriveHandle(name: string, metadata?: HandleMetadata): Promise<Handle>;
230
+ deriveSubHandle(handleName: string, subName: string,
231
+ metadata?: SubHandleMetadata): Promise<SubHandle>; // atomic, for verification
232
+ attestHandle(name: string, grant: AttestationGrant,
233
+ opts?: { ttlSeconds?, expiresAt?, jti?, now? }): Promise<Attestation>;
196
234
  getPublicKey(): Uint8Array;
197
235
  }
198
236
  ```
199
237
 
200
- #### `Handle.getId()`
201
-
202
- Returns a URL-safe base64 string representing the Handle's public key:
203
-
204
- ```typescript
205
- const handleId = handle.getId();
206
- // Example: "pK7xJ2mN8vQ3rL5wY9zB1cD4eF6gH8iJ0kL2mN4oP6qR8sT0uV2wX4yZ6aB8cD0"
207
- ```
208
-
209
- This is the identifier you send to servers for authentication and routing.
210
-
211
- #### `Handle.sign(data)`
212
-
213
- Signs arbitrary binary data using Ed25519:
214
-
215
- ```typescript
216
- const payload = new TextEncoder().encode('{"action":"post","content":"Hello"}');
217
- const signature = await handle.sign(payload);
218
-
219
- // Send to server:
220
- fetch('https://api.example.com/endpoint', {
221
- method: 'POST',
222
- headers: {
223
- 'X-Handle-ID': handle.getId(),
224
- 'Content-Type': 'application/json'
225
- },
226
- body: JSON.stringify({
227
- payload: btoa(String.fromCharCode(...payload)),
228
- signature: btoa(String.fromCharCode(...signature))
229
- })
230
- });
231
- ```
232
-
233
- #### `Handle.verify(signature, data, publicKey)`
234
-
235
- Static method for server-side signature verification:
236
-
237
- ```typescript
238
- // Server receives: handleId, signature, payload
239
- const publicKey = Uint8Array.from(atob(handleId), c => c.charCodeAt(0));
240
- const data = Uint8Array.from(atob(payload), c => c.charCodeAt(0));
241
- const sig = Uint8Array.from(atob(signature), c => c.charCodeAt(0));
242
-
243
- const isValid = await Handle.verify(sig, data, publicKey);
244
- if (!isValid) throw new Error('Invalid signature');
245
- ```
246
-
247
- #### `Handle.derivePassword(context, length?)`
248
-
249
- Deterministically derives a secret (e.g., a password or API key) for a specific service context. The private key **never leaves this class**, ensuring maximum security.
238
+ ### `Handle`
250
239
 
251
240
  ```typescript
252
- // Derive a password for a specific service
253
- const googlePassword = workHandle.derivePassword('google');
254
- // Example output: "xK9mP2qL5wY9zB1cD4eF6g"
255
-
256
- // Derive a longer secret (e.g., 32 bytes for an API key)
257
- const apiKey = workHandle.derivePassword('aws-api', 32);
241
+ class Handle {
242
+ getId(): string; // base64url of the public key
243
+ getName(): string; // canonical (normalized) name
244
+ getMetadata(): HandleMetadata | undefined;
245
+ getPublicKey(): Uint8Array;
246
+ getPath(): string[] | undefined; // undefined for Handle, path for SubHandle
247
+ sign(data: Uint8Array): Promise<Uint8Array>;
248
+ static verify(sig: Uint8Array, data: Uint8Array, pub: Uint8Array): Promise<boolean>;
249
+ derivePassword(context: string, length?: number): string; // base64url secret
250
+ deriveChannelKey(context: string): Uint8Array; // 32-byte AES key
251
+ deriveSharedSecret(otherPublicKey: Uint8Array): Promise<Uint8Array>; // X25519 + HKDF
252
+ deriveSubHandle(name: string, metadata?: SubHandleMetadata): Promise<SubHandle>;
253
+ attestSubHandle(subName: string, grant: AttestationGrant,
254
+ opts?: { ttlSeconds?, expiresAt?, jti?, now? }): Promise<Attestation>;
255
+ validateSessionOptions(options: { audience: string; scopes: string[]; ttl: number }): void;
256
+ }
258
257
  ```
259
258
 
260
- **Parameters:**
261
- - `context`: A unique identifier for the service (e.g., `'google'`, `'github'`, `'wifi-router'`)
262
- - `length`: Length of the derived raw bytes (default: 16 bytes = ~22 chars base64url)
263
-
264
- **Returns:** A URL-safe base64 string suitable for use as a strong password.
265
-
266
- **Security Benefit:** The `privateKey` remains strictly encapsulated within the `Handle` instance. It is used internally by HKDF-SHA256 and is never returned, logged, or serialized.
267
-
268
- **Use Case:** Zero-knowledge password management. No database of passwords is required on the server. If a service forces a password change, the user simply derives a new handle (e.g., `'google-v2'`) or adds a version suffix to the context.
269
-
270
- #### `Handle.deriveChannelKey(context)`
271
-
272
- Derives a symmetric 256-bit key for establishing a secure, encrypted communication channel between the Identity (controller) and this Handle (device/context). Both parties can independently compute this key without any key exchange protocol, because they both have access to the Handle's private key.
259
+ ### `SubHandle` (leaf, MAX_DEPTH = 2)
273
260
 
274
261
  ```typescript
275
- // On the device (Handle side):
276
- const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
277
- // channelKey is a 32-byte Uint8Array, ready for AES-256-GCM
278
-
279
- // On the controller (Identity side):
280
- const droneHandle = await centerIdentity.deriveHandle('drone-001');
281
- const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
282
- // Identical key, derived independently
283
- ```
284
-
285
- **Parameters:**
286
- - `context`: Channel identifier for domain separation (e.g., `'drone-001'`, `'session-abc'`). Both parties **must** use the same context to derive the same key.
287
-
288
- **Returns:** 32-byte `Uint8Array` suitable for AES-256-GCM encryption.
289
-
290
- **Security Benefit:** The `privateKey` remains strictly encapsulated within the `Handle` instance. No key exchange protocol (ECDH, etc.) is needed β€” both parties derive the same key independently from the shared Handle private key.
291
-
292
- **Note:** This method returns raw bytes (Uint8Array), unlike `derivePassword` which returns a base64url string. Use the returned bytes directly with AES-256-GCM via Web Crypto API or similar.
293
-
294
- ---
295
-
296
- ## 🎯 Use Cases
297
-
298
- ### 1. Deterministic Password Manager (Access Key Keeper)
299
-
300
- Instead of storing passwords in a database, derive them deterministically from the Handle. The user only needs to remember their root Seed and the service name.
301
-
302
- ```typescript
303
- // 1. User restores Identity from Seed (e.g., after entering a PIN)
304
- const identity = await Identity.fromSeed(userSeed);
305
-
306
- // 2. Derive the specific service Handle
307
- const googleHandle = await identity.deriveHandle('google', {
308
- displayName: 'Alice Personal'
309
- });
310
-
311
- // 3. Deterministically generate the password on the fly
312
- const password = googleHandle.derivePassword('google');
313
-
314
- // 4. Auto-fill the login form
315
- console.log('Login:', 'alice@example.com');
316
- console.log('Password:', password); // Always the same for this seed + handle + context
262
+ class SubHandle extends Handle {
263
+ getPath(): string[]; // ['station-001', 'connector-ccs']
264
+ getPathString(): string; // 'station-001/connector-ccs'
265
+ getDepth(): number; // always 2
266
+ isLeaf(): boolean; // always true
267
+ getSubMetadata(): SubHandleMetadata;
268
+ validateSessionOptions(options: { audience: string; scopes: string[]; ttl: number }): void;
269
+ // deriveSubHandle is overridden and ALWAYS throws (leaf node)
270
+ }
317
271
  ```
318
272
 
319
- βœ… **Benefit**: Zero-knowledge password management. No database of passwords is required on the server. If a service forces a password change, the user simply derives a new handle (e.g., `'google-v2'`) or adds a version suffix to the context (e.g., `derivePassword('google-v2')`).
320
-
321
- ---
322
-
323
- ### 2. IoT Fleet with Encrypted Channels
324
-
325
- Control a fleet of devices (drones, sensors, robots) with zero-knowledge encrypted communication. The control center derives a channel key for each device, and the device independently derives the same key β€” no key exchange protocol required.
273
+ ### `Session`
326
274
 
327
275
  ```typescript
328
- // === CONTROL CENTER (Identity) ===
329
- const centerIdentity = await Identity.fromSeed(centerSeed);
330
-
331
- // Minimal registry: just device names (no public keys stored!)
332
- const allowedDevices = ['drone-001', 'drone-002', 'sensor-warehouse-a'];
333
-
334
- // Receiving telemetry from a drone
335
- async function receiveTelemetry(message: { name: string, signature: Uint8Array, encrypted: Uint8Array }) {
336
- // 1. Check if device is in registry
337
- if (!allowedDevices.includes(message.name)) {
338
- throw new Error('Unknown device');
339
- }
340
-
341
- // 2. Derive the Handle (deterministic, no DB lookup)
342
- const deviceHandle = await centerIdentity.deriveHandle(message.name);
343
-
344
- // 3. Verify signature (proves device owns the private key)
345
- const dataToVerify = concatBytes(
346
- new TextEncoder().encode(message.name),
347
- message.encrypted
348
- );
349
- const isValid = await Handle.verify(message.signature, dataToVerify, deviceHandle.getPublicKey());
350
- if (!isValid) throw new Error('Invalid signature');
351
-
352
- // 4. Derive the SAME channel key the device used for encryption
353
- const channelKey = deviceHandle.deriveChannelKey('telemetry-v1');
354
-
355
- // 5. Decrypt the message
356
- const telemetry = await decryptAESGCM(message.encrypted, channelKey);
357
- return telemetry;
276
+ class Session {
277
+ static create(handle: Handle | SubHandle, options: SessionOptions): Promise<Session>;
278
+ static verifyStateless(token: string, companyIdentity: Identity,
279
+ expectedAudience: string,
280
+ revocationChecker?: RevocationChecker): Promise<Session>;
281
+ static verifyAttested(token: string, rootPublicKey: Uint8Array,
282
+ attestationChain: string[], expectedAudience: string,
283
+ revocationChecker?: RevocationChecker): Promise<Session>;
284
+ isExpired(): boolean;
285
+ readonly handleId, handleName, audience, scopes, expiresAt, token, path, sessionId;
358
286
  }
359
287
 
360
- // === DRONE (Handle, provisioned at factory) ===
361
- // Drone is provisioned with its Handle's private key and name
362
- async function sendTelemetry(telemetry: object) {
363
- const name = 'drone-001';
364
- const privateKey = /* loaded from secure enclave */;
365
- const droneHandle = new Handle(privateKey, name);
366
-
367
- // 1. Derive the SAME channel key the center will use for decryption
368
- const channelKey = droneHandle.deriveChannelKey('telemetry-v1');
369
-
370
- // 2. Encrypt telemetry
371
- const telemetryBytes = new TextEncoder().encode(JSON.stringify(telemetry));
372
- const encrypted = await encryptAESGCM(telemetryBytes, channelKey);
373
-
374
- // 3. Sign (name + encrypted data)
375
- const dataToSign = concatBytes(new TextEncoder().encode(name), encrypted);
376
- const signature = await droneHandle.sign(dataToSign);
377
-
378
- return { name, signature, encrypted };
288
+ interface SessionOptions {
289
+ audience: string; scopes: string[]; ttl: number; sessionId?: string;
379
290
  }
380
- ```
381
-
382
- βœ… **Benefits**:
383
- - **Minimal registry**: Control center stores only device names (strings), not public keys
384
- - **No key exchange**: Both parties derive the same key independently
385
- - **Stateless verification**: Signature check proves device authenticity
386
- - **Isolation**: Compromise of one device doesn't affect others (different Handles β†’ different channel keys)
387
291
 
388
- ---
389
-
390
- ### 3. Stateless Multi-Device Synchronization
391
-
392
- A user with the same Identity on multiple devices (phone, laptop, tablet) can derive identical Handles and secrets on each device without any synchronization protocol.
292
+ interface SessionPayload { // signed token contents
293
+ hId: string; hNm: string; hPath?: string[];
294
+ aud: string; scp: string[]; exp: number; iat: number; jti: string;
295
+ }
393
296
 
394
- ```typescript
395
- // On the phone:
396
- const identity = await Identity.fromSeed(userSeed);
397
- const messengerHandle = await identity.deriveHandle('messenger-main');
398
- const handleId = messengerHandle.getId();
399
- // Send handleId to server for registration
400
-
401
- // On the laptop (later, no sync needed):
402
- const identity = await Identity.fromSeed(userSeed); // Same seed
403
- const messengerHandle = await identity.deriveHandle('messenger-main'); // Same name
404
- const handleId = messengerHandle.getId(); // Identical handleId!
405
- // Server recognizes the same user automatically
297
+ interface RevocationChecker {
298
+ isRevoked(jti: string): Promise<boolean>;
299
+ }
406
300
  ```
407
301
 
408
- βœ… **Benefit**: Zero-knowledge multi-device support. No QR codes, no server-side key sync, no backup servers. The mathematics guarantees identity across devices.
409
-
410
- ---
411
-
412
- ### 4. Break-Glass Recovery and Inheritance
413
-
414
- A user's entire digital identity can be recovered from a single seed phrase, even years later, on any device, without contacting any service provider.
302
+ ### `Attestation`
415
303
 
416
304
  ```typescript
417
- // User stores seed phrase in a physical safe (or via Shamir's Secret Sharing with trusted heirs)
418
-
419
- // Years later, on a new device:
420
- const identity = await Identity.fromSeed(recoveredSeed);
421
-
422
- // All handles are instantly recoverable:
423
- const googleHandle = await identity.deriveHandle('google');
424
- const bankHandle = await identity.deriveHandle('bank');
425
- const messengerHandle = await identity.deriveHandle('messenger-main');
305
+ class Attestation {
306
+ static issue(signerPrivateKey: Uint8Array, subjectPublicKey: Uint8Array,
307
+ subjectName: string, grant: AttestationGrant,
308
+ opts?: { ttlSeconds?, expiresAt?, jti?, now? }): Promise<Attestation>;
309
+ static decode(token: string): AttestationPayload; // structure only β€” no sig, no time
310
+ static verifySignature(token: string, signerPublicKey: Uint8Array): Promise<boolean>;
311
+ static matchNamePattern(name: string, patterns: string[]): boolean;
312
+ get payload(): AttestationPayload;
313
+ get token(): string;
314
+ get jti(): string;
315
+ }
426
316
 
427
- // All passwords are instantly recoverable:
428
- const googlePassword = googleHandle.derivePassword('google');
429
- const bankPassword = bankHandle.derivePassword('bank');
317
+ interface AttestationGrant {
318
+ audiences?: string[]; // undefined = unrestricted; [] = deny all
319
+ scopes: string[]; // exact strings, no wildcards
320
+ maxSessionTtl: number; // seconds, > 0
321
+ subNamePatterns?: string[]; // root→handle only; trailing '*' only
322
+ }
430
323
 
431
- // All channel keys are instantly recoverable:
432
- const messengerChannelKey = messengerHandle.deriveChannelKey('session-2026');
324
+ class AttestationError extends Error {
325
+ readonly code: AttestationErrorCode;
326
+ readonly level: AttestationLevel;
327
+ }
433
328
  ```
434
329
 
435
- βœ… **Benefit**: True self-sovereignty. No company can lock you out of your identity. Recovery is a mathematical certainty, not a customer support ticket.
436
-
437
- ---
438
-
439
- ### 5. Ephemeral Delegated Access
440
-
441
- Grant time-limited access to a contractor or temporary service by deriving a Handle with a time-bound name.
330
+ ### Name normalization
442
331
 
443
- ```typescript
444
- // Grant access to contractor until 2026-12-31
445
- const contractorHandle = await identity.deriveHandle('contractor-acme-2026-12-31', {
446
- displayName: 'ACME Corp Contractor',
447
- role: 'auditor',
448
- expiresAt: '2026-12-31T23:59:59Z'
449
- });
332
+ All derivation inputs are canonicalized: `NFKC β†’ lowercase β†’ trim`,
333
+ then validated against `/^[a-z0-9][a-z0-9._@-]{0,62}$/`. Names with `/`,
334
+ non-ASCII letters, or > 64 chars **throw**. Identical inputs always
335
+ produce identical keys across platforms and entry points.
450
336
 
451
- // Share the Handle ID with the contractor's system
452
- // Contractor uses this Handle for authenticated access
337
+ ## 🎯 Core Use Cases
453
338
 
454
- // After expiration:
455
- // - Server rejects requests (checks expiresAt metadata)
456
- // - User simply stops using this Handle
457
- // - No cleanup needed β€” the Handle is just a name in the derivation tree
458
- ```
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.
459
344
 
460
- βœ… **Benefit**: Clean delegation without polluting the permanent identity. Expired Handles become inert cryptographic artifacts.
461
-
462
- ---
345
+ πŸ‘‰ **[USE_CASES.md](./USE_CASES.md)** β€” EV charging stations, drone fleet
346
+ access marketplace, corporate messenger, and a production Redis
347
+ `RevocationChecker`.
463
348
 
464
349
  ## πŸ” Cryptographic Details
465
350
 
466
- ### Handle Derivation Algorithm
467
-
468
- Handles are derived using **HKDF-SHA256** with domain separation:
469
-
470
- ```
471
- HandlePrivateKey = HKDF-SHA256(
472
- inputKeyMaterial = IdentityPrivateKey,
473
- salt = empty,
474
- info = "me2em/handle/v1/" + lowercase(name),
475
- length = 32
476
- )
477
- HandlePublicKey = Ed25519.PublicKey(HandlePrivateKey)
478
- HandleId = Base64Url(HandlePublicKey)
479
- ```
480
-
481
- **Properties:**
482
- - πŸ” **Deterministic**: Same inputs β†’ same output across all implementations
483
- - πŸ”’ **One-way**: Cannot derive Identity key from Handle key
484
- - 🧩 **Isolated**: Each Handle uses independent Ed25519 keypair
485
-
486
- ### Password Derivation Algorithm
487
-
488
- Passwords are derived using **HKDF-SHA256** with the Handle's private key as input key material:
489
-
490
- ```
491
- PasswordBytes = HKDF-SHA256(
492
- inputKeyMaterial = HandlePrivateKey,
493
- salt = "me2em/secret/" + lowercase(context),
494
- info = "me2em/secret/v1",
495
- length = 16 (default)
496
- )
497
- Password = Base64Url(PasswordBytes)
498
- ```
499
-
500
- **Properties:**
501
- - πŸ” **Deterministic**: Same Handle + same context β†’ same password
502
- - πŸ” **Encapsulated**: Private key never leaves the Handle instance
503
- - 🧩 **Domain-separated**: Different contexts produce different passwords
504
-
505
- ### Channel Key Derivation
506
-
507
- Channel keys are derived using **HKDF-SHA256** with the Handle's private key as input key material:
508
-
509
- ```
510
- ChannelKey = HKDF-SHA256(
511
- inputKeyMaterial = HandlePrivateKey,
512
- salt = "me2em/channel/" + lowercase(context),
513
- info = "me2em/channel/v1",
514
- length = 32
515
- )
516
- ```
517
-
518
- **Properties:**
519
- - πŸ” **Deterministic**: Same Handle + same context β†’ same 32-byte key
520
- - πŸ” **Encapsulated**: Private key never leaves the Handle instance
521
- - 🧩 **Domain-separated**: Different contexts produce different keys (e.g., `'telemetry-v1'` vs `'command-v1'`)
522
- - ⚑ **No key exchange**: Both parties derive the key independently, no ECDH needed
523
-
524
- ### Signature Scheme
525
-
526
- - **Algorithm**: Ed25519 (RFC 8032)
527
- - **Hash**: SHA-512 (via `@noble/ed25519`)
528
- - **Encoding**: Raw bytes β†’ base64url for transport
529
-
530
- ---
351
+ - **Identity:** `Ed25519 key = HKDF-SHA256(seed, salt="", info="me2em/identity/v1/root", 32)`
352
+ - **Handle:** `HKDF-SHA256(identityKey, salt="", info="me2em/handle/v1/{name}", 32)`
353
+ - **SubHandle:** `HKDF-SHA256(handleKey, salt="", info="me2em/subhandle/v1/{handle}/{sub}", 32)`
354
+ - **Signatures:** Ed25519 (RFC 8032); tokens are `base64url(payload).base64url(signature)`
355
+ - **Attestation payload limit:** 2048 bytes; **session payload limit:** 4096 bytes
356
+ - **Clock skew tolerance:** Β±30 seconds on all time checks
531
357
 
532
358
  ## πŸ›‘οΈ Security Best Practices
533
359
 
534
- ### βœ… Do
535
-
536
- - **Store seeds encrypted**: Use PIN/biometric + AES-GCM before persisting to IndexedDB
537
- - **Clear memory**: Zero out seed/private key buffers after use (`buffer.fill(0)`)
538
- - **Use short TTLs**: Rotate session tokens frequently (≀1 hour recommended)
539
- - **Validate metadata server-side**: Never trust client-provided Handle metadata without verification
540
- - **Pin dependencies**: Lock `@me2em/core` to specific version in `package.json`
541
-
542
- ### ❌ Don't
543
-
544
- - **Never transmit seeds**: The seed is the root of trust β€” keep it client-side only
545
- - **Don't reuse Handles across contexts**: Derive separate Handles for different apps/services
546
- - **Don't log private keys**: Ensure debugging output never includes key material
547
- - **Don't disable signature verification**: Always verify Ed25519 signatures server-side
548
-
549
- ### Key Lifecycle
550
-
551
- ```
552
- [User enters seed]
553
- β”‚
554
- β–Ό
555
- [Derive Identity in RAM]
556
- β”‚
557
- β–Ό
558
- [Derive Handle(s) as needed]
559
- β”‚
560
- β–Ό
561
- [Sign challenge / data / derive password / derive channel key]
562
- β”‚
563
- β–Ό
564
- [Zero out private key buffers] ← Critical!
565
- β”‚
566
- β–Ό
567
- [Keep only public HandleId for future use]
568
- ```
569
-
570
- ---
360
+ βœ… **Do**:
361
+ - Store seeds encrypted (PIN/biometric + AES-GCM); keep the root offline
362
+ except for issuance ceremonies.
363
+ - Use short session TTLs (≀ 1 hour recommended).
364
+ - Implement a `RevocationChecker` (e.g., Redis SET) β€” it is consulted for
365
+ attestation **and** session `jti` in `verifyAttested`.
366
+ - Prefer `verifyAttested` for any external audience; reserve
367
+ `verifyStateless` for infrastructure you fully control.
368
+ - Scope `subNamePatterns` as narrowly as possible β€” a holder can do
369
+ everything *inside* its wildcard.
370
+
371
+ ❌ **Don't**:
372
+ - Never transmit seeds; keep derivation client-side.
373
+ - Don't reuse Handles across unrelated contexts.
374
+ - Don't log private keys or seed phrases.
375
+ - Don't rely on zeroing buffers as a hard guarantee β€” GC/JIT may retain
376
+ copies (tracked in [BACKLOG](./BACKLOG.md) BL-07).
571
377
 
572
378
  ## πŸ§ͺ Testing
573
379
 
574
- ### Unit Tests
575
-
576
380
  ```bash
577
- cd packages/core
578
- pnpm test
579
- ```
580
-
581
- Tests cover:
582
- - βœ… Deterministic derivation (same seed + name β†’ same HandleId)
583
- - βœ… Signature generation and verification
584
- - βœ… Password derivation (same Handle + context β†’ same password)
585
- - βœ… Channel key derivation (same Handle + context β†’ same key)
586
- - βœ… Edge cases (empty metadata, long names, unicode)
587
-
588
- ### Integration Test Example
589
-
590
- ```typescript
591
- import { Identity } from '@me2em/core';
592
-
593
- test('full auth flow', async () => {
594
- // Client side
595
- const identity = await Identity.fromSeed(testSeed);
596
- const handle = await identity.deriveHandle('test');
597
- const challenge = new TextEncoder().encode('nonce-123');
598
- const signature = await handle.sign(challenge);
599
-
600
- // Server side
601
- const isValid = await Handle.verify(
602
- signature,
603
- challenge,
604
- handle.getPublicKey()
605
- );
606
- expect(isValid).toBe(true);
607
- expect(handle.getId()).toMatch(/^[A-Za-z0-9_-]{43}$/);
608
- });
609
- ```
610
-
611
- ---
612
-
613
- ## πŸ“¦ Package Info
614
-
615
- ```json
616
- {
617
- "name": "@me2em/core",
618
- "version": "0.4.2-alpha.1",
619
- "type": "module",
620
- "main": "./dist/index.js",
621
- "types": "./dist/index.d.ts",
622
- "exports": {
623
- ".": {
624
- "types": "./dist/index.d.ts",
625
- "import": "./dist/index.js",
626
- "require": "./dist/index.cjs"
627
- }
628
- },
629
- "dependencies": {
630
- "@noble/ed25519": "^3.1.0",
631
- "@noble/hashes": "^2.2.0",
632
- "@scure/bip39": "^1.3.0"
633
- },
634
- "engines": {
635
- "node": ">=18.0.0"
636
- }
637
- }
381
+ cd packages/core && pnpm test
638
382
  ```
639
383
 
640
- ---
641
-
642
- ## 🀝 Contributing
643
-
644
- We welcome contributions! See:
384
+ 166 tests cover: deterministic derivation and cross-entry-point key
385
+ consistency, name canonicalization, session lifecycle (create, verify,
386
+ tamper, expiry, iat), revocation, SubHandle constraint enforcement,
387
+ MAX_DEPTH leaf enforcement, attestation issue/decode/signature
388
+ determinism and validation, and the full `verifyAttested` chain
389
+ (20+ cases including nesting, wildcard permitting, revocation at every
390
+ level, and signature robustness).
645
391
 
646
- - πŸ“„ [CONTRIBUTING.md](../../CONTRIBUTING.md) β€” How to contribute code/docs
647
- - πŸ—³οΈ [GOVERNANCE.md](../../GOVERNANCE.md) β€” Project decision-making process
648
- - πŸ” [SECURITY.md](../../SECURITY.md) β€” Responsible disclosure policy
392
+ ## πŸ—ΊοΈ Roadmap
649
393
 
650
- ---
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.
651
398
 
652
399
  ## πŸ“œ License
653
400
 
654
- Apache License 2.0 β€” see [LICENSE](../../LICENSE) for details.
401
+ Apache License 2.0 β€” see [LICENSE](../../LICENSE).
655
402
 
656
- Β© 2026 Me2em Organization. Built for privacy, openness, and user sovereignty.
403
+ Β© 2026 Me2em Organization. Built for privacy, openness, and user sovereignty.