Skip to content

Commit 69d344d

Browse files
committed
Add MuSig module which allows creating n-of-n multisignatures and adaptor signatures.
1 parent f0e4bb9 commit 69d344d

File tree

8 files changed

+1758
-0
lines changed

8 files changed

+1758
-0
lines changed

Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ if ENABLE_MODULE_SCHNORRSIG
182182
include src/modules/schnorrsig/Makefile.am.include
183183
endif
184184

185+
if ENABLE_MODULE_MUSIG
186+
include src/modules/musig/Makefile.am.include
187+
endif
188+
185189
if ENABLE_MODULE_RECOVERY
186190
include src/modules/recovery/Makefile.am.include
187191
endif

configure.ac

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ AC_ARG_ENABLE(module_schnorrsig,
134134
[enable_module_schnorrsig=$enableval],
135135
[enable_module_schnorrsig=no])
136136

137+
AC_ARG_ENABLE(module_musig,
138+
AS_HELP_STRING([--enable-module-musig],[enable MuSig module (experimental)]),
139+
[enable_module_musig=$enableval],
140+
[enable_module_musig=no])
141+
137142
AC_ARG_ENABLE(module_recovery,
138143
AS_HELP_STRING([--enable-module-recovery],[enable ECDSA pubkey recovery module (default is no)]),
139144
[enable_module_recovery=$enableval],
@@ -472,6 +477,10 @@ if test x"$enable_module_schnorrsig" = x"yes"; then
472477
AC_DEFINE(ENABLE_MODULE_SCHNORRSIG, 1, [Define this symbol to enable the schnorrsig module])
473478
fi
474479

480+
if test x"$enable_module_musig" = x"yes"; then
481+
AC_DEFINE(ENABLE_MODULE_MUSIG, 1, [Define this symbol to enable the MuSig module])
482+
fi
483+
475484
if test x"$enable_module_recovery" = x"yes"; then
476485
AC_DEFINE(ENABLE_MODULE_RECOVERY, 1, [Define this symbol to enable the ECDSA pubkey recovery module])
477486
fi
@@ -520,8 +529,16 @@ if test x"$enable_experimental" = x"yes"; then
520529
AC_MSG_NOTICE([Building key whitelisting module: $enable_module_whitelist])
521530
AC_MSG_NOTICE([Building surjection proof module: $enable_module_surjectionproof])
522531
AC_MSG_NOTICE([Building schnorrsig module: $enable_module_schnorrsig])
532+
AC_MSG_NOTICE([Building MuSig module: $enable_module_musig])
523533
AC_MSG_NOTICE([******])
524534

535+
536+
if test x"$enable_module_schnorrsig" != x"yes"; then
537+
if test x"$enable_module_musig" = x"yes"; then
538+
AC_MSG_ERROR([MuSig module requires the schnorrsig module. Use --enable-module-schnorrsig to allow.])
539+
fi
540+
fi
541+
525542
if test x"$enable_module_generator" != x"yes"; then
526543
if test x"$enable_module_rangeproof" = x"yes"; then
527544
AC_MSG_ERROR([Rangeproof module requires the generator module. Use --enable-module-generator to allow.])
@@ -543,6 +560,9 @@ else
543560
if test x"$enable_module_schnorrsig" = x"yes"; then
544561
AC_MSG_ERROR([schnorrsig module is experimental. Use --enable-experimental to allow.])
545562
fi
563+
if test x"$enable_module_musig" = x"yes"; then
564+
AC_MSG_ERROR([MuSig module is experimental. Use --enable-experimental to allow.])
565+
fi
546566
if test x"$set_asm" = x"arm"; then
547567
AC_MSG_ERROR([ARM assembly optimization is experimental. Use --enable-experimental to allow.])
548568
fi
@@ -574,6 +594,7 @@ AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])
574594
AM_CONDITIONAL([USE_ECMULT_STATIC_PRECOMPUTATION], [test x"$set_precomp" = x"yes"])
575595
AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])
576596
AM_CONDITIONAL([ENABLE_MODULE_SCHNORRSIG], [test x"$enable_module_schnorrsig" = x"yes"])
597+
AM_CONDITIONAL([ENABLE_MODULE_MUSIG], [test x"$enable_module_musig" = x"yes"])
577598
AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])
578599
AM_CONDITIONAL([ENABLE_MODULE_GENERATOR], [test x"$enable_module_generator" = x"yes"])
579600
AM_CONDITIONAL([ENABLE_MODULE_RANGEPROOF], [test x"$enable_module_rangeproof" = x"yes"])

include/secp256k1_musig.h

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.

src/modules/musig/Makefile.am.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include_HEADERS += include/secp256k1_musig.h
2+
noinst_HEADERS += src/modules/musig/main_impl.h
3+
noinst_HEADERS += src/modules/musig/tests_impl.h

0 commit comments

Comments
 (0)