chilldkg: Phase 0 - module scaffolding and build wiring
Add an empty, experimental `chilldkg` module as the foundation for a ChillDKG implementation (distributed key generation for FROST) per the bip-frost-dkg BIP draft (v0.3.0-dev): https://github.com/BlockstreamResearch/bip-frost-dkg The module lives in src/modules/chilldkg/ (separate from the frost module, per the implementation plan in .idea/docs/ chilldkg-implementation-plan.md: FROST signing (BIP 445) and ChillDKG are separate BIPs with separate reference repos, test vectors and review cycles; the dependency between them is one-way bytes). New files: - include/secp256k1_chilldkg.h: public header skeleton with the same "EXTREMELY DANGEROUS / work in progress" warning style as secp256k1_frost.h, plus a note that the BIP is a draft and tagged hashes/wire formats may change. No API yet (Phase 3+). - src/modules/chilldkg/main_impl.h: implementation skeleton including the public header. - src/modules/chilldkg/tests_impl.h: trivial scaffolding unit test (chilldkg_scaffolding_test) registered via the tests_chilldkg[] CASE1 array used by this repo's unit-test framework. - src/modules/chilldkg/Makefile.am.include: autotools file list, mirroring the frost module's. - src/modules/chilldkg/chilldkg.md: module doc stub (purpose, draft status, dependency on the schnorrsig and ecdh modules). Build wiring (mirrors the frost module exactly): - configure.ac: --enable-module-chilldkg (default no, experimental gate), dependency errors when schnorrsig or ecdh are explicitly disabled, AM_CONDITIONAL(ENABLE_MODULE_CHILLDKG), summary line. - Makefile.am: include src/modules/chilldkg/Makefile.am.include under ENABLE_MODULE_CHILLDKG. - src/secp256k1.c: guarded include of modules/chilldkg/main_impl.h after the frost module. - src/tests.c: guarded include of tests_impl.h and MAKE_TEST_MODULE(chilldkg) registration. - CMakeLists.txt: SECP256K1_ENABLE_MODULE_CHILLDKG option (OFF) + summary line. - src/CMakeLists.txt: dependency checks on SECP256K1_ENABLE_MODULE_SCHNORRSIG and SECP256K1_ENABLE_MODULE_ECDH, ENABLE_MODULE_CHILLDKG=1 compile definition, public header export. Verified: - ./autogen.sh && ./configure --enable-experimental --enable-module-chilldkg --enable-module-schnorrsig --enable-module-ecdh && make check: PASS 3/3 (tests, noverify_tests, exhaustive_tests). - configure fails with a clear error when schnorrsig or ecdh are disabled, or when experimental is not enabled. - CMake build with SECP256K1_ENABLE_MODULE_CHILLDKG=ON: ctest 345/345 passed; dependency errors fire correctly when schnorrsig/ecdh OFF.
This commit is contained in:
3
src/modules/chilldkg/Makefile.am.include
Normal file
3
src/modules/chilldkg/Makefile.am.include
Normal file
@@ -0,0 +1,3 @@
|
||||
include_HEADERS += include/secp256k1_chilldkg.h
|
||||
noinst_HEADERS += src/modules/chilldkg/main_impl.h
|
||||
noinst_HEADERS += src/modules/chilldkg/tests_impl.h
|
||||
24
src/modules/chilldkg/chilldkg.md
Normal file
24
src/modules/chilldkg/chilldkg.md
Normal file
@@ -0,0 +1,24 @@
|
||||
Notes on the chilldkg module API
|
||||
================================
|
||||
|
||||
This module implements ChillDKG, a distributed key generation (DKG) protocol
|
||||
for FROST, as specified by the bip-frost-dkg BIP draft
|
||||
(https://github.com/BlockstreamResearch/bip-frost-dkg, version 0.3.0-dev). In
|
||||
a ChillDKG session, n participants jointly generate a threshold key with the
|
||||
help of an untrusted coordinator, such that no party (including the
|
||||
coordinator) learns more than its own secret share, and every participant
|
||||
obtains the threshold public key and the public shares of all participants.
|
||||
The output is designed to feed directly into the frost module
|
||||
(`include/secp256k1_frost.h`), which implements FROST signing (BIP 445) and
|
||||
explicitly leaves DKG out of scope.
|
||||
|
||||
**This module is experimental.** Do not use it in production. The API should
|
||||
not be considered stable. The underlying BIP is still a draft (v0.3.0-dev):
|
||||
tagged hashes, wire formats, and protocol details may change in future BIP
|
||||
versions.
|
||||
|
||||
The module depends on the schnorrsig module (for the CertEq certificate and
|
||||
proofs of possession) and the ecdh module (for encrypted share distribution).
|
||||
|
||||
The API is under construction; see the implementation plan in
|
||||
`.idea/docs/chilldkg-implementation-plan.md` for the phased roadmap.
|
||||
11
src/modules/chilldkg/main_impl.h
Normal file
11
src/modules/chilldkg/main_impl.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/***********************************************************************
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_MODULE_CHILLDKG_MAIN_H
|
||||
#define SECP256K1_MODULE_CHILLDKG_MAIN_H
|
||||
|
||||
#include "../../../include/secp256k1_chilldkg.h"
|
||||
|
||||
#endif
|
||||
21
src/modules/chilldkg/tests_impl.h
Normal file
21
src/modules/chilldkg/tests_impl.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/***********************************************************************
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_MODULE_CHILLDKG_TESTS_IMPL_H
|
||||
#define SECP256K1_MODULE_CHILLDKG_TESTS_IMPL_H
|
||||
|
||||
#include "../../../include/secp256k1_chilldkg.h"
|
||||
|
||||
/* Placeholder test for the chilldkg module scaffolding. Real tests are added
|
||||
* in later implementation phases. */
|
||||
static void chilldkg_scaffolding_test(void) {
|
||||
CHECK(1);
|
||||
}
|
||||
|
||||
static const struct tf_test_entry tests_chilldkg[] = {
|
||||
CASE1(chilldkg_scaffolding_test),
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user