This PR adds secp256k1lab as a subtree and uses it for low-level secp256k1 field and group arithmetic (i.e. replacing the contents of secp256k1.py) as a first step, primarily for demonstration purposes. Keeping it as a draft right now, to assess if there is conceptual support. The goal would be to keep the test framework code maintained here to Bitcoin Core specific parts and develop secp256k1-specific parts (e.g. MuSig, Silent Payments, FROST etc., to name a few upcoming ones) in secp256k1lab. I’m not sure if that’s a clear win from a maintenance perspective (it could e.g. add friction, having to depend on and coordinate with secp256k1lab maintainers), but I’m curious to hear opinions. Suggested e.g. in #32642#pullrequestreview-2881144268.
Also, there are still some problems and open questions:
- CI for “Windows native” job is failing (didn’t check in detail yet, but I assume the secp256k1lab folder is not found due to failing Path.resolve() symlink resolution, i.e. the library is searched within the build folder)
- BIP340 signing/verification can’t be fully replaced yet (the test framework’s Schnorr signing in
key.pyuses special testing parameters likeflip_pandflip_rthat aren’t available in secp256k1lab) - Where to place the subtree? Originally I added it in
test_framework/cryptobut moved it up directly totest, for not having to add a linter mypy exception, as it only targetstest/functional/*; maybe adding the subtree to a new folder liketest/libswould be better for clarity