Table of Contents

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 uint
fundingCompactPubKey CompactPubKey
revocationCompactBasepoint CompactPubKey
paymentCompactBasepoint CompactPubKey
delayedPaymentCompactBasepoint CompactPubKey
htlcCompactBasepoint CompactPubKey
currentPerCommitmentCompactPoint CompactPubKey
currentPerCommitmentIndex ulong
lastRevealedPerCommitmentSecret byte[]

Properties

CurrentPerCommitmentCompactPoint

public CompactPubKey CurrentPerCommitmentCompactPoint { get; }

Property Value

CompactPubKey

CurrentPerCommitmentIndex

public ulong CurrentPerCommitmentIndex { get; }

Property Value

ulong

DelayedPaymentCompactBasepoint

public CompactPubKey DelayedPaymentCompactBasepoint { get; }

Property Value

CompactPubKey

FundingCompactPubKey

public CompactPubKey FundingCompactPubKey { get; }

Property Value

CompactPubKey

HtlcCompactBasepoint

public CompactPubKey HtlcCompactBasepoint { get; }

Property Value

CompactPubKey

KeyIndex

public uint KeyIndex { get; }

Property Value

uint

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

CompactPubKey

RevocationCompactBasepoint

public CompactPubKey RevocationCompactBasepoint { get; }

Property Value

CompactPubKey

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 CompactPubKey
revocationBasepoint CompactPubKey
paymentBasepoint CompactPubKey
delayedPaymentBasepoint CompactPubKey
htlcBasepoint CompactPubKey
firstPerCommitmentPoint CompactPubKey

Returns

ChannelKeySetModel

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