Discreet Log Contracts (DLCs)
DLCs let two parties bet on real-world outcomes (price, sports, weather)
with on-chain settlement, without revealing contract terms on
chain. The oracle never knows about the bet; the chain only sees a
2-of-2 multisig + a CET that looks like an ordinary cooperative spend.
Original 2017 paper: Tadge Dryja. Modern specs: DLC Specification
working group (github.com/discreetlogcontracts/dlcspecs).
Core mechanism
Oracle setup (one-time):
- Oracle has long-term key
P_oracle.
- For each event, oracle publishes nonce
R_event = k * G in
advance.
- Oracle pledges: when event happens, publishes
s_outcome such that
s_outcome * G = R_event + e_outcome * P_oracle where
e_outcome = H(R_event, outcome_label).
Funding (party setup):
- Alice and Bob agree on contract: payout function
(outcome → (a, b)).
- They pre-sign all possible CETs as adaptor signatures over
each outcome's
T_outcome = R_event + e_outcome * P_oracle.
- Together they fund a 2-of-2 multisig output (the funding tx).
Settlement:
- Oracle publishes
s_outcome for the actual outcome.
- The party favored by that outcome adapts their pre-signed CET
with
s_outcome and broadcasts.
- Settlement happens in a single tx, looking like a generic 2-of-2
spend on chain.
Refund (timeout):
- If oracle never publishes (event canceled), parties can refund
via a CSV time-locked refund tx pre-signed during funding.
Why "discreet"
- On chain, an observer sees: funding tx (2-of-2 multisig output),
settlement tx (a regular spend). No contract terms, no oracle key,
no payout structure.
- Oracle never learns about the contract. Oracles can serve many
unrelated DLCs from one event publication.
Numerical outcomes
For continuous outcomes (e.g., BTC price ∈ [0, 100k]), oracle uses
multi-nonce attestation: publishes one R_i per bit / digit of
the outcome. Parties pre-sign CETs covering ranges of bit patterns.
CET count grows with precision:
- 0.1% precision over a 100k range → ~1000 CETs.
- Modern DLC libraries use CET trees + adaptor combinator tricks
to compress.
DLC vs other primitives
| Property |
DLC |
HTLC |
LN PTLC |
| On-chain footprint |
1 funding + 1 settlement |
1 setup + 1 redeem |
LN channel update |
| Oracle/preimage |
external oracle attestation |
internal preimage |
internal point |
| Outcome space |
discrete or numerical |
binary (revealed/not) |
binary |
| Atomicity |
enforced via adaptor sigs |
enforced via hash |
enforced via point |
Standardization
github.com/discreetlogcontracts/dlcspecs defines:
- Funding protocol.
- CET construction.
- Adaptor sig encoding.
- Oracle attestation format.
Wire protocol uses Lightning-style TLV messages over Tor / clearnet.
Implementations
rust-dlc (Crypto Garage) — most complete; production-grade.
rust-dlc-manager orchestrates funding/CET/refund tx chain.
- Integrates with
rust-bitcoin, bdk.
dlc-protocol (DLC.dev) — Python.
dlc-tools — JS/TS utility libs.
- DLCKit — Bitfinex's iOS DLC client.
Use cases
- Sports betting — outcome = team A or B wins.
- Price hedging — bilateral derivatives on BTC/USD.
- Parametric insurance — payout based on weather oracle.
- Lightning Loop alternatives — DLC-based off-chain mechanisms.
- Lava / Atomic Finance — production DLC apps.
Operational considerations
- Oracle availability: parties must trust the oracle to publish
the outcome. Multiple oracles → "DLC with k-of-n oracles" combines
attestations.
- CET storage: pre-signed CETs (per outcome) can total megabytes
of data per contract. Both parties must persist their share.
- Fee management: each pre-signed CET has a fixed fee at construction
time. If mempool fee rates spike, settlement may not confirm.
Mitigation: CPFP via anchor outputs, RBF if not pre-signed
immutably, or fee-bump-via-replacement on a per-CET basis.
Security caveats
- Oracle compromise = funds at risk. Use multi-oracle (k-of-n)
structure for high-value contracts.
- Replay across CETs — adaptor points must be unique per outcome
(built-in via
e_outcome derivation).
- Refund path must always exist; otherwise oracle outage =
permanent fund lock.
Common pitfalls
- Underestimating CET storage requirements for fine-grained numerical
contracts.
- Hard-coding fee rates instead of using anchor outputs / fee bumping.
- Trusting a single oracle for high-value contracts.
- Confusing DLC oracles (which are just signers, no chain) with
chain oracles like UMA, Chainlink, etc.
See also
1---2name: bitcoin-dlcs3description: |4 Discreet Log Contracts: smart contracts on Bitcoin via oracle5 attestations + adaptor signatures. Oracle publishes nonces upfront,6 reveals signed outcomes; CETs (Contract Execution Transactions)7 enforce payouts. No on-chain footprint of the contract logic.8 USE WHEN: building betting / prediction markets, parametric9 insurance, derivatives, oracle-driven settlements on Bitcoin.10allowed-tools: Read, Grep, Glob11metadata:12 source: https://skillmd.com/skills/claude-dev-suite/bitcoin-dlcs13---1415# Discreet Log Contracts (DLCs)1617DLCs let two parties bet on real-world outcomes (price, sports, weather)18with on-chain settlement, **without** revealing contract terms on19chain. The oracle never knows about the bet; the chain only sees a202-of-2 multisig + a CET that looks like an ordinary cooperative spend.2122Original 2017 paper: Tadge Dryja. Modern specs: DLC Specification23working group (`github.com/discreetlogcontracts/dlcspecs`).2425## Core mechanism26271. **Oracle setup** (one-time):28 - Oracle has long-term key `P_oracle`.29 - For each event, oracle publishes nonce `R_event = k * G` in30 advance.31 - Oracle pledges: when event happens, publishes `s_outcome` such that32 `s_outcome * G = R_event + e_outcome * P_oracle` where33 `e_outcome = H(R_event, outcome_label)`.34352. **Funding** (party setup):36 - Alice and Bob agree on contract: payout function `(outcome → (a, b))`.37 - They pre-sign **all possible CETs** as adaptor signatures over38 each outcome's `T_outcome = R_event + e_outcome * P_oracle`.39 - Together they fund a 2-of-2 multisig output (the funding tx).40413. **Settlement**:42 - Oracle publishes `s_outcome` for the actual outcome.43 - The party favored by that outcome adapts their pre-signed CET44 with `s_outcome` and broadcasts.45 - Settlement happens in a single tx, looking like a generic 2-of-246 spend on chain.47484. **Refund** (timeout):49 - If oracle never publishes (event canceled), parties can refund50 via a CSV time-locked refund tx pre-signed during funding.5152## Why "discreet"5354- On chain, an observer sees: funding tx (2-of-2 multisig output),55 settlement tx (a regular spend). No contract terms, no oracle key,56 no payout structure.57- Oracle never learns about the contract. Oracles can serve many58 unrelated DLCs from one event publication.5960## Numerical outcomes6162For continuous outcomes (e.g., BTC price ∈ [0, 100k]), oracle uses63**multi-nonce attestation**: publishes one `R_i` per bit / digit of64the outcome. Parties pre-sign CETs covering ranges of bit patterns.6566CET count grows with precision:67- 0.1% precision over a 100k range → ~1000 CETs.68- Modern DLC libraries use **CET trees** + adaptor combinator tricks69 to compress.7071## DLC vs other primitives7273| Property | DLC | HTLC | LN PTLC |74|----------|-----|------|---------|75| On-chain footprint | 1 funding + 1 settlement | 1 setup + 1 redeem | LN channel update |76| Oracle/preimage | external oracle attestation | internal preimage | internal point |77| Outcome space | discrete or numerical | binary (revealed/not) | binary |78| Atomicity | enforced via adaptor sigs | enforced via hash | enforced via point |7980## Standardization8182`github.com/discreetlogcontracts/dlcspecs` defines:83- Funding protocol.84- CET construction.85- Adaptor sig encoding.86- Oracle attestation format.8788Wire protocol uses Lightning-style TLV messages over Tor / clearnet.8990## Implementations9192- **`rust-dlc`** (Crypto Garage) — most complete; production-grade.93 - `rust-dlc-manager` orchestrates funding/CET/refund tx chain.94 - Integrates with `rust-bitcoin`, `bdk`.95- **`dlc-protocol`** (DLC.dev) — Python.96- **`dlc-tools`** — JS/TS utility libs.97- **DLCKit** — Bitfinex's iOS DLC client.9899## Use cases100101- **Sports betting** — outcome = team A or B wins.102- **Price hedging** — bilateral derivatives on BTC/USD.103- **Parametric insurance** — payout based on weather oracle.104- **Lightning Loop alternatives** — DLC-based off-chain mechanisms.105- **Lava / Atomic Finance** — production DLC apps.106107## Operational considerations108109- **Oracle availability**: parties must trust the oracle to publish110 the outcome. Multiple oracles → "DLC with k-of-n oracles" combines111 attestations.112- **CET storage**: pre-signed CETs (per outcome) can total megabytes113 of data per contract. Both parties must persist their share.114- **Fee management**: each pre-signed CET has a fixed fee at construction115 time. If mempool fee rates spike, settlement may not confirm.116 Mitigation: CPFP via anchor outputs, RBF if not pre-signed117 immutably, or fee-bump-via-replacement on a per-CET basis.118119## Security caveats120121- **Oracle compromise** = funds at risk. Use multi-oracle (k-of-n)122 structure for high-value contracts.123- **Replay across CETs** — adaptor points must be unique per outcome124 (built-in via `e_outcome` derivation).125- **Refund path** must always exist; otherwise oracle outage =126 permanent fund lock.127128## Common pitfalls129130- Underestimating CET storage requirements for fine-grained numerical131 contracts.132- Hard-coding fee rates instead of using anchor outputs / fee bumping.133- Trusting a single oracle for high-value contracts.134- Confusing **DLC oracles** (which are just signers, no chain) with135 **chain oracles** like UMA, Chainlink, etc.136137## See also138139- [adaptor-sigs/SKILL.md](../adaptor-sigs/SKILL.md)140- [schnorr/SKILL.md](../schnorr/SKILL.md)141- [../../libraries/rust-dlc/SKILL.md](../../libraries/rust-dlc/SKILL.md)142- [../../privacy/atomic-swaps/SKILL.md](../../privacy/atomic-swaps/SKILL.md)