Author

Topic: Bitcoin and SageMath question (Read 196 times)

member
Activity: 118
Merit: 11
December 12, 2019, 05:56:43 PM
#1
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?  Angry Ugh! It bugs me. Thank you for any constructive thoughts.


Jump to: