@majikah/majik-key 1.0.0 → 1.0.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/dist/core/backup/majik-key-backup.js +2 -2
- package/dist/core/crypto/crypto-provider.js +6 -6
- package/dist/core/database/system/identity.d.ts +2 -2
- package/dist/core/database/system/identity.js +1 -1
- package/dist/core/keys/key-impls.js +3 -3
- package/dist/core/web3/bitcoin/bitcoin.js +1 -1
- package/dist/core/web3/solana/solana.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/majik-key.d.ts +3 -3
- package/dist/majik-key.js +1 -1
- package/package.json +3 -3
|
@@ -122,8 +122,8 @@ export class MajikKeyBackup {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
if (pngResult && jsonResult) {
|
|
125
|
-
const idsMatch = pngResult.
|
|
126
|
-
const seedsMatch = pngResult.
|
|
125
|
+
const idsMatch = pngResult.id === jsonResult.id;
|
|
126
|
+
const seedsMatch = pngResult.seed.join(" ") === jsonResult.seed.join(" ");
|
|
127
127
|
if (!idsMatch || !seedsMatch) {
|
|
128
128
|
throw new BackupIntegrityMismatchError("the PNG and JSON backups inside this archive do not describe the same account");
|
|
129
129
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// crypto-provider.ts from @majikah/majik-key
|
|
2
|
-
import * as ed25519 from "@stablelib/ed25519
|
|
2
|
+
import * as ed25519 from "@stablelib/ed25519";
|
|
3
3
|
import ed2curve from "ed2curve";
|
|
4
|
-
import { AES } from "@stablelib/aes
|
|
5
|
-
import { GCM } from "@stablelib/gcm
|
|
6
|
-
import { deriveKey } from "@stablelib/pbkdf2
|
|
7
|
-
import { hash, SHA256 } from "@stablelib/sha256
|
|
8
|
-
import * as x25519 from "@stablelib/x25519
|
|
4
|
+
import { AES } from "@stablelib/aes";
|
|
5
|
+
import { GCM } from "@stablelib/gcm";
|
|
6
|
+
import { deriveKey } from "@stablelib/pbkdf2";
|
|
7
|
+
import { hash, SHA256 } from "@stablelib/sha256";
|
|
8
|
+
import * as x25519 from "@stablelib/x25519";
|
|
9
9
|
import { arrayToBase64 } from "../utils.js";
|
|
10
10
|
import { argon2id as nobleArgon2id } from "@noble/hashes/argon2.js";
|
|
11
11
|
import { ARGON2_PARAMS } from "./constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MajikUser } from "@thezelijah/majik-user
|
|
2
|
-
import { SerializedMajikContact } from "@majikah/majik-contact
|
|
1
|
+
import { MajikUser } from "@thezelijah/majik-user";
|
|
2
|
+
import { SerializedMajikContact } from "@majikah/majik-contact";
|
|
3
3
|
export interface MajikMessageIdentityJSON {
|
|
4
4
|
id: string;
|
|
5
5
|
user_id: string;
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
* New algorithms (phase 4) register here with the "hkdf-sha512-v1" recipe.
|
|
11
11
|
* Derived views (web3:sol) are NOT stored keys and are not listed here.
|
|
12
12
|
*/
|
|
13
|
-
import * as ed25519 from "@stablelib/ed25519
|
|
13
|
+
import * as ed25519 from "@stablelib/ed25519";
|
|
14
14
|
import ed2curve from "ed2curve";
|
|
15
|
-
import { hash } from "@stablelib/sha256
|
|
15
|
+
import { hash } from "@stablelib/sha256";
|
|
16
16
|
import { ml_kem512, ml_kem768, ml_kem1024, } from "@noble/post-quantum/ml-kem.js";
|
|
17
17
|
import { ml_dsa44, ml_dsa65, ml_dsa87 } from "@noble/post-quantum/ml-dsa.js";
|
|
18
18
|
import { slh_dsa_sha2_128s, slh_dsa_sha2_128f, slh_dsa_sha2_192s, slh_dsa_sha2_192f, slh_dsa_sha2_256s, slh_dsa_sha2_256f, slh_dsa_shake_128s, slh_dsa_shake_128f, slh_dsa_shake_192s, slh_dsa_shake_192f, slh_dsa_shake_256s, slh_dsa_shake_256f, } from "@noble/post-quantum/slh-dsa.js";
|
|
19
19
|
import { falcon512, falcon1024 } from "@noble/post-quantum/falcon.js";
|
|
20
20
|
import { deriveSeedHkdf } from "./hkdf-recipe.js";
|
|
21
|
-
import { HDKey } from "@scure/bip32
|
|
21
|
+
import { HDKey } from "@scure/bip32";
|
|
22
22
|
import { MajikKeyError } from "../error.js";
|
|
23
23
|
import { KeyId } from "./key-id.js";
|
|
24
24
|
// ── frozen legacy-v1 recipe constants (do not "tidy" these) ──
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { HDKey } from "@scure/bip32";
|
|
27
27
|
import { schnorr, secp256k1 } from "@noble/curves/secp256k1.js";
|
|
28
28
|
import { MAJIK_BITCOIN_STANDARD_PATH, MAJIK_BITCOIN_DOMAIN_PATH, } from "./constants.js";
|
|
29
|
-
import { hash } from "@stablelib/sha256
|
|
29
|
+
import { hash } from "@stablelib/sha256";
|
|
30
30
|
import { base58Encode } from "../utils.js";
|
|
31
31
|
import { MajikKeyError } from "../../error.js";
|
|
32
32
|
import { randomBytes } from "@noble/hashes/utils.js";
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* signing Ed25519 keypair AS-IS. Simpler, but means the same private
|
|
26
26
|
* key secures two different protocols. Opt-in only.
|
|
27
27
|
*/
|
|
28
|
-
import * as ed25519 from "@stablelib/ed25519
|
|
29
|
-
import { hash } from "@stablelib/sha256
|
|
28
|
+
import * as ed25519 from "@stablelib/ed25519";
|
|
29
|
+
import { hash } from "@stablelib/sha256";
|
|
30
30
|
import { MAJIK_SOLANA_SEED } from "./constants.js";
|
|
31
31
|
import { MajikKeyError } from "../../error.js";
|
|
32
32
|
import { base58Encode } from "../utils.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -11,3 +11,6 @@ export * from "./core/keys/key-store.js";
|
|
|
11
11
|
export * from "./core/keys/key-impls.js";
|
|
12
12
|
export * from "./core/keys/keypair-handle.js";
|
|
13
13
|
export * from "./core/keys/registry.js";
|
|
14
|
+
export * from "./core/crypto/wordlist.js";
|
|
15
|
+
export * from "./core/crypto/constants.js";
|
|
16
|
+
export * from "./core/crypto/crypto-provider.js";
|
package/dist/index.js
CHANGED
|
@@ -9,3 +9,6 @@ export * from "./core/keys/key-store.js";
|
|
|
9
9
|
export * from "./core/keys/key-impls.js";
|
|
10
10
|
export * from "./core/keys/keypair-handle.js";
|
|
11
11
|
export * from "./core/keys/registry.js";
|
|
12
|
+
export * from "./core/crypto/wordlist.js";
|
|
13
|
+
export * from "./core/crypto/constants.js";
|
|
14
|
+
export * from "./core/crypto/crypto-provider.js";
|
package/dist/majik-key.d.ts
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* core/keys/key-impls.ts. Frozen "legacy-v1" recipes are pinned by
|
|
15
15
|
* vectors/legacy-v1.vectors.json.
|
|
16
16
|
*/
|
|
17
|
-
import { MajikContactData, MajikContactMeta } from "@majikah/majik-contact
|
|
18
|
-
import { MajikContact } from "@majikah/majik-contact
|
|
17
|
+
import { MajikContactData, MajikContactMeta } from "@majikah/majik-contact";
|
|
18
|
+
import { MajikContact } from "@majikah/majik-contact";
|
|
19
19
|
import { KDF_VERSION } from "./core/crypto/constants.js";
|
|
20
20
|
import type { BitcoinRawPublicKey, ED25519RawPublicKey, MajikKeyAddress, MajikKeyDangerousJSON, MajikKeyFingerprint, MajikKeyJSON, MajikKeyMetadata, MLDSA87RawPublicKey, MLKEM768RawPublicKey, MnemonicJSON, X25519RawKey } from "./core/types.js";
|
|
21
21
|
import { MajikMessageIdentity } from "./core/database/system/identity.js";
|
|
22
|
-
import { MajikUser } from "@thezelijah/majik-user
|
|
22
|
+
import { MajikUser } from "@thezelijah/majik-user";
|
|
23
23
|
import { MnemonicLanguage } from "./core/crypto/wordlist.js";
|
|
24
24
|
import { MajikKeyWeb3Namespace, BitcoinDerivationOptions, BitcoinKeypairMaterial, SolanaKeypairMaterial, EthereumKeypairMaterial } from "./core/web3/index.js";
|
|
25
25
|
import { KeyFamily, KeyId } from "./core/keys/key-id.js";
|
package/dist/majik-key.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { generateMnemonic as bip39GenerateMnemonic, mnemonicToSeed, validateMnemonic, } from "@scure/bip39";
|
|
18
18
|
import { aesGcmDecrypt, aesGcmEncrypt, deriveKeyFromPassphraseArgon2, deriveKeyFromMnemonicArgon2, deriveKeyFromPassphrase, fingerprintFromPublicRaw, generateRandomBytes, IV_LENGTH, } from "./core/crypto/crypto-provider.js";
|
|
19
|
-
import { MajikContact } from "@majikah/majik-contact
|
|
19
|
+
import { MajikContact } from "@majikah/majik-contact";
|
|
20
20
|
import { arrayToBase64, base64ToArrayBuffer, utf8ToBase64, base64ToUtf8, seedStringToArray, seedArrayToString, base64ToUint8Array, } from "./core/utils.js";
|
|
21
21
|
import { KDF_VERSION, LEGACY_MAJIK_MNEMONIC_SALT, BACKUP_SALT_WRITE_VERSION, backupSaltFor, } from "./core/crypto/constants.js";
|
|
22
22
|
import { MajikKeyValidator } from "./core/validator.js";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@majikah/majik-key",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "A post-quantum ready seed phrase account library for the Majikah ecosystem. Manages deterministic X25519 and ML-KEM-768 identities with Argon2id protection and seamless legacy account migration.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"test:vectors": "vitest run test/test-vectors.test.ts"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@majikah/majik-contact": "^0.
|
|
74
|
+
"@majikah/majik-contact": "^0.2.0",
|
|
75
75
|
"@noble/curves": "^2.4.0",
|
|
76
76
|
"@noble/hashes": "^2.4.0",
|
|
77
77
|
"@noble/post-quantum": "^0.7.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@stablelib/pbkdf2": "^2.0.1",
|
|
84
84
|
"@stablelib/sha256": "^2.0.1",
|
|
85
85
|
"@stablelib/x25519": "^2.0.1",
|
|
86
|
-
"@thezelijah/majik-user": "^1.0
|
|
86
|
+
"@thezelijah/majik-user": "^1.1.0",
|
|
87
87
|
"ed2curve": "^0.3.0",
|
|
88
88
|
"hash-wasm": "^4.12.0"
|
|
89
89
|
},
|