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
PubKeyThe local payment basepoint.
remotePaymentBasepoint
PubKeyThe remote payment basepoint.
initialValue
ulongThe initial commitment number. Defaults to 0
Properties
ObscuredValue
Gets the obscured commitment number (value XOR obscuring factor).
public ulong ObscuredValue { get; }
Property Value
ObscuringFactor
Gets the obscuring factor derived from payment basepoints.
public ulong ObscuringFactor { get; }
Property Value
Value
Gets the commitment number value.
public ulong Value { get; }
Property Value
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.