EdDSA and Ed25519: the modern signing choice
EdDSA is the JOSE name for signatures built on twisted Edwards curves. In practice it means Ed25519, standardised in RFC 8032 and profiled for JOSE in RFC 8037. A private key is 32 bytes, a public key is 32 bytes, and a signature is 64 bytes, at a security level comparable to P-256. For a token that travels in headers and cookies, that compactness is attractive.
The design avoids several sharp edges of ECDSA. Signing is deterministic: the nonce is derived from the private key and the message hash, so a weak random generator cannot leak the key through repeated nonces. Verification rejects non-canonical encodings, which removes a class of malleability bugs. The API surface is also smaller: no hash parameter, because the hash is part of the curve definition.
The key in JWK form
An Ed25519 public JWK has kty equal to OKP, crv equal to Ed25519, and x equal to the base64url encoding of the 32-byte public key. That is all. There is no y coordinate, because the key is compressed to a single value. A private JWK adds d, the 32-byte seed, which must never be published.
In PEM, an Ed25519 public key is a SubjectPublicKeyInfo with an algorithm OID of 1.3.101.112 and a 32-byte BIT STRING. Some tools label it simply PUBLIC KEY; older tools may not recognise the algorithm at all. Web Crypto imports either an OKP JWK or a DER SubjectPublicKeyInfo and verifies with the algorithm name Ed25519.
| Property | Ed25519 | ES256 | RS256 |
|---|---|---|---|
| Public key | 32 bytes | 64 bytes uncompressed | 256+ bytes |
| Signature | 64 bytes | 64 bytes | 256 bytes for 2048-bit |
| Hash | SHA-512 inside the curve | SHA-256 parameter | SHA-256 parameter |
| Deterministic signing | Yes | No, unless RFC 6979 | Yes (PKCS#1 v1.5) |
Signing and verifying
The signer hashes the message with SHA-512 as part of the Ed25519 procedure, derives a scalar from the private key and that hash, computes a curve point, and combines it with the key and message to produce R || S, 64 bytes in total. The verifier recomputes the same combination from the public key and the message and accepts if the two match. There is no separate digest to compare and no padding choice to get wrong.
For a JWT the message is still the exact ASCII text of header.payload. The header says "alg":"EdDSA" and usually carries a kid. A verifier should check that the key's crv is one it accepts — Ed25519 in almost every deployment — and reject Ed448 unless it was explicitly configured.
Where support is still uneven
Ed25519 is in modern browsers, OpenSSL 1.1.1 and later, and most current language runtimes, but older JWT libraries and some managed identity providers still do not issue or accept EdDSA. That matters for interoperability: a token signed with EdDSA cannot be verified by a service that only knows RS256. If you control both ends, Ed25519 is a good default. If you do not, check the verifier matrix before committing.
A second interoperability trap is key serialisation. Some libraries accept only raw 32-byte keys, some only PEM, some only JWK. The same public key can look different in each, and an import error is often mistaken for a signature failure. Convert deliberately and test the conversion once, in a unit test with a known key pair.
Choosing Ed25519
Prefer Ed25519 for new systems that control both issuer and verifier, especially where tokens are small and numerous, or where signing happens on constrained devices. Keep RS256 support if third parties must verify and their libraries are older. Keep ES256 if a platform has P-256 support but not Ed25519. Document the accepted algorithms in one place, and reject everything else by default.
One operational note: Ed25519 keys are short, so it is tempting to paste them into configuration files and chat messages. Treat the private seed like any other signing key: a secret manager, restricted access, rotation with an overlap, and an audit trail of use. The small size makes it easier to handle, not safer to expose.
EdDSA removes the nonce and padding decisions, but it does not remove the need to choose a trusted key. Verification still begins with a key you already trust.
Sources
- RFC 8037 — JOSE and CFRG curves (EdDSA)
- RFC 8032 — Edwards-Curve Digital Signature Algorithm
- RFC 7518 §3.1 — Algorithm names
Questions
Is EdDSA an algorithm or a family?
A family. In JOSE, the alg value EdDSA covers Ed25519 and Ed448, with Ed25519 by far the more common. The key's crv parameter says which curve is in use. The hash is fixed by the curve and is not a separate parameter, unlike ECDSA.
Why does importing an Ed25519 JWK fail with a curve error?
The JWK must have kty OKP, crv Ed25519, and x as the 32-byte public key. Supplying kty EC or a namedCurve of P-256 is a common mistake. Some older libraries and runtimes do not support Ed25519 at all, which shows up as an unsupported algorithm rather than a key error.
Are Ed25519 signatures deterministic?
Yes. Ed25519 derives its nonce from the private key and the message, so signing the same message twice with the same key produces the same signature. That removes the catastrophic nonce-reuse failure mode of ECDSA, and it means a signature test can compare exact bytes.
Sign an EdDSA sample in the browser and verify it with the exported OKP public key.
Open the verifierWritten against the JOSE specifications (RFC 7515–7519), RFC 7636 and RFC 8037; every example can be reproduced in the verifier linked above.
Back to the guides