Class ChannelKeySetModel
- Namespace
- NLightning.Domain.Channels.Models
- Assembly
- NLightning.Domain.dll
public class ChannelKeySetModel
- Inheritance
-
ChannelKeySetModel
- Inherited Members
Constructors
ChannelKeySetModel(uint, CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey, ulong, byte[]?)
public ChannelKeySetModel(uint keyIndex, CompactPubKey fundingCompactPubKey, CompactPubKey revocationCompactBasepoint, CompactPubKey paymentCompactBasepoint, CompactPubKey delayedPaymentCompactBasepoint, CompactPubKey htlcCompactBasepoint, CompactPubKey currentPerCommitmentCompactPoint, ulong currentPerCommitmentIndex = 281474976710655, byte[]? lastRevealedPerCommitmentSecret = null)
Parameters
keyIndex
uintfundingCompactPubKey
CompactPubKeyrevocationCompactBasepoint
CompactPubKeypaymentCompactBasepoint
CompactPubKeydelayedPaymentCompactBasepoint
CompactPubKeyhtlcCompactBasepoint
CompactPubKeycurrentPerCommitmentCompactPoint
CompactPubKeycurrentPerCommitmentIndex
ulonglastRevealedPerCommitmentSecret
byte[]
Properties
CurrentPerCommitmentCompactPoint
public CompactPubKey CurrentPerCommitmentCompactPoint { get; }
Property Value
CurrentPerCommitmentIndex
public ulong CurrentPerCommitmentIndex { get; }
Property Value
DelayedPaymentCompactBasepoint
public CompactPubKey DelayedPaymentCompactBasepoint { get; }
Property Value
FundingCompactPubKey
public CompactPubKey FundingCompactPubKey { get; }
Property Value
HtlcCompactBasepoint
public CompactPubKey HtlcCompactBasepoint { get; }
Property Value
KeyIndex
public uint KeyIndex { get; }
Property Value
LastRevealedPerCommitmentSecret
For remote key sets: stores their last revealed per-commitment secret This is needed to create penalty transactions if they broadcast old commitments For local key sets: this should be null (we don't store our own secrets)
public byte[]? LastRevealedPerCommitmentSecret { get; }
Property Value
- byte[]
PaymentCompactBasepoint
public CompactPubKey PaymentCompactBasepoint { get; }
Property Value
RevocationCompactBasepoint
public CompactPubKey RevocationCompactBasepoint { get; }
Property Value
Methods
CreateForRemote(CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey, CompactPubKey)
Create a ChannelKeySet for the remote party (we don't generate their keys)
public static ChannelKeySetModel CreateForRemote(CompactPubKey fundingPubKey, CompactPubKey revocationBasepoint, CompactPubKey paymentBasepoint, CompactPubKey delayedPaymentBasepoint, CompactPubKey htlcBasepoint, CompactPubKey firstPerCommitmentPoint)
Parameters
fundingPubKey
CompactPubKeyrevocationBasepoint
CompactPubKeypaymentBasepoint
CompactPubKeydelayedPaymentBasepoint
CompactPubKeyhtlcBasepoint
CompactPubKeyfirstPerCommitmentPoint
CompactPubKey
Returns
RevealPerCommitmentSecret(byte[])
Store a revealed per-commitment secret from the counterparty This is called when they send a revoke_and_ack message
public void RevealPerCommitmentSecret(byte[] secret)
Parameters
secret
byte[]
UpdatePerCommitmentPoint(CompactPubKey)
public void UpdatePerCommitmentPoint(CompactPubKey newPoint)
Parameters
newPoint
CompactPubKey