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:
- Threshold contracts — monitor a price level continuously; attest when the price crosses above or below a defined strike
- Numeric contracts — attest the exact price at a scheduled maturity timestamp using digit decomposition
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.
| Instance | Oracle Pubkey | Endpoint |
|---|---|---|
| US GC | 03ff5589b5812f07dec1aad7af189e05131607998203 | api.myceliasignal.com/dlc/ |
| Asia GC | 02b1377c30c7dcfcba428cf299c18782856a12eb4fab | Internal only |
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.
# 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"}'
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.
# 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"}'
| Rail | Amount | Notes |
|---|---|---|
| L402 Lightning | 10,000 sats (~$7) | Any Lightning wallet. Invoice expires in 1 hour. |
| x402 USDC | $7.00 USDC on Base | EIP-3009 signature. Replay protection via CDP on-chain nonce. |
Free Endpoints
No payment required for discovery and read-only endpoints.
| Endpoint | Description |
|---|---|
GET /dlc/oracle/pubkey | Oracle public key, key format, curve, instance identifier |
GET /dlc/oracle/status | Announcement counts, attestation counts, supported pairs, instance |
GET /dlc/oracle/announcements | All 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/threshold | List 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
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"
}'
{
"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"
}
| Field | Type | Required | Description |
|---|---|---|---|
pair | string | Yes | Uppercase concatenated pair, e.g. BTCUSD, ETHUSD, XAUEUR |
strike | float | Yes | Price level to monitor |
direction | string | Yes | "above" or "below" |
expiry | int | No | Unix timestamp. Defaults to 1 year from registration. |
webhookUrl | string | No | Oracle 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.
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
| Schedule | Time (UTC) | Description |
|---|---|---|
| Daily | 00:00 | Every day |
| Weekly | 09:00 Friday | Standard options expiry |
| Monthly | 09:00 Last Friday | Institutional settlement |
Fetch a numeric announcement
curl -s https://api.myceliasignal.com/dlc/oracle/announcements/BTCUSD-2026-03-28T00:00:00Z
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.
| Pairs | Digits | Max price covered |
|---|---|---|
| BTCUSD, BTCEUR | 6 | $999,999 — future-proofed for BTC above $100k |
| ETHUSD, ETHEUR, SOLUSD, SOLEUR | 5 | $99,999 |
Supported Pairs
All 17 pairs support both threshold and numeric contracts. Pair format: uppercase concatenated, no slash.
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.
{
"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:
- Agree on terms — Strike price, direction (below/above), expiry timestamp
- Register contract — Lender calls
POST /dlc/oracle/thresholdwith payment credential - Get announcement — Response includes
eventid,oraclePubkey,rpoints - Construct CETs — Both parties use
oraclePubkeyandrpointsto build Contract Execution Transactions - Fund contract — Both parties sign and broadcast the funding transaction on-chain
- Monitor — Oracle watches price every 10 seconds using multi-source aggregated feeds
- Attestation — On breach or expiry, oracle publishes
svalues - Notification — Webhook fires if URL was provided; poll
GET /dlc/oracle/attestations/{eventid} - Settlement — Winning party uses
svaluesto complete adaptor signature and broadcast winning CET
Integration Guide — Numeric DLC
Options, futures, or prediction markets:
- Fetch announcement —
GET /dlc/oracle/announcements/BTCUSD-2026-03-28T00:00:00Z - Get pubkey and rpoints — From the announcement response
- Construct CETs — Build one CET per possible price outcome using digit decomposition
- Fund contract — Both parties sign and broadcast
- Wait for maturity — Oracle attests within 60 seconds of the scheduled time
- Fetch attestation —
GET /dlc/oracle/attestations/BTCUSD-2026-03-28T00:00:00Z - Settle — Use
svaluesto complete adaptor signature and broadcast winning CET
Cryptography
| Property | Value |
|---|---|
| Curve | secp256k1 |
| Signature scheme | Schnorr over secp256k1 |
| Threshold attestations | Binary outcome — breached or safe. Single R-point, single s-value. |
| Numeric attestations | Digit decomposition — N individual digits, each with its own R-point and s-value. |
| Nonces | Generated fresh per announcement using os.urandom(32). Stored per event ID. |
| Attestation latency | Within 60 seconds of scheduled maturity. Threshold contracts monitored every 10 seconds. |
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.