fix: Record derivation paths for payjoin payments - #159
Open
ValeraFinebits wants to merge 1 commit into
Open
ValeraFinebits wants to merge 1 commit into
ValeraFinebits wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Missing derivation metadata can abort new sessions and permanently fail pre-upgrade in-flight settlements.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds derivation metadata to reconciled Payjoin payments so invoices can display the correct wallet index.
Changes:
- Captures and persists settlement key paths.
- Records payment destination,
KeyPath, andKeyIndex. - Adds schema migration and coverage for hot, cold, and preserved destinations.
File summaries
| File | Description |
|---|---|
PayjoinReceiverStateProcessor.cs |
Adds validation TODO. |
PayjoinReceiverSessionProcessor.cs |
Persists settlement key paths. |
PayjoinReceiverProposalFinalizer.cs |
Adds settlement-value TODOs. |
PayjoinReceiverOutputBuilder.cs |
Captures output derivation paths. |
PayjoinAccountingPaymentService.cs |
Records payment derivation metadata. |
PayjoinAccountingBridgeService.cs |
Carries and resets persisted paths. |
PayjoinPluginDbContextModelSnapshot.cs |
Updates the EF model snapshot. |
20260822143644_AddSettlementKeyPath.Designer.cs |
Defines the migration model. |
20260822143644_AddSettlementKeyPath.cs |
Adds the database column. |
PayjoinPluginDbSchema.cs |
Defines the path length limit. |
PayjoinAccountingBridgeData.cs |
Adds the persistence property. |
PayjoinAccountingBridgeConfiguration.cs |
Configures path storage. |
PayjoinReceiverOutputBuilderTests.cs |
Tests path propagation. |
PayjoinAccountingPaymentServiceTests.cs |
Tests recorded payment metadata. |
PayjoinAccountingBridgeResetTests.cs |
Tests path clearing. |
PayjoinSettlementFlowTests.cs |
Tests atomic path persistence. |
PayjoinReceiverOutputBuilderIntegrationTests.cs |
Verifies real wallet paths. |
PayjoinPluginIntegrationTests.cs |
Verifies preserved invoice paths. |
Review details
Files not reviewed (1)
- BTCPayServer.Plugins.Payjoin/Migrations/20260822143644_AddSettlementKeyPath.Designer.cs: Generated file
- Files reviewed: 17/18 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ValeraFinebits
marked this pull request as ready for review
August 22, 2026 17:55
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.
Summary
Payjoin reconciliation created the final Bitcoin payment without its wallet derivation metadata, causing the invoice to display
Index: Unknown.This change:
KeyPathandKeyIndexin the final payment details;