minor updates to handle psbtv2 as the default internal representation
What changed, and why it matters
This commit changes Sparrow Wallet to use PSBT version 2 as its default internal format instead of converting PSBTv2 files down to PSBTv0. It also adjusts how transactions are compared (by transaction ID instead of object equality) and changes how a PayJoin PSBT is prepared before being exported. These are internal refactoring changes; there is no direct evidence in the commit that they fix a security vulnerability.
Treat this as a routine compatibility/refactoring commit unless additional context (e.g., a release note, advisory, or follow-up commit) explicitly identifies a security issue. Review the updated drongo/lark libraries for any related PSBTv2 parsing or export fixes, and verify that the new transaction-ID comparison and export path do not introduce subtle correctness bugs in multi-tab or PayJoin workflows.
Security signals we found
Change in PSBT serialization/export path (getForExport().getPublicCopy())
Change in transaction equality check from object identity to txId comparison
Removal of PSBTv2-to-v0 conversion, changing internal PSBT handling
Evidence from the diff
The diff removes an automatic downgrade of PSBTv2 to PSBTv0 when opening a transaction tab, making PSBTv2 the native internal representation. It replaces reference equality (!=) with a transaction ID equality check when deciding whether to enable the ‘Save Transaction’ menu item. In PayJoin.java, it calls getForExport() before getPublicCopy() when serializing the PSBT to base64. The subproject references to drongo and lark are updated, likely to pick up PSBTv2 support in those libraries. No explicit security bug is described in the commit message or diff.
Changed components
Sparrow Wallet desktop applicationAppController transaction tab handlingPayJoin implementationdrongo and lark subproject librariesInspect captured patch +4 / −9
diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java
index eccfb4a..edc302c 100644
--- a/src/main/java/com/sparrowwallet/sparrow/AppController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java
@@ -1911,11 +1911,6 @@ public class AppController implements Initializable {
}
private void addTransactionTab(String name, File file, PSBT psbt) {
- //Convert to PSBTv0 first as the consistent internal representation
- if(psbt.getVersion() != null && psbt.getVersion() >= 2) {
- psbt.convertVersion(0);
- }
-
//Add any missing previous outputs if available in open wallets
for(PSBTInput psbtInput : psbt.getPsbtInputs()) {
if(psbtInput.getUtxo() == null) {
@@ -2565,7 +2560,7 @@ public class AppController implements Initializable {
if(event instanceof TransactionTabSelectedEvent) {
TransactionTabSelectedEvent txTabEvent = (TransactionTabSelectedEvent)event;
TransactionTabData transactionTabData = txTabEvent.getTransactionTabData();
- if(transactionTabData.getPsbt() == null || transactionTabData.getPsbt().getTransaction() != transactionTabData.getTransaction()) {
+ if(transactionTabData.getPsbt() == null || !transactionTabData.getPsbt().getTransaction().getTxId().equals(transactionTabData.getTransaction().getTxId())) {
saveTransaction.setVisible(true);
saveTransaction.setDisable(false);
} else {
diff --git a/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java b/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
index dad575c..0c2e9bf 100644
--- a/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
+++ b/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
@@ -67,7 +67,7 @@ public class Payjoin {
}
try {
- String base64Psbt = psbt.getPublicCopy().toBase64String();
+ String base64Psbt = psbt.getForExport().getPublicCopy().toBase64String();
String appendQuery = "v=1&minfeerate=" + AppServices.getMinimumRelayFeeRate();
int changeOutputIndex = getChangeOutputIndex();
Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.