Table of Contents

Class LocalLightningSigner

Namespace
NLightning.Infrastructure.Bitcoin.Signers
Assembly
NLightning.Infrastructure.Bitcoin.dll
public class LocalLightningSigner : ILightningSigner
Inheritance
LocalLightningSigner
Implements
Inherited Members

Constructors

LocalLightningSigner(IFundingOutputBuilder, IKeyDerivationService, ILogger<LocalLightningSigner>, NodeOptions, ISecureKeyManager)

public LocalLightningSigner(IFundingOutputBuilder fundingOutputBuilder, IKeyDerivationService keyDerivationService, ILogger<LocalLightningSigner> logger, NodeOptions nodeOptions, ISecureKeyManager secureKeyManager)

Parameters

fundingOutputBuilder IFundingOutputBuilder
keyDerivationService IKeyDerivationService
logger ILogger<LocalLightningSigner>
nodeOptions NodeOptions
secureKeyManager ISecureKeyManager

Methods

CreateNewChannel(out ChannelBasepoints, out CompactPubKey)

Generate a new channel key set and return the channel key index

public uint CreateNewChannel(out ChannelBasepoints basepoints, out CompactPubKey firstPerCommitmentPoint)

Parameters

basepoints ChannelBasepoints
firstPerCommitmentPoint CompactPubKey

Returns

uint

GenerateFundingPrivateKey(uint)

protected virtual Key GenerateFundingPrivateKey(uint channelKeyIndex)

Parameters

channelKeyIndex uint

Returns

Key

GetChannelBasepoints(ChannelId)

Generate or retrieve channel basepoints for a channel

public ChannelBasepoints GetChannelBasepoints(ChannelId channelId)

Parameters

channelId ChannelId

Returns

ChannelBasepoints

GetChannelBasepoints(uint)

Generate or retrieve channel basepoints for a channel

public ChannelBasepoints GetChannelBasepoints(uint channelKeyIndex)

Parameters

channelKeyIndex uint

Returns

ChannelBasepoints

GetNodePublicKey()

Get the node's public key

public CompactPubKey GetNodePublicKey()

Returns

CompactPubKey

GetPerCommitmentPoint(ChannelId, ulong)

Generate a per-commitment point for a specific commitment number

public CompactPubKey GetPerCommitmentPoint(ChannelId channelId, ulong commitmentNumber)

Parameters

channelId ChannelId
commitmentNumber ulong

Returns

CompactPubKey

GetPerCommitmentPoint(uint, ulong)

Generate a per-commitment point for a specific commitment number

public CompactPubKey GetPerCommitmentPoint(uint channelKeyIndex, ulong commitmentNumber)

Parameters

channelKeyIndex uint
commitmentNumber ulong

Returns

CompactPubKey

RegisterChannel(ChannelId, ChannelSigningInfo)

Store channel information needed for signing

public void RegisterChannel(ChannelId channelId, ChannelSigningInfo signingInfo)

Parameters

channelId ChannelId
signingInfo ChannelSigningInfo

ReleasePerCommitmentSecret(ChannelId, ulong)

Release (reveal) a per-commitment secret for revocation

public Secret ReleasePerCommitmentSecret(ChannelId channelId, ulong commitmentNumber)

Parameters

channelId ChannelId
commitmentNumber ulong

Returns

Secret

ReleasePerCommitmentSecret(uint, ulong)

Release (reveal) a per-commitment secret for revocation

public Secret ReleasePerCommitmentSecret(uint channelKeyIndex, ulong commitmentNumber)

Parameters

channelKeyIndex uint
commitmentNumber ulong

Returns

Secret

SignTransaction(ChannelId, SignedTransaction)

Sign a transaction using the channel's signing context

public CompactSignature SignTransaction(ChannelId channelId, SignedTransaction unsignedTransaction)

Parameters

channelId ChannelId
unsignedTransaction SignedTransaction

Returns

CompactSignature

ValidateSignature(ChannelId, CompactSignature, SignedTransaction)

Verify a signature against a transaction

public void ValidateSignature(ChannelId channelId, CompactSignature signature, SignedTransaction unsignedTransaction)

Parameters

channelId ChannelId
signature CompactSignature
unsignedTransaction SignedTransaction