Skip to content

RFC: Integrate secp256k1lab v1.0.0 as subtree, use it for BIP-374 #1855

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

theStack
Copy link
Contributor

@theStack theStack commented May 20, 2025

This PR integrates the recently released secp256k1lab prototyping library as a subtree [1] and uses it in the BIP-374 reference code as a drop-in replacement of the currently used secp256k1.py file (copied in from the Bitcoin Core functional test framework in 0c7e54d). This is intended to serve as a showcase in the hope of triggering a discussion with BIP maintainers and authors on how to best integrate current and future BIPs reference implementations that take use secp256k1 curve operations.

I chose to demo this on BIP-374 since that's the BIP reference implementation I'm most familiar with, and as one can see in the last commit, the interface is fully compatible, i.e. there were no actual changes in the code logic needed. In order to find the vendored copy of secp256k1lab, Python's sys.path is extended [2]. Similar integrations have been done in the bip-frost-dkg (BlockstreamResearch/bip-frost-dkg#83) and bip-frost-signing (siv2r/bip-frost-signing#23, still WIP) repos.

See also related mailing list threads:

[1] added via the command $ git subtree add --prefix=python/secp256k1lab --squash https://github.com/secp256k1lab/secp256k1lab v1.0.0
[2] see e.g. BlockstreamResearch/bip-frost-dkg#81 for an earlier uglier approach; extending sys.path also seems to be a bit hacky, but seems to be the typical way to achieve the goal

theStack added 4 commits May 20, 2025 21:28
git-subtree-dir: python/secp256k1lab
git-subtree-split: 44dc4bd893b8f03e621585e3bf255253e0e0fbfb
This approach is incompatible with the sys.path extension approach
in the next commit which is used to to find the vendored copy of
secp256k1lab, so use __file__ instead which works as well.
@jonatack jonatack added Proposed BIP modification Process Trying to update process or stuck due to disagreement about Process labels May 21, 2025
@murchandamus murchandamus self-requested a review June 20, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Process Trying to update process or stuck due to disagreement about Process Proposed BIP modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants