dlccryptlib

Crates.iodlccryptlib
lib.rsdlccryptlib
version1.0.0
created_at2025-12-16 13:36:30.607449+00
updated_at2026-01-12 13:59:40.40979+00
descriptionLibrary for working with DLC's with adaptor signatures (Discrete Log Contracts), by Cadena Bitcoin
homepage
repository
max_upload_size
id1987792
size93,539
optout (optout21)

documentation

README

cryptlib -- DLC helper library

This library provides methods for working with Dicreet Log Contracts -- DLC's -- with adaptor signatures, on the Bitcoin chain.

This library is part of the Cadena Bitcoin platform, and used in places where DLC signatures are required (the Oracle server, the client application).

The secp256k1_zkp library is used for the cryptographic primitives -- this is the most complete and secure adaptor signatures implementation available.

The library is written in Rust (a programming environment popular for crypto implemetations, due to its correctness and performance aspects), but interfacing from Python or a C interface is also possible.

Functionality

  • Load and store seed phrase

  • Generate child account keys, addresses

  • Sign a hash using a child key

  • Generate nonce values

  • Perform Schnorr signature of a message using a given nonce, using a child key

  • Create CET adaptor signature points (batch)

  • Create final CET signature

Roadmap

Currently cryptlib lives in two copies (with slight differences):

In the Oracle it is used from here, with a light Python wrapper. https://github.com/CadenaWizard/oracle/tree/main/dlcplazacryptlib

We plan to unify them into this repository.

Developing

To build and test in Rust:

cargo build && cargo test

Publish the library:

cargo publish

To build the Python-wrapper library:

cd lib-py
./venv/bin/pip install -r requirements.txt
VIRTUAL_ENV="./venv" ./venv/bin/maturin develop

Samples

cd samples/rust && cargo run && cd ../..
Commit count: 0

cargo fmt