How can I find the nonce inverse of a particular bitcoin transaction?

138 Views Asked by At

How can I calculate the Y axis Of the R value in the Eliptic Curve Digital Signature Algorithm (Ecdsa). The reason I said 'y' axis of the 'r' value is because I believe the y axis is the nonce used to calculate the s value in Ecdsa. S = K^-1 (Z + RA) MOD Please correct me if I'm wrong.

The nonce inverse (k^-1) ...I'm trying to sign the digital signature I want to make. Is there any solution to this problem. I would love to know. Thanks in advance. (if the question is not understood please let me know down in the comments)

1

There are 1 best solutions below

10
On BEST ANSWER

If I'm understanding correctly: you're trying to run your own example of ECDSA (from your other closed post about the same issue). You have your "nonce", which is otherwise seems to be known as your secret key/ephemeral key: in this case a random element $k \mod q$, where $q$ is a prime that is a public parameter that I can only assume you know.

In order to find $k^{-1} \mod q$, you should use Bézout's Lemma that provides you with the following: if you let $g = \gcd(k,q)$, then there exists $u,v \in \mathbb{Z}$ such that $$uk+vq=g.$$ Noting in this case that $g =1$ since $q$ is prime, we have that $$uk+vq \equiv uk \equiv g \equiv 1 \mod q$$ hence $u=k^{-1}$. Therefore your objective should be to find this value $u$. To compute this value one often uses the extended Euclidean algorithm.