Class CommitmentNumber
- Namespace
- NLightning.Domain.Protocol.Models
- Assembly
- NLightning.Domain.dll
Manages Lightning Network commitment numbers and their obscuring as defined in BOLT3.
public class CommitmentNumber
- Inheritance
-
CommitmentNumber
- Inherited Members
Constructors
CommitmentNumber(CompactPubKey, CompactPubKey, ISha256, ulong)
Represents a commitment number in the Lightning Network.
public CommitmentNumber(CompactPubKey localPaymentBasepoint, CompactPubKey remotePaymentBasepoint, ISha256 sha256, ulong initialValue = 0)
Parameters
localPaymentBasepoint
CompactPubKeyremotePaymentBasepoint
CompactPubKeysha256
ISha256initialValue
ulong
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 BitcoinLockTime CalculateLockTime()
Returns
- BitcoinLockTime
The transaction locktime.
CalculateSequence()
Calculates the transaction sequence value using the obscured commitment number.
public BitcoinSequence CalculateSequence()
Returns
- BitcoinSequence
The transaction sequence.
Increment()
Increments the commitment number.
public CommitmentNumber Increment()
Returns
- CommitmentNumber
This instance for chaining.