Upgrade from @noble/ed25519 v1 to v2
mainUpgrading to v2 involves significant changes as the library was refactored for security and performance:
- Synchronous by Default: Methods are now synchronous by default. For asynchronous versions, use
getPublicKeyAsync,signAsync, andverifyAsync. - No BigInts:
bigintis no longer allowed ingetPublicKey,sign, orverifyto prevent bugs related to Little Endian (LE) encoding. - Point Class Change: The
Pointclass (2d xy) has been replaced byExtendedPoint(xyzt). - Signature Type: The
Signaturetype was removed; use raw bytes or hex instead. - Utility Splitting:
utilswere split intoutils(standard API) andetc(containingsha512Syncand others).
Note on Feature Migration: Many features were moved to noble-curves. If you require any of the following, switch to noble-curves instead:
- x25519 / curve25519 / getSharedSecret
- ristretto255 / RistrettoPoint
- Using
utils.precompute()for non-base point - Support for environments without
bigintliterals - Common.js support
- Support for Node.js 18 and older (without shims)