> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashnet.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# ZeroConf

> Accept or decline ZeroConf offers for instant Bitcoin L1 deposit credit in Orchestra without waiting for on-chain confirmations.

## What does ZeroConf do?

When ZeroConf is enabled, Bitcoin L1 deposits can receive full credit instantly. Instead of waiting for on-chain confirmations, the engine generates a ZeroConf offer that partners accept or decline. Accepted offers credit the deposit immediately and proceed with execution.

## How are confirmations handled?

| Scenario                                    | Confirmations required |
| ------------------------------------------- | ---------------------- |
| ZeroConf offer accepted                     | 0 (instant)            |
| ZeroConf offer declined                     | 1                      |
| ZeroConf offer expired (no response)        | 1                      |
| ZeroConf disabled (`zeroconfEnabled=false`) | 3                      |

## What is the offer flow?

<Steps>
  <Step title="Quote with ZeroConf enabled">
    Create a quote with `sourceChain=bitcoin` and `zeroconfEnabled=true` (the default for bitcoin source, exact-in quotes). Set `zeroconfEnabled=false` explicitly to disable.
  </Step>

  <Step title="Deposit detected">
    After the Bitcoin transaction is broadcast and detected by the mempool monitor, the engine evaluates the deposit for ZeroConf eligibility.
  </Step>

  <Step title="Offer generated">
    The engine generates a ZeroConf offer and moves the order to `awaiting_approval`. The offer appears in `order.zeroconfOffer` in both status responses and webhook payloads.
  </Step>

  <Step title="Accept or decline">
    Call `POST /v1/orchestration/zeroconf/accept` for instant credit, or `POST /v1/orchestration/zeroconf/decline` to wait for 1 confirmation. If you do not respond before `expiresAt`, the offer expires and the engine waits for 1 confirmation.
  </Step>

  <Step title="Execution continues">
    After acceptance (instant credit) or confirmation (1 block), the order proceeds through swapping, bridging, and delivery.
  </Step>
</Steps>

## What fields are in a ZeroConf offer?

When present, `order.zeroconfOffer` contains:

| Field                     | Type           | Description                                                  |
| ------------------------- | -------------- | ------------------------------------------------------------ |
| `status`                  | string         | `pending`, `accepted`, `declined`, `expired`, or `confirmed` |
| `quoteId`                 | string         | ZeroConf quote identifier                                    |
| `depositSats`             | string         | Total BTC deposited (sats)                                   |
| `instantSats`             | string         | Amount credited instantly on acceptance                      |
| `holdbackSats`            | string         | Amount held until on-chain confirmation                      |
| `feeSats`                 | string         | ZeroConf fee (sats)                                          |
| `confirmationProbability` | number         | Estimated probability the transaction confirms               |
| `expiresAt`               | string         | Offer expiry (ISO 8601)                                      |
| `offeredAt`               | string         | When the offer was generated                                 |
| `resolvedAt`              | string or null | When accepted, declined, or expired. `null` while pending    |

The `confirmed` status means the Bitcoin transaction reached 1 confirmation before the offer was resolved, bypassing the approval window entirely.

## How do I accept or decline an offer?

Accept (instant credit):

```bash theme={null}
curl -sS -X POST "https://orchestration.flashnet.xyz/v1/orchestration/zeroconf/accept" \
  -H "Authorization: Bearer fn_..." \
  -H "X-Idempotency-Key: zeroconf:accept:YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"orderId": "ord_..."}'
```

Decline (wait for 1 confirmation):

```bash theme={null}
curl -sS -X POST "https://orchestration.flashnet.xyz/v1/orchestration/zeroconf/decline" \
  -H "Authorization: Bearer fn_..." \
  -H "X-Idempotency-Key: zeroconf:decline:YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"orderId": "ord_...", "reason": "Optional reason"}'
```

## When does ZeroConf apply?

* ZeroConf applies when `sourceChain=bitcoin` and `amountMode=exact_in`.
* Exact-out (`amountMode=exact_out`) uses confirmation-based processing and does not use ZeroConf.
* `zeroconfEnabled` defaults to `true` when `sourceChain=bitcoin`. Set it to `false` explicitly to disable.
* If the deployment does not have ZeroConf configured, the engine falls back to on-chain confirmations silently. No error is returned.

## How does ZeroConf work with liquidation addresses?

Liquidation addresses support the `zeroconfEnabled` flag. When enabled, each Bitcoin deposit generates a ZeroConf offer requiring partner resolution via webhook + API call. When disabled, deposits wait for 3 on-chain confirmations.

Some deployments require ZeroConf to be configured for liquidation address provisioning. If address creation returns a configuration error, contact your Flashnet operator.

See [reusable addresses](/products/orchestration/reusable-addresses#liquidation-addresses) for setup.

## Next steps

* [Order Lifecycle](/products/orchestration/order-lifecycle)
* [API: Approval Flows](/products/orchestration/api/approval-flows)
* [Reusable Addresses](/products/orchestration/reusable-addresses)
