@oxyhq/core 12.2.0 → 12.3.0

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 (107) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/crypto/aead.js +79 -0
  3. package/dist/cjs/crypto/ecdh.js +53 -0
  4. package/dist/cjs/crypto/kdf.js +39 -0
  5. package/dist/cjs/crypto/keyManager.js +7 -0
  6. package/dist/cjs/crypto/recoveryPhrase.js +89 -1
  7. package/dist/cjs/i18n/locales/ar-SA.json +2 -0
  8. package/dist/cjs/i18n/locales/ca-ES.json +2 -0
  9. package/dist/cjs/i18n/locales/de-DE.json +2 -0
  10. package/dist/cjs/i18n/locales/en-US.json +7 -0
  11. package/dist/cjs/i18n/locales/es-ES.json +7 -0
  12. package/dist/cjs/i18n/locales/fr-FR.json +2 -0
  13. package/dist/cjs/i18n/locales/it-IT.json +2 -0
  14. package/dist/cjs/i18n/locales/ja-JP.json +2 -0
  15. package/dist/cjs/i18n/locales/ko-KR.json +2 -0
  16. package/dist/cjs/i18n/locales/locales/ar-SA.json +2 -0
  17. package/dist/cjs/i18n/locales/locales/ca-ES.json +2 -0
  18. package/dist/cjs/i18n/locales/locales/de-DE.json +2 -0
  19. package/dist/cjs/i18n/locales/locales/en-US.json +7 -0
  20. package/dist/cjs/i18n/locales/locales/es-ES.json +7 -0
  21. package/dist/cjs/i18n/locales/locales/fr-FR.json +2 -0
  22. package/dist/cjs/i18n/locales/locales/it-IT.json +2 -0
  23. package/dist/cjs/i18n/locales/locales/ja-JP.json +2 -0
  24. package/dist/cjs/i18n/locales/locales/ko-KR.json +2 -0
  25. package/dist/cjs/i18n/locales/locales/pt-PT.json +2 -0
  26. package/dist/cjs/i18n/locales/locales/zh-CN.json +2 -0
  27. package/dist/cjs/i18n/locales/pt-PT.json +2 -0
  28. package/dist/cjs/i18n/locales/zh-CN.json +2 -0
  29. package/dist/cjs/index.js +14 -4
  30. package/dist/cjs/mixins/OxyServices.identity.js +166 -0
  31. package/dist/cjs/mixins/OxyServices.identityBackup.js +161 -0
  32. package/dist/cjs/mixins/OxyServices.user.js +43 -0
  33. package/dist/cjs/mixins/index.js +4 -0
  34. package/dist/esm/.tsbuildinfo +1 -1
  35. package/dist/esm/crypto/aead.js +74 -0
  36. package/dist/esm/crypto/ecdh.js +51 -0
  37. package/dist/esm/crypto/kdf.js +36 -0
  38. package/dist/esm/crypto/keyManager.js +7 -0
  39. package/dist/esm/crypto/recoveryPhrase.js +88 -0
  40. package/dist/esm/i18n/locales/ar-SA.json +2 -0
  41. package/dist/esm/i18n/locales/ca-ES.json +2 -0
  42. package/dist/esm/i18n/locales/de-DE.json +2 -0
  43. package/dist/esm/i18n/locales/en-US.json +7 -0
  44. package/dist/esm/i18n/locales/es-ES.json +7 -0
  45. package/dist/esm/i18n/locales/fr-FR.json +2 -0
  46. package/dist/esm/i18n/locales/it-IT.json +2 -0
  47. package/dist/esm/i18n/locales/ja-JP.json +2 -0
  48. package/dist/esm/i18n/locales/ko-KR.json +2 -0
  49. package/dist/esm/i18n/locales/locales/ar-SA.json +2 -0
  50. package/dist/esm/i18n/locales/locales/ca-ES.json +2 -0
  51. package/dist/esm/i18n/locales/locales/de-DE.json +2 -0
  52. package/dist/esm/i18n/locales/locales/en-US.json +7 -0
  53. package/dist/esm/i18n/locales/locales/es-ES.json +7 -0
  54. package/dist/esm/i18n/locales/locales/fr-FR.json +2 -0
  55. package/dist/esm/i18n/locales/locales/it-IT.json +2 -0
  56. package/dist/esm/i18n/locales/locales/ja-JP.json +2 -0
  57. package/dist/esm/i18n/locales/locales/ko-KR.json +2 -0
  58. package/dist/esm/i18n/locales/locales/pt-PT.json +2 -0
  59. package/dist/esm/i18n/locales/locales/zh-CN.json +2 -0
  60. package/dist/esm/i18n/locales/pt-PT.json +2 -0
  61. package/dist/esm/i18n/locales/zh-CN.json +2 -0
  62. package/dist/esm/index.js +4 -0
  63. package/dist/esm/mixins/OxyServices.identity.js +166 -0
  64. package/dist/esm/mixins/OxyServices.identityBackup.js +158 -0
  65. package/dist/esm/mixins/OxyServices.user.js +43 -0
  66. package/dist/esm/mixins/index.js +4 -0
  67. package/dist/types/.tsbuildinfo +1 -1
  68. package/dist/types/crypto/aead.d.ts +56 -0
  69. package/dist/types/crypto/ecdh.d.ts +29 -0
  70. package/dist/types/crypto/kdf.d.ts +25 -0
  71. package/dist/types/crypto/keyManager.d.ts +5 -0
  72. package/dist/types/crypto/recoveryPhrase.d.ts +85 -0
  73. package/dist/types/index.d.ts +7 -3
  74. package/dist/types/mixins/OxyServices.identity.d.ts +95 -0
  75. package/dist/types/mixins/OxyServices.identityBackup.d.ts +129 -0
  76. package/dist/types/mixins/OxyServices.user.d.ts +38 -8
  77. package/dist/types/mixins/index.d.ts +2 -1
  78. package/package.json +4 -2
  79. package/src/crypto/__tests__/backupMaterial.test.ts +86 -0
  80. package/src/crypto/__tests__/cryptoPrimitives.test.ts +225 -0
  81. package/src/crypto/__tests__/keyManager.atomicity.test.ts +33 -0
  82. package/src/crypto/__tests__/recoveryPhrase.test.ts +61 -0
  83. package/src/crypto/aead.ts +97 -0
  84. package/src/crypto/ecdh.ts +60 -0
  85. package/src/crypto/kdf.ts +43 -0
  86. package/src/crypto/keyManager.ts +8 -0
  87. package/src/crypto/recoveryPhrase.ts +133 -0
  88. package/src/i18n/locales/ar-SA.json +2 -0
  89. package/src/i18n/locales/ca-ES.json +2 -0
  90. package/src/i18n/locales/de-DE.json +2 -0
  91. package/src/i18n/locales/en-US.json +7 -0
  92. package/src/i18n/locales/es-ES.json +7 -0
  93. package/src/i18n/locales/fr-FR.json +2 -0
  94. package/src/i18n/locales/it-IT.json +2 -0
  95. package/src/i18n/locales/ja-JP.json +2 -0
  96. package/src/i18n/locales/ko-KR.json +2 -0
  97. package/src/i18n/locales/pt-PT.json +2 -0
  98. package/src/i18n/locales/zh-CN.json +2 -0
  99. package/src/index.ts +16 -1
  100. package/src/mixins/OxyServices.identity.ts +250 -0
  101. package/src/mixins/OxyServices.identityBackup.ts +237 -0
  102. package/src/mixins/OxyServices.user.ts +82 -4
  103. package/src/mixins/__tests__/OxyServices.rotateKey.test.ts +277 -0
  104. package/src/mixins/__tests__/getFollowStatuses.test.ts +95 -0
  105. package/src/mixins/__tests__/identityBackup.test.ts +258 -0
  106. package/src/mixins/index.ts +5 -0
  107. package/src/types/elliptic.d.ts +10 -2
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * Authenticated Encryption with Associated Data (XChaCha20-Poly1305)
4
+ *
5
+ * Pure-JS/TS AEAD via `@noble/ciphers` — identical behaviour on web, Node, and
6
+ * React Native with zero WebCrypto / native-module dependency. This replaces
7
+ * the `crypto.subtle`-based path (unreliable on React Native) for the Commons
8
+ * encrypted backup and device-to-device transfer flows.
9
+ *
10
+ * XChaCha20-Poly1305 is chosen over AES-GCM specifically for its 24-byte
11
+ * (192-bit) random nonce: the nonce space is large enough that random nonces
12
+ * never collide in practice, so callers do not need to maintain a per-key
13
+ * counter. The 16-byte Poly1305 tag is appended to the ciphertext by the
14
+ * underlying library and validated on decrypt.
15
+ *
16
+ * The optional Associated Data (AAD) is authenticated but NOT encrypted: it
17
+ * binds the ciphertext to its context (e.g. a backup version, a device id, a
18
+ * DID). Decryption fails if the key, nonce, ciphertext, OR aad differ from
19
+ * those used at encryption time.
20
+ *
21
+ * ESM/CJS safe: static `import` only, no `require()`.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.AEAD_NONCE_LENGTH = exports.AEAD_KEY_LENGTH = void 0;
25
+ exports.encryptAead = encryptAead;
26
+ exports.decryptAead = decryptAead;
27
+ // Loading the polyfill guarantees `globalThis.crypto.getRandomValues` exists on
28
+ // every platform (native crypto on web/Node; expo-crypto-backed shim on RN).
29
+ require("./polyfill");
30
+ const chacha_1 = require("@noble/ciphers/chacha");
31
+ /** Key length for XChaCha20-Poly1305, in bytes (256-bit). */
32
+ exports.AEAD_KEY_LENGTH = 32;
33
+ /** Nonce length for XChaCha20-Poly1305, in bytes (192-bit). */
34
+ exports.AEAD_NONCE_LENGTH = 24;
35
+ function assertKey(key) {
36
+ if (key.length !== exports.AEAD_KEY_LENGTH) {
37
+ throw new Error(`AEAD key must be ${exports.AEAD_KEY_LENGTH} bytes, got ${key.length}`);
38
+ }
39
+ }
40
+ /** Generate a fresh 24-byte random nonce via the platform CSPRNG. */
41
+ function randomNonce() {
42
+ const nonce = new Uint8Array(exports.AEAD_NONCE_LENGTH);
43
+ globalThis.crypto.getRandomValues(nonce);
44
+ return nonce;
45
+ }
46
+ /**
47
+ * Encrypt `plaintext` under `key` with a fresh random nonce, authenticating the
48
+ * optional `aad`.
49
+ *
50
+ * @param key 32-byte symmetric key (e.g. from `hkdfSha256`).
51
+ * @param plaintext Bytes to encrypt.
52
+ * @param aad Optional associated data authenticated but not encrypted.
53
+ * @returns `{ nonce, ciphertext }` — both are required to decrypt.
54
+ */
55
+ function encryptAead(key, plaintext, aad) {
56
+ assertKey(key);
57
+ const nonce = randomNonce();
58
+ const ciphertext = (0, chacha_1.xchacha20poly1305)(key, nonce, aad).encrypt(plaintext);
59
+ return { nonce, ciphertext };
60
+ }
61
+ /**
62
+ * Decrypt and authenticate `ciphertext` produced by {@link encryptAead}.
63
+ *
64
+ * Throws if the key, nonce, ciphertext, or aad differ from those used at
65
+ * encryption time (tamper detection), or if the tag is invalid.
66
+ *
67
+ * @param key 32-byte symmetric key.
68
+ * @param nonce The 24-byte nonce returned by `encryptAead`.
69
+ * @param ciphertext Ciphertext with the appended Poly1305 tag.
70
+ * @param aad The same associated data supplied at encryption time.
71
+ * @returns The recovered plaintext bytes.
72
+ */
73
+ function decryptAead(key, nonce, ciphertext, aad) {
74
+ assertKey(key);
75
+ if (nonce.length !== exports.AEAD_NONCE_LENGTH) {
76
+ throw new Error(`AEAD nonce must be ${exports.AEAD_NONCE_LENGTH} bytes, got ${nonce.length}`);
77
+ }
78
+ return (0, chacha_1.xchacha20poly1305)(key, nonce, aad).decrypt(ciphertext);
79
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * ECDH shared-secret derivation (secp256k1)
4
+ *
5
+ * Derives a raw 32-byte ECDH shared secret from a local private key and a
6
+ * remote public key, using the SAME `elliptic` `EC('secp256k1')` primitive the
7
+ * rest of core's identity layer uses (`keyManager.ts`). This is the key-exchange
8
+ * step for the Commons device-to-device transfer flow: each side computes the
9
+ * same shared secret, which is then run through `hkdfSha256` to derive the
10
+ * symmetric key handed to `encryptAead` / `decryptAead`.
11
+ *
12
+ * The returned value is the raw x-coordinate of the ECDH point, big-endian,
13
+ * zero-padded to 32 bytes. It is NOT itself a symmetric key — always pass it
14
+ * through a KDF (HKDF) with a context-binding `info` before use.
15
+ *
16
+ * ESM/CJS safe: static `import` only, no `require()`.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.deriveSharedSecret = deriveSharedSecret;
20
+ const elliptic_1 = require("elliptic");
21
+ const ec = new elliptic_1.ec('secp256k1');
22
+ /** Lowercase and left-pad a private-key hex string to canonical 64-char form. */
23
+ function canonicalPrivateKey(key) {
24
+ return key.toLowerCase().padStart(64, '0');
25
+ }
26
+ const HEX_RE = /^[0-9a-fA-F]+$/;
27
+ /**
28
+ * Compute the ECDH shared secret between a local private key and a remote
29
+ * public key on secp256k1.
30
+ *
31
+ * Symmetric by construction:
32
+ * `deriveSharedSecret(privA, pubB) === deriveSharedSecret(privB, pubA)`.
33
+ *
34
+ * @param privateKeyHex Local private key, hex (up to 64 chars; canonicalized).
35
+ * @param otherPublicKeyHex Remote public key, hex — compressed (`02`/`03` + 32
36
+ * bytes) or uncompressed (`04` + 64 bytes).
37
+ * @returns The 32-byte big-endian shared secret.
38
+ */
39
+ function deriveSharedSecret(privateKeyHex, otherPublicKeyHex) {
40
+ if (typeof privateKeyHex !== 'string' || !HEX_RE.test(privateKeyHex)) {
41
+ throw new Error('deriveSharedSecret: privateKeyHex must be a hex string');
42
+ }
43
+ if (typeof otherPublicKeyHex !== 'string' || !HEX_RE.test(otherPublicKeyHex)) {
44
+ throw new Error('deriveSharedSecret: otherPublicKeyHex must be a hex string');
45
+ }
46
+ const keyPair = ec.keyFromPrivate(canonicalPrivateKey(privateKeyHex));
47
+ const otherKey = ec.keyFromPublic(otherPublicKeyHex, 'hex');
48
+ // `derive` returns a BN (the shared point's x-coordinate). Serialize it
49
+ // big-endian, fixed 32 bytes, so both sides agree byte-for-byte regardless of
50
+ // any leading-zero stripping.
51
+ const sharedBytes = keyPair.derive(otherKey.getPublic()).toArray('be', 32);
52
+ return Uint8Array.from(sharedBytes);
53
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Key Derivation Function (HKDF-SHA256)
4
+ *
5
+ * Pure-JS/TS HKDF via `@noble/hashes` — identical behaviour on web, Node, and
6
+ * React Native with zero WebCrypto / native-module dependency. Used to derive
7
+ * fixed-length symmetric keys from higher-entropy input keying material (an
8
+ * ECDH shared secret, a recovery-phrase seed, etc.) for the Commons encrypted
9
+ * backup and device-to-device transfer flows.
10
+ *
11
+ * ESM/CJS safe: static `import` only, no `require()`.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.hkdfSha256 = hkdfSha256;
15
+ const hkdf_1 = require("@noble/hashes/hkdf");
16
+ const sha256_1 = require("@noble/hashes/sha256");
17
+ /**
18
+ * Derive `length` bytes of keying material from `ikm` using HKDF-SHA256
19
+ * (RFC 5869 — extract-then-expand).
20
+ *
21
+ * @param ikm Input keying material (the raw secret; NOT necessarily uniform).
22
+ * @param salt Non-secret random salt. An empty array is treated by HKDF as a
23
+ * zero-filled salt of the hash length — pass a real salt whenever
24
+ * one is available so derivations for different contexts diverge.
25
+ * @param info Context/application-binding string ("what is this key for").
26
+ * Distinct `info` values yield independent keys from the same ikm.
27
+ * @param length Number of output bytes. Must be in (0, 255 * 32].
28
+ * @returns Exactly `length` bytes of derived keying material.
29
+ */
30
+ function hkdfSha256(ikm, salt, info, length) {
31
+ if (!Number.isInteger(length) || length <= 0) {
32
+ throw new Error('hkdfSha256: length must be a positive integer');
33
+ }
34
+ // HKDF-Expand is defined for at most 255 * HashLen bytes of output.
35
+ if (length > 255 * 32) {
36
+ throw new Error('hkdfSha256: length must not exceed 8160 bytes (255 * 32)');
37
+ }
38
+ return (0, hkdf_1.hkdf)(sha256_1.sha256, ikm, salt, info, length);
39
+ }
@@ -1295,6 +1295,13 @@ class KeyManager {
1295
1295
  const keyPair = ec.keyFromPrivate(KeyManager.canonicalPrivateKey(privateKey));
1296
1296
  return keyPair.getPublic('hex');
1297
1297
  }
1298
+ /**
1299
+ * Normalize a public key to uncompressed, lowercased hex. Used when building
1300
+ * signed rotation payloads so legacy compressed/cased encodings still verify.
1301
+ */
1302
+ static canonicalPublicKey(publicKey) {
1303
+ return ec.keyFromPublic(publicKey, 'hex').getPublic(false, 'hex').toLowerCase();
1304
+ }
1298
1305
  /**
1299
1306
  * Validate that a string is a valid public key
1300
1307
  *
@@ -41,9 +41,10 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  };
42
42
  })();
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.RecoveryPhraseService = void 0;
44
+ exports.RecoveryPhraseService = exports.BACKUP_MATERIAL_LENGTH = exports.BACKUP_KDF_LOOKUP_INFO = exports.BACKUP_KDF_ENCRYPTION_INFO = exports.BACKUP_KDF_SALT = void 0;
45
45
  const bip39 = __importStar(require("bip39"));
46
46
  const keyManager_1 = require("./keyManager");
47
+ const kdf_1 = require("./kdf");
47
48
  /**
48
49
  * Convert Uint8Array or array-like to hexadecimal string
49
50
  * Works in both Node.js and React Native without depending on Buffer
@@ -55,6 +56,22 @@ function toHex(data) {
55
56
  .map(b => b.toString(16).padStart(2, '0'))
56
57
  .join('');
57
58
  }
59
+ /** UTF-8 encode an ASCII label to bytes (for HKDF salt/info). */
60
+ function utf8(label) {
61
+ return new TextEncoder().encode(label);
62
+ }
63
+ /**
64
+ * HKDF context tag for the encrypted-backup key schedule (b3 Feature 1). Used as
65
+ * the HKDF `salt`; distinct from any other Oxy key-derivation salt so the backup
66
+ * key schedule is independent. Versioned so a future scheme change is a new tag.
67
+ */
68
+ exports.BACKUP_KDF_SALT = 'oxy-identity-backup-v1';
69
+ /** HKDF `info` label that derives the symmetric AEAD key from the seed. */
70
+ exports.BACKUP_KDF_ENCRYPTION_INFO = 'oxy-backup-encryption-key';
71
+ /** HKDF `info` label that derives the (server-hashed) backup locator from the seed. */
72
+ exports.BACKUP_KDF_LOOKUP_INFO = 'oxy-backup-lookup-id';
73
+ /** Byte length of both the derived backup key and the derived lookup id (256-bit). */
74
+ exports.BACKUP_MATERIAL_LENGTH = 32;
58
75
  class RecoveryPhraseService {
59
76
  /**
60
77
  * Generate a new identity with a recovery phrase.
@@ -105,6 +122,77 @@ class RecoveryPhraseService {
105
122
  publicKey,
106
123
  };
107
124
  }
125
+ /**
126
+ * Derive a brand-new identity + recovery phrase WITHOUT persisting anything.
127
+ *
128
+ * Pure: same derivation as {@link generateIdentityWithRecovery} (128-bit
129
+ * mnemonic → seed → first 32 bytes as the secp256k1 private key) but it stops
130
+ * BEFORE `KeyManager.importKeyPair`, so no on-device identity is touched. The
131
+ * caller decides if/when to commit the material (e.g. only after a server
132
+ * confirms a key rotation). Works on web too — it never reads or writes secure
133
+ * storage.
134
+ *
135
+ * The 12-word `phrase` MUST be shown to the user before the identity is
136
+ * committed anywhere — if it is lost the account becomes unrecoverable.
137
+ */
138
+ static async derivePendingIdentity() {
139
+ const mnemonic = bip39.generateMnemonic(128);
140
+ const seed = await bip39.mnemonicToSeed(mnemonic);
141
+ const seedSlice = seed.subarray ? seed.subarray(0, 32) : seed.slice(0, 32);
142
+ const privateKey = toHex(seedSlice);
143
+ const publicKey = keyManager_1.KeyManager.derivePublicKey(privateKey);
144
+ return {
145
+ phrase: mnemonic,
146
+ words: mnemonic.split(' '),
147
+ privateKey,
148
+ publicKey,
149
+ };
150
+ }
151
+ /**
152
+ * Derive the private key from a recovery phrase WITHOUT storing it.
153
+ *
154
+ * The private-key counterpart of {@link derivePublicKeyFromPhrase}. Used to
155
+ * re-derive a key in memory (e.g. to sign a rotation proof with the current
156
+ * key when the device has no SecureStore copy). Never persists — the returned
157
+ * material lives only in the caller's memory.
158
+ */
159
+ static async derivePrivateKeyFromPhrase(phrase) {
160
+ const normalizedPhrase = phrase.trim().toLowerCase();
161
+ if (!bip39.validateMnemonic(normalizedPhrase)) {
162
+ throw new Error('Invalid recovery phrase');
163
+ }
164
+ const seed = await bip39.mnemonicToSeed(normalizedPhrase);
165
+ const seedSlice = seed.subarray ? seed.subarray(0, 32) : seed.slice(0, 32);
166
+ return toHex(seedSlice);
167
+ }
168
+ /**
169
+ * Derive the encrypted-backup key material from a recovery phrase (b3 Feature
170
+ * 1). PURE and additive — it does NOT touch the frozen phrase→privateKey
171
+ * derivation ({@link derivePrivateKeyFromPhrase} slices the first 32 seed
172
+ * bytes) and never reads or writes secure storage.
173
+ *
174
+ * Both outputs are derived from the FULL 64-byte BIP-39 seed via HKDF-SHA256
175
+ * with domain-separated `info` labels, so the domain separation is real: a
176
+ * device compromise that leaks only the raw 32-byte private key can compute
177
+ * NEITHER the backup key nor the lookup id (both need the whole seed). Locating
178
+ * AND decrypting a backup therefore requires the recovery phrase.
179
+ *
180
+ * @param phrase - The BIP-39 recovery phrase (validated + normalized here).
181
+ * @returns `{ backupKey, lookupId }` — the AEAD key (kept local) and the hex
182
+ * locator (uploaded; server stores only its hash).
183
+ * @throws if the phrase is not a valid BIP-39 mnemonic.
184
+ */
185
+ static async deriveBackupMaterial(phrase) {
186
+ const normalizedPhrase = phrase.trim().toLowerCase();
187
+ if (!bip39.validateMnemonic(normalizedPhrase)) {
188
+ throw new Error('Invalid recovery phrase. Please check the words and try again.');
189
+ }
190
+ const seed = await bip39.mnemonicToSeed(normalizedPhrase);
191
+ const salt = utf8(exports.BACKUP_KDF_SALT);
192
+ const backupKey = (0, kdf_1.hkdfSha256)(seed, salt, utf8(exports.BACKUP_KDF_ENCRYPTION_INFO), exports.BACKUP_MATERIAL_LENGTH);
193
+ const lookupId = toHex((0, kdf_1.hkdfSha256)(seed, salt, utf8(exports.BACKUP_KDF_LOOKUP_INFO), exports.BACKUP_MATERIAL_LENGTH));
194
+ return { backupKey, lookupId };
195
+ }
108
196
  /**
109
197
  * Restore an identity from a recovery phrase.
110
198
  *
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "أنشئ حسابك",
54
+ "subtitle": "هوية واحدة لكل النظام البيئي.",
53
55
  "commonsHeadline": "أنشئ هويتك في Commons",
54
56
  "commonsExplainer": "‏Commons هي هوية Oxy الخاصة بك بحفظ ذاتي كامل — تطبيق واحد يعمل في كل مكان.",
55
57
  "createInCommons": "أنشئ هويتك في Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crea el teu compte",
54
+ "subtitle": "Una identitat per a tot l'ecosistema.",
53
55
  "commonsHeadline": "Crea la teva identitat a Commons",
54
56
  "commonsExplainer": "Commons és la teva identitat d'Oxy amb autocustòdia completa: una app que funciona a tot arreu.",
55
57
  "createInCommons": "Crea la teva identitat a Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Erstellen Sie Ihr Konto",
54
+ "subtitle": "Eine Identität für das gesamte Ökosystem.",
53
55
  "commonsHeadline": "Erstellen Sie Ihre Identität in Commons",
54
56
  "commonsExplainer": "Commons ist Ihre vollständig selbstverwaltete Oxy-Identität – eine App, überall einsetzbar.",
55
57
  "createInCommons": "Erstellen Sie Ihre Identität in Commons",
@@ -57,6 +57,8 @@
57
57
  }
58
58
  },
59
59
  "signup": {
60
+ "title": "Create your account",
61
+ "subtitle": "One identity for the whole ecosystem.",
60
62
  "commonsHeadline": "Create your identity in Commons",
61
63
  "commonsExplainer": "Commons is your full self-custody Oxy identity — one app, works everywhere.",
62
64
  "createInCommons": "Create your identity in Commons",
@@ -70,6 +72,9 @@
70
72
  "backToSignInLink": "Already have an account? Sign in",
71
73
  "hubExplainer": "Create your Oxy ID in a secure window, then come right back.",
72
74
  "continueInWindow": "Continue in a new window",
75
+ "toasts": {
76
+ "passkeyCreateFailed": "We couldn't create your account. Please try again."
77
+ },
73
78
  "welcome": {
74
79
  "title": "Welcome to Oxy!",
75
80
  "subtitle": "Let's create your account in just a few steps",
@@ -372,6 +377,8 @@
372
377
  "toasts": {
373
378
  "switchSuccess": "Account switched successfully!",
374
379
  "switchFailed": "There was a problem switching accounts. Please try again.",
380
+ "signInFailed": "Sign-in failed. Please try again.",
381
+ "passkeySignInFailed": "Passkey sign-in failed. Please try again.",
375
382
  "removeSuccess": "Account removed successfully!",
376
383
  "removeFailed": "There was a problem removing the account. Please try again.",
377
384
  "signOutAllSuccess": "All accounts signed out successfully!",
@@ -57,6 +57,8 @@
57
57
  }
58
58
  },
59
59
  "signup": {
60
+ "title": "Crea tu cuenta",
61
+ "subtitle": "Una identidad para todo el ecosistema.",
60
62
  "commonsHeadline": "Crea tu identidad en Commons",
61
63
  "commonsExplainer": "Commons es tu identidad de Oxy con autocustodia completa: una app que funciona en todas partes.",
62
64
  "createInCommons": "Crea tu identidad en Commons",
@@ -70,6 +72,9 @@
70
72
  "backToSignInLink": "¿Ya tienes cuenta? Inicia sesión",
71
73
  "hubExplainer": "Crea tu Oxy ID en una ventana segura y vuelve enseguida.",
72
74
  "continueInWindow": "Continuar en una ventana nueva",
75
+ "toasts": {
76
+ "passkeyCreateFailed": "No pudimos crear tu cuenta. Inténtalo de nuevo."
77
+ },
73
78
  "welcome": {
74
79
  "title": "¡Te damos la bienvenida a Oxy!",
75
80
  "subtitle": "Crea tu cuenta en pocos pasos",
@@ -570,6 +575,8 @@
570
575
  "toasts": {
571
576
  "switchSuccess": "¡Cuenta cambiada correctamente!",
572
577
  "switchFailed": "Hubo un problema al cambiar de cuenta. Inténtalo de nuevo.",
578
+ "signInFailed": "No se pudo iniciar sesión. Inténtalo de nuevo.",
579
+ "passkeySignInFailed": "No se pudo iniciar sesión con la llave de acceso. Inténtalo de nuevo.",
573
580
  "removeSuccess": "¡Cuenta eliminada correctamente!",
574
581
  "removeFailed": "Hubo un problema al eliminar la cuenta. Inténtalo de nuevo.",
575
582
  "signOutAllSuccess": "¡Todas las cuentas cerradas correctamente!",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Créez votre compte",
54
+ "subtitle": "Une seule identité pour tout l'écosystème.",
53
55
  "commonsHeadline": "Créez votre identité dans Commons",
54
56
  "commonsExplainer": "Commons est votre identité Oxy en autoconservation complète : une seule app, partout.",
55
57
  "createInCommons": "Créez votre identité dans Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crea il tuo account",
54
+ "subtitle": "Un'unica identità per tutto l'ecosistema.",
53
55
  "commonsHeadline": "Crea la tua identità in Commons",
54
56
  "commonsExplainer": "Commons è la tua identità Oxy in piena autocustodia: un'unica app, ovunque.",
55
57
  "createInCommons": "Crea la tua identità in Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "アカウントを作成",
54
+ "subtitle": "エコシステム全体で使える1つのアイデンティティ。",
53
55
  "commonsHeadline": "Commonsであなたのアイデンティティを作成",
54
56
  "commonsExplainer": "Commonsは完全に自己管理できるあなたのOxy IDです。1つのアプリでどこでも使えます。",
55
57
  "createInCommons": "Commonsであなたのアイデンティティを作成",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "계정 만들기",
54
+ "subtitle": "생태계 전체를 위한 하나의 아이덴티티.",
53
55
  "commonsHeadline": "Commons에서 나의 아이덴티티 만들기",
54
56
  "commonsExplainer": "Commons는 완전한 자기 보관 방식의 Oxy 아이덴티티입니다. 하나의 앱으로 어디서나 사용하세요.",
55
57
  "createInCommons": "Commons에서 나의 아이덴티티 만들기",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "أنشئ حسابك",
54
+ "subtitle": "هوية واحدة لكل النظام البيئي.",
53
55
  "commonsHeadline": "أنشئ هويتك في Commons",
54
56
  "commonsExplainer": "‏Commons هي هوية Oxy الخاصة بك بحفظ ذاتي كامل — تطبيق واحد يعمل في كل مكان.",
55
57
  "createInCommons": "أنشئ هويتك في Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crea el teu compte",
54
+ "subtitle": "Una identitat per a tot l'ecosistema.",
53
55
  "commonsHeadline": "Crea la teva identitat a Commons",
54
56
  "commonsExplainer": "Commons és la teva identitat d'Oxy amb autocustòdia completa: una app que funciona a tot arreu.",
55
57
  "createInCommons": "Crea la teva identitat a Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Erstellen Sie Ihr Konto",
54
+ "subtitle": "Eine Identität für das gesamte Ökosystem.",
53
55
  "commonsHeadline": "Erstellen Sie Ihre Identität in Commons",
54
56
  "commonsExplainer": "Commons ist Ihre vollständig selbstverwaltete Oxy-Identität – eine App, überall einsetzbar.",
55
57
  "createInCommons": "Erstellen Sie Ihre Identität in Commons",
@@ -57,6 +57,8 @@
57
57
  }
58
58
  },
59
59
  "signup": {
60
+ "title": "Create your account",
61
+ "subtitle": "One identity for the whole ecosystem.",
60
62
  "commonsHeadline": "Create your identity in Commons",
61
63
  "commonsExplainer": "Commons is your full self-custody Oxy identity — one app, works everywhere.",
62
64
  "createInCommons": "Create your identity in Commons",
@@ -70,6 +72,9 @@
70
72
  "backToSignInLink": "Already have an account? Sign in",
71
73
  "hubExplainer": "Create your Oxy ID in a secure window, then come right back.",
72
74
  "continueInWindow": "Continue in a new window",
75
+ "toasts": {
76
+ "passkeyCreateFailed": "We couldn't create your account. Please try again."
77
+ },
73
78
  "welcome": {
74
79
  "title": "Welcome to Oxy!",
75
80
  "subtitle": "Let's create your account in just a few steps",
@@ -372,6 +377,8 @@
372
377
  "toasts": {
373
378
  "switchSuccess": "Account switched successfully!",
374
379
  "switchFailed": "There was a problem switching accounts. Please try again.",
380
+ "signInFailed": "Sign-in failed. Please try again.",
381
+ "passkeySignInFailed": "Passkey sign-in failed. Please try again.",
375
382
  "removeSuccess": "Account removed successfully!",
376
383
  "removeFailed": "There was a problem removing the account. Please try again.",
377
384
  "signOutAllSuccess": "All accounts signed out successfully!",
@@ -57,6 +57,8 @@
57
57
  }
58
58
  },
59
59
  "signup": {
60
+ "title": "Crea tu cuenta",
61
+ "subtitle": "Una identidad para todo el ecosistema.",
60
62
  "commonsHeadline": "Crea tu identidad en Commons",
61
63
  "commonsExplainer": "Commons es tu identidad de Oxy con autocustodia completa: una app que funciona en todas partes.",
62
64
  "createInCommons": "Crea tu identidad en Commons",
@@ -70,6 +72,9 @@
70
72
  "backToSignInLink": "¿Ya tienes cuenta? Inicia sesión",
71
73
  "hubExplainer": "Crea tu Oxy ID en una ventana segura y vuelve enseguida.",
72
74
  "continueInWindow": "Continuar en una ventana nueva",
75
+ "toasts": {
76
+ "passkeyCreateFailed": "No pudimos crear tu cuenta. Inténtalo de nuevo."
77
+ },
73
78
  "welcome": {
74
79
  "title": "¡Te damos la bienvenida a Oxy!",
75
80
  "subtitle": "Crea tu cuenta en pocos pasos",
@@ -570,6 +575,8 @@
570
575
  "toasts": {
571
576
  "switchSuccess": "¡Cuenta cambiada correctamente!",
572
577
  "switchFailed": "Hubo un problema al cambiar de cuenta. Inténtalo de nuevo.",
578
+ "signInFailed": "No se pudo iniciar sesión. Inténtalo de nuevo.",
579
+ "passkeySignInFailed": "No se pudo iniciar sesión con la llave de acceso. Inténtalo de nuevo.",
573
580
  "removeSuccess": "¡Cuenta eliminada correctamente!",
574
581
  "removeFailed": "Hubo un problema al eliminar la cuenta. Inténtalo de nuevo.",
575
582
  "signOutAllSuccess": "¡Todas las cuentas cerradas correctamente!",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Créez votre compte",
54
+ "subtitle": "Une seule identité pour tout l'écosystème.",
53
55
  "commonsHeadline": "Créez votre identité dans Commons",
54
56
  "commonsExplainer": "Commons est votre identité Oxy en autoconservation complète : une seule app, partout.",
55
57
  "createInCommons": "Créez votre identité dans Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crea il tuo account",
54
+ "subtitle": "Un'unica identità per tutto l'ecosistema.",
53
55
  "commonsHeadline": "Crea la tua identità in Commons",
54
56
  "commonsExplainer": "Commons è la tua identità Oxy in piena autocustodia: un'unica app, ovunque.",
55
57
  "createInCommons": "Crea la tua identità in Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "アカウントを作成",
54
+ "subtitle": "エコシステム全体で使える1つのアイデンティティ。",
53
55
  "commonsHeadline": "Commonsであなたのアイデンティティを作成",
54
56
  "commonsExplainer": "Commonsは完全に自己管理できるあなたのOxy IDです。1つのアプリでどこでも使えます。",
55
57
  "createInCommons": "Commonsであなたのアイデンティティを作成",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "계정 만들기",
54
+ "subtitle": "생태계 전체를 위한 하나의 아이덴티티.",
53
55
  "commonsHeadline": "Commons에서 나의 아이덴티티 만들기",
54
56
  "commonsExplainer": "Commons는 완전한 자기 보관 방식의 Oxy 아이덴티티입니다. 하나의 앱으로 어디서나 사용하세요.",
55
57
  "createInCommons": "Commons에서 나의 아이덴티티 만들기",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crie a sua conta",
54
+ "subtitle": "Uma identidade para todo o ecossistema.",
53
55
  "commonsHeadline": "Crie a sua identidade no Commons",
54
56
  "commonsExplainer": "O Commons é a sua identidade Oxy com autocustódia total: uma app que funciona em todo o lado.",
55
57
  "createInCommons": "Crie a sua identidade no Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "创建您的账户",
54
+ "subtitle": "一个身份,畅行整个生态系统。",
53
55
  "commonsHeadline": "在 Commons 中创建您的身份",
54
56
  "commonsExplainer": "Commons 是您完全自主保管的 Oxy 身份——一个应用,随处可用。",
55
57
  "createInCommons": "在 Commons 中创建您的身份",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "Crie a sua conta",
54
+ "subtitle": "Uma identidade para todo o ecossistema.",
53
55
  "commonsHeadline": "Crie a sua identidade no Commons",
54
56
  "commonsExplainer": "O Commons é a sua identidade Oxy com autocustódia total: uma app que funciona em todo o lado.",
55
57
  "createInCommons": "Crie a sua identidade no Commons",
@@ -50,6 +50,8 @@
50
50
  }
51
51
  },
52
52
  "signup": {
53
+ "title": "创建您的账户",
54
+ "subtitle": "一个身份,畅行整个生态系统。",
53
55
  "commonsHeadline": "在 Commons 中创建您的身份",
54
56
  "commonsExplainer": "Commons 是您完全自主保管的 Oxy 身份——一个应用,随处可用。",
55
57
  "createInCommons": "在 Commons 中创建您的身份",