ECPrivateKey class

Represents an ECC private key for use with the secp256k1 curve

Constructors

ECPrivateKey.new(Uint8List data, {bool compressed = true})
Constructs a private key from a 32-byte scalar. The public key may be in the compressed format which is the default. InvalidPrivateKey will be thrown if the private key is not within the secp256k1 order.
ECPrivateKey.fromHex(String hex, {bool compressed = true})
Constructs a private key from HEX encoded data. The public key may be in the compressed format which is the default.
ECPrivateKey.generate({bool compressed = true})
Generates a private key using a CSPRING.

Properties

compressed bool
True if the derived public key should be in compressed format
final
data Uint8List
no setter
hashCode int
The hash code for this object.
no setterinherited
pubkey ECPublicKey
The public key associated with this private key
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
xonly ECPrivateKey
Get the private key where the public key always has an even Y-coordinate for any X-coordinate. This is used for Schnorr signatures.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tweak(Uint8List scalar) ECPrivateKey?
Tweaks the private key with a scalar. In the instance a new key cannot be created (practically impossible for random 32-bit scalars), then null will be returned.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

privateKeyLength → const int