-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support ltc mweb #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Because the taggedHash API is typed, these are compile-time checked and it's more clear w/o the constants.
* More clearly show the continuation and base cases in findScriptPath * Return undefined not empty path when no path is found * This would lead to generating an invalid witness * Tighten the type for HashTree to not allow 1-sided branch nodes
* Also added caching of `hashTree`, per todo. * Added a test for this functionality
The spec uses this notation because in a spec there's no such thing as reassigning a value. In real code it is appropriate to us accumulators or such.
* refactor: explicit initialization on the ecc library - remove optional `eccLib` parameter for `p2tr` and `psbt`
- does not cover `TapBip32Derivation` - does not cover taproot outputs
Minor fixes throughout codebase
Fix tx version from int32 to uint32
Corrected the package name from @bitcoinjs-lib/tiny-secp256k1-asmjs to @bitcoin-js/tiny-secp256k1-asmjs in the ECC library alternatives section. This ensures accurate documentation for users integrating Taproot features with bitcoinjs-lib.
fix(docs): correct package name for tiny-secp256k1-asmjs alternative
Remove kawaii logo
docs: replace expired link in README.md
Fix deploy doc task
…s of taproot inputs (bitcoinjs#2270) * Removed unnecessary check for tapInternalKey for signature validations of taproot inputs * Update ts_src/psbt.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update ts_src/psbt.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Upgrade setup-node action from v3 to v6 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jonathan Underwood <jonathan.underwood4649@gmail.com>
Extend p2ms to support up to 20 public keys (n-of-20 multisig). The previous 16-key cap was only an internal implementation limit, not a Bitcoin rule. In practice, P2SH multisig cannot handle 16 keys anyway due to script-size limits (the effective cap is ~15), but those constraints do not apply to P2WSH. Since p2ms is often wrapped inside P2WSH, the implementation now supports the full 20-key range. Added new fixtures and a P2MS under P2WSH integration test.
p2ms: support up to 20 keys
…lpers feat(crypto): restore ripemd160, sha1 and sha256 hash helpers
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
⛔ Snyk checks have failed. 1 issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for Litecoin MWEB (Mimblewimble Extension Blocks) by significantly refactoring the bitcoinjs-lib library. The changes include migrating from JavaScript to TypeScript, updating the type system from typeforce to valibot, replacing Buffer with Uint8Array, and adding comprehensive Taproot (P2TR) support along with various test and fixture updates.
Key Changes
- Complete migration from JavaScript to TypeScript with modern ESM module structure
- Addition of Taproot (P2TR) payment type support with extensive test coverage
- Migration from Buffer to Uint8Array throughout the codebase
- Replacement of typeforce validation with valibot schema validation
- Updated dependencies and modernized build tooling
Reviewed changes
Copilot reviewed 109 out of 212 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/integration/taproot.md | Removed legacy Taproot example documentation |
| test/integration/payments.spec.ts | Updated payment integration tests with new imports and BigInt values |
| test/integration/csv.spec.ts | Updated CSV transaction tests with Uint8Array and new imports |
| test/integration/cltv.spec.ts | Updated CLTV transaction tests with corrected comments and BigInt values |
| test/integration/blocks.spec.ts | Updated block integration tests with new import paths |
| test/integration/bip32.spec.ts | Updated BIP32 tests with factory pattern and assertions |
| test/integration/addresses.spec.ts | Updated address tests with ECPair factory and random number generation |
| test/fixtures/transaction.json | Added MWEB transaction fixture and updated error messages |
| test/fixtures/script.json | Updated error message format for valibot validation |
| test/fixtures/psbt.json | Added extensive Taproot PSBT test cases |
| test/fixtures/p2wsh.json | Added script validation test cases |
| test/fixtures/p2tr.json | New comprehensive Taproot payment fixture file |
| test/fixtures/p2sh.json | Updated error messages and added script size validation |
| test/fixtures/p2pkh.json | Updated error message format |
| test/fixtures/p2pk.json | Updated error message format |
| test/fixtures/p2ms.json | Added 20-of-20 multisig test and validation cases |
| test/fixtures/address.json | Updated Bech32m address fixtures |
| test/ecc_lib.spec.ts | New test file for ECC library initialization |
| test/crypto.spec.ts | Updated crypto tests with Uint8Array tools |
| test/bufferutils.spec.ts | Updated buffer utility tests, removed deprecated functions |
| test/block.spec.ts | Updated block tests with Uint8Array conversion |
| test/bitcoin.core.spec.ts | Updated Bitcoin Core compatibility tests |
| test/bip371.spec.ts | New test file for BIP371 (Taproot) functionality |
| test/address.spec.ts | Updated address tests with ECC library initialization |
| src/types.js | Removed deprecated JavaScript type definitions |
| src/script_signature.js | Removed deprecated JavaScript implementation |
| src/script_number.js | Removed deprecated JavaScript implementation |
| src/script.js | Removed deprecated JavaScript implementation |
| src/merkle.js | Removed deprecated JavaScript implementation |
| LICENSE | Updated copyright year to 2025 |
| .prettierignore | Added TypeScript definition file ignore pattern |
Comments suppressed due to low confidence (1)
test/integration/csv.spec.ts:1
- The comment incorrectly references OP_CHECKLOCKTIMEVERIFY instead of OP_CHECKSEQUENCEVERIFY. This file is testing CSV (CHECKSEQUENCEVERIFY) functionality, not CLTV (CHECKLOCKTIMEVERIFY).
import * as assert from 'assert';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "weight": 624 | ||
| }, | ||
| { | ||
| "description": "Litecoin MWEB peg-out transaction", |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new MWEB transaction fixture lacks corresponding test cases to verify the transaction parsing and validation. Consider adding test cases that specifically exercise this MWEB transaction structure.
| }, | ||
| { | ||
| "description": "Script Tree is not a binary tree (has tree leafs)", | ||
| "exception": "ValiError: Taptree is not of type isTaptree", |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'Taptree' to 'TapTree'.
| "exception": "ValiError: Taptree is not of type isTaptree", | |
| "exception": "ValiError: TapTree is not of type isTaptree", |
No description provided.