A ready-to-go DLC node with a gRPC server and accompanying CLI built on the DlcDevKit framework.
The node uses Nostr for transport, PostgreSQL for storage, and Kormir as the oracle client.
$ cargo install ddk-node
| Binary | Description |
|---|---|
ddk-node |
The DLC node server exposing a gRPC API |
ddk-cli |
Command-line client to interact with ddk-node |
$ ddk-node --help
Usage: ddk-node [OPTIONS]
Options:
--log <LOG> Set the log level [default: info]
-n, --network <NETWORK> Set the Bitcoin network: regtest or signet [default: signet]
-s, --storage-dir <STORAGE_DIR> Data storage path [default: ~/.ddk]
-p, --port <PORT> Transport listening port [default: 1776]
--grpc <GRPC_HOST> gRPC server host:port [default: 127.0.0.1:3030]
--esplora <ESPLORA_HOST> Esplora server URL [default: https://mutinynet.com/api]
--oracle <ORACLE_HOST> Kormir oracle URL [default: https://kormir.dlcdevkit.com]
--seed <SEED> Seed strategy: 'file' or 'bytes' [default: file]
--postgres-url <URL> PostgreSQL connection URL
-h, --help Print help
$ ddk-cli --help
CLI for ddk-node
Usage: ddk-cli [OPTIONS] <COMMAND>
Commands:
info Get node information (pubkey, transport, oracle)
offer-contract Send a contract offer to a counterparty
offers List received contract offers
accept-offer Accept a DLC offer by contract ID
contracts List all contracts
balance Get wallet balance
wallet Wallet commands (new-address, transactions, utxos, send, sync)
oracle Oracle commands (announcements, create-enum, create-numeric, sign)
peers List connected peers
connect Connect to another DDK node
sync Sync wallet and contracts
help Print help
Options:
-s, --server <SERVER> gRPC server to connect to [default: http://127.0.0.1:3030]
-h, --help Print help
The node exposes a gRPC service with the following methods:
| Method | Description |
|---|---|
Info |
Get node info (pubkey, transport, oracle) |
SendOffer |
Send a DLC offer to a counterparty |
AcceptOffer |
Accept a received DLC offer |
ListOffers |
List all received contract offers |
ListContracts |
List all contracts |
NewAddress |
Generate a new wallet address |
WalletBalance |
Get wallet balance |
WalletSync |
Sync the on-chain wallet |
GetWalletTransactions |
Get wallet transactions |
ListUtxos |
List wallet UTXOs |
Send |
Send Bitcoin to an address |
ListPeers |
List connected peers |
ConnectPeer |
Connect to another DDK node |
ListOracles |
Get oracle info |
OracleAnnouncements |
Get oracle announcement by event ID |
CreateEnum |
Create an enum oracle event |
CreateNumeric |
Create a numeric oracle event |
SignAnnouncement |
Sign an oracle announcement |
# Start bitcoin, esplora, and postgres
$ just deps
# Start node one
$ just node-one
# Start node two (in another terminal)
$ just node-two
# Use the CLI
$ just cli-one info
$ just cli-two info
# Connect nodes
$ PUBKEY=$(just cli-one info | jq -r .pubkey)
$ just cli-two connect $PUBKEY@127.0.0.1:1776
# Create and accept a contract
$ just cli-two offer-contract $PUBKEY
$ just cli-one offers
$ just cli-one accept-offer <CONTRACT_ID>This project is licensed under the MIT License.
ddk-node is a development and test node. Its gRPC server has no
authentication and no TLS, and it exposes calls that spend the wallet
(Send) and commit collateral (AcceptOffer). It binds to loopback by
default; only pass another --grpc address on a network where every client
is trusted. Mainnet is not offered for this reason.
The wallet seed is written to <storage-dir>/seed.ddk in the clear with
owner-only permissions. Anyone who can read that file controls the wallet,
every contract key, and the nostr identity.