@arkade-os/sdk Documentation - v0.4.36
    Preparing search index...

    Class MnemonicIdentity

    Mnemonic-based identity derived from a BIP39 phrase.

    This is the most user-friendly identity type — recommended for wallet applications where users manage their own backup phrase. Extends

    SeedIdentity with mnemonic validation and optional passphrase support.

    const identity = MnemonicIdentity.fromMnemonic(
    'abandon abandon abandon ...',
    { isMainnet: true, passphrase: 'secret' }
    );

    Hierarchy (View Summary)

    Index

    Properties

    descriptor: string

    Wildcard account-descriptor template (e.g. tr([fp/86'/0'/0']xpub/0/*)). The canonical thing to pass through the system; consumers materialize a concrete descriptor at a specific index themselves (see HDDescriptorProvider in the wallet layer for the rotating-counter use case).

    Methods

    • Returns true when descriptor is derived from this identity's seed. HD descriptors match by account xpub; bare tr(pubkey) descriptors match by raw pubkey. See descriptorIsOurs.

      Parameters

      • descriptor: string

      Returns boolean

      Prefer DescriptorProvider.isOurs() via HDDescriptorProvider for rotating HD wallets or StaticDescriptorProvider for legacy single-key wallets.

    • Sign an arbitrary message using the requested signature type.

      Parameters

      • message: Uint8Array
      • signatureType: "schnorr" | "ecdsa" = "schnorr"

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Signs a message with the key derived from descriptor.

      Parameters

      • descriptor: string
      • message: Uint8Array
      • signatureType: "schnorr" | "ecdsa" = "schnorr"

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Prefer DescriptorProvider.signMessageWithDescriptor() via HDDescriptorProvider or StaticDescriptorProvider. Identities keep this method only as backing implementation for descriptor providers.

    • Signs each request with the key derived from its descriptor. Each descriptor must share this identity's seed (isOurs).

      Parameters

      • requests: DescriptorSigningRequest[]

      Returns Promise<Transaction[]>

      Prefer DescriptorProvider.signWithDescriptor() via HDDescriptorProvider or StaticDescriptorProvider. Identities keep this method only as backing implementation for descriptor providers.

    • Creates a MnemonicIdentity from a BIP39 mnemonic phrase.

      Pass { isMainnet } for default BIP86 derivation, or { descriptor } for a caller-supplied account-descriptor template (the option's value must end with /*)).

      Parameters

      • phrase: string

        BIP39 mnemonic phrase (12 or 24 words)

      • opts: MnemonicOptions = {}

        Network selection or descriptor template, plus optional passphrase

      Returns MnemonicIdentity