2

After reading this: ECDSA Signature and the "z" value

I'm still confused about the 'Z' value, for this transaction: https://blockchain.info/tx/ea6aa5d49b8e351e307bf9220f2d7cd31d41e640683539e00580e17cb4cf3e36?show_adv=true

the signature is in the input script, and uses the output script of it's source transaction when calculating the message hash. So the nr of outputs to the transaction does not matter, they are always hashed unmodified into the messagehash for each input. – Willem Hengeveld

I find the above quote confusing, sorry!

This is what I hashed: 01000000 01 e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65000000001976a9147e7fe35e49f0e8a920780c00d40b7171d880811988ac1976a914942920e041353162b0d8bd006d09c2ca25cdc27888acffffffff 02 1004df02000000001976a9147e7fe35e49f0e8a920780c00d40b7171d880811988ac c05f3b04000000001976a914942920e041353162b0d8bd006d09c2ca25cdc27888ac 00000000 01000000

And got this:

0x76041b6949563e76d77012f9723bec3c7a1a21fd84c74bb58df47087cef056d7

Is it correct? Is there a way to verify it?

1

Seems to me that it is not correct

Sorry, I do not have a tool rigth now, and creating data manually is a little bit difficult and I may create errors also See update below

There should be something like this

01000000
01
e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65 00000000
1976a914 f65d5c02866b8cea5840b2f9fb739f2e6ee6c8f4 88ac
ffffffff
02
1004df0200000000 1976a914 7e7fe35e49f0e8a920780c00d40b7171d8808119 88ac
c05f3b0400000000 1976a914 942920e041353162b0d8bd006d09c2ca25cdc278 88ac
00000000
01000000

Update: Here is a piece of my checking code.

const QByteArray xx ( QByteArray::fromHex ( "01000000"
"01"
"e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65 00000000"
"1976a914 f65d5c02866b8cea5840b2f9fb739f2e6ee6c8f4 88ac"
"ffffffff"
"02"
"1004df0200000000 1976a914 7e7fe35e49f0e8a920780c00d40b7171d8808119 88ac"
"c05f3b0400000000 1976a914 942920e041353162b0d8bd006d09c2ca25cdc278 88ac"
"00000000"
"01000000" ) );
const MyKey32 digest ( xx.constData ( ), xx.size ( ) ); // construct object of sha256 (sha256 ( xx ) )
_trace ( digest.toStringRev ( ) );                      // print result
const QByteArray pubkey ( QByteArray::fromHex ( "036a6d9c781613b2f07607b240e019fb2344704258e63df4802a436302942e73d3" ) );
const QByteArray signature ( QByteArray::fromHex ( "30450221008f1bcf2624da3b423ca19eb9eb6c8fb84e6614cd603cbf9f2f1d8c7103534138022038190065341fd3cd4a697ee1ca02f5b1f1131a5268ba9df5d976e782a5edc379" ) );
_trace ( QString ( "verify=%1" ).arg ( digest.verify ( pubkey, signature ) ) );

and the result is

"f71aa6b6127ce9229d9607c0ee133d8195f91b14fe7d554ef8a6a40d99338426"
"verify=1"
  • I'd like to know how you got f65d5c02866b8cea5840b2f9fb739f2e6ee6c8f4 – prof.Zoom Oct 31 '16 at 9:08
  • this is funding script from blockchain.info/tx/… – amaclin Oct 31 '16 at 9:52
  • Thanks! sha256(sha256(your modified transaction)) gives: 0xf71aa6b6127ce9229d9607c0ee133d8195f91b14fe7d554ef8a6a40d99338426 Is there any way I can verify the z value? – prof.Zoom Oct 31 '16 at 9:58
  • sorry, i do not have a tool mentioned in bitcoin.stackexchange.com/questions/32305/… right now. you have to check signature yourself – amaclin Oct 31 '16 at 10:05
  • Thanks! your explanation is convincing. Although I couldn't verify due to my limited knowledge about ECDSA signature. I'll accept this answer if I'm able to verify. – prof.Zoom Oct 31 '16 at 12:12

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.