First transaction
Given a transaction on the blockchain:
3a1b9e330d32fef1ee42f8e86420d2be978bbe0dc5862f17da9027cf9e11f8c4
One of the outputs transfers 424,242.42424242 BTC to 1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC
scriptPubKey:
OP_DUP OP_HASH160 070d550bc5bc843149410b8863b5b72857d91439 OP_EQUALVERIFY OP_CHECKSIG
Second transaction
And the input to spend that output is in this transaction: 7a2a6f66e87ed4e72d85ba7a82eda1572605c3330c461e171f58d7ff2763ac63
scriptSig:
30450221009c45573098c41e5ebd1e41fea5f6d0f96c7833a631c7ae890de328ca7e643a79022037cb1736d6aeeed517b234a16d731072cddf1917947dab25776a0f6dff9d741f01
041b4c38a55f7d3de915a0732c2237e13349c17250c05b4803e147fcee08ebad75fa76cfcde6aa5f45cde1201f63920c3625c6cba17c42ce052c07cdea0607f488
Question
How does one go about manually verifying the signature with ECDSA given the signature, public key, and the two transactions?
My naive attempt using pybitcointools:
>>> from bitcoin import *
>>> public_key = '041b4c38a55f7d3de915a0732c2237e13349c17250c05b4803e147fcee08ebad75fa76cfcde6aa5f45cde1201f63920c3625c6cba17c42ce052c07cdea0607f488'
>>> sig = '30450221009c45573098c41e5ebd1e41fea5f6d0f96c7833a631c7ae890de328ca7e643a79022037cb1736d6aeeed517b234a16d731072cddf1917947dab25776a0f6dff9d741f01'
>>> tx = '7a2a6f66e87ed4e72d85ba7a82eda1572605c3330c461e171f58d7ff2763ac63'
>>> print ecdsa_verify(tx, sig, public_key)
False
It might be that I have to go through this diagram to construct the "message" to use in verification: https://dl.dropboxusercontent.com/u/1139081/BitcoinImg/OpCheckSigDiagram.png
Thanks in advance for any help on this!