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
fundingOutputBuilderIFundingOutputBuilderkeyDerivationServiceIKeyDerivationServiceloggerILogger<LocalLightningSigner>nodeOptionsNodeOptionssecureKeyManagerISecureKeyManager
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
basepointsChannelBasepointsfirstPerCommitmentPointCompactPubKey
Returns
GenerateFundingPrivateKey(uint)
protected virtual Key GenerateFundingPrivateKey(uint channelKeyIndex)
Parameters
channelKeyIndexuint
Returns
- Key
GetChannelBasepoints(ChannelId)
Generate or retrieve channel basepoints for a channel
public ChannelBasepoints GetChannelBasepoints(ChannelId channelId)
Parameters
channelIdChannelId
Returns
GetChannelBasepoints(uint)
Generate or retrieve channel basepoints for a channel
public ChannelBasepoints GetChannelBasepoints(uint channelKeyIndex)
Parameters
channelKeyIndexuint
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
channelIdChannelIdsigningInfoChannelSigningInfo
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
channelIdChannelIdunsignedTransactionSignedTransaction
Returns
ValidateSignature(ChannelId, CompactSignature, SignedTransaction)
Verify a signature against a transaction
public void ValidateSignature(ChannelId channelId, CompactSignature signature, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdsignatureCompactSignatureunsignedTransactionSignedTransaction