ECPair class
Stores a keypair and provides various methods and factories for creating it and working with it
Constructors
- ECPair(Uint8List _d, Uint8List _Q, { dynamic network, bool compressed: true })
-
Default constructor. If
network
is not provided, it will assume Bitcoin Cash mainnet - ECPair.fromPrivateKey(Uint8List privateKey, { Network network, bool compressed })
-
Creates a keypair from
privateKey
factory - ECPair.fromPublicKey(Uint8List publicKey, { Network network, bool compressed })
-
Creates a keypair from [publicKey. The returned keypair will contain
null
private keyfactory - ECPair.fromWIF(String wifPrivateKey, { Network network })
-
Creates a keypair from the private key provided in WIF format
factory
- ECPair.makeRandom({Network network, bool compressed, Function rng })
-
Creates a random keypair
factory
Properties
- address → String
-
read-only
- compressed → bool
-
final
- network → Network
-
final
- privateKey → Uint8List
-
read-only
- publicKey → Uint8List
-
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
sign(
Uint8List hash) → Uint8List -
Signs the provided
hash
with the private key -
toWIF(
) → String - Returns the private key in WIF format
-
verify(
Uint8List hash, Uint8List signature) → bool -
Verifies whether the provided
signature
matches thehash
using the keypair's publicKey -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited