Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HDKey

HDKey provides the ability to create hierarchical deterministic keys.

export
class

HDKey

Hierarchy

  • HDKey

Index

Constructors

constructor

  • new HDKey(key: Buffer, chainCode: Buffer): HDKey
  • Creates an instance of HDKey.

    memberof

    HDKey

    Parameters

    • key: Buffer

      Left half of the hmac digest

    • chainCode: Buffer

      Right half of the hmac digest

    Returns HDKey

Properties

Private mChainCode

mChainCode: Buffer

Private mKey

mKey: Buffer

Methods

chainCode

  • chainCode(): Buffer
  • Return the derived chain code

    memberof

    HDKey

    Returns Buffer

ckd

  • ckd(key: Buffer, chainCode: Buffer, index: number): HDKey
  • Child key derivation function

    memberof

    HDKey

    Parameters

    • key: Buffer

      The parent key

    • chainCode: Buffer

      The parent chain code

    • index: number

      The key index

    Returns HDKey

derive

  • derive(path: string): HDKey
  • Given a path, derive a child key. Path must contain only hardened indices

    memberof

    HDKey

    Parameters

    • path: string

      The derivation path

    Returns HDKey

key

  • key(): Buffer
  • Return the derived key

    memberof

    HDKey

    Returns Buffer

privateKey

  • Get the private key created using the derived key

    memberof

    HDKey

    Returns PrivateKey

Static fromMasterSeed

  • fromMasterSeed(seed: Buffer): HDKey
  • Create an HDKey from a seed.

    static
    memberof

    HDKey

    Parameters

    • seed: Buffer

    Returns HDKey