DLC Oracle

Schnorr-signed attestations for Discreet Log Contracts. Trustless, non-custodial financial contracts on Bitcoin L1 — without the oracle ever knowing the contract terms.

Overview

The Mycelia Signal DLC Oracle provides cryptographic attestations that enable two parties to construct trustless financial contracts on Bitcoin without the oracle knowing the contract terms, counterparty identities, or collateral amounts. The oracle is intentionally blind — this privacy-preserving property is a core feature of the DLC design.

Two contract types are supported:

Both types use Schnorr signatures over secp256k1 and are compatible with the DLC specification.

Instances

The oracle runs on two independent instances. Each maintains its own key material, nonces, announcements, and attestations. A contract built against one instance's announcement must be settled using that same instance's attestation.

InstanceOracle PubkeyEndpoint
US GC03ff5589b5812f07dec1aad7af189e05131607998203
86128a80d37d1503a8e84f
api.myceliasignal.com/dlc/
Asia GC02b1377c30c7dcfcba428cf299c18782856a12eb4fab
32b87081460f4ba2deab73
Internal only
Cloudflare routing

Both instances sit behind api.myceliasignal.com. Cloudflare routes to the nearest GC based on latency. To target a specific instance, connect directly to the GC IP and check the instance field in the /dlc/oracle/status response.

Payment

Two payment rails are supported. Both are checked on every request — you only need to implement one.

L402 — Lightning (10,000 sats)

Standard L402 protocol. Pay the invoice with any Lightning wallet (Phoenix, Strike, Alby, etc.) and retry with the preimage.

bash
# Step 1 — POST to get the invoice
curl -s -X POST https://api.myceliasignal.com/dlc/oracle/threshold \
  -H "Content-Type: application/json" \
  -d '{"pair":"BTCUSD","strike":90000,"direction":"above"}'

# Response: 402 with WWW-Authenticate header containing invoice + macaroon
# Pay the invoice, then retry with preimage:

curl -s -X POST https://api.myceliasignal.com/dlc/oracle/threshold \
  -H "Content-Type: application/json" \
  -H "Authorization: L402 <macaroon>:<preimage>" \
  -d '{"pair":"BTCUSD","strike":90000,"direction":"above"}'
Macaroon encoding

DLC macaroons use URL-safe base64 encoding. Use urlsafe_b64decode with padding normalisation when decoding. Macaroons are path-bound to /dlc/oracle/threshold and expire in 5 minutes.

x402 — USDC on Base ($7.00)

Standard x402 protocol using EIP-3009 transferWithAuthorization. Sign the transfer from your Base wallet and include the encoded payload.

bash
# Step 1 — POST to get payment requirements
curl -s -X POST https://api.myceliasignal.com/dlc/oracle/threshold \
  -H "Content-Type: application/json" \
  -d '{"pair":"BTCUSD","strike":90000,"direction":"above"}'

# Response: 402 with PAYMENT-REQUIRED header (x402 requirements)
# Sign EIP-3009 transfer, then retry:

curl -s -X POST https://api.myceliasignal.com/dlc/oracle/threshold \
  -H "Content-Type: application/json" \
  -H "X-Payment: <base64-encoded-payload>" \
  -d '{"pair":"BTCUSD","strike":90000,"direction":"above"}'
RailAmountNotes
L402 Lightning10,000 sats (~$7)Any Lightning wallet. Invoice expires in 1 hour.
x402 USDC$7.00 USDC on BaseEIP-3009 signature. Replay protection via CDP on-chain nonce.

Free Endpoints

No payment required for discovery and read-only endpoints.

EndpointDescription
GET /dlc/oracle/pubkeyOracle public key, key format, curve, instance identifier
GET /dlc/oracle/statusAnnouncement counts, attestation counts, supported pairs, instance
GET /dlc/oracle/announcementsAll announcements (numeric and threshold)
GET /dlc/oracle/announcements/{eventid}Single announcement by event ID
GET /dlc/oracle/attestations/{eventid}Single attestation. Returns HTTP 425 if not yet attested.
GET /dlc/oracle/thresholdList all active threshold contracts

Threshold Contracts

Threshold contracts monitor a price continuously and attest when the price crosses a defined level. Use for Bitcoin-collateralized loans, perpetual hedges, or any binary outcome contract.

Register a threshold contract

bash — L402
curl -s -X POST https://api.myceliasignal.com/dlc/oracle/threshold \
  -H "Content-Type: application/json" \
  -H "Authorization: L402 <macaroon>:<preimage>" \
  -d '{
    "pair": "BTCUSD",
    "strike": 90000,
    "direction": "above",
    "expiry": 1780000000,
    "webhookUrl": "https://your-server.com/dlc-webhook"
  }'
json — response
{
  "status": "registered",
  "eventid": "BTCUSD-ABOVE-90000-1774050380",
  "pair": "BTCUSD",
  "strike": 90000,
  "direction": "above",
  "expiry": 1780000000,
  "oraclePubkey": "03ff5589b5812f07dec1aad7af189e0513160799820386128a80d37d1503a8e84f",
  "rpoints": ["<R-point hex>"],
  "webhookUrl": "https://your-server.com/dlc-webhook",
  "rail": "secret"
}
FieldTypeRequiredDescription
pairstringYesUppercase concatenated pair, e.g. BTCUSD, ETHUSD, XAUEUR
strikefloatYesPrice level to monitor
directionstringYes"above" or "below"
expiryintNoUnix timestamp. Defaults to 1 year from registration.
webhookUrlstringNoOracle POSTs attestation payload here on breach or expiry.

Cancel a threshold contract

Send a DELETE to cancel an active contract. The oracle immediately attests safe. Use this for loan repayment or manual contract closure.

bash
curl -s -X DELETE https://api.myceliasignal.com/dlc/oracle/threshold/BTCUSD-ABOVE-90000-1774050380 \
  -H "Authorization: L402 <macaroon>:<preimage>"

Numeric Contracts

Numeric contracts attest the exact price at a scheduled maturity timestamp. Pre-announced 35 days in advance. Use for options, futures, or prediction markets where counterparties need to construct CETs covering all possible price outcomes.

Scheduled expiry series

ScheduleTime (UTC)Description
Daily00:00Every day
Weekly09:00 FridayStandard options expiry
Monthly09:00 Last FridayInstitutional settlement

Fetch a numeric announcement

bash
curl -s https://api.myceliasignal.com/dlc/oracle/announcements/BTCUSD-2026-03-28T00:00:00Z
bash — fetch attestation after maturity
curl -s https://api.myceliasignal.com/dlc/oracle/attestations/BTCUSD-2026-03-28T00:00:00Z

Digit decomposition

Numeric attestations decompose the price into individual digits, each attested separately. This allows counterparties to construct CETs covering all possible price outcomes efficiently.

PairsDigitsMax price covered
BTCUSD, BTCEUR6$999,999 — future-proofed for BTC above $100k
ETHUSD, ETHEUR, SOLUSD, SOLEUR5$99,999

Supported Pairs

All 17 pairs support both threshold and numeric contracts. Pair format: uppercase concatenated, no slash.

BTCUSD
BTCUSDVWAP
BTCEUR
BTCEURVWAP
BTCJPY
ETHUSD
ETHEUR
ETHJPY
SOLUSD
SOLEUR
SOLJPY
XAUUSD
XAUEUR
XAUJPY
XRPUSD
ADAUSD
DOGEUSD

Webhook Delivery

When registering a threshold contract, an optional webhookUrl can be provided. The oracle POSTs the attestation payload to this URL on breach or expiry. Delivery is attempted up to 3 times with exponential backoff.

json — webhook payload
{
  "eventid": "BTCUSD-ABOVE-90000-1774050380",
  "outcome": "breached",
  "pair": "BTCUSD",
  "strike": 90000,
  "direction": "above",
  "oraclePubkey": "03ff5589b5812f07dec1aad7af189e0513160799820386128a80d37d1503a8e84f",
  "svalues": ["<s-value hex>"],
  "rpoints": ["<R-point hex>"],
  "attestedAt": "2026-03-21T14:22:10Z"
}

Attestation retrieval via the API remains available regardless of webhook delivery status.

Integration Guide — Threshold DLC

Bitcoin-collateralized loan example:

  1. Agree on terms — Strike price, direction (below/above), expiry timestamp
  2. Register contract — Lender calls POST /dlc/oracle/threshold with payment credential
  3. Get announcement — Response includes eventid, oraclePubkey, rpoints
  4. Construct CETs — Both parties use oraclePubkey and rpoints to build Contract Execution Transactions
  5. Fund contract — Both parties sign and broadcast the funding transaction on-chain
  6. Monitor — Oracle watches price every 10 seconds using multi-source aggregated feeds
  7. Attestation — On breach or expiry, oracle publishes svalues
  8. Notification — Webhook fires if URL was provided; poll GET /dlc/oracle/attestations/{eventid}
  9. Settlement — Winning party uses svalues to complete adaptor signature and broadcast winning CET

Integration Guide — Numeric DLC

Options, futures, or prediction markets:

  1. Fetch announcementGET /dlc/oracle/announcements/BTCUSD-2026-03-28T00:00:00Z
  2. Get pubkey and rpoints — From the announcement response
  3. Construct CETs — Build one CET per possible price outcome using digit decomposition
  4. Fund contract — Both parties sign and broadcast
  5. Wait for maturity — Oracle attests within 60 seconds of the scheduled time
  6. Fetch attestationGET /dlc/oracle/attestations/BTCUSD-2026-03-28T00:00:00Z
  7. Settle — Use svalues to complete adaptor signature and broadcast winning CET

Cryptography

PropertyValue
Curvesecp256k1
Signature schemeSchnorr over secp256k1
Threshold attestationsBinary outcome — breached or safe. Single R-point, single s-value.
Numeric attestationsDigit decomposition — N individual digits, each with its own R-point and s-value.
NoncesGenerated fresh per announcement using os.urandom(32). Stored per event ID.
Attestation latencyWithin 60 seconds of scheduled maturity. Threshold contracts monitored every 10 seconds.
Per-instance keys

Each GC instance maintains independent key material. This means contracts built against the US GC pubkey must be settled using US GC attestations, and vice versa for the Asia GC. Both public keys are listed in the Public Keys reference.