Table of Contents

Interface ILightningSigner

Namespace
NLightning.Domain.Bitcoin.Interfaces
Assembly
NLightning.Domain.dll

Interface for transaction signing services that can be implemented either locally or delegated to external services like VLS (Validating Lightning Signer)

public interface ILightningSigner

Methods

CreateNewChannel(out ChannelBasepoints, out CompactPubKey)

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

uint CreateNewChannel(out ChannelBasepoints basepoints, out CompactPubKey firstPerCommitmentPoint)

Parameters

basepoints ChannelBasepoints
firstPerCommitmentPoint CompactPubKey

Returns

uint

GetChannelBasepoints(ChannelId)

Generate or retrieve channel basepoints for a channel

ChannelBasepoints GetChannelBasepoints(ChannelId channelId)

Parameters

channelId ChannelId

Returns

ChannelBasepoints

GetChannelBasepoints(uint)

Generate or retrieve channel basepoints for a channel

ChannelBasepoints GetChannelBasepoints(uint channelKeyIndex)

Parameters

channelKeyIndex uint

Returns

ChannelBasepoints

GetNodePublicKey()

Get the node's public key

CompactPubKey GetNodePublicKey()

Returns

CompactPubKey

GetPerCommitmentPoint(ChannelId, ulong)

Generate a per-commitment point for a specific commitment number

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

CompactPubKey GetPerCommitmentPoint(uint channelKeyIndex, ulong commitmentNumber)

Parameters

channelKeyIndex uint
commitmentNumber ulong

Returns

CompactPubKey

RegisterChannel(ChannelId, ChannelSigningInfo)

Store channel information needed for signing

void RegisterChannel(ChannelId channelId, ChannelSigningInfo signingInfo)

Parameters

channelId ChannelId
signingInfo ChannelSigningInfo

ReleasePerCommitmentSecret(ChannelId, ulong)

Release (reveal) a per-commitment secret for revocation

Secret ReleasePerCommitmentSecret(ChannelId channelId, ulong commitmentNumber)

Parameters

channelId ChannelId
commitmentNumber ulong

Returns

Secret

ReleasePerCommitmentSecret(uint, ulong)

Release (reveal) a per-commitment secret for revocation

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

CompactSignature SignTransaction(ChannelId channelId, SignedTransaction unsignedTransaction)

Parameters

channelId ChannelId
unsignedTransaction SignedTransaction

Returns

CompactSignature

ValidateSignature(ChannelId, CompactSignature, SignedTransaction)

Verify a signature against a transaction

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

Parameters

channelId ChannelId
signature CompactSignature
unsignedTransaction SignedTransaction