> For the complete documentation index, see [llms.txt](https://docs.ducatprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ducatprotocol.com/how-ducat-works/oracles.md).

# Oracles

Oracles provide authenticated BTC/USD observations and the threshold commitments used by vault liquidation paths. Bitcoin does not fetch a market price or compare a vault's collateral ratio with a threshold.

The current mechanism uses a **price contract** signed with BIP-340 Schnorr. It binds an oracle identity, network, base price, timestamp, threshold price and a hash of a secret threshold key. A vault records the signed commitment and includes the hash in its spending conditions.

### Two responsibilities

| Responsibility            | Oracle output                                  | How it is used                                                                                                  |
| ------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Attest to a price         | Signed price contract                          | Wallets, guardians and validators authenticate the observation and check the proposed vault action.             |
| Enable a liquidation path | Released threshold key, also called a preimage | A liquidation spend presents this key and a guardian-group signature to satisfy a matching Bitcoin script path. |

The signature authenticates what the oracle attested. It does not prove that the quoted market price is correct. Likewise, Bitcoin verifies that a supplied preimage matches a hash; it does not verify why or when the oracle released it.

### Price contracts and transport

A current-price response, a signed price contract and an event carrying that contract are different objects. Only the validated contract supplies the authenticated commitment required for a vault.

Contracts can be delivered through service APIs or relays. The transport does not replace validation against the oracle keys authorised by the selected protocol profile. See [Price Quotes](https://docs.ducatprotocol.com/how-ducat-works/oracles/price-quotes.md) for the fields and reference client endpoints.

### Multiple oracles

An encumbered vault can retain one to three oracle commitments. The current format requires distinct oracle indices and compatible network, timestamp and price data. Each oracle retains its own signed threshold and hash.

Multiple oracle commitments do not mean that all oracles must release a key before a vault can be spent. The script construction offers alternative liquidation leaves. One matching preimage and an authorised guardian-group signature can satisfy a leaf; the complete transaction must also pass the protocol's liquidation rules.

For the lifecycle, see [How It Works](https://docs.ducatprotocol.com/how-ducat-works/oracles/how-it-works.md). For the exact cryptographic encoding, see [Generating Keys and Signatures](https://docs.ducatprotocol.com/how-ducat-works/oracles/generating-keys-and-signatures.md).
