Class KeyDerivationService
- Namespace
- NLightning.Infrastructure.Bitcoin.Services
- Assembly
- NLightning.Infrastructure.Bitcoin.dll
public class KeyDerivationService : IKeyDerivationService
- Inheritance
-
KeyDerivationService
- Implements
- Inherited Members
Methods
DerivePrivateKey(PrivKey, CompactPubKey)
Derives a private key using the formula: basepoint_secret + SHA256(per_commitment_point || basepoint)
public PrivKey DerivePrivateKey(PrivKey basepointSecretPriv, CompactPubKey compactPerCommitmentPoint)
Parameters
basepointSecretPriv
PrivKeycompactPerCommitmentPoint
CompactPubKey
Returns
DerivePublicKey(CompactPubKey, CompactPubKey)
Derives a public key using the formula: basepoint + SHA256(per_commitment_point || basepoint) * G
public CompactPubKey DerivePublicKey(CompactPubKey compactBasepoint, CompactPubKey compactPerCommitmentPoint)
Parameters
compactBasepoint
CompactPubKeycompactPerCommitmentPoint
CompactPubKey
Returns
DeriveRevocationPrivKey(PrivKey, PrivKey)
Derives the revocation private key when both secrets are known
public PrivKey DeriveRevocationPrivKey(PrivKey revocationBasepointSecretPriv, PrivKey perCommitmentSecretPriv)
Parameters
Returns
DeriveRevocationPubKey(CompactPubKey, CompactPubKey)
Derives the revocation public key
public CompactPubKey DeriveRevocationPubKey(CompactPubKey compactRevocationBasepoint, CompactPubKey compactPerCommitmentPoint)
Parameters
compactRevocationBasepoint
CompactPubKeycompactPerCommitmentPoint
CompactPubKey
Returns
GeneratePerCommitmentSecret(Secret, ulong)
Generates per-commitment secret from seed and index
public Secret GeneratePerCommitmentSecret(Secret seed, ulong index)