DLC Oracle

Schnorr-signed attestations for Discreet Log Contracts on Bitcoin L1. Trustless settlement of financial contracts without custodial intermediaries.

What are DLCs?

Discreet Log Contracts are a Bitcoin-native protocol for trustless financial contracts. Two parties lock funds in a multisig, and an oracle's Schnorr attestation determines which party can claim the funds. The oracle never sees the contract, the participants, or the amounts — it simply publishes a signed price at the agreed time.

How It Works

The Mycelia Signal DLC oracle follows a two-phase commit-then-reveal pattern:

1. Announcement phase. Before the event maturity, the oracle publishes an announcement containing pre-committed nonce points (R-values) for each digit of the price. Contract participants use these R-points to construct their Contract Execution Transactions (CETs) before the outcome is known.

2. Attestation phase. At maturity (hourly for BTC/USD), the oracle publishes Schnorr s-values — one per digit — that correspond to the actual price outcome. These s-values, combined with the pre-committed R-points, allow exactly one party to claim the contract funds.

Numeric Decomposition

The oracle uses 5-digit numeric decomposition for BTC/USD prices. Each digit (0–9) of the price gets its own R-point and s-value. For example, a BTC price of $84,231 is decomposed into digits: [8, 4, 2, 3, 1].

This allows contract participants to construct CETs for price ranges rather than exact values — you can build a contract that pays out if BTC is above $80,000 by only checking the first two digits.

Endpoints

Free Endpoints

bash — oracle public key
curl https://api.myceliasignal.com/dlc/oracle/pubkey
json — response
{
  "oracle_pubkey": "02a1b2c3d4...compressed_hex",
  "key_format": "compressed",
  "key_bytes": 33,
  "curve": "secp256k1"
}
bash — oracle status
curl https://api.myceliasignal.com/dlc/oracle/status
json — response
{
  "oracle_pubkey": "02a1b2c3d4...",
  "announcements": 720,
  "attestations": 715,
  "pending": 5,
  "num_digits": 5,
  "pairs": ["BTCUSD"],
  "version": "v1"
}
bash — list announcements
curl https://api.myceliasignal.com/dlc/oracle/announcements
bash — single announcement
curl https://api.myceliasignal.com/dlc/oracle/announcements/BTCUSD-2026-03-03T17:00:00Z

Paid Endpoint (L402 — 1000 sats)

bash — get attestation
curl -i https://api.myceliasignal.com/dlc/oracle/attestations/BTCUSD-2026-03-03T17:00:00Z

This follows the same L402 flow as other paid endpoints — you'll receive a 402 with a Lightning invoice for 1000 sats, pay it, then retry with the macaroon + preimage.

Event ID Format

Event IDs follow the pattern: {PAIR}-{ISO8601_TIMESTAMP}

format
BTCUSD-2026-03-03T17:00:00Z

Events are created hourly. The timestamp indicates the maturity time — when the oracle will publish the attestation.

Announcement Structure

Each announcement contains the pre-committed R-points that contract participants need to build their CETs:

json — announcement
{
  "event_id": "BTCUSD-2026-03-03T17:00:00Z",
  "pair": "BTCUSD",
  "maturity": "2026-03-03T17:00:00Z",
  "num_digits": 5,
  "created_at": "2026-03-03T16:00:00Z",
  "nonce_points": [
    "03aabb...digit_0_R_point",
    "03ccdd...digit_1_R_point",
    "03eeff...digit_2_R_point",
    "031122...digit_3_R_point",
    "033344...digit_4_R_point"
  ]
}

Attestation Structure

After maturity, the attestation reveals the s-values for the actual price digits:

json — attestation
{
  "event_id": "BTCUSD-2026-03-03T17:00:00Z",
  "pair": "BTCUSD",
  "price": 84231,
  "digits": [8, 4, 2, 3, 1],
  "s_values": [
    "aabb11...s_for_digit_8",
    "ccdd22...s_for_digit_4",
    "eeff33...s_for_digit_2",
    "112244...s_for_digit_3",
    "334455...s_for_digit_1"
  ],
  "oracle_pubkey": "02a1b2c3d4...",
  "attested_at": "2026-03-03T17:00:05Z"
}

Error Handling

StatusMeaning
200Attestation available
402Payment required (L402 — 1000 sats)
404Event not found (invalid event ID)
425Event announced but not yet attested (maturity hasn't passed)
425 Too Early

If you request an attestation before the maturity time, the oracle returns HTTP 425 with the scheduled maturity. This is expected — the oracle has committed to the nonces but hasn't yet observed the price. Retry after the maturity timestamp.

Technical Details

ParameterValue
Curvesecp256k1
Signature schemeSchnorr (BIP-340 compatible)
Public key formatCompressed, 33 bytes hex
Numeric decomposition5 digits (price range 00000–99999)
Supported pairsBTCUSD (more coming)
Attestation frequencyHourly
Attestation price1000 sats (L402)
Nonce generationFresh random per digit per event
Cryptographic librarycoincurve (libsecp256k1)