@majikah/majik-key 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -183,7 +183,7 @@ const standardBtc = await MajikKey.deriveStandardBitcoinFromMnemonic(mnemonic);
183
183
 
184
184
  ### Two Solana paths, on purpose
185
185
 
186
- By default (`deriveSolanaKeypairFromEdSecretKey`), the Solana keypair is domain-separated from your Ed25519 message-signing key via `SHA256(edSeed || "MajikMessageSolanaSeed")`, so the same private key never secures two different protocols. You can opt into reusing your Ed25519 message-signing key directly instead:
186
+ By default (`deriveSolanaKeypairFromEdSecretKey`), the Solana keypair is domain-separated from your Ed25519 message-signing key via `SHA256(edSeed || "MajikKeySolanaSeed")`, so the same private key never secures two different protocols. You can opt into reusing your Ed25519 message-signing key directly instead:
187
187
 
188
188
  ```typescript
189
189
  // Recommended: domain-separated Solana key
@@ -1,2 +1,2 @@
1
1
  export declare const MAJIK_BITCOIN_STANDARD_PATH = "m/84'/0'/0'/0/0";
2
- export declare const MAJIK_BITCOIN_DOMAIN_PATH = "m/84'/1989'/0'/0/0";
2
+ export declare const MAJIK_BITCOIN_DOMAIN_PATH = "m/84'/1971'/0'/0/0";
@@ -4,4 +4,4 @@ export const MAJIK_BITCOIN_STANDARD_PATH = "m/84'/0'/0'/0/0";
4
4
  // Unregistered/private coin-type index — domain-separates Majik's default
5
5
  // Bitcoin key from a user's "real" BTC wallet, while remaining 100% standard
6
6
  // BIP-32 math (just a different branch of the same tree).
7
- export const MAJIK_BITCOIN_DOMAIN_PATH = "m/84'/1989'/0'/0/0";
7
+ export const MAJIK_BITCOIN_DOMAIN_PATH = "m/84'/1971'/0'/0/0";
@@ -319,7 +319,11 @@ export declare class MajikKey {
319
319
  */
320
320
  static fromDangerousJSON(json: MajikKeyDangerousJSON | string): MajikKey;
321
321
  toMnemonicJSON(mnemonic: string, passphrase?: string): MnemonicJSON;
322
- static fromMnemonicJSON(mnemonicJson: MnemonicJSON | string, passphrase: string, label?: string): Promise<MajikKey>;
322
+ static fromMnemonicJSON(mnemonicJson: MnemonicJSON | string, passphrase: string, label?: string, options?: {
323
+ mnemonicLanguage?: MnemonicLanguage;
324
+ /** @experimental Set `false` to skip deriving the Bitcoin keypair. Defaults to `true` for backward compatibility. */
325
+ deriveBitcoin?: boolean;
326
+ }): Promise<MajikKey>;
323
327
  updateLabel(newLabel: string): this;
324
328
  updatePassphrase(currentPassphrase: string, newPassphrase: string): Promise<this>;
325
329
  /**
package/dist/majik-key.js CHANGED
@@ -483,7 +483,10 @@ export class MajikKey {
483
483
  phrase: passphrase?.trim() || undefined,
484
484
  };
485
485
  }
486
- static async fromMnemonicJSON(mnemonicJson, passphrase, label) {
486
+ static async fromMnemonicJSON(mnemonicJson, passphrase, label, options = {
487
+ deriveBitcoin: true,
488
+ mnemonicLanguage: "en",
489
+ }) {
487
490
  try {
488
491
  const parsed = typeof mnemonicJson === "string"
489
492
  ? JSON.parse(mnemonicJson)
@@ -492,7 +495,7 @@ export class MajikKey {
492
495
  throw new MajikKeyError("Invalid MnemonicJSON");
493
496
  const mnemonic = seedArrayToString(parsed.seed);
494
497
  MajikKeyValidator.validateMnemonic(mnemonic);
495
- return await MajikKey.create(mnemonic, passphrase, label);
498
+ return await MajikKey.create(mnemonic, passphrase, label, options);
496
499
  }
497
500
  catch (err) {
498
501
  if (err instanceof MajikKeyError)
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": "0.3.0",
5
+ "version": "0.3.1",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",