RFC: Integrate secp256k1lab v1.0.0 as subtree, use it for BIP-374 #1855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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