Mnemonic

Overview

Manages BIP39 mnemonic phrases with BIP360 quantum-resistant wallet derivation. The Mnemonic class creates both a classical BIP32 HD key tree (for ECDSA/Schnorr) and a quantum BIP32 HD key tree (for ML-DSA) from a single mnemonic seed phrase, enabling deterministic derivation of hybrid wallets that contain both key types.

The Mnemonic implements Disposable for secure zeroing of seed material.

The full source code is available on GitHub at Mnemonic.ts.

Import

import { Mnemonic, MnemonicStrength, BIPStandard } from '@btc-vision/transaction';
import { MLDSASecurityLevel } from '@btc-vision/bip32';
import { networks } from '@btc-vision/bitcoin';

Enums and Interfaces

MLDSASecurityLevel
MnemonicStrength
BIPStandard

Constructor

constructor()

Static Methods

generatePhrase()
generate()
validate()

Instance Methods

derive()
deriveOPWallet()
deriveMultiple()
deriveMultipleOPWallet()
deriveCustomPath()
getClassicalRoot()
getQuantumRoot()
zeroize()
[Symbol.dispose]()

Properties

phrase
network
securityLevel
seed

Derivation Paths

Classical Paths

The classical derivation path follows the standard BIP32 format:

m/<purpose>'/<coin_type>'/<account>'/<change>/<index>
  • purpose: Determined by BIPStandard (44, 49, 84, or 86).
  • coin_type: 0 for mainnet, 1 for testnet, opnetTestnet, and regtest.
  • account: Account index (hardened).
  • change: 0 for receiving addresses, 1 for change addresses.
  • index: Address index within the chain.

Quantum Paths

The quantum derivation path always uses purpose 360 (BIP360):

m/360'/<coin_type>'/<account>'/<change>/<index>

This ensures quantum keys are derived independently from classical keys while using the same account/index structure.