On GitHub, paulmillr/noble-ed25519 has picked up 514 stars, Security, TypeScript. Fastest 5KB JS implementation of ed25519 signatures
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Fastest 5KB JS implementation of ed25519 signatures.
✍️ EDDSA signatures compliant with
RFC8032, FIPS 186-5
🪢 Consensus-friendly, compliant with ZIP215
🔖 SUF-CMA (strong unforgeability under chosen message attacks) and
SBS (non-repudiation / exclusive ownership)
🪶 3.9KB (gzipped)
The module is a sister project of noble-curves.
Use noble-ed25519 if you need smaller attack surface & better auditability.
Switch to noble-curves (drop-in) if you need features like ristretto255, x25519 / curve25519, ed25519ph, hash-to-curve, oprf.
This library belongs to noble cryptography
noble-cryptography — high-security, easily auditable set of contained cryptographic libraries and tools.
Zero or minimal dependencies
Highly readable TypeScript / JS code
PGP-signed releases and transparent NPM builds
All libraries:
ciphers,
curves,
hashes,
post-quantum,
5kb secp256k1 /
ed25519
WASM version: awasm-noble
Check out the homepage
for reading resources, documentation, and apps built with noble
Usage
npm install @noble/ed25519
deno add jsr:@noble/ed25519
We support all major platforms and runtimes. For React Native, additional polyfills are needed: see below.
Only async methods are available by default, to keep the library dependency-free.
To enable sync methods:
npm install @noble/hashes
import * as ed from '@noble/ed25519';
import { sha512 } from '@noble/hashes/sha2.js';
ed.hashes.sha512 = sha512;
// Sync methods can be used now:
const { secretKey, publicKey } = ed.keygen();
const msg = new TextEncoder().encode('hello noble');
// const publicKey = ed.getPublicKey(secretKey);
const sig = ed.sign(msg, secretKey);
const isValid = ed.verify(sig, msg, publicKey);
React Native: polyfill getRandomValues and sha512
React Native does not provide secure getRandomValues by default.
This can't be securely polyfilled from our end, so one will need a RN-specific compile-time dep.
import 'react-native-get-random-values';
import * as ed from '@noble/ed25519';
import { sha512 } from '@noble/hashes/sha2.js';
ed.hashes.sha512 = sha512;
ed.hashes.sha512Async = (m: Uint8Array) => Promise.resolve(sha512(m));
API
There are 4 main methods, which accept Uint8Array-s:
keygen() and keygenAsync()
getPublicKey(secretKey) and getPublicKeyAsync(secretKey)
sign(message, secretKey) and signAsync(message, secretKey)
verify(signature, message, publicKey) and verifyAsync(signature, message, publicKey)
keygen
import * as ed from '@noble/ed25519';
import { sha512 } from '@noble/hashes/sha2.js';
ed.hashes.sha512 = sha512;
(async () => {
const keys = ed.keygen();
const { secretKey, publicKey } = keys;
const keysA = await ed.keygenAsync();
})();
Verifies EdDSA signature. Has SUF-CMA (strong unforgeability under chosen message attacks).
By default, follows ZIP215 1 and can be used in consensus-critical apps 2.
zip215: false option switches verification criteria to strict
RFC8032 / FIPS 186-5 and provides non-repudiation with SBS (Strongly Binding Signatures) 3.
[!NOTE]
Most other libraries don't have SUF-CMA & SBS - less optimal choice for their security.
[!NOTE]
Any message with pubkey from ED25519_TORSION_SUBGROUP would be valid in sigs under ZIP215.
We cross-test against sister project noble-curves, which was audited and provides improved security.
The current version has not been independently audited. It is a rewrite of v1, which has been audited by cure53 in Feb 2022:
PDF.
It's being fuzzed in a separate repository
If you see anything unusual: investigate and report.
Constant-timeness
We're targetting algorithmic constant time. JIT-compiler and Garbage Collector make "constant time"
extremely hard to achieve timing attack resistance
in a scripting language. Which means any other JS library can't have
constant-timeness. Even statically typed Rust, a language without GC,
makes it harder to achieve constant-time
for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones.
Use low-level libraries & languages.
Supply chain security
Commits are signed with PGP keys to prevent forgery. Be sure to verify the commit signatures
Releases are made transparently through token-less GitHub CI and Trusted Publishing. Be sure to verify the provenance logs for authenticity.
Rare releasing is practiced to minimize the need for re-audits by end-users.
Dependencies are minimized and strictly pinned to reduce supply-chain risk.
We use as few dependencies as possible.
Version ranges are locked, and changes are checked with npm-diff.
Dev dependencies are excluded from end-user installs; they’re only used for development and build steps.
For this package, there are 0 dependencies; and a few dev dependencies:
jsbt is used for benchmarking / testing / build tooling and developed by the same author
prettier, fast-check and typescript are used for code quality / test generation / ts compilation
Randomness
We rely on the built-in
crypto.getRandomValues,
which is considered a cryptographically secure PRNG.
Browsers have had weaknesses in the past - and could again - but implementing a userspace CSPRNG is even worse, as there’s no reliable userspace source of high-quality entropy.
Quantum computers
Cryptographically relevant quantum computer, if built, will allow to
break elliptic curve cryptography (both ECDSA / EdDSA & ECDH) using Shor's algorithm.
Consider switching to newer / hybrid algorithms, such as SPHINCS+. They are available in
noble-post-quantum.
NIST prohibits classical cryptography (RSA, DSA, ECDSA, ECDH) after 2035. Australian ASD prohibits it after 2030.
Upgrading
v2 to v3
v3 brings the package closer to noble-curves v2.
Most methods now expect Uint8Array, string hex inputs are prohibited
Add keygen, keygenAsync method
Node v20.19 is now the minimum required version
Various small changes for types and Point class
etc: hashes are now set in hashes object:
import * as ed from '@noble/ed25519';
import { sha512 } from '@noble/hashes/sha2.js';
// before
ed.etc.sha512Sync = (...m: Uint8Array[]) => sha512(ed.etc.concatBytes(...m));
ed.etc.sha512Async = (...m: Uint8Array[]) => Promise.resolve(sha512(ed.etc.concatBytes(...m)));
// after
ed.hashes.sha512 = sha512;
ed.hashes.sha512Async = (m: Uint8Array) => Promise.resolve(sha512(m));
v1 to v2
v2 features improved security and smaller attack surface.
The goal of v2 is to provide minimum possible JS library which is safe and fast.
That means the library was reduced 4x, to just over 300 lines. In order to
achieve the goal, some features were moved to
noble-curves, which is
even safer and faster drop-in replacement library with same API.
Switch to curves if you intend to keep using these features:
x25519 / curve25519 / getSharedSecret
ristretto255 / RistrettoPoint
Using utils.precompute() for non-base point
Support for environments which don't support bigint literals
Common.js support
Support for node.js 18 and older without shim
Other changes for upgrading from @noble/ed25519 1.7 to 2.0:
Methods are now sync by default; use getPublicKeyAsync, signAsync, verifyAsync for async versions
bigint is no longer allowed in getPublicKey, sign, verify. Reason: ed25519 is LE, can lead to bugs
Point (2d xy) has been changed to ExtendedPoint (xyzt)
Signature was removed: just use raw bytes or hex now
utils were split into utils (same api as in noble-curves) and
etc (sha512Sync and others)
Contributing & testing
npm install && npm run build && npm test will build the code and run tests.
npm run bench will run benchmarks
npm run build:release will build single file
See paulmillr.com/noble
for useful resources, articles, documentation and demos
related to the library.
Speed
npm run bench
Benchmarks measured with Apple M4.
init 11ms
keygen x 14,467 ops/sec @ 69μs/op
sign x 7,275 ops/sec @ 137μs/op
verify x 2,004 ops/sec @ 498μs/op
keygenAsync x 12,822 ops/sec @ 77μs/op
signAsync x 5,902 ops/sec @ 169μs/op
verifyAsync x 1,955 ops/sec @ 511μs/op
Point.fromBytes x 36,545 ops/sec @ 27μs/op
Compare to alternative implementations:
[email protected] getPublicKey x 1,808 ops/sec @ 552μs/op ± 1.64%
[email protected] sign x 651 ops/sec @ 1ms/op
[email protected] getPublicKey x 640 ops/sec @ 1ms/op ± 1.59%
sodium-native#sign x 83,654 ops/sec @ 11μs/op
License
The MIT License (MIT)
Copyright (c) 2019 Paul Miller (https://paulmillr.com)
How active is development on paulmillr/noble-ed25519?
The most recent commit recorded on paulmillr/noble-ed25519 was 6 days ago, based on the GitHub push timestamp. The repository has 68 forks — one of the better signals of community interest.
How many stars does paulmillr/noble-ed25519 have?
paulmillr/noble-ed25519 has 514 GitHub stars — refresh the page for the live number, or check github.com/paulmillr/noble-ed25519. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is paulmillr/noble-ed25519 open source?
Yes — paulmillr/noble-ed25519 ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/paulmillr/noble-ed25519.
What else is in the Security space?
paulmillr/noble-ed25519 is tracked by TopGit under the Security category, alongside 12 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What topics is paulmillr/noble-ed25519 associated with?
Where can I see paulmillr/noble-ed25519 in action?
The project maintains a homepage at https://paulmillr.com/noble. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about paulmillr/noble-ed25519?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/paulmillr/noble-ed25519 is the definitive source.
Read full README in the tab above.
Still deciding about noble-ed25519?
One click hands the question to an AI along with this page — see what it says about noble-ed25519.