• Stars
    star
    288
  • Rank 143,818 (Top 3 %)
  • Language
    C
  • Created over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Experimental fork of libsecp256k1 with support for pedersen commitments and range proofs.

libsecp256k1-zkp

Dependencies: None

A fork of libsecp256k1 with support for advanced and experimental features such as Confidential Assets and MuSig2

Added features:

  • Experimental module for ECDSA adaptor signatures.
  • Experimental module for ECDSA sign-to-contract.
  • Experimental module for MuSig2.
  • Experimental module for Confidential Assets (Pedersen commitments, range proofs, and surjection proofs).
  • Experimental module for Bulletproofs++ range proofs.
  • Experimental module for address whitelisting.

Experimental features are made available for testing and review by the community. The APIs of these features should not be considered stable.

Build steps

Building with Autotools

$ ./autogen.sh
$ ./configure
$ make
$ make check  # run the test suite
$ sudo make install  # 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-musig.

Building with CMake (experimental)

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

$ mkdir build && cd build
$ cmake ..
$ cmake --build .
$ ctest  # run the test suite
$ sudo cmake --build . --target install  # 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 .. -LH 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 .. -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 .. -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=28

Building on Windows

To build on Windows with Visual Studio, a proper generator must be specified for a new build tree.

The following example assumes using of Visual Studio 2022 and CMake v3.21+.

In "Developer Command Prompt for VS 2022":

>cmake -G "Visual Studio 17 2022" -A x64 -S . -B build
>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.

To compile the Schnorr signature, ECDH and MuSig examples, you need to enable the corresponding module by providing a flag to the configure script, for example --enable-module-schnorrsig.

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

More Repositories

1

lightning

Core Lightning β€” Lightning Network implementation focusing on spec compliance and performance
C
2,829
star
2

elements

Open Source implementation of advanced blockchain features extending the Bitcoin protocol
C++
1,044
star
3

lightning-charge

A simple drop-in solution for accepting lightning payments
JavaScript
553
star
4

libwally-core

Useful primitives for wallets
C
271
star
5

simplicity

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.
C
243
star
6

paypercall

Charge for HTTP APIs on a pay-per-call basis with Bitcoin and Lightning ⚑
JavaScript
147
star
7

scriptless-scripts

Documentation about scriptless scripts
TeX
130
star
8

filebazaar

Sell digital files with Bitcoin & Lightning ⚑
JavaScript
120
star
9

woocommerce-gateway-lightning

A WooCommerce gateway for lightning payments
PHP
115
star
10

nanopos

A simple Lightning ⚑ point-of-sale system, powered by Lightning Charge
JavaScript
108
star
11

peerswap

Go
96
star
12

elementsproject.org

Source code for the ElementsProject.org website
CSS
90
star
13

nanotip

⚑ Lightning Tip Box ⚑
JavaScript
85
star
14

lightning-charge-client-js

JavaScript client for lightning-charge
JavaScript
64
star
15

ifpaytt

If Pay Then That ⚑ Trigger IFTTT actions with Bitcoin Lightning payments
JavaScript
56
star
16

wordpress-lightning-publisher

⚑ Lightning Publisher for WordPress
PHP
54
star
17

rust-elements

Rust support for Elements transaction/block deserialization
Rust
51
star
18

reserves

Proof-of-Reserves tool for Bitcoin
Rust
46
star
19

confidential-assets-demo

Confidential Assets Demo built on the Elements blockchain platform
Go
36
star
20

cross-input-aggregation

Thoughts on cross-input (signature) aggregation for Bitcoin
Rust
35
star
21

lightning-jukebox

A Lightning powered Jukebox ⚑ Pay with Bitcoin to choose your music.
JavaScript
35
star
22

rust-simplicity

C
34
star
23

elementsproject.github.io

https://elementsproject.org website
HTML
28
star
24

dicemix

Rust
24
star
25

lightning-charge-client-php

PHP client for lightning-charge
PHP
24
star
26

rust-secp256k1-zkp

C
23
star
27

cln-application

Core lightning application on Umbrel
TypeScript
21
star
28

ELIPs

Elements Improvement proposals
12
star
29

elements-miniscript

Rust
11
star
30

glightning

Go
7
star
31

peerswap-spec

7
star
32

borromean-signatures-writeup

TeX
6
star
33

elements-assets-exchange-demo

OTC-style exchange based on atomic swaps using Elements and confidential assets
JavaScript
5
star
34

qa-assets

Elements-related blobs used for quality assurance.
3
star
35

elementsbp-api-reference

[DEPRECATED: Moved to https://github.com/ElementsProject/elements/blob/elements-0.14.1/doc/elements-api.md] API Reference Documentation for the Elements Blockchain Platform
3
star
36

lightning-demos

2
star