Why Nostr? What is Njump?
2023-06-09 12:44:43
in reply to

Richard Kiss [ARCHIVE] on Nostr: 📅 Original date posted:2015-10-03 📝 Original message: > > > Ah, it looks like ...

📅 Original date posted:2015-10-03
📝 Original message:
>
>
> Ah, it looks like the problem is that libsec256k1 actually goes a step
> further and runs SHA256(y||x), where "x" is the value I'm getting and y
> is '\x02' is the y value is even and '\x03' if it's odd. If I try both,
> one of them turns out right:
>
> Secret1: d9946724c6bd8d5b58bdd2256a0251816a42f9707c794427a410075e4dbb199c
> Secret2: 105e0c04f0a910d72dcf2683c21903ba08cd8b225e4124afc41bb2341dc40f49
>
> Unfortunately openssl throws away y and just gives us x, so I'm not sure
> if I can work out the right secret directly. I guess I can run the HMAC
> twice and pick the value that worked?
>
> Okay, we'll see if we can get any further tomorrow.
>
> Cheers,
> aj
>

My open source library pycoin has a function that will give you Y from X,
so you can use that or just pilfer enough code to reproduce it (it's not
native, but it's not a very complex operation).

https://github.com/richardkiss/pycoin/blob/master/pycoin/ecdsa/ecdsa.py#L115

Richard

--
http://richardkiss.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20151003/4c630e5d/attachment.html>;
Author Public Key
npub13erleydh06jnsdsz3y8xgza85h29g7kr6fus5ukx8j0f3pwyls3qrkyqe7