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
basepointsChannelBasepointsfirstPerCommitmentPointCompactPubKey
Returns
GetChannelBasepoints(ChannelId)
Generate or retrieve channel basepoints for a channel
ChannelBasepoints GetChannelBasepoints(ChannelId channelId)
Parameters
channelIdChannelId
Returns
GetChannelBasepoints(uint)
Generate or retrieve channel basepoints for a channel
ChannelBasepoints GetChannelBasepoints(uint channelKeyIndex)
Parameters
channelKeyIndexuint
Returns
GetNodePublicKey()
Get the node's public key
CompactPubKey GetNodePublicKey()
Returns
GetPerCommitmentPoint(ChannelId, ulong)
Generate a per-commitment point for a specific commitment number
CompactPubKey GetPerCommitmentPoint(ChannelId channelId, ulong commitmentNumber)
Parameters
Returns
GetPerCommitmentPoint(uint, ulong)
Generate a per-commitment point for a specific commitment number
CompactPubKey GetPerCommitmentPoint(uint channelKeyIndex, ulong commitmentNumber)
Parameters
Returns
RegisterChannel(ChannelId, ChannelSigningInfo)
Store channel information needed for signing
void RegisterChannel(ChannelId channelId, ChannelSigningInfo signingInfo)
Parameters
channelIdChannelIdsigningInfoChannelSigningInfo
ReleasePerCommitmentSecret(ChannelId, ulong)
Release (reveal) a per-commitment secret for revocation
Secret ReleasePerCommitmentSecret(ChannelId channelId, ulong commitmentNumber)
Parameters
Returns
ReleasePerCommitmentSecret(uint, ulong)
Release (reveal) a per-commitment secret for revocation
Secret ReleasePerCommitmentSecret(uint channelKeyIndex, ulong commitmentNumber)
Parameters
Returns
SignTransaction(ChannelId, SignedTransaction)
Sign a transaction using the channel's signing context
CompactSignature SignTransaction(ChannelId channelId, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdunsignedTransactionSignedTransaction
Returns
ValidateSignature(ChannelId, CompactSignature, SignedTransaction)
Verify a signature against a transaction
void ValidateSignature(ChannelId channelId, CompactSignature signature, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdsignatureCompactSignatureunsignedTransactionSignedTransaction