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, IUtxoMemoryRepository)
public LocalLightningSigner(IFundingOutputBuilder fundingOutputBuilder, IKeyDerivationService keyDerivationService, ILogger<LocalLightningSigner> logger, NodeOptions nodeOptions, ISecureKeyManager secureKeyManager, IUtxoMemoryRepository utxoMemoryRepository)
Parameters
fundingOutputBuilderIFundingOutputBuilderkeyDerivationServiceIKeyDerivationServiceloggerILogger<LocalLightningSigner>nodeOptionsNodeOptionssecureKeyManagerISecureKeyManagerutxoMemoryRepositoryIUtxoMemoryRepository
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
SignChannelTransaction(ChannelId, SignedTransaction)
Sign a transaction using the channel's signing context
public CompactSignature SignChannelTransaction(ChannelId channelId, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdunsignedTransactionSignedTransaction
Returns
SignFundingTransaction(ChannelId, SignedTransaction)
Sign a funding transaction using the wallet signing context and validating using the channel context
public bool SignFundingTransaction(ChannelId channelId, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdunsignedTransactionSignedTransaction
Returns
SignWalletTransaction(SignedTransaction)
Sign a general transaction using the wallet signing context
public bool SignWalletTransaction(SignedTransaction unsignedTransaction)
Parameters
unsignedTransactionSignedTransaction
Returns
ValidateSignature(ChannelId, CompactSignature, SignedTransaction)
Verify a signature against a transaction
public void ValidateSignature(ChannelId channelId, CompactSignature signature, SignedTransaction unsignedTransaction)
Parameters
channelIdChannelIdsignatureCompactSignatureunsignedTransactionSignedTransaction