AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 19 Bitcoin

rpc: Run type check on decodepsbt result

Public commit record

What the developer wrote

Authored by MarcoFalke

80/100 · Strong
rpc: Run type check on decodepsbt result

For RPCResults, the type may be ELISION, which is confusing and brittle:

* The elision should only affect the help output, not the type.
* The type should be the real type, so that type checks can be run on
it.

Fix this issue by introducing a new print_elision option and using it
in decodepsbt.

This change will ensure that RPCResult::MatchesType is properly run.
Also, this clarifies the RPC output minimally:

```diff
--- a/decodepsbt
+++ b/decodepsbt
@@ -35,7 +35,7 @@ Result:
"inputs" : [ (json array)
{ (json object)
"non_witness_utxo" : { (json object, optional) Decoded network transaction for non-witness UTXOs
- ...
+ ... The layout is the same as the output of decoderawtransaction.
},
"witness_utxo" : { (json object, optional) Transaction output for witness UTXOs
"amount" : n, (numeric) The value in BTC
```
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This is a code-quality fix for Bitcoin Core's RPC help output. It changes how the documentation generator marks parts of the response as '...' (elided) so that the internal type checker can still verify the real data types. It does not change how transactions are decoded or how the network behaves, and it is not a security patch in the usual sense. The only user-visible change is a slightly clearer help message for the decodepsbt command.

Recommended action

No urgent action. Treat as a routine refactor/testability improvement. Reviewers may want to confirm that all RPCResult::ELISION usages are correctly migrated and that the new type checks pass in CI.

Security signals we found

01

Type-checking bypass removed for decodepsbt RPC result schema

02

New CHECK_NONFATAL assertions on elision descriptions

03

No change to consensus, networking, wallet, or transaction parsing logic

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 3/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.