Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the direct dependency on tiny‑secp256k1 from xpub‑lib and introduces an explicit initialization function for the ECC library to support asynchronous WASM import environments, similar to bitcoinjs‑lib’s handling.
- Removed the direct import and initialization of tiny‑secp256k1 from xpub‑lib.
- Added an initEccLib function in xpub‑lib to allow consumers to initialize the ECC library as needed.
- Updated xpub‑cli to import and initialize the ECC library before using taproot functionality.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/xpub-lib/src/derivation.js | Removed direct dependency on tiny‑secp256k1 and added initEccLib. |
| packages/xpub-cli/src/xpub.js | Updated to call initEccLib with an imported instance of tiny‑secp256k1. |
Files not reviewed (2)
- packages/xpub-cli/package.json: Language not supported
- packages/xpub-lib/package.json: Language not supported
bca7b11 to
f5b55eb
Compare
laf-rge
approved these changes
Apr 3, 2025
bertonjulian
reviewed
Apr 3, 2025
f5b55eb to
62d0f19
Compare
…tion, require for taproot
62d0f19 to
af494b3
Compare
laf-rge
approved these changes
Apr 3, 2025
bertonjulian
approved these changes
Apr 3, 2025
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.
Some projects, like vite-based web applications, have issues with
tiny-secp256k1v2 and up being included in the dependency tree since this relies on web assembly (wasm) dependencies. Wasm dependencies must be imported asynchronously which makes use ofxpub-libdifficult in these environments.This change models bitcoinjs-lib and requires the ECC library to be initialized before use.