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

Refuse an OP_RETURN that is not made of complete pushes

Public commit record

What the developer wrote

Authored by okaybro

73/100 · Adequate
Refuse an OP_RETURN that is not made of complete pushes

Bitcoin Core treats an OP_RETURN output as nonstandard unless everything after the
opcode is a push. The parser used to display whatever was left when a push ran past the
end of the script, or when it met an opcode that is not a push. It now raises
PSBTMalformedOpReturnError instead, and the user gets the same plain "Transaction
Problem" warning used for other malformed psbts before discarding it.

OP_0, OP_1NEGATE, OP_RESERVED, and OP_1 through OP_16 still count as pushes to Core, so
they are kept and the walk carries on past them rather than stopping there.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes how SeedSigner handles unusual OP_RETURN data in Bitcoin transactions. Previously, if the data after an OP_RETURN instruction was malformed, the app would still try to display whatever bytes remained. Now it stops and shows a plain 'Transaction Problem' warning, treating the transaction as malformed and discarding it. This aligns SeedSigner with how Bitcoin Core treats such transactions, and prevents a malformed or crafted OP_RETURN script from influencing what the user sees during transaction review.

Recommended action

Review the new PSBTMalformedOpReturnView wording to ensure users understand the transaction is malformed and cannot be signed. Consider whether any other script-parsing paths (e.g., non-OP_RETURN outputs) have similar 'best-effort display' behavior that could be tightened. Verify that the new exception is also handled in any other entry points that parse PSBTs.

Security signals we found

01

New exception class for malformed OP_RETURN scripts

02

Parser now rejects truncated pushes and non-push opcodes instead of surfacing raw bytes

03

UI redirects to a discard-only warning view on malformed OP_RETURN

04

Behavior aligned with Bitcoin Core standardness policy for OP_RETURN outputs

05

Tests added for malformed scripts and flow termination

Risk score

Why this scored 52/100

Our methodology →
Potential impact 12/30
Exploitability 10/25
Stealth signal 8/15
Affected reach 10/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.