ECPublicKey class
Represents an ECC public key on the secp256k1 curve that has an associated private key
- Implementers
Constructors
- ECPublicKey.new(Uint8List data)
- Constructs a public key from a 33-byte compressed or 65-byte uncompressed representation. InvalidPublicKey will be thrown if the public key is invalid or in the wrong format.
- ECPublicKey.fromHex(String hex)
- Constructs a public key from HEX encoded data that must represent a 33-byte compressed key, or 65-byte uncompressed key
- ECPublicKey.fromXOnly(Uint8List xcoord)
- Constructs a public key from a 32-byte X coordinate where the Y coordinate is made even.
- ECPublicKey.fromXOnlyHex(String hex)
Properties
- compressed → bool
-
no setter
- data → Uint8List
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hex → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → Uint8List
-
Obtains the X coordinate of the public key which is used for Schnorr
signatures. Schnorr signatures force an even Y coordinate. Public and
private keys are converted to use even Y coordinates as necessary allowing
any existing keys to work.
no setter
- xonly → ECPublicKey
-
Obtains a new key that uses the same X coordinate but uses an even Y
coordinate.
no setter
- yIsEven → bool
-
True if the Y-coordinate is even as required for Schnorr signatures. If
the Y-coorindate is not even, then the odd equivilent can be obtained via
xonly.
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) → ECPublicKey? - Tweaks the public key with a scalar multiplied by the generator point. 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.
override