Commit Graph

38 Commits

Author SHA1 Message Date
Kgothatso Ngako
e581abad00 iceberg: add the Iceberg threshold-MuSig module
Port the experimental Iceberg module from the benchmark-iceberg tree
(github.com/furszy/benchmark-iceberg, sources/secp256k1-kmp/native/
secp256k1) into this repo.

Iceberg is a threshold scheme that lets a group of parties stand in
for a single MuSig2 (BIP 327) participant: the group produces one
ordinary MuSig2 public nonce and one ordinary MuSig2 partial
signature, so cosigners cannot tell a group is involved and need no
changes. Nonces are derived from a caller-chosen per-session label
(sid32) rather than stored, so no signer holds a secret nonce between
rounds; labels are public but must never be reused. A quorum of 2t-1
members (of whom up to t-1 may be corrupt) is needed in each round,
so the threshold is at most half the group rounded up; combined with
the scheme's other constraints the smallest usable group is 2-of-4.
See doc/iceberg.md and the module header for the full usage notes.

Module layout (src/modules/iceberg/, layered bottom-up, each layer
may only use the ones above it -- that ordering is also the
constant-time story):
- scalar_poly.{h,_impl.h}: secret-carrying polynomial arithmetic,
  keeping secrets away from inversions (documented in the header).
- rss.{h,_impl.h}: replicated secret sharing evaluation.
- vpss.{h,_impl.h}: verifiable public shares; variable-time by
  design, sees only participant indices and published points.
- keygen_impl.h: distributed key generation producing one share per
  member.
- session_impl.h: nonce_gen/nonce_agg and partial_sign/
  partial_sig_agg producing plain MuSig2 objects.
- tests_impl.h: 28 tests including the shipped vectors.h vector
  suite and dealer known-answer tests.
- bench_impl.h: benchmark definitions (wired in a follow-up commit).

Public headers: include/secp256k1_iceberg.h (installed) and
include/secp256k1_iceberg_dealer.h (in-tree only: a trusted dealer is
not part of the shipped API, but tests, benchmarks and the example
need to deal shares).

Content adaptations relative to the source tree (the only changes to
the ported code): three secp256k1_musig_nonce_process call sites in
tests_impl.h gained a NULL adaptor argument, because this repo's
musig is the zkp variant whose public nonce_process takes an optional
adaptor point. All musig internals the module uses (ge_parse_ext,
ge_serialize_ext, keyaggcoef, aggnonce_load, pubnonce_save,
partial_sig_save, nonce_process_internal) are identical in both
trees, as are all core headers the module touches; nothing else
needed adaptation.

Build wiring mirrors the chilldkg module:
- configure.ac: --enable-module-iceberg (default no, experimental
  gate), hard dependency on the musig module with a configure error
  if musig is explicitly disabled (musig itself pulls in schnorrsig),
  AM_CONDITIONAL(ENABLE_MODULE_ICEBERG), summary line.
- Makefile.am: include src/modules/iceberg/Makefile.am.include under
  the conditional.
- src/secp256k1.c: guarded include of modules/iceberg/main_impl.h
  after the chilldkg block (musig is included earlier, so its
  internals are in scope).
- src/tests.c: module test registration via MAKE_TEST_MODULE(iceberg).
- CMakeLists.txt / src/CMakeLists.txt: SECP256K1_ENABLE_MODULE_ICEBERG
  option (OFF) with a dependency check on SECP256K1_ENABLE_MODULE_MUSIG
  (placed before the musig block so the force-enable takes effect),
  ENABLE_MODULE_ICEBERG=1 compile definition, public header export,
  summary line.

Verified: ./configure --enable-experimental --enable-module-iceberg
&& make check passes; ./tests --target=iceberg runs the full module
suite (28/28); CMake build + ctest pass; the musig dependency error
fires correctly in both build systems.
2026-08-31 12:24:48 +02:00
mllwchrry
3b2ceb3e7a Merge commits '14e56970 1605b02f cd49c57e 453949ab 57315a69 97de5120 c5da3bde 99ab4a10 d071aa56 1d146ac3 322d0a43 c7a7f732 ac561601 dfe042fe 3019186a 95e68158 10f546a2 c0a2aba0 ' into temp-merge-1811 2026-03-03 14:45:28 +02:00
mllwchrry
8c7c24eb8a docs: simplify README description, fix musig docs 2026-02-16 13:01:42 +02:00
mllwchrry
8d443b8030 musig: Re-add adaptor signatures support 2026-02-13 15:07:52 +02:00
Jonas Nick
0267b65512 release process: mention the [Unreleased] link clearly
Adding this link was forgotten in the first version of the 0.7.1 release PR but
caught in PR review.
2026-01-30 14:32:36 +00:00
Jonas Nick
f411841a46 Add module "musig" that implements MuSig2 multi-signatures (BIP 327) 2024-10-07 14:03:42 +00:00
Jonas Nick
759bd4bbc8 doc: mention needs-changelog github label in release process 2024-08-01 15:55:01 +00:00
Hennadii Stepanov
9420eece24 cmake: Bump CMake minimum required version up to 3.16 2024-07-03 08:23:20 +01:00
Tim Ruffing
9fb7e2f156 release process: Style and formatting nits 2024-01-09 00:59:24 +01:00
Tim Ruffing
e7053d065b release process: Add email step 2023-12-21 17:34:22 +01:00
Tim Ruffing
429d21dc79 release process: Run sanity checks on release PR 2023-12-21 17:34:18 +01:00
Hennadii Stepanov
74a4d974d5 doc: Add ABI checking with check-abi.sh to the Release Process 2023-12-20 17:38:18 +00:00
Hennadii Stepanov
b0f7bfedc9 doc: Do not mention soname in CHANGELOG.md "ABI Compatibility" section
Co-authored-by: Tim Ruffing <crypto@timruffing.de>
2023-09-04 17:05:53 +01:00
Hennadii Stepanov
bd9d98d353 doc: Align documented scripts with CI ones 2023-09-04 16:05:29 +01:00
stratospher
c7d900ffd1 doc: minor ellswift.md updates 2023-07-05 20:26:18 +05:30
Pieter Wuille
90e360acc2 Add doc/ellswift.md with ElligatorSwift explanation 2023-06-20 11:31:58 -04:00
Jonas Nick
ad84603297 release process: clarify change log updates 2023-05-24 13:43:29 +00:00
Jonas Nick
6348bc7eee release process: fix process for maintenance release 2023-05-24 13:43:29 +00:00
Jonas Nick
79fa50b082 release process: mention targeted release schedule 2023-05-24 13:43:28 +00:00
Jonas Nick
165206789b release process: add sanity checks 2023-05-24 13:43:25 +00:00
Jonas Nick
1b6fb5593c doc: clarify process for patch releases 2023-04-10 15:19:07 +00:00
Tim Ruffing
0c07c82834 Add CMake instructions to release process
... and make wording a bit more consistent.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2023-03-26 17:40:18 +09:00
Elliott Jin
ce3cfc78a6 doc: Describe Jacobi calculation in safegcd_implementation.md 2023-02-28 15:57:32 -05:00
Pieter Wuille
5048be17e9 Rename valgrind_ctime_test -> ctime_tests 2023-01-11 16:07:37 -05:00
Jonas Nick
b6b360efaf doc: improve message of cleanup commit 2022-12-12 22:08:13 +00:00
Jonas Nick
b1f992a552 doc: improve release process
- make version on master always equal to latest release with patch+1
- separate regular from maintenance releases
- add more git commands to prevent accidents
- mention that one needs to somehow deal with release dates
- _LIB_VERSIONS_ -> _LIB_VERSION_
- don't push all tags in step 4
- add required message to git tag
- add suggested commit messages
2022-12-12 19:53:27 +00:00
Jonas Nick
ad39e2dc41 build: change package version to 0.1.0-dev
The suffix -dev is slightly clearer.

Also, since the package version follows semantic versioning, rename
VERSION_BUILD to VERSION_PATCH for clarity.
2022-12-07 22:07:05 +00:00
Jonas Nick
90618e9263 doc: move CHANGELOG from doc/ to root directory 2022-12-06 15:29:50 +00:00
Tim Ruffing
e02d6862bd selftest: Expose in public API 2022-12-05 11:26:44 +01:00
Tim Ruffing
53796d2b24 contexts: Rename static context 2022-12-05 11:26:44 +01:00
Tim Ruffing
316ac7625a contexts: Deprecate all context flags except SECP256K1_CONTEXT_NONE 2022-12-05 11:26:02 +01:00
Tim Ruffing
41e8704b48 build: Enable some modules by default
We don't enable the ECDSA recovery module, because we don't recommend
ECDSA recovery for new protocols. In particular, the recovery API is
prone to misuse: It invites the caller to forget to check the public
key (and the verification function always returns 1).

In general, we also don't recommend ordinary ECDSA for new protocols.
But disabling the ECDSA functions is not possible because they're not
in a module, and let's be honest: disabling ECDSA would mean to ignore
reality blatantly.
2022-08-03 17:09:54 +02:00
Jonas Nick
3ed0d02bf7 doc: add CHANGELOG template 2021-12-23 14:47:15 +00:00
Jonas Nick
6f42dc16c8 doc: add release_process.md 2021-12-23 14:47:15 +00:00
Elliott Jin
dc9b6853b7 doc: Minor fixes in safegcd_implementation.md 2021-11-15 21:16:00 -06:00
Pieter Wuille
277b224b6a Use modified divsteps with initial delta=1/2 for constant-time
Instead of using eta=-delta, use zeta=-(delta+1/2) to represent
delta. This variant only needs at most 590 iterations for 256-bit
inputs rather than 724 (by convex hull bounds analysis).
2021-04-13 11:59:11 -07:00
Pieter Wuille
376ca366db Fix typo in explanation 2021-04-13 11:58:54 -07:00
Pieter Wuille
d8a92fcc4c Add extensive comments on the safegcd algorithm and implementation
This adds a long comment explaining the algorithm and implementation choices by building
it up step by step in Python.

Comments in the code are also reworked/added, with references to the long explanation.
2021-03-08 09:56:07 -08:00