chore: update toruslabs/metadata-helper package#387
Merged
chaitanyapotti merged 6 commits intomasterfrom Mar 5, 2026
Merged
Conversation
chaitanyapotti
approved these changes
Mar 5, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
arch1995
approved these changes
Mar 5, 2026
arch1995
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Jira Link:
Description
Upgrade
@toruslabs/metadata-helpersand consolidate crypto dependenciesSummary
Upgrades
@toruslabs/metadata-helpersto v8.2.0 and leverages its newly re-exported utilities to remove direct dependencies on@noble/curvesand@toruslabs/tweetnacl-js, reducing the dependency surface area.Dependency Changes
@toruslabs/metadata-helpers^8.1.0^8.2.0@toruslabs/customauth^22.1.0^22.2.0@toruslabs/secure-pub-sub^4.1.0^4.2.0@toruslabs/session-manager^5.3.0^5.4.0@noble/curves^2.0.1@toruslabs/tweetnacl-js^1.0.4Changes
src/core/auth.ts— Useadd0xfrom@toruslabs/metadata-helpersto ensure session IDs are0x-prefixed before passing to the session manager.src/core/utils.ts— Replace customsafeatobwrapper withdecodeBase64Urlimported directly from@toruslabs/metadata-helpers.src/ed25519/utils.ts— Replace low-level tweetnacl internals withgetEd25519().getPublicKey()andhexToBytesfrom@toruslabs/metadata-helpers, significantly simplifying thegetED25519Keyimplementation.src/subkey/keyDerivation.ts— ImportbytesToNumberBE,mod, andsecp256k1from@toruslabs/metadata-helpersinstead of separate@noble/curvesentry points.src/subkey/mimcsponge.ts— Replacekeccak256(which returned a hex string) withkeccak256Bytes(which returnsUint8Array) from@toruslabs/metadata-helpers.src/utils/utils.ts— Remove now-unusedsafebtoa/safeatobwrapper functions; callers useencodeBase64Url/decodeBase64Urldirectly.test/ed25519.test.ts— Rewrite ED25519 tests to validate key structure (64-byte sk, 32-byte pk),Uint8Arrayinput support, and deterministic derivation without depending on@toruslabs/tweetnacl-js.Motivation
@toruslabs/metadata-helpersv8.2.0 now re-exports common crypto primitives (getEd25519,hexToBytes,bytesToNumberBE,mod,secp256k1,keccak256Bytes, etc.) that were previously pulled in as separate direct dependencies. By consolidating imports through a single package:@noble/curvesand@toruslabs/tweetnacl-jsare no longer needed in this package.package-lock.json.How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Note
Medium Risk
Touches auth session token handling and cryptographic key/hash derivation paths; while behavior is intended to be equivalent (and ED25519 is covered by vectors), dependency upgrades and
0x-prefix normalization could affect runtime interoperability.Overview
Upgrades TorusLabs packages (including
@toruslabs/metadata-helpers8.2.0) and updates lockfiles/examples accordingly, removing direct@noble/curvesusage and shifting@toruslabs/tweetnacl-jsto dev-only (tests).Updates auth/session handling to always
0x-prefixsession_id/loginIdviaadd0x, replaces base64 URL decoding withdecodeBase64Url, and refactors crypto utilities (ED25519key derivation, subkey derivation, MiMC sponge keccak helpers) to use@toruslabs/metadata-helpersre-exports.Adds
.github/CODEOWNERSand excludes it from Prettier formatting.Written by Cursor Bugbot for commit 57c9f5f. This will update automatically on new commits. Configure here.