MultiversX Tracker is Live!

ECDSA sign of transaction

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 114 Views

Assuming you are talking about the transaction signatures and not attempting to sign the raw transaction data, I can see a few problems with this method.

First, it is worth understanding what a transaction signature is. A transaction contains signatures for each input, and thus, the signature cannot sign the entire transaction. When a typical (legacy) transaction is signed, the fields where the signatures would go is set to zero, allowing the signatures to be generated. Then these signatures are emplaced in those fields.

Read more from Jimmy Song's Programming Bitcoin: https://learning.oreilly.com/library/view/programming-bitcoin/9781492031482/ch05.html#idm46739596961624

Second, inputs have signatures, not the transaction as a whole. If a transaction spends multiple coins, there will be multiple signatures in the transaction. If a coin locked in a multisig address is being spent, there can even be multiple signatures per input.

Thirdly, this is an irregular transaction. It spends a P2SH input whose redeem script is a P2PK script. But here you can see a breakdown of the transaction's fields.

Read more about how P2SH inputs are validated here: https://learning.oreilly.com/library/view/programming-bitcoin/9781492031482/ch08.html#idm46739591457944

{ inputs: [ { prev_txid: "cf016927962ec028964c186043d48e465b3d4672f758953b00d3c4682f71cad6", prev_vout: 0, script_sig: "21026d2204a9535443657a88a0724fbd49a0e78d305f50a82f2cc9dd9bea10a6c5cd0c093006020101020101017cac", sequence_no: 4294967295 } ], lock_time: 0, outputs: [{script_pub_key: "6a", value: 0}], version: 1, witnesses: nil }

The ScriptSig is where the signature (wrapped in some script) can be found. If we decode the ScriptSig, we see a Public Key and a Redeem Script. The Redeem Script is the last 12 bytes of data 093006020101020101017cac.

OP_PUSHBYTES_33 026d2204a9535443657a88a0724fbd49a0e78d305f50a82f2cc9dd9bea10a6c5cd OP_PUSHBYTES_12 093006020101020101017cac

If we parse this redeem Script, we get:

OP_PUSHBYTES_9 300602010102010101 OP_SWAP OP_CHECKSIG

There is the signature: 300602010102010101 Its last byte, 01 is the SigHash flag for SIGHASH_ALL. The rest, 3006020101020101 is a DER-encoded signature.

For some reason I can't explain, this signature has (r,s) = (1,1). I don't know why this is valid.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments