psbt: Change default psbt version to 2
What changed, and why it matters
This commit changes the default version number used when Bitcoin Core creates new Partially Signed Bitcoin Transactions (PSBTs) from version 0 to version 2. PSBT is a standard format for passing around unsigned or partially signed transactions between wallets and signers. The change itself is a one-line default-value update plus a test that confirms new PSBTs are created as version 2. It does not fix a memory corruption bug, crash, or remote-code-execution flaw, and there is no evidence in the commit or supplied references that it addresses a known security incident.
No immediate security action is required. Treat this as a routine protocol-upgrade/defaulting change. Reviewers may want to confirm that downstream callers and RPC documentation correctly reflect the new PSBT v2 default, and that legacy PSBT v0 parsing remains supported for compatibility.
Security signals we found
Default-value change in a serialization format constructor
Addition of a regression/behavior test for the new default
No input validation, parsing, or memory-safety changes present
No mention of vulnerability, CVE, security fix, or incident in commit message or diff
Evidence from the diff
The patch modifies the constructor default in src/psbt.h for PartiallySignedTransaction so that newly constructed PSBT objects use version 2 instead of version 0. A functional test is added in rpc_psbt.py to assert that createpsbt returns psbt_version 2. PSBT v2 (BIP 370) is a newer serialization format that separates input/output maps and is required for certain features such as MuSig2 signing flows. The change is a protocol/format defaulting update, not a patch for an exploitable vulnerability in serialization, parsing, or transaction handling.
Changed components
src/psbt.h: PartiallySignedTransaction constructor default parametertest/functional/rpc_psbt.py: PSBT version functional testInspect captured patch +4 / −1
diff --git a/src/psbt.h b/src/psbt.h
index 9e514f2e..bca99953 100644
--- a/src/psbt.h
+++ b/src/psbt.h
@@ -1260,7 +1260,7 @@ public:
std::optional<uint32_t> ComputeTimeLock() const;
std::optional<CMutableTransaction> GetUnsignedTx() const;
std::optional<Txid> GetUniqueID() const;
- explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 0);
+ explicit PartiallySignedTransaction(const CMutableTransaction& tx, uint32_t version = 2);
template <typename Stream>
inline void Serialize(Stream& s) const {
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 3c3e7288..9a75a35d 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -761,6 +761,9 @@ class PSBTTest(BitcoinTestFramework):
# Create a psbt spending outputs from nodes 1 and 2
psbt_orig = self.nodes[0].createpsbt([utxo1, utxo2], {self.nodes[0].getnewaddress():25.999})
+ # Check that the default psbt version is 2
+ assert_equal(self.nodes[0].decodepsbt(psbt_orig)["psbt_version"], 2)
+
# Update psbts, should only have data for one input and not the other
psbt1 = self.nodes[1].walletprocesspsbt(psbt_orig, False, "ALL")['psbt']
psbt1_decoded = self.nodes[0].decodepsbt(psbt1)
Why this scored 21/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.