Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: imjustagirl on December 12, 2019, 10:56:43 PM



Title: Bitcoin and SageMath question
Post by: imjustagirl on December 12, 2019, 10:56:43 PM
I was reading up on Bitcoin formulas, but I cannot get this one to work in SageMath.
This was supposed to be for related nonces and I was trying it with my own transactions.
c = k2-k1 where c is the difference between the two nonces.

p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
K = GF(p)
K((r2*z1)+(r1*s2*c)-(r1*z2))/((s1*r2)-(s2*r1))

Doesn't come up with the right result! It's supposed to give me k1.

This one works fine: K((z1*s2 - z2*s1)/(r*(s1-s2))) for repeated R's.

Did I mess up the formula or SageMath? Or everything together?  >:( Ugh! It bugs me. Thank you for any constructive thoughts.