DotNetLightning


ISecp256k1 Type

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

Instance members

Instance member Description

this.PrivateKeyTweakAdd

Full Usage: this.PrivateKeyTweakAdd

Parameters:
Returns: bool
Modifiers: abstract

Add a tweak (32 bytes) to a private key. Causes a mutation to privateKeyToMutate.

tweak : ReadOnlySpan<byte>
privateKeyToMutate : Span<byte>
Returns: bool

this.PrivateKeyTweakMultiply

Full Usage: this.PrivateKeyTweakMultiply

Parameters:
Returns: bool
Modifiers: abstract

Assume tweak (32 bytes) as a scalar and add G (basepoint) for tweak times. Causes a mutation to privateKeyToMutate

tweak : ReadOnlySpan<byte>
privKeyToMutate : Span<byte>
Returns: bool

this.PublicKeyCombine

Full Usage: this.PublicKeyCombine

Parameters:
    inputPubKey1 : Span<byte>
    inputPubKey2 : Span<byte>

Returns: bool * byte array
Modifiers: abstract

Combine 2 public keys. Input can be either 33 bytes or 64 bytes. So normalization by PublicKeyParse is required.

inputPubKey1 : Span<byte>
inputPubKey2 : Span<byte>
Returns: bool * byte array

this.PublicKeyCreate

Full Usage: this.PublicKeyCreate

Parameters:
Returns: bool * byte array
Modifiers: abstract

Create uncompressed public key(64 bytes) from private key (32 bytes)

privateKeyInput : ReadOnlySpan<byte>
Returns: bool * byte array

this.PublicKeyParse

Full Usage: this.PublicKeyParse

Parameters:
Returns: bool * byte array
Modifiers: abstract

Convert compressed pubkey (33 bytes) to secp256k1 compatible style (64 bytes).

serializedPublicKey : ReadOnlySpan<byte>
Returns: bool * byte array

this.PublicKeySerializeCompressed

Full Usage: this.PublicKeySerializeCompressed

Parameters:
Returns: bool * byte array
Modifiers: abstract

Convert secp256k1 compatible style pubkey (64 bytes) into compressed form (33 bytes)

publicKey : ReadOnlySpan<byte>
Returns: bool * byte array

this.PublicKeyTweakMultiply

Full Usage: this.PublicKeyTweakMultiply

Parameters:
Returns: bool
Modifiers: abstract

Add a public key (64 bytes) to itself for tweak times. Causes a mutation to pubKeyToMutate

tweak : ReadOnlySpan<byte>
pubKeyToMutate : Span<byte>
Returns: bool