Bitcoin Forum

Other => Beginners & Help => Topic started by: elpanxaaa on May 05, 2020, 09:07:08 PM



Title: Calculate Z value from r and s
Post by: elpanxaaa on May 05, 2020, 09:07:08 PM
Can anyone explain me any clearly answer or code in python with examples how we can calculate Z value from r and s ?? I search in google and youtube and i not saw any correctly answer i just see scam posts or video in youtube.

thank you in advance


Title: Re: Calculate Z value from r and s
Post by: pooya87 on May 06, 2020, 04:31:54 AM
you should first explain what it is you are trying to do and what you have in mind when you say "Z".

if Z is the 256-bit value used in creation of the signature then you can't compute it from r and s, it is computed from the data that was signed. in which case it depends on what was signed, for example in message signing the normalized UTF-8 decode of the message string + a fixed string added to the start of it then hashed twice with SHA256. for a transaction this is a lot more complicated and is not something i can cover in one comment because it includes transaction serialization and working with scripts and changes based on the script type being spent.