Ed25519PrivateKey class

Represents the private key of an Ed25519 key pair.

Inheritance
Implemented types

Constructors

Ed25519PrivateKey(HexInput hexInput, [bool? strict])
Create a new PrivateKey instance from a Uint8List or String.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bcsToBytes() → Uint8List
Serializes a Serializable value to its BCS representation. This function is the Dart SDK equivalent of bcs::to_bytes in Move.
inherited
bcsToHex() → Hex
Converts the BCS-serialized bytes of a value into a Hex instance.
inherited
clear() → void
Overwrites the underlying private-key byte buffer with random bytes and then zeros. After calling this method the key can no longer sign or derive a public key.
isCleared() → bool
Returns whether the private key has been cleared from memory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publicKey() → Ed25519PublicKey
Derive the Ed25519PublicKey for this private key.
override
serialize(Serializer serializer) → void
override
sign(HexInput message) → Ed25519Signature
Sign the given message with the private key.
override
signBytes(Uint8List message) → Ed25519Signature
Sign exactly the bytes of message. The input is interpreted as raw bytes regardless of what they encode. Pair with Ed25519PublicKey.verifyBytes.
signText(String message) → Ed25519Signature
Sign the UTF-8 encoding of message. The input is always treated as text — there is no hex/text heuristic. Pair with Ed25519PublicKey.verifyText.
toAIP80String() → String
Get the private key as an AIP-80 compliant hex string.
toHexString() → String
Get the private key as a hex string with the 0x prefix.
toString() → String
Get the private key as an AIP-80 compliant hex string.
override
toStringWithoutPrefix() → String
Returns the hex string representation of the value without the 0x prefix.
inherited
toUint8Array() → Uint8List
Get the private key in bytes.
override

Operators

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

Static Methods

deserialize(Deserializer deserializer) → Ed25519PrivateKey
fromDerivationPath(String path, String mnemonics) → Ed25519PrivateKey
Derives a private key from a mnemonic seed phrase using a specified BIP44 path. To derive multiple keys from the same phrase, change the path.
fromDerivationPathInner(String path, Uint8List seed, {int offset = hardenedOffset}) → Ed25519PrivateKey
Derives a child private key from a given BIP44 path and seed.
generate() → Ed25519PrivateKey
Generate a new random private key.

Constants

length → const int
Length of an Ed25519 private key.
slip0010Seed → const String
The Ed25519 key seed to use for BIP-32 compatibility. See more https://github.com/satoshilabs/slips/blob/master/slip-0010.md