Replace ed25519 with libsodium
See original GitHub issueed25519
hasn’t been updated in years and is lagging behind what’s otherwise available:
https://github.com/future-tense/ed25519-dalek#benchmarks
ed25519
might have been a good choice in terms of a smaller binary size, but this only used for node anyway, so the extra bloat doesn’t matter as much.
I’d suggest libsodium/sodium-native, since that’s an actual npm package, and since signature verification isn’t that big of a deal; I’d be surprised if most people even know it’s in the SDK.
I’d also suggest using the native bindings for key generation, instead of only using it for signing and verification.
Can do the work, just want a go/no-go
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (8 by maintainers)
Top Results From Across the Web
Ed25519 to Curve25519 - libsodium
Ed25519 keys can be converted to X25519 keys, so that the same key pair can be used both for authenticated encryption ( crypto_box...
Read more >libsodium x25519 and Ed25519 small order check
Studying libsodium implementation of x25519 and Ed25519 I saw that it performs an small order check comparing given inputs with a hard coded ......
Read more >Ed25519 Deep Dive Addendum - Cendyne.dev
By replacing the commitment secret probabilistic process with a deterministic process, the complete signature process for a pre-existing key ...
Read more >ed25519_consensus - Rust - Docs.rs
Ed25519 for consensus-critical contexts. ... of Zcash consensus in zcashd inherited validity criteria from a then-current version of libsodium (1.0.15).
Read more >Sodium: A Modern and Easy-to-Use Crypto Library
The sodium R package provides bindings to libsodium: a modern, easy-to-use ... for signatures (ed25519) than for encryption (curve25519).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like those ideas to reduce the bundle size. I don’t think
reduce
->keyBy
is a big enough upgrade to warrant the file size increase.As far as tree-shaking is concerned: I worked on this a few weeks ago but came to the conclusion that it requires a lot of complicated changes, and I’m not positive the output will be worth it. Especially if we can just write Lodash out of the packages. Here’s the rough todo list for that, which has to be done to all 3 libs:
module.exports
use to use imports / exports instead. All instances have to be rewritten for tree-shaking to workYou have to very precisely manage your codebase to get tree-shaking working, and I wasn’t confident at the time that I could do that in a reasonable amount of time.
I just updated stellar-base and stellar-sdk to remove node builtins from the bundle. Unless my methodology was wrong, I was used your webpack config with Webpack Bundle Analyzer, and it no longer includes the
crypto
polyfill orelliptic
. It does still includetweetnacl
.