Skip to content

Conversation

@originalix
Copy link

No description provided.

reardencode and others added 30 commits November 29, 2022 10:41
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
junderw and others added 22 commits March 5, 2025 18:01
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
docs: replace expired link in README.md
…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.
…lpers

feat(crypto): restore ripemd160, sha1 and sha256 hash helpers
@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ltc-mweb

Comment @coderabbitai help to get the list of available commands and usage tips.

@originalix originalix marked this pull request as draft December 16, 2025 05:59
@revan-zhang
Copy link

revan-zhang commented Dec 16, 2025

Snyk checks have failed. 1 issues have been found so far.

Status Scanner Critical High Medium Low Total (1)
Open Source Security 0 1 0 0 1 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@originalix originalix requested a review from Copilot December 16, 2025 06:00
Copy link

Copilot AI left a 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",
Copy link

Copilot AI Dec 16, 2025

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.

Copilot uses AI. Check for mistakes.
},
{
"description": "Script Tree is not a binary tree (has tree leafs)",
"exception": "ValiError: Taptree is not of type isTaptree",
Copy link

Copilot AI Dec 16, 2025

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'.

Suggested change
"exception": "ValiError: Taptree is not of type isTaptree",
"exception": "ValiError: TapTree is not of type isTaptree",

Copilot uses AI. Check for mistakes.
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.