1

tx1

from the trans1 i got

Input Scripts

30450220262e481b6d8905b5adba67aff05eb8261501b0a9434c0b7f043d00cf8d23c91b022100bf82c0d212f30d3a0599e9b879516d762eaf5688ab83787cf470e99af5a6917101       
046578188abe5aaf9f3d1809d972e87307493dfefa3a5b6c94c870e8f58743179678f059c6402d9806ccce5d0672dc171d962fe392f8ef77cc9827c3eb633966b4

R = 262e481b6d8905b5adba67aff05eb8261501b0a9434c0b7f043d00cf8d23c91b

S2 = bf82c0d212f30d3a0599e9b879516d762eaf5688ab83787cf470e99af5a69171

tx1 raw trans

01000000012eb64643254262722e33e72cb2ad67fecb6ae2fd812d2f2bff217458715e11a0000000008b4830450220262e481b6d8905b5adba67aff05eb8261501b0a9434c0b7f043d00cf8d23c91b022100bf82c0d212f30d3a0599e9b879516d762eaf5688ab83787cf470e99af5a691710141046578188abe5aaf9f3d1809d972e87307493dfefa3a5b6c94c870e8f58743179678f059c6402d9806ccce5d0672dc171d962fe392f8ef77cc9827c3eb633966b4ffffffff02a0252600000000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88aca0252600000000001976a91409a4cb092dc30da1354369fc78f482365ce2767a88ac00000000

calculating z2

replace the input with the corresponding output script

01000000012eb64643254262722e33e72cb2ad67fecb6ae2fd812d2f2bff217458715e11a0000000001976a91409a4cb092dc30da1354369fc78f482365ce2767a88acffffffff02a0252600000000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88aca0252600000000001976a91409a4cb092dc30da1354369fc78f482365ce2767a88ac0000000001000000

then do sha256(sha256(modified transaction))

Z2 = e2b8acb01c0ea6a2a1273fc9dbbe3cdd58c68afb54e240e1f51abcc652468204

tx2

from tx2

Input Scripts

30450220262e481b6d8905b5adba67aff05eb8261501b0a9434c0b7f043d00cf8d23c91b022100d45c9ef85bb65a2a5bb3cf862124188adfe5fb8d430bc4b0d1222b1704d10d1901      
046578188abe5aaf9f3d1809d972e87307493dfefa3a5b6c94c870e8f58743179678f059c6402d9806ccce5d0672dc171d962fe392f8ef77cc9827c3eb633966b4

S1 = d45c9ef85bb65a2a5bb3cf862124188adfe5fb8d430bc4b0d1222b1704d10d19

tx2 raw trans

010000000180a2856a5a973b0953328a8b2bca142acc0c1a20b4b77ffe4a62aab8afcc1293010000008b4830450220262e481b6d8905b5adba67aff05eb8261501b0a9434c0b7f043d00cf8d23c91b022100d45c9ef85bb65a2a5bb3cf862124188adfe5fb8d430bc4b0d1222b1704d10d190141046578188abe5aaf9f3d1809d972e87307493dfefa3a5b6c94c870e8f58743179678f059c6402d9806ccce5d0672dc171d962fe392f8ef77cc9827c3eb633966b4ffffffff01a0252600000000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88ac00000000

calculating z1

replace the input with the corresponding output script

010000000180a2856a5a973b0953328a8b2bca142acc0c1a20b4b77ffe4a62aab8afcc1293010000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88acffffffff01a0252600000000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88ac0000000001000000

then do sha256(sha256(modified transaction))

I got Z1 = f62dab861eb451dad7cc74fa9f754e4d233b5fb80b1327fd623f5617e1f46d21

but the correct z1 value is

z1 = 66042ab1a1befe137de5328ff1d4b263604824fe33c739d3a80565afdd94b34d

what wrong in the calculation

3

calculating z1

replace the input with the corresponding output script

This is the step where you made a small mistake.

The UTXO that's being spent is from txid 9312ccafb8aa624afe7fb7b4201a0ccc2a14ca2b8b8a3253093b975a6a85a280 which contains two txouts. When you did the script replacement, you chose txout #0 (with a hash160 of cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d), but the tx being signed is spending txout #1 (with a hash160 of 09a4cb092dc30da1354369fc78f482365ce2767a).

Doing the replacement with the correct txout script results in this, which hashes to the z1 value you were expecting:

010000000180a2856a5a973b0953328a8b2bca142acc0c1a20b4b77ffe4a62aab8afcc1293010000001976a91409a4cb092dc30da1354369fc78f482365ce2767a88acffffffff01a0252600000000001976a914cf3aaf67c964d5c239f4cf2d9c2d2a7257d85b5d88ac0000000001000000
  • Christopher Gurnee thank you now i get correct output – Prabu r Jun 8 '15 at 5:27
  • @Prabur If this has completely answered your question, please consider Accepting it (and of course the same goes for any other answers). More info on Accepting answers can be found here: meta.stackexchange.com/questions/5234 – Christopher Gurnee Jun 8 '15 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.