> 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/how-it-works.md).

# How It Works

An oracle price contract connects a signed BTC/USD observation to a hashlocked liquidation path.

<figure><img src="https://3381100491-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZOzQaoopNKdgkYJmuRPt%2Fuploads%2Fgit-blob-4e223ed7e784bcd8d07d421d8df73d088f5be7fc%2Fgitbook-oracle-workflow.png?alt=media" alt="The oracle signs price and threshold commitments. A matching threshold key and guardian signature authorise the liquidation spend from the committed vault."><figcaption><p>Oracle commitments &#x26; liquidation</p></figcaption></figure>

### Creating the commitment

1. The oracle constructs a contract for a base price, observation timestamp, network and threshold price.
2. It derives a threshold key from its secret key and the contract parameters, then publishes the key's HASH160 hash.
3. It signs the contract identifier using BIP-340 Schnorr. The threshold key remains unrevealed while the contract is sealed.
4. The wallet and guardians authenticate the contract and check that its threshold is appropriate for the proposed vault state and protocol terms.
5. The vault transaction records the signed commitment and creates a liquidation leaf containing the threshold hash.

The hash, threshold price and signature are public. The threshold key is the part intended to remain secret before release.

### Selecting a threshold

The economic threshold depends on the debt, net collateral, oracle base price and protocol risk parameters. Price buckets and integer rounding determine the available commitments; the result is not always identical to an unrounded spreadsheet formula.

For example, with a $100,000 base BTC price, a 160% bucket and a 135% liquidation threshold ratio, the corresponding threshold is $84,375. At a 161% bucket, the unrounded result is approximately $83,850.93 and the threshold rounds upward to $83,851.

Use the signed threshold in the accepted vault commitment to identify its hashlocked path. Do not substitute a dashboard's current ratio or an independently rounded price.

### Releasing and spending

When the oracle's breach policy detects the threshold crossing, it can release the matching threshold key. A liquidator uses that key when constructing a transaction, and a guardian group checks the action's debt transfer, collateral, reserve payment and other rules before signing.

Bitcoin then checks the signature, preimage and normal transaction validity. A valid preimage alone cannot spend the vault; the guardian signature is also required. The borrower's signature is not required for the liquidation path.

The preimage becomes public when revealed and is visible in a liquidation witness. Once exposed, it cannot become secret again if the BTC price recovers. Fresh signing policy still requires the authenticated settlement price to be at or below the threshold associated with that preimage. Continued spendability also depends on the vault still being unspent and a guardian authorising the transaction.

### Availability and privacy

An unavailable oracle can prevent new commitments or delay the release needed for liquidation. An incorrect or premature release is a different risk: it exposes a spending capability that guardians must still evaluate against protocol policy.

Contract generation need not include a vault identifier. That reduces the information required in a request, but it does not guarantee anonymity: requests, relay activity and public vault commitments may be correlated. Deterministic key derivation also does not mean a service keeps no logs or cached contracts.
