Skip to content

fix: Fix Taproot receiver input handling in async Payjoin - #196

Merged
ValeraFinebits merged 4 commits into
masterfrom
fix/taproot-receiver-inputs
Oct 14, 2026
Merged

ValeraFinebits merged 4 commits into
masterfrom
fix/taproot-receiver-inputs

Conversation

@ValeraFinebits

@ValeraFinebits ValeraFinebits commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #195

Fix weight prediction not supported when a store contributes a Taproot UTXO to async Payjoin, reported during Bull Bitcoin testing against test/v0.3.2-alpha.rc2.

  • Use the typed NewP2trKeyspend and NewP2wpkh FFI constructors.
  • Add regression coverage with a P2WPKH sender and one confirmed BIP86 receiver UTXO.
  • Verify that the confirmed payment spends the exact receiver outpoint with a 64-byte signature and 230 WU input weight, settles the invoice correctly, and removes the receiver session.

Local validation on Windows: 4 adapter unit tests and both SegWit and Taproot regtest payment tests pass (6 passed, 0 failed, 0 skipped). Release build, formatting, and git diff --check pass.

Pins rust-payjoin to c20d01d4edb9aa36e93ce91f99153ad6f8188b33 from rust-payjoin#1959. Coordinated with rust-payjoin#1955.

@ValeraFinebits
ValeraFinebits requested a balanced review from Copilot October 9, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open findings
What changed in this PR

Adds an integration regression test to reproduce/guard the Taproot receiver-input Payjoin failure, and updates test helpers to support initializing wallets with Taproot derivation schemes.

Changes:

  • Extend Payjoin integration test helpers to allow selecting ScriptPubKeyType (defaulting to Segwit).
  • Add an integration test that funds the receiver with a BIP86 Taproot UTXO and asserts expected witness/signature/weight characteristics.
File Description
BTCPayServer.Plugins.Payjoin.IntegrationTests/​TestUtils/​PayjoinAccountTestHelper.cs Adds a scriptPubKeyType parameter so tests can initialize merchant wallets as Taproot (BIP86) instead of Segwit.
BTCPayServer.Plugins.Payjoin.IntegrationTests/​PayjoinPluginIntegrationTests.cs Adds a Taproot-focused Payjoin integration test asserting correct inclusion and shape of the receiver input.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread BTCPayServer.Plugins.Payjoin.IntegrationTests/PayjoinPluginIntegrationTests.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The recorded rust-payjoin submodule lacks the newly called constructors, preventing clean CI builds.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The typed-constructor fix is consistent with the updated FFI API and has focused unit and end-to-end regression coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@ValeraFinebits
ValeraFinebits marked this pull request as ready for review October 13, 2026 11:47
@ValeraFinebits
ValeraFinebits requested a review from chavic October 13, 2026 11:47

@chavic chavic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cACK 23c7cd1

@ValeraFinebits
ValeraFinebits merged commit 4e305af into master Oct 14, 2026
7 checks passed
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.

Fix Taproot receiver inputs (follow-up to rust-payjoin #1955)

3 participants