I have all of the Shamir's secret shares required to Lagrange-interpolate f(0)
, which represents an ECDSA private key. The field of this object is secp256k1
, which has associated prime number p=115792089237316195423570985008687907853269984665640564039457584007908834671663
.
The Lagrange interpolation produces a negative f(0)
, but because curves over secp256k1
can have exactly 0 or exactly 2 y-coordinates at any x, I'm assuming I can use the absolute value of f(0)
.
My other understanding is that since we're working over the finite field Zp, S = f(0) (mod p)
. Where I'm held up is how to turn this 77-byte number (S
) into the ECDSA private key.
I've tried reconstructing a wallet using S
in hexadecimal as the private key, as well as the sha256 of S
, but I don't believe either of those methods are correct.
Are my previous assumptions correct, and if so, how should I go from S
to the ECDSA private key?