@tevm/voltaire / crypto/Ed25519
crypto/Ed25519
Classes
Ed25519Error
Defined in: src/crypto/Ed25519/errors.js:21 Base error class for Ed25519 operationsExample
Extends
Extended by
Constructors
Constructor
new Ed25519Error(Defined in: src/crypto/Ed25519/errors.js:26message,options?):Ed25519Error
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
Ed25519Error
Overrides
CryptoError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
CryptoError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
CryptoError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
CryptoError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
CryptoError.docsPath
name
name: string
Defined in: src/crypto/Ed25519/errors.js:33
Inherited from
CryptoError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
CryptoError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
CryptoError.toJSON
InvalidPublicKeyError
Defined in: src/crypto/Ed25519/errors.js:77 Error thrown when public key is invalidExample
Extends
Constructors
Constructor
new InvalidPublicKeyError(Defined in: src/crypto/Ed25519/errors.js:82message,options?):InvalidPublicKeyError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
InvalidPublicKeyError
Overrides
InvalidPublicKeyError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidPublicKeyError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidPublicKeyError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidPublicKeyError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidPublicKeyError.docsPath
name
name: string
Defined in: src/crypto/Ed25519/errors.js:89
Inherited from
BaseInvalidPublicKeyError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidPublicKeyError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidPublicKeyError.toJSON
InvalidSecretKeyError
Defined in: src/crypto/Ed25519/errors.js:105 Error thrown when secret key is invalidExample
Extends
Constructors
Constructor
new InvalidSecretKeyError(Defined in: src/crypto/Ed25519/errors.js:110message,options?):InvalidSecretKeyError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
InvalidSecretKeyError
Overrides
InvalidPrivateKeyError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidPrivateKeyError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidPrivateKeyError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidPrivateKeyError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidPrivateKeyError.docsPath
name
name: string
Defined in: src/crypto/Ed25519/errors.js:117
Inherited from
InvalidPrivateKeyError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidPrivateKeyError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidPrivateKeyError.toJSON
InvalidSeedError
Defined in: src/crypto/Ed25519/errors.js:133 Error thrown when seed is invalidExample
Extends
Constructors
Constructor
new InvalidSeedError(Defined in: src/crypto/Ed25519/errors.js:138message,options?):InvalidSeedError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
InvalidSeedError
Overrides
Ed25519Error.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
Ed25519Error.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
Ed25519Error.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
Ed25519Error.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
Ed25519Error.docsPath
name
name: string
Defined in: src/crypto/Ed25519/errors.js:145
Inherited from
Ed25519Error.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
Ed25519Error.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
Ed25519Error.toJSON
InvalidSignatureError
Defined in: src/crypto/Ed25519/errors.js:49 Error thrown when signature is invalidExample
Extends
Constructors
Constructor
new InvalidSignatureError(Defined in: src/crypto/Ed25519/errors.js:54message,options?):InvalidSignatureError
Parameters
message
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
Returns
InvalidSignatureError
Overrides
InvalidSignatureError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidSignatureError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidSignatureError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidSignatureError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidSignatureError.docsPath
name
name: string
Defined in: src/crypto/Ed25519/errors.js:61
Inherited from
BaseInvalidSignatureError.name
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidSignatureError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidSignatureError.toJSON
Variables
Ed25519
Defined in: src/crypto/Ed25519/Ed25519.js:54 Ed25519 Digital Signature Algorithm Edwards-curve Digital Signature Algorithm (EdDSA) using Curve25519. Fast, secure, and deterministic signatures without requiring a hash function. Used in many modern protocols including SSH, TLS 1.3, and cryptocurrency.constEd25519:object
Type Declaration
derivePublicKey()
derivePublicKey: (Derive Ed25519 public key from secret key.secretKey) =>PublicKey
Parameters
secretKey
SecretKey
32-byte Ed25519 secret key (seed)
Returns
PublicKey
32-byte Ed25519 public key
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If secret key length is invalid or derivation failsExample
keypairFromSeed()
keypairFromSeed: (Generate Ed25519 keypair from seed deterministically.seed) =>object
Parameters
seed
Seed
32-byte seed for deterministic keypair generation
Returns
object
Object containing 32-byte secretKey and 32-byte publicKey
publicKey
publicKey: PublicKey
secretKey
secretKey: SecretKey
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If seed length is not 32 bytesThrows
If keypair generation failsExample
PUBLIC_KEY_SIZE
PUBLIC_KEY_SIZE: 32
Ed25519 public key size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
SECRET_KEY_SIZE
SECRET_KEY_SIZE: 32
Ed25519 secret key size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
SEED_SIZE
SEED_SIZE: 32
Ed25519 seed size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
sign()
sign: (Sign message with Ed25519 secret key. Produces deterministic signatures using EdDSA.message,secretKey) =>Signature
Parameters
message
Uint8Array<ArrayBufferLike>
Message bytes to sign (any length)
secretKey
SecretKey
32-byte Ed25519 secret key
Returns
Signature
64-byte Ed25519 signature
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If secret key length is not 32 bytesThrows
If signing operation failsExample
SIGNATURE_SIZE
SIGNATURE_SIZE: 64
Ed25519 signature size in bytes.
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
validatePublicKey()
validatePublicKey: (Validate Ed25519 public key format and curve membership.publicKey) =>boolean
Parameters
publicKey
PublicKey
Ed25519 public key to validate
Returns
boolean
True if public key is valid and on curve, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
validateSecretKey()
validateSecretKey: (Validate Ed25519 secret key format. Checks length and attempts public key derivation.secretKey) =>boolean
Parameters
secretKey
SecretKey
Ed25519 secret key to validate
Returns
boolean
True if secret key is valid (32 bytes and can derive public key), false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
validateSeed()
validateSeed: (Validate Ed25519 seed format. Checks if seed has correct 32-byte length.seed) =>boolean
Parameters
seed
Seed
Ed25519 seed to validate
Returns
boolean
True if seed is exactly 32 bytes, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
verify()
verify: (Verify Ed25519 signature. Returns false on verification failure instead of throwing.signature,message,publicKey) =>boolean
Parameters
signature
Signature
64-byte Ed25519 signature to verify
message
Uint8Array<ArrayBufferLike>
Original message bytes that were signed
publicKey
PublicKey
32-byte Ed25519 public key
Returns
boolean
True if signature is cryptographically valid, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If public key length is not 32 bytesThrows
If signature length is not 64 bytesExample
Example
PUBLIC_KEY_SIZE
Defined in: src/crypto/Ed25519/constants.js:27 Ed25519 public key size in bytes.constPUBLIC_KEY_SIZE:32=32
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
SECRET_KEY_SIZE
Defined in: src/crypto/Ed25519/constants.js:13 Ed25519 secret key size in bytes.constSECRET_KEY_SIZE:32=32
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
SEED_SIZE
Defined in: src/crypto/Ed25519/constants.js:55 Ed25519 seed size in bytes.constSEED_SIZE:32=32
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
SIGNATURE_SIZE
Defined in: src/crypto/Ed25519/constants.js:41 Ed25519 signature size in bytes.constSIGNATURE_SIZE:64=64
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Example
Functions
derivePublicKey()
derivePublicKey(Defined in: src/crypto/Ed25519/derivePublicKey.js:20 Derive Ed25519 public key from secret key.secretKey):PublicKey
Parameters
secretKey
SecretKey
32-byte Ed25519 secret key (seed)
Returns
PublicKey
32-byte Ed25519 public key
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If secret key length is invalid or derivation failsExample
keypairFromSeed()
keypairFromSeed(Defined in: src/crypto/Ed25519/keypairFromSeed.js:22 Generate Ed25519 keypair from seed deterministically.seed):object
Parameters
seed
Seed
32-byte seed for deterministic keypair generation
Returns
object
Object containing 32-byte secretKey and 32-byte publicKey
publicKey
publicKey: PublicKey
secretKey
secretKey: SecretKey
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If seed length is not 32 bytesThrows
If keypair generation failsExample
sign()
sign(Defined in: src/crypto/Ed25519/sign.js:24 Sign message with Ed25519 secret key. Produces deterministic signatures using EdDSA.message,secretKey):Signature
Parameters
message
Uint8Array<ArrayBufferLike>
Message bytes to sign (any length)
secretKey
SecretKey
32-byte Ed25519 secret key
Returns
Signature
64-byte Ed25519 signature
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
If secret key length is not 32 bytesThrows
If signing operation failsExample
validatePublicKey()
validatePublicKey(Defined in: src/crypto/Ed25519/validatePublicKey.js:19 Validate Ed25519 public key format and curve membership.publicKey):boolean
Parameters
publicKey
PublicKey
Ed25519 public key to validate
Returns
boolean
True if public key is valid and on curve, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
validateSecretKey()
validateSecretKey(Defined in: src/crypto/Ed25519/validateSecretKey.js:21 Validate Ed25519 secret key format. Checks length and attempts public key derivation.secretKey):boolean
Parameters
secretKey
SecretKey
Ed25519 secret key to validate
Returns
boolean
True if secret key is valid (32 bytes and can derive public key), false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
validateSeed()
validateSeed(Defined in: src/crypto/Ed25519/validateSeed.js:20 Validate Ed25519 seed format. Checks if seed has correct 32-byte length.seed):boolean
Parameters
seed
Seed
Ed25519 seed to validate
Returns
boolean
True if seed is exactly 32 bytes, false otherwise
See
https://voltaire.tevm.sh/crypto for crypto documentationSince
0.0.0Throws
Example
verify()
verify(Defined in: src/crypto/Ed25519/verify.js:25 Verify Ed25519 signature. Returns false on verification failure instead of throwing.signature,message,publicKey):boolean
Parameters
signature
Signature
64-byte Ed25519 signature to verify
message
Uint8Array<ArrayBufferLike>
Original message bytes that were signed
publicKey
PublicKey
32-byte Ed25519 public key
Returns
boolean
True if signature is cryptographically valid, false otherwise

