AccountEd25519Signature class
Ed25519 signature for Soroban authorization entries.
This class encapsulates a cryptographic signature used to prove authorization in Soroban transactions. Each signature consists of:
- Public key: The Ed25519 public key that signed the data
- Signature bytes: The 64-byte Ed25519 signature
Signatures are automatically generated when signing authorization entries via SorobanAuthorizationEntry.sign(). The signature format conforms to Stellar's Ed25519 signature scheme.
The signature is serialized to XdrSCVal as a map with two entries:
- "public_key": The 32-byte public key
- "signature": The 64-byte signature
Fields:
- publicKey The Ed25519 public key in XDR format
- signatureBytes The 64-byte signature
Example - Usage in authorization:
// Create authorization entry
final authEntry = simulation.getSorobanAuth()![0];
// Sign with keypair (signature created automatically)
authEntry.sign(signerKeyPair, network);
// The signature is embedded in the auth entry credentials
final credentials = authEntry.credentials.innerAddressCredentials;
print('Signature embedded in auth entry');
Example - Manual signature construction (advanced):
// Typically not needed - use authEntry.sign() instead
final publicKey = signerKeyPair.xdrPublicKey;
final signatureBytes = signerKeyPair.sign(payload);
final signature = AccountEd25519Signature(publicKey, signatureBytes);
final scVal = signature.toXdrSCVal();
See also:
- SorobanAuthorizationEntry.sign for signing auth entries
- KeyPair.sign for creating signatures
Constructors
- AccountEd25519Signature(XdrPublicKey publicKey, Uint8List signatureBytes)
- Creates an AccountEd25519Signature.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- publicKey ↔ XdrPublicKey
-
The Ed25519 public key that created this signature.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signatureBytes ↔ Uint8List
-
The 64-byte Ed25519 signature bytes.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toXdrSCVal(
) → XdrSCVal - Converts this signature to XdrSCVal format for Soroban.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited