-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do real secp256k1 point->curve checking #1786
base: master
Are you sure you want to change the base?
Conversation
brandonblack
commented
Mar 23, 2022
•
edited
Loading
edited
- This is a breaking change, as it requires the JS environment to have BigInt (all supported releases that I can find do).
- This check may prevent loss of funds by eliminating a category of unspendable addresses from being created.
- Performance is almost as fast as tiny-secp256k1 39-42us vs 33-35us.
A note on performance: |
Also of note: I confirmed the accuracy of this function by comparing it to |
|
|
|
96d1df2
to
b176d36
Compare
Also, this exposes the methods from the public API via crypto. (we export crypto directly as is) I don't want to export these. (which is why types is not exported) |
Would you like them in a new file, in types, or another file?
…On Wed, Mar 23, 2022, 21:36 Jonathan Underwood ***@***.***> wrote:
Also, this exposes the methods from the public API via crypto. (we export
crypto directly as is)
I don't want to export these. (which is why types is not exported)
—
Reply to this email directly, view it on GitHub
<#1786 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVTUYXDF7BOVORO7NEFLZJDVBPWOPANCNFSM5RPIU6AQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
In types is fine. |
NACK on:
|
My Suggestion:
|
b176d36
to
3544424
Compare
IIUC React Native uses JavaScriptCore, which appears to have BigInt since Safari iOS 14, which was released 1.5 years ago. Looks like the very last version that didn't have BigInt was released with iOS 13.4.1 in April, 2020 and is not supported with security updates. Ah, but iOS 12 had its last release as recently as September 2021. I see that Exodus supports iOS 12+. OK. |
3544424
to
a54cad4
Compare
I'm still trying to avoid that in favor of passing just Because the MuSig tweak function will be per-input, a cached |
React: aka FacebookJS, aka ES5-or-bust |
And now that I've spelunked into the odd world of mobile device support cycles, I see that a version of iOS that didn't have BigInt in its JS engine was released as recently as September, 2021, and so using BigInt in bitcoinjs-lib should probably wait until that's aged out a bit more. 😢 |
* This is a breaking change, as it requires the JS environment to have BigInt (all supported versions of JavaScript engines appear to). * This check may prevent loss of funds by eliminating a category of unspendable addresses from being created. * Performance is almost as fast as tiny-secp256k1 39-42us vs 33-35us. * Added `isXOnlyPoint` to types, expecting it to be used for Taproot.
a54cad4
to
bf1a94a
Compare
Not sure if I want to ask for a rebase (we merged taproot yay!!!) or just close this... If we're gonna jump to BigInt requirements, might as well compile everything to WASM from Rust and rewrite the entire library in Rust! (can you tell I've become a Rust evangelist since the beginning of this year??? lol) |
React Native supported bigints since august. It doesn't support bigint literals 42n, so this PR is ok. @brandonblack is jacobi symbol faster than sqrt bit-by-bit unroll? |
I noticed RN support for BigInt recently when I was checking for support when merging noble into bip32. It's been almost half a year, but notably BlueWallet (one of our biggest/most popular dependents) is on an old version of RN that doesn't support it. Once BlueWallet supports BigInt, I'd support merging this, in addition to switching the concept of "amount" (currently type re: @Overtorment mentioned needing to bump to RN70 in October. |
Can confirm, BlueWallet is working on bumping RN to 70+. Not easy as we have some native dependencies lagging behind/unmaintained, so we are looking into workarounds cc @marcosrdz |
btw BW migrated to RN70+ and theoretically has BigInt now |