Table of Contents

Class RecoveryOptions

Namespace
NArk.Abstractions.Recovery
Assembly
NArk.Abstractions.dll

Configuration for an HD wallet recovery scan.

public record RecoveryOptions : IEquatable<RecoveryOptions>
Inheritance
RecoveryOptions
Implements
Inherited Members

Constructors

RecoveryOptions(int, int, int)

Configuration for an HD wallet recovery scan.

public RecoveryOptions(int GapLimit = 20, int MaxIndex = 10000, int StartIndex = 0)

Parameters

GapLimit int

Number of consecutive unused derivation indices that signals the end of usage and stops the scan. BIP44 recommends 20; tune higher for wallets known to have generated many addresses ahead of use. MUST be > 0.

MaxIndex int

Hard upper bound on the highest index probed. Acts as a safety stop in case the gap is never reached on a pathological provider. MUST be ≥ StartIndex.

StartIndex int

First derivation index to probe. Default 0 (full scan from the start); callers can resume a partial scan by passing the highest known index. MUST be ≥ 0.

Properties

Default

Default options (gap=20, max=10000, start=0).

public static RecoveryOptions Default { get; }

Property Value

RecoveryOptions

GapLimit

Number of consecutive unused derivation indices that signals the end of usage and stops the scan. BIP44 recommends 20; tune higher for wallets known to have generated many addresses ahead of use. MUST be > 0.

public int GapLimit { get; init; }

Property Value

int

MaxIndex

Hard upper bound on the highest index probed. Acts as a safety stop in case the gap is never reached on a pathological provider. MUST be ≥ StartIndex.

public int MaxIndex { get; init; }

Property Value

int

StartIndex

First derivation index to probe. Default 0 (full scan from the start); callers can resume a partial scan by passing the highest known index. MUST be ≥ 0.

public int StartIndex { get; init; }

Property Value

int

Methods

Validate()

Validates the options and throws ArgumentOutOfRangeException if any field is nonsensical. Called by HdWalletRecoveryService.ScanAsync at the start of every scan.

public void Validate()