Table of Contents

Class CommitmentNumber

Namespace
NLightning.Bolts.BOLT3.Types
Assembly
NLightning.Bolts.dll

Manages Lightning Network commitment numbers and their obscuring as defined in BOLT3.

public sealed class CommitmentNumber
Inheritance
CommitmentNumber
Inherited Members

Constructors

CommitmentNumber(PubKey, PubKey, ulong)

Initializes a new instance of the CommitmentNumber class.

public CommitmentNumber(PubKey localPaymentBasepoint, PubKey remotePaymentBasepoint, ulong initialValue = 0)

Parameters

localPaymentBasepoint PubKey

The local payment basepoint.

remotePaymentBasepoint PubKey

The remote payment basepoint.

initialValue ulong

The initial commitment number. Defaults to 0

Properties

ObscuredValue

Gets the obscured commitment number (value XOR obscuring factor).

public ulong ObscuredValue { get; }

Property Value

ulong

ObscuringFactor

Gets the obscuring factor derived from payment basepoints.

public ulong ObscuringFactor { get; }

Property Value

ulong

Value

Gets the commitment number value.

public ulong Value { get; }

Property Value

ulong

Methods

CalculateLockTime()

Calculates the transaction locktime value using the obscured commitment number.

public LockTime CalculateLockTime()

Returns

LockTime

The transaction locktime.

CalculateSequence()

Calculates the transaction sequence value using the obscured commitment number.

public Sequence CalculateSequence()

Returns

Sequence

The transaction sequence.

Increment()

Increments the commitment number.

public CommitmentNumber Increment()

Returns

CommitmentNumber

This instance for chaining.