DotNetLightning


DotNetLightning.Crypto Namespace

"DotNetLightning.Crypto" contains a cryptographic utilities to work with LN. e.g. 1. Extension methods for key types to tweak/multiply e.g. NBitcoin.Key.Mul 2. Aezeed CipherSeed for managing node master key in seed phrase with its birthday encoded. (useful when rescanning the blockchain) This is a port of the aezeed in lnd. 3. Sphinx packet decoding/encoding described in bolt04 4. PerCommitmentSecretStore to hold "per_commitment_secret" in an efficient way.

Type/Module Description

AezeedError

BouncyCastle

CipherSeed

CipherSeed is a fully decoded instance of the aezeed scheme. You can convert from/to NBitcoin.Mnemonic by CipherSeed.ToMnemonic Mnemonic.ToCipherSeed Aezeed in lnd

CryptoError

An error on cryptography layer. If this happens, normally you should close the connection against the peer. Since it is clear protocol violation.

CryptoUtils

D

ICryptoImpl

InsertPerCommitmentSecretError

ISecp256k1

An interface responsible for set of low-level cryptographic operation. We need this because there are several types of secp256k1 implementation * 1. NBitcoinSecp256k1 * The one we usually want to use. Which depends on NBitcoin's implementation * 2. BouncySecp256k1 * Fallback when we are compiling with netstandard2.0, since NBitcoin.Secp256k1 does not support older netstandard version. * This will be obsolete when we drop the support for netstandard2.1

KeyExtensions

MnemonicExtensions

NBitcoinArithmethicExtensions

Node

O

PerCommitmentSecretStore

Secret

ShaChain (Module)

ShaChain (Type)

Sphinx

Module to work with sphinx encryption. Which is used in lightning network p2p onion routing. see bolt04 for more detail.

Usually you want to use high-level wrapper in DotNetLightning.Peer for e.g. 3-way handshake and establishing the connection.