Seeds

class index.SEEDS()

The SEEDS class acts as a centralized registry for all supported seed types.

It provides a unified interface for accessing, validating, and retrieving seed classes (such as Algorand, BIP39, Cardano, Electrum, and Monero).

Each seed class implements the Seed base class and defines its own derivation logic.

exported from seeds.index

static index.SEEDS.getClasses()

Returns all seed class constructors.

Returns:

typeof Seed[] – Array of seed class constructors.

static index.SEEDS.getNames()

Returns the names of all available seed classes.

Returns:

string[] – Array of seed class names.

static index.SEEDS.getSeedClass(name)

Retrieves a specific seed class by name.

Arguments:
  • name (string) – The name of the seed class.

Returns:

any – The corresponding seed class.

static index.SEEDS.isSeed(name)

Checks if a given name corresponds to a valid registered seed type.

Arguments:
  • name (string) – The seed name to check.

Returns:

booleantrue if valid, otherwise false.

class seed.Seed(seed, options={})

exported from seeds.seed

Arguments:
  • seed (string)

  • options (SeedOptionsInterface)

seed.Seed.options

type: SeedOptionsInterface

seed.Seed.seed

type: string

seed.Seed.getName()
Returns:

string

seed.Seed.getSeed()
Returns:

string

static seed.Seed.fromMnemonic(mnemonic, options={})
Arguments:
  • mnemonic (string | Mnemonic)

  • options (SeedOptionsInterface)

Returns:

string

static seed.Seed.getName()
Returns:

string

class algorand.AlgorandSeed()

Represents the Algorand seed implementation.

The AlgorandSeed class extends the base Seed class and provides functionality for generating and validating Algorand-compatible seeds.

This class primarily handles conversion from mnemonic phrases (either as plain strings or Mnemonic instances) into seed bytes.

exported from seeds.algorand

Extends:
  • Seed

static algorand.AlgorandSeed.fromMnemonic(mnemonic)

Derives a seed from an Algorand mnemonic phrase.

Accepts either a string-based mnemonic or a Mnemonic instance. If the mnemonic is invalid, a MnemonicError is thrown.

Arguments:
  • mnemonic (string | Mnemonic) – The mnemonic phrase or Mnemonic object.

Returns:

string – The derived seed as a string (typically base-encoded or hex-encoded).

static algorand.AlgorandSeed.getName()

Returns the name identifier for this seed type.

Returns:

string – The string "Algorand".

const { SEEDS, AlgorandSeed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("Algorand")
console.log(SEEDS.getSeedClass("Algorand"));
// Output: [class AlgorandSeed]
SEEDS.getSeedClass("Algorand") === AlgorandSeed
console.log(SEEDS.getSeedClass("Algorand") === AlgorandSeed);
// Output: true
SEEDS.isSeed("Algorand")
console.log(SEEDS.isSeed("Algorand"));
// Output: true
AlgorandSeed.getName()
console.log(AlgorandSeed.getName());
// Output: 'Algorand'
class bip39.BIP39Seed()

BIP39Seed provides functionality for deriving a cryptographic seed from a valid BIP39 mnemonic phrase using PBKDF2 with HMAC-SHA512.

exported from seeds.bip39

Extends:
  • Seed

bip39.BIP39Seed.seedPbkdf2Rounds

type: number

bip39.BIP39Seed.seedSaltModifier

type: string

static bip39.BIP39Seed.fromMnemonic(mnemonic, options={})

Derives a cryptographic seed from a BIP39 mnemonic phrase.

Arguments:
  • mnemonic (string | Mnemonic) – The mnemonic phrase or Mnemonic instance.

  • options (SeedOptionsInterface) – Optional derivation parameters.

Returns:

string – The derived seed as a hexadecimal string.

static bip39.BIP39Seed.getName()

Returns the name of this seed type.

Returns:

string

const { SEEDS, BIP39Seed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("BIP39")
console.log(SEEDS.getSeedClass("BIP39"));
// Output: [class BIP39Seed]
SEEDS.getSeedClass("BIP39") === BIP39Seed
console.log(SEEDS.getSeedClass("BIP39") === BIP39Seed);
// Output: true
SEEDS.isSeed("BIP39")
console.log(SEEDS.isSeed("BIP39"));
// Output: true
BIP39Seed.getName()
console.log(BIP39Seed.getName());
// Output: 'BIP39'
const mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
const seed = BIP39Seed.fromMnemonic(mnemonic, { passphrase: 'optional-passphrase' });
console.log('BIP39Seed.fromMnemonic(...)');
console.log(seed);
// Output: '5eb00bbddcf069084889a8ab9155568165f5c1e76e3b1d7d0...'
class cardano.CardanoSeed(seed, options=...)

Represents a Cardano seed generator, supporting multiple derivation standards including Byron (Icarus, Ledger, Legacy) and Shelley (Icarus, Ledger).

exported from seeds.cardano

Extends:
  • Seed

Creates a new instance of CardanoSeed.

Arguments:
  • seed (string) – The hexadecimal seed string.

  • options (SeedOptionsInterface) – Optional seed configuration including the Cardano type.

cardano.CardanoSeed.getCardanoType()

Returns the current Cardano type assigned to this seed instance.

Returns:

string – The selected Cardano type.

static cardano.CardanoSeed.fromMnemonic(mnemonic, options=...)

Generates a Cardano seed from a mnemonic phrase, supporting multiple Cardano derivation types.

Arguments:
  • mnemonic (string | Mnemonic) – A mnemonic phrase or Mnemonic object.

  • options (SeedOptionsInterface) – Optional parameters including passphrase and cardanoType.

Returns:

string – A hexadecimal string representing the derived Cardano seed.

static cardano.CardanoSeed.getName()

Returns the name of this seed type.

Returns:

string – The string "Cardano".

const { SEEDS, CardanoSeed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("Cardano")
console.log(SEEDS.getSeedClass("Cardano"));
// Output: [class CardanoSeed]
SEEDS.getSeedClass("Cardano") === CardanoSeed
console.log(SEEDS.getSeedClass("Cardano") === CardanoSeed);
// Output: true
SEEDS.isSeed("Cardano")
console.log(SEEDS.isSeed("Cardano"));
// Output: true
CardanoSeed.getName()
console.log(CardanoSeed.getName());
// Output: 'Cardano'
const mnemonic = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
const seedByronIcarus = CardanoSeed.fromMnemonic(mnemonic, { cardanoType: 'Byron-Icarus' });
console.log('CardanoSeed.fromMnemonic(..., { cardanoType: "Byron-Icarus" })');
console.log(seedByronIcarus);
// Output: 'b19d5f1e4d5e24e3d7a09c3b5fbe1b4f7e...'
const seedShelleyLedger = CardanoSeed.fromMnemonic(mnemonic, { cardanoType: 'Shelley-Ledger', passphrase: 'my-passphrase' });
console.log('CardanoSeed.fromMnemonic(..., { cardanoType: "Shelley-Ledger", passphrase: "my-passphrase" })');
console.log(seedShelleyLedger);
// Output: '6ab00cfde91e56b4889a8ab9155568165f...'
class monero.MoneroSeed()

Represents the Monero-specific seed derivation implementation.

The MoneroSeed class provides functionality for validating and decoding Monero mnemonic phrases into their corresponding seed value.

Each Monero seed follows the Monero-specific encoding and decoding scheme.

exported from seeds.monero

Extends:
  • Seed

static monero.MoneroSeed.fromMnemonic(mnemonic)

Derives a Monero seed from a given mnemonic phrase.

Arguments:
  • mnemonic (string | Mnemonic) – The mnemonic phrase or Mnemonic instance.

Returns:

string – The derived Monero seed as a hexadecimal string.

static monero.MoneroSeed.getName()

Returns the name of the seed type.

Returns:

string – The name "Monero".

const { SEEDS, MoneroSeed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("Monero")
console.log(SEEDS.getSeedClass("Monero"));
// Output: [class MoneroSeed]
SEEDS.getSeedClass("Monero") === MoneroSeed
console.log(SEEDS.getSeedClass("Monero") === MoneroSeed);
// Output: true
SEEDS.isSeed("Monero")
console.log(SEEDS.isSeed("Monero"));
// Output: true
MoneroSeed.getName()
console.log(MoneroSeed.getName());
// Output: 'Monero'
const mnemonic = 'abbey academic acid acrobat ...'; // 25-word Monero mnemonic
const seed = MoneroSeed.fromMnemonic(mnemonic);
console.log('MoneroSeed.fromMnemonic(...)');
console.log(seed);
// Output: '4f8c9a1b9a2e6d3b4c5e2d1f0a9b8c7d6e5f4c3b2a1d0e9f8c7b6a5d4e3f2a1b'
class electrum.v1.ElectrumV1Seed()

Represents the Electrum-V1 seed generation process.

This class is responsible for creating a seed from an Electrum-V1 mnemonic phrase. The mnemonic is validated and decoded, and the resulting entropy is hashed iteratively using SHA-256 to derive the final Electrum-V1 seed.

exported from seeds.electrum.v1

Extends:
  • Seed

electrum.v1.ElectrumV1Seed.hashIterationNumber

type: number

static electrum.v1.ElectrumV1Seed.fromMnemonic(mnemonic)

Derives an Electrum-V1 seed from a mnemonic phrase.

The mnemonic is validated using ElectrumV1Mnemonic.isValid(). Then, it is decoded to entropy, and hashed 100,000 times with SHA-256, concatenating the entropy at each step to derive the final seed.

Arguments:
  • mnemonic (string | Mnemonic) – The Electrum-V1 mnemonic phrase or a Mnemonic instance.

Returns:

string – The derived Electrum-V1 seed as a hexadecimal string.

static electrum.v1.ElectrumV1Seed.getName()

Returns the name of this seed type.

Returns:

string – The string 'Electrum-V1'.

const { SEEDS, ElectrumV1Seed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("Electrum-V1")
console.log(SEEDS.getSeedClass("Electrum-V1"));
// Output: [class ElectrumV1Seed]
SEEDS.getSeedClass("Electrum-V1") === ElectrumV1Seed
console.log(SEEDS.getSeedClass("Electrum-V1") === ElectrumV1Seed);
// Output: true
SEEDS.isSeed("Electrum-V1")
console.log(SEEDS.isSeed("Electrum-V1"));
// Output: true
ElectrumV1Seed.getName()
console.log(ElectrumV1Seed.getName());
// Output: 'Electrum-V1'
const mnemonic = 'all all all all all all all all all all all all';
const seed = ElectrumV1Seed.fromMnemonic(mnemonic);
console.log(seed);
// Output: 'c7d5f32a1b4f6e8d9a0b2c3d4e5f60718293a4b5c6d7e8f9a0b1c2d3e4f50617'
class electrum.v2.ElectrumV2Seed()

Represents an Electrum-V2 seed derived from an Electrum V2 mnemonic phrase.

Implements the PBKDF2-HMAC-SHA512 key derivation using the salt “electrum” plus an optional passphrase. Compatible with Standard, Segwit, and 2FA mnemonic types.

exported from seeds.electrum.v2

Extends:
  • Seed

electrum.v2.ElectrumV2Seed.seedPbkdf2Rounds

type: number

electrum.v2.ElectrumV2Seed.seedSaltModifier

type: string

electrum.v2.ElectrumV2Seed.getMnemonicType()

Retrieves the mnemonic type from the seed options.

Returns:

string – The mnemonic type (e.g., 'standard', 'segwit', '2fa').

static electrum.v2.ElectrumV2Seed.fromMnemonic(mnemonic, options=...)

Derives an Electrum-V2 seed from a given mnemonic.

Arguments:
  • mnemonic (string | Mnemonic) – The mnemonic phrase or Mnemonic object.

  • options (SeedOptionsInterface) – Optional parameters including: - mnemonicType (ELECTRUM_V2_MNEMONIC_TYPES): The type of Electrum V2 mnemonic. - passphrase (string): An optional passphrase for seed derivation.

Returns:

string – The derived Electrum-V2 seed as a hex string.

static electrum.v2.ElectrumV2Seed.getName()

Returns the name of this seed type.

Returns:

string – The seed name, 'Electrum-V2'.

const { SEEDS, ElectrumV2Seed } = await import('./src/seeds/index.js');
SEEDS.getNames()
console.log(SEEDS.getNames());
// Output: [ 'Algorand', 'BIP39', 'Cardano', 'Electrum-V1', 'Electrum-V2', 'Monero' ]
SEEDS.getClasses()
console.log(SEEDS.getClasses());
// Output: [ [class AlgorandSeed], [class BIP39Seed], [class CardanoSeed], [class ElectrumV1Seed], [class ElectrumV2Seed], [class MoneroSeed] ]
SEEDS.getSeedClass("Electrum-V2")
console.log(SEEDS.getSeedClass("Electrum-V2"));
// Output: [class ElectrumV2Seed]
SEEDS.getSeedClass("Electrum-V2") === ElectrumV2Seed
console.log(SEEDS.getSeedClass("Electrum-V2") === ElectrumV2Seed);
// Output: true
SEEDS.isSeed("Electrum-V2")
console.log(SEEDS.isSeed("Electrum-V2"));
// Output: true
ElectrumV2Seed.getName()
console.log(ElectrumV2Seed.getName());
// Output: 'Electrum-V2'
const mnemonic = 'like breeze vast morning vapor sense task desert vivid token frost jungle';
const seed = ElectrumV2Seed.fromMnemonic(mnemonic, { mnemonicType: 'standard' });
console.log('ElectrumV2Seed.fromMnemonic(...)');
console.log(seed);
// Output: 'd3c5a47b1c3e9f2d8a5c6e7f9b0a1d3e4f5061728394a5b6c7d8e9f0a1b2c3d4'
const instance = new ElectrumV2Seed(mnemonic, { mnemonicType: 'segwit' });
console.log('instance.getMnemonicType()');
console.log(instance.getMnemonicType());
// Output: 'segwit'