Provides a mechanism to discover addresses in Hierarchical Deterministic (HD) wallets by performing a look-ahead search of a specified number of addresses in the following manner:

  • Derive base addresses with payment credential at index 0 and increasing stake credential until it reaches the given limit.
  • Derives base addresses with increasing payment credential and stake credential at index 0.
  • if no transactions are found for both internal and external address type, increase the gap count.
  • if there are some transactions, increase the payment credential index and set the gap count to 0.
  • if the gap count reaches the given lookAheadCount stop the discovery process.

Please note that the algorithm works with the transaction history, not balances, so you can have an address with 0 total coins and the algorithm will still continue with discovery if the address was previously used.

If the wallet hits gap limit of unused addresses in a row, it expects there are no used addresses beyond this point and stops searching the address chain.

Hierarchy

  • HDSequentialDiscovery

Implements

Constructors

Properties

Methods

Constructors

Properties

#chainHistoryProvider: ChainHistoryProvider
#lookAheadCount: number

Methods

Generated using TypeDoc