Skip to content

library under the hood used by Cadena's applications

License

Notifications You must be signed in to change notification settings

CadenaWizard/cryptlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ../..

About

library under the hood used by Cadena's applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages