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