Sixth and last commit of the series. Completes frost_enrollment.md, adds the README feature link, and records the results of the full cross-build verification pass. frost_enrollment.md gains the four sections that only made sense once the code existed: - A round diagram naming who sends what to whom for u = 3, because the transposition between round 1.1's output buffers and round 1.2's input buffer is the one part of this protocol that is genuinely easy to wire up backwards, and prose does not make it obvious. - An API table in protocol order, plus the two array conventions stated once in a place a reader will find them: everything of length u is aligned with the caller's own ids order, and the parameters hash is the sole exception because it sorts a local copy; and the deliberately opposite own-slot conventions of share_agg's two u*32 buffers. - The Test vectors section, saying plainly what the vectors are and are not. They are regression vectors: they pin the tag strings, the serialization, the derivation and the identifier conventions, so that changing any of those is loud. They are not cross-validation, because the protocol has no BIP and the reference proof of concept's randomness is not seedable. The algebraic invariants in tests_impl.h are what carry correctness, and the section says which ones. - Frozen encodings, giving both tagged hashes in full so an interoperating implementation does not have to read the C. The verification section also now records what the fault-injection test demonstrates, since it is the concrete argument for the expected_pubshare parameter: a flipped bit in one sigma makes secshare_gen fail and wipe its output, while the same call with NULL succeeds and returns a wrong share. README.md gains the module link beside the other four FROST-stack entries, pointing at the module-local document. That keeps it consistent with EXTRA_DIST, which has carried the file since the scaffolding commit -- the pairing42f827a7established and0e5369decompleted for prefractal. CI wiring landed with the scaffolding commit and is unchanged here. NOT DONE, deliberately: the plan called for a CHANGELOG.md entry. That file opens by stating it is not this fork's changelog but upstream libsecp256k1's, and it has no "fork's experimental additions" section to add one under. None of frost, chilldkg, iceberg or prefractal has an entry there. Adding the first one would put fork-only content into a file documenting upstream releases and break with four modules' worth of precedent, so it is left out rather than done quietly. If a fork changelog is wanted, it is a separate decision affecting all five modules. ALSO NOT DONE, and flagged: no CI job builds any experimental module through CMake -- the only module flag in the workflow is -DSECP256K1_ENABLE_MODULE_RECOVERY=ON in the MSVC job (ci.yml:702). So the src/CMakeLists.txt block, the EXPERIMENTAL gate entry and the PARENT_SCOPE lift added by this series have no standing CI guard, exactly as they have none for frost, chilldkg, iceberg or prefractal. The plan offered closing the gap as optional; it would change what an existing job covers for five modules at once, which is wider than this series, so it is left as a separate decision. The CMake path was therefore verified by hand, below. Final verification, run over the finished tree: Autotools. - Ordering regression: configuring with ONLY --enable-module-frost-enrollment emits both -DENABLE_MODULE_FROST_ENROLLMENT=1 and -DENABLE_MODULE_FROST=1, the summary reports frost = yes, the build is warning-free and ./tests exits 0. - Full build with frost, chilldkg, iceberg, prefractal, frost-enrollment, recovery, ellswift, examples and ctime tests: zero warnings, `make check` reports 12/12 PASS including frost_enrollment_example. - ctime_tests under valgrind: 0 errors from 0 contexts. - make dist succeeds and the tarball carries the public header, all five module files including frost_enrollment.md, and the example. - With the module off (the default), nm shows zero frost_enrollment symbols in libsecp256k1.so. - --enable-module-frost-enrollment without --enable-experimental is rejected with the expected message. CMake, by hand. - Full FROST stack plus examples: configure reports frost-enrollment ON and frost ON (the PARENT_SCOPE lift working), the build is warning-free, ctest is 532/532 including secp256k1.example.frost_enrollment. - -DSECP256K1_ENABLE_MODULE_FROST_ENROLLMENT=ON without -DSECP256K1_EXPERIMENTAL=ON is rejected with the expected message. - The dev-mode preset that tools/check-abi.sh uses leaves both frost and frost-enrollment OFF, so the ABI comparison is unaffected by this series. Symbols. tools/symbol-check.py derives its expected set by grepping SECP256K1_API declarations under include/; simulating that grep yields exactly the five new names, and nm reports exactly those five exported from a frost-enrollment build, with no duplicates. The script itself could not be run here because python3-lief is not installed in this environment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6.4 KiB
libsecp256k1-zkp
A fork of libsecp256k1 with support for advanced and experimental features
Added features:
- Experimental module for ECDSA adaptor signatures.
- Experimental module for ECDSA sign-to-contract.
- Experimental modules for Confidential Assets (Pedersen commitments, range proofs, and surjection proofs).
- Experimental module for address whitelisting.
- Experimental module for Schnorr signature half-aggregation.
- Experimental module for FROST (BIP 445).
- Experimental module for ChillDKG, distributed key generation for FROST (bip-frost-dkg draft).
- Experimental module for Iceberg, a threshold scheme that lets a group of parties stand in for a single MuSig2 (BIP 327) participant.
- Experimental module for Prefractal, a nested FROST+MuSig2 signer that lets a FROST group occupy one participant slot of an ordinary MuSig2 (BIP 327) session.
- Experimental module for FROST enrollment, which grows a (t, n) FROST group into a (t, n+1) one, and repairs a lost share, without re-running key generation.
Experimental features are made available for testing and review by the community. The APIs of these features should not be considered stable.
Build steps
Obtaining and verifying
The git tag for each release (e.g. v0.6.0) is GPG-signed by one of the maintainers.
For a fully verified build of this project, it is recommended to obtain this repository
via git, obtain the GPG keys of the signing maintainer(s), and then verify the release
tag's signature using git.
This can be done with the following steps:
- Obtain the GPG keys listed in SECURITY.md.
- If possible, cross-reference these key IDs with another source controlled by its owner (e.g. social media, personal website). This is to mitigate the unlikely case that incorrect content is being presented by this repository.
- Clone the repository:
git clone https://github.com/bitcoin-core/secp256k1 - Check out the latest release tag, e.g.
git checkout v0.7.1 - Use git to verify the GPG signature:
% git tag -v v0.7.1 | grep -C 3 'Good signature' gpg: Signature made Mon 26 Jan 2026 07:42:46 PM UTC gpg: using RSA key 2840EAABF4BC9F0FFD716AFAFBAFCC46DE2D3FE2 gpg: Good signature from "Pieter Wuille <pieter@wuille.net>" [unknown] gpg: aka "Pieter Wuille <pieter.wuille@gmail.com>" [full] gpg: aka "[jpeg image of size 5996]" [undefined] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 133E AC17 9436 F14A 5CF1 B794 860F EB80 4E66 9320 Subkey fingerprint: 2840 EAAB F4BC 9F0F FD71 6AFA FBAF CC46 DE2D 3FE2
Building with Autotools
$ ./autogen.sh # Generate a ./configure script
$ ./configure # Generate a build system
$ make # Run the actual build process
$ make check # Run the test suite
$ sudo make install # Install the library into the system (optional)
To compile optional modules (such as Schnorr signatures), you need to run ./configure with additional flags (such as --enable-module-schnorrsig). Run ./configure --help to see the full list of available flags. For experimental modules, you will also need --enable-experimental as well as a flag for each individual module, e.g. --enable-module-rangeproof.
Building with CMake
To maintain a pristine source tree, CMake encourages to perform an out-of-source build by using a separate dedicated build tree.
Building on POSIX systems
$ cmake -B build # Generate a build system in subdirectory "build"
$ cmake --build build # Run the actual build process
$ ctest --test-dir build # Run the test suite
$ sudo cmake --install build # Install the library into the system (optional)
To compile optional modules (such as Schnorr signatures), you need to run cmake with additional flags (such as -DSECP256K1_ENABLE_MODULE_SCHNORRSIG=ON). Run cmake -B build -LH or ccmake -B build to see the full list of available flags.
Cross compiling
To alleviate issues with cross compiling, preconfigured toolchain files are available in the cmake directory.
For example, to cross compile for Windows:
$ cmake -B build -DCMAKE_TOOLCHAIN_FILE=cmake/x86_64-w64-mingw32.toolchain.cmake
To cross compile for Android with NDK (using NDK's toolchain file, and assuming the ANDROID_NDK_ROOT environment variable has been set):
$ cmake -B build -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28
Building on Windows
The following example assumes Visual Studio 2022. Using clang-cl is recommended.
In "Developer Command Prompt for VS 2022":
>cmake -B build -T ClangCL
>cmake --build build --config RelWithDebInfo
Usage examples
Usage examples can be found in the examples directory. To compile them you need to configure with --enable-examples.
- ECDSA example
- Schnorr signatures example
- Deriving a shared secret (ECDH) example
- ElligatorSwift key exchange example
- MuSig2 Schnorr multi-signatures example
To compile the examples, make sure the corresponding modules are enabled.
Benchmark
If configured with --enable-benchmark (which is the default), binaries for benchmarking the libsecp256k1-zkp functions will be present in the root directory after the build.
To print the benchmark result to the command line:
$ ./bench_name
To create a CSV file for the benchmark result :
$ ./bench_name | sed '2d;s/ \{1,\}//g' > bench_name.csv
Reporting a vulnerability
See SECURITY.md
Contributing to libsecp256k1
See CONTRIBUTING.md