Table of Contents

Class CommitmentKeyDerivationService

Namespace
NLightning.Infrastructure.Bitcoin.Services
Assembly
NLightning.Infrastructure.Bitcoin.dll
public class CommitmentKeyDerivationService : ICommitmentKeyDerivationService
Inheritance
CommitmentKeyDerivationService
Implements
Inherited Members

Constructors

CommitmentKeyDerivationService(IKeyDerivationService, ILightningSigner)

public CommitmentKeyDerivationService(IKeyDerivationService keyDerivationService, ILightningSigner lightningSigner)

Parameters

keyDerivationService IKeyDerivationService
lightningSigner ILightningSigner

Methods

DeriveLocalCommitmentKeys(uint, ChannelBasepoints, ChannelBasepoints, ulong)

Derives the local commitment keys based on the provided parameters, including local and remote basepoints and the commitment number.

public CommitmentKeys DeriveLocalCommitmentKeys(uint localChannelKeyIndex, ChannelBasepoints localBasepoints, ChannelBasepoints remoteBasepoints, ulong commitmentNumber)

Parameters

localChannelKeyIndex uint

An index representing the local channel key for deriving commitment keys.

localBasepoints ChannelBasepoints

The set of cryptographic basepoints associated with the local channel.

remoteBasepoints ChannelBasepoints

The set of cryptographic basepoints associated with the remote channel.

commitmentNumber ulong

A numeric identifier representing the specific commitment.

Returns

CommitmentKeys

A CommitmentKeys instance containing the derived keys for the local commitment.

DeriveRemoteCommitmentKeys(uint, ChannelBasepoints, ChannelBasepoints, CompactPubKey, ulong)

Derives the remote commitment keys based on the provided parameters, including local and remote basepoints, the remote per-commitment point, and the commitment number.

public CommitmentKeys DeriveRemoteCommitmentKeys(uint localChannelKeyIndex, ChannelBasepoints localBasepoints, ChannelBasepoints remoteBasepoints, CompactPubKey remotePerCommitmentPoint, ulong commitmentNumber)

Parameters

localChannelKeyIndex uint

An index representing the local channel key for deriving remote commitment keys.

localBasepoints ChannelBasepoints

The set of cryptographic basepoints associated with the local channel.

remoteBasepoints ChannelBasepoints

The set of cryptographic basepoints associated with the remote channel.

remotePerCommitmentPoint CompactPubKey

The per-commitment point provided by the remote party, used for key derivation.

commitmentNumber ulong

A numeric identifier representing the specific commitment.

Returns

CommitmentKeys

A CommitmentKeys instance containing the derived keys for the remote commitment.