Skip to content

Conversation

@gugell
Copy link
Contributor

@gugell gugell commented Nov 4, 2025

Description

This pull request introduces several important updates focused on improving cryptography performance and compatibility, particularly for React Native environments. The most significant changes are the addition of native bindings for secp256k1 and noble-curves libraries, enabling faster cryptographic operations via native code (Nitro/Avalabs), and updating package patching and dependency management to ensure these enhancements are used consistently. Additionally, Ruby version requirements for the mobile core package have been bumped.

Cryptography: Native Nitro/Avalabs Integration

  • Added native bindings to @bitcoinerlab/secp256k1 and @noble/curves libraries, allowing key operations (sign, verify, point addition, and Schnorr signatures) to use fast native implementations when available, with fallback to JavaScript if needed. This improves both performance and compatibility for React Native apps. (.yarn/patches/@bitcoinerlab-secp256k1-npm-1.2.0-1098d4b329.patch, .yarn/patches/@noble-curves-npm-1.9.7-2b9efc8ab4.patch) [1] [2]

  • Modified cryptographic functions in dist/index.js and abstract/weierstrass.js to prefer native Nitro/Avalabs implementations for sign/verify and point addition, with robust fallback mechanisms and logging for troubleshooting. [1] [2]

Dependency and Patch Management

  • Updated package.json to consistently use patched versions of @noble/curves and @bitcoinerlab/secp256k1, ensuring all variants and version ranges resolve to the enhanced, Nitro-compatible builds.

  • Added React Native and browser compatibility fields to the package.json files of patched libraries (@bitcoinerlab/secp256k1, @noble/curves), mapping Node.js modules to browser/React Native equivalents for seamless cross-platform support. [1] [2]

Ruby Version Update

  • Bumped Ruby version requirement for the mobile core package from 3.2.2 to 3.3.0 in .ruby-version and Gemfile. [1] [2]

Testing

Dev Testing (if applicable)

  • Provide steps to test the happy path of your feature
  • Provide steps to test edge cases and error states
  • Trigger a build on bitrise and reference it here
  • Move the ticket into the "Testing" column on Jira

QA Testing (if applicable)

  • Provide instructions for QA to test this feature thoroughly
  • State expected behavior / acceptance criteria

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have included screenshots / videos of android and ios
  • I have added testing steps
  • I have added/updated necessary unit tests
  • I have updated the documentation

Szymon20000 and others added 9 commits November 4, 2025 22:14
# Conflicts:
#	yarn.lock

fix set problems

stash work

# Conflicts:
#	yarn.lock

stash work

# Conflicts:
#	packages/core-mobile/index.js

performance tracking

# Conflicts:
#	yarn.lock

stash work

make it more solid

fix patch for ios

update sentry

fix patches
@gugell gugell marked this pull request as ready for review November 10, 2025 21:21
@gugell gugell force-pushed the @szymon/nativeCryptoLib branch from 3a99462 to 2f2e959 Compare November 11, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants