Class KeyDerivationService
- Namespace
- NLightning.Bolts.BOLT3.Services
- Assembly
- NLightning.Bolts.dll
public class KeyDerivationService
- Inheritance
-
KeyDerivationService
- Inherited Members
Methods
DerivePrivateKey(Key, PubKey)
Derives a private key using the formula: basepoint_secret + SHA256(per_commitment_point || basepoint)
public Key DerivePrivateKey(Key basepointSecret, PubKey perCommitmentPoint)
Parameters
basepointSecret
KeyperCommitmentPoint
PubKey
Returns
- Key
DerivePublicKey(PubKey, PubKey)
Derives a public key using the formula: basepoint + SHA256(per_commitment_point || basepoint) * G
public PubKey DerivePublicKey(PubKey basepoint, PubKey perCommitmentPoint)
Parameters
basepoint
PubKeyperCommitmentPoint
PubKey
Returns
- PubKey
DeriveRevocationPrivKey(Key, Key)
Derives the revocation private key when both secrets are known
public Key DeriveRevocationPrivKey(Key revocationBasepointSecret, Key perCommitmentSecret)
Parameters
revocationBasepointSecret
KeyperCommitmentSecret
Key
Returns
- Key
DeriveRevocationPubKey(PubKey, PubKey)
Derives the revocation public key
public PubKey DeriveRevocationPubKey(PubKey revocationBasepoint, PubKey perCommitmentPoint)
Parameters
revocationBasepoint
PubKeyperCommitmentPoint
PubKey
Returns
- PubKey
GeneratePerCommitmentSecret(byte[], ulong)
Generates per-commitment secret from seed and index
public static byte[] GeneratePerCommitmentSecret(byte[] seed, ulong index)
Parameters
Returns
- byte[]