Skip to content
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

INVESTIGATION: Staging branch for experimental cryptography for the secp256k1 library? #88

Open
ChristopherA opened this issue May 8, 2022 · 4 comments

Comments

@ChristopherA
Copy link
Contributor

ChristopherA commented May 8, 2022

There is a need for a reasonable long-term "staging" ground branch for sep256k1 related crypto that might ultimately be brought into the bitcoin ecosystem, not just at the L1 level but also at L2.

The problem is that Bitcoin Core's secp256k1 library tends to not merge branches until they are extremely mature and are ready to use in an upcoming L1 release.

Until recently, Blockstream's Elements [secp256k1-zkp] has unofficially served this purpose, with early versions of Segwit, Schnorr, Taproot, etc. being first implemented there first and ultimately merged into the upstream master. Most recently, Musig 2 has been implemented in Elements -zkp branch and is under evaluation for merging upstream, and work toward quorum threshold FROST has started on Elements -zkp.

However, Blockstream and the Elements team are not sure that their Elements -zkp branch should be used this way, unless it is specifically for a Blockstream project. This causes problems as there are other important cryptographic functions that need tight integration with the secp256k1 library, but are not currently important to Blockstream, that ought to be supported by the larger community. Currently having to support multiple branches of the secp256k1 library is problematic.

I'm not sure if the right answer is to persuade Blockstream to broaden their support of other cryptographic code into Elements -zkp, or to try to build community support in the broader bitcoin-core community for an official long-term experimental staging branch hosted there, or if this is something that Blockchain Commons should try to offer the ecosystem. In the latter case, we don't have a sufficient level of cryptographic engineers to support a project like this, but we could possibly encourage some to commit to support a project like this hosted by Blockchain Commons.

/cc @kanzure @jesseposner @maaku @wolfmcnally @kanzure

@maaku
Copy link

maaku commented May 8, 2022 via email

@wolfmcnally
Copy link

If libsecp256k1-zkp is a fork of libsecp256k1, then it might make sense to have a well-maintained fork of libsecp256k1-zkp that can continue to pull from it as its upstream but also include a much wider variety of constructs contributed by the community. If any of the constructs prove more widely useful, they could be cherrypicked by upstream projects, but projects that need these less proven or more niche constructs could use this fork without giving up any of the advantages of the upstream repos.

@ChristopherA
Copy link
Contributor Author

The problem with forking -zkp is that there is a lot of code specific to Blockstream Liquid or other Blockstream projects that we may not want to support.

@wolfmcnally
Copy link

wolfmcnally commented May 14, 2022

If we fork libsecp256k1 directly then we'd have to cherry pick (and maintain) the parts of -zkp that we do want. If our fork is more about providing a wide range of functionality over providing support for a specific project like BitcoinCore or Elements, then I don't think we'd need to worry about bringing along the code that Blockstream uses; other people may find it useful too. I expect that maintaining it would basically involve pulling from -zkp upstream and making sure there are no regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 2025 Backlog
Development

No branches or pull requests

3 participants