bitauth / libauth

An ultra-lightweight, zero-dependency TypeScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.

Home Page:https://libauth.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom libsecp256k1 is hard to merge with upstream

angel-manuel opened this issue · 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.

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 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 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 @brookr i was able to extend other js libsecp256k1 project

here is my fork https://github.com/angel-manuel/js-secp256k1 and PR sc0Vu/js-secp256k1#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

@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

Solved now by a number of other libraries 👍