libauth icon indicating copy to clipboard operation
libauth copied to clipboard

Custom libsecp256k1 is hard to merge with upstream

Open angel-manuel opened this issue 4 years ago • 5 comments

I've been trying to merge some libsecp256k1 upstream into libauth-secp256k1. This would solve #25, which is what i need.

Merging with bitcoin-core libsecp256k1 and solving conflicts is too painful and I wasn't able to make it compile and pass make check, merging with ABC's libsecp256k1 fails with git reporting fatal: refusing to merge unrelated histories.

Replacing the submodule with core libsecp256k1 is possible. The implementation of schnorr (schnorrsig module) has the same function signatures but ultimately fails to pass tests(results seem to be different), you can check this on https://github.com/angel-manuel/libauth/tree/d7f3fab9b1e1581a45e9c303c6de7743b96063b5

On https://github.com/angel-manuel/libauth/tree/feat-update-libsecp256k1 you can see part of my work wrapping the new functions.

Any ideas, @bitjson?

In any case I'm thinking about forking the WASM libsecp256k1 parts and supporting just stable bitcoin-core libsecp256k1. But I would like to finish my contribution if we find a way to merge with an acceptable upstream. Also, if the 0 npm dependencies restrictions were dropped it woudl be possible to maintain the WASM + wrappers on different repo/packages.

angel-manuel avatar Mar 27 '21 10:03 angel-manuel

Ever make any progress with this @angel-manuel ? I see you did some initial work getting core libsecp256k1 to compile to WASM, and updating the schnorrsig wrappers. I'm trying to get stable bitcoin-core libsecp256k1 wrapped for use in the browser.

blake-regalia avatar May 08 '22 04:05 blake-regalia

@blake-regalia I came here looking for a version of bitcoin-core libsecp256k1 that I could use in the browser. Did you happen across any good solutions? This repo here appears to be falling out of date...

brookr avatar May 30 '22 00:05 brookr

@brookr I did not. However, our org Solar Republic (namely @anragab) is about to start development on our own fork that will merge libsecp256k1 upstream and add support for ECDH (and possibly finish @angel-manuel's work with Schnorr sigs). Although, we only intend to support the Secp256k1 interface and may deprecate everything else.

blake-regalia avatar May 30 '22 01:05 blake-regalia

@blake-regalia @brookr i was able to extend other js libsecp256k1 project

here is my fork https://github.com/angel-manuel/js-secp256k1 and PR https://github.com/sc0Vu/js-secp256k1/pull/5 i exposed some functions there and reduced mem allocations

is it not typed as the one in this repo but it is closer to upstream(i think) and easy to modify

angel-manuel avatar Jun 06 '22 20:06 angel-manuel

@brookr @angel-manuel FYI I released a new project here that focusses strictly on bringing bitcoin-core's libsecp256k1 to the browser: https://github.com/SolarRepublic/wasm-secp256k1

blake-regalia avatar Nov 09 '23 02:11 blake-regalia

Solved now by a number of other libraries 👍

bitjson avatar Feb 23 '24 05:02 bitjson

Links please and thank you.

brookr avatar Feb 23 '24 18:02 brookr