Dlc Dev Kit
:warning:
dlcdevkitis alpha software and should not be used with real money. API is subject to change.
Application tooling to get started with DLCs build with rust-dlc and bdk.
Build DLC application by plugging in your own transport, storage, and oracle clients.
Get Started
$ cargo add ddk
use Builder;
use SledStorage;
use LightningTransport; // with "lightning" feature
use KormirOracleClient;
use Network;
use Arc;
type ApplicationDdk = DlcDevKit;
Crates
Ready-to-go clients for developing applications:
ddk - DLC management with an internal BDK wallet.
ddk-node - A ready-to-go node with an accompanying cli.
payouts - Functions to build DLC contracts.
You can create a custom DDK instance by implementing the required traits for storage and transport. DDK traits are defined in ddk/src/lib.rs. The traits are super traits from what is required in bdk and rust-dlc.
To quickly get started building a DDK application, there are pre-built components.
Storage
sled - A simple file based storage using sled
Transport
LDK Peer Manager - Communication over Lightning gossip using rust-dlc's implementation
nostr - DLC communication from the NIP-88 spec
Oracle Clients
P2PDerivatives - Spot price futures on the Bitcoin price repo
kormir - Enumeration based oracle with server and nostr support repo
Development
A bitcoin node, esplora server, and oracle server are required to run DDK. Developers can spin up a development environment with the justfile provided.
$ just deps
Go to the README in ddk-node to start the project's DDK node example and more development information.