Helios API/ API Reference/ Namespaces/

Ed25519

The elliptic curve signature algorithm used by Cardano wallets.

Ported from: https://ed25519.cr.yp.to/python/ed25519.py.

ExtendedPoint implementation taken from: https://github.com/paulmillr/noble-ed25519.

Index

Functions

deriveBip32PublicKey

deriveBip32PublicKey(extendedKey): number[]

Similar to Ed25519.derivePublicKey, but doesn't hash the input key.

Parameters

NameType
extendedKeynumber[]

Returns

number[]

32 byte public key.

derivePublicKey

derivePublicKey(privateKey): number[]

Derive a public key from a private key. The private key can be any number of bytes (it's hashed internally). The returned public key is 32 bytes long.

Parameters

NameType
privateKeynumber[]

Returns

number[]

32 byte public key.

sign

sign(message, privateKey): number[]

Creates a 64 byte signature.

Parameters

NameType
messagenumber[]
privateKeynumber[]

Returns

number[]

64 byte signature.

signBip32

signBip32(message, extendedKey): number[]

Like Ed25519.sign, but doesn't hash the input key.

Parameters

NameType
messagenumber[]
extendedKeynumber[]

Returns

number[]

64 byte signature.

verify

verify(signature, message, publicKey): boolean

Returns true if the signature is correct.

Parameters

NameType
signaturenumber[]
messagenumber[]
publicKeynumber[]

Returns

boolean