bitcoinjs / tiny-secp256k1

A tiny secp256k1 native/JS wrapper
MIT License
86 stars 55 forks source link

Pure-js backport of `xOnlyPointFromPoint()`..? #99

Closed Overtorment closed 1 year ago

Overtorment commented 1 year ago

For a project utilizing ver 1.1.6 Id like to use xOnlyPointFromPoint() which is available only on higher versions. Cant bumptiny because it doenst work in my environment (React Native).

xOnlyPointFromPointis needed by BIP47 (payment codes).

Is there any way to hack a pure-js implementation, or backport it to v1 branch..?

Thanks!

junderw commented 1 year ago

It's essentially buffer.slice(1, 33) 🤣

junderw commented 1 year ago

xonly pubkey is literally "just take the x value"

Overtorment commented 1 year ago

drake helps

Overtorment commented 1 year ago

Found ts implementation https://github.com/bitcoinjs/tiny-secp256k1/blob/8ab242adbb888e43b5964af503b814eadc28f5c5/src_ts/index.ts#L172 I dont know how I overlooked it looking the first time 🤦