transaction: use dummy DER ECDSA sig from descriptor.py
What changed, and why it matters
This commit is a minor code cleanup. It replaces a locally-defined placeholder fake cryptographic signature with a shared constant from another file. The placeholder is only used to estimate transaction size and is never broadcast or used in real transactions. There is no security issue here.
No action required. This is a benign refactoring commit with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes an inline 71-byte dummy DER ECDSA signature (b'\x00' * 71) in electrum/transaction.py and instead imports and uses DUMMY_DER_SIG from electrum/descriptor.py. The dummy signature is consumed only during size estimation (estimate_size=True) to compute txin.witness_sizehint. It is not a valid signature and is not included in any transaction sent to the network. This is purely a refactoring to eliminate duplication between two dummy signature definitions.
Changed components
electrum/transaction.pyInspect captured patch +2 / −3
diff --git a/electrum/transaction.py b/electrum/transaction.py
index 816914f..c172917 100644
--- a/electrum/transaction.py
+++ b/electrum/transaction.py
@@ -52,7 +52,7 @@ from .bitcoin import (
from .crypto import sha256d, sha256
from .logging import get_logger
from .util import ShortID, OldTaskGroup
-from .descriptor import Descriptor, MissingSolutionPiece, create_dummy_descriptor_from_address
+from .descriptor import Descriptor, MissingSolutionPiece, create_dummy_descriptor_from_address, DUMMY_DER_SIG
if TYPE_CHECKING:
from .wallet import Abstract_Wallet
@@ -1008,8 +1008,7 @@ class Transaction:
return construct_witness([])
if estimate_size and hasattr(txin, 'make_witness'):
- sig_dummy = b'\x00' * 71 # DER-encoded ECDSA sig, with low S and low R
- txin.witness_sizehint = len(txin.make_witness(sig_dummy))
+ txin.witness_sizehint = len(txin.make_witness(DUMMY_DER_SIG))
if estimate_size and txin.witness_sizehint is not None:
return bytes(txin.witness_sizehint)
Why this scored 15/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.