# Signing and nonces

Your desk has two keys. Keep them apart.

| Key | Type | Signs | Lives in |
| --- | --- | --- | --- |
| **Quote key** | secp256k1 (`0x…` address) | Bid intents, quotes, the registration grant | Your quoting service, ideally a KMS or HSM |
| **Authority** | Solana ed25519 | Setup, deposits, `configureMaker`, exercise | Cold or well-guarded storage |

The quote key never touches SOL or USDC directly. The authority owns your accounts and your vault. You can also name an **operator**: a second Solana key that may exercise for you without holding the authority.

## EIP-712, one domain per market

Every message is EIP-712 typed data. The domain is:

| Field | Value |
| --- | --- |
| `name` | `SOL Covered Calls` |
| `version` | `1` |
| `chainId` | `2000000001` (`CHAIN_ID`) |
| `verifyingContract` | Derived from the market's full terms (`quoteDomain`) |

The `verifyingContract` commits to every term of the market: program, deployment, collateral, strike, expiry, fee and more. So a bid or quote signed for one market can never be replayed on another. Always build the domain from the market account you read yourself:

```ts
import { decodeMarketV3, quoteDomain } from '@covrfun/maker-sdk';

const market = await decodeMarketV3(marketAddress, rawAccountBytes); // read at finalized, owner checked
const domain = quoteDomain(market);
```

## Low-s signatures only

The program rejects a signature whose `s` value is in the upper half of the curve order. `signIntent`, `signQuote` and `signRegistrationGrant` check this for you. If you sign another way, run `assertCanonicalSignature` on the result. Most libraries already produce low-s signatures.

## Nonces

Every quote carries a `nonce`: an unsigned 64-bit integer you choose. The nonce names the position the quote can open. Your position account address is derived from your quote key and that nonce. So **each nonce can open at most one position, ever, across all markets**.

The program accepts a quote only when:

```text
nonce >= min_nonce  and  nonce != 2^64 - 1
```

`min_nonce` lives in your Maker account. Read it with `decodeMaker`.

### Rules for a safe nonce journal

1. **Never reuse a nonce.** Keep a counter that only goes up.
2. **Write before you sign.** Before you sign a quote, durably record its nonce, its full terms and the cash it could cost. Use fsync or a database commit.
3. **Start at or above `min_nonce`.** On startup, read your Maker account and start at the larger of your journal and `min_nonce`.
4. **One writer per journal.** Two processes on one journal will hand out the same nonce.

The example bot does all four. It keeps an append-only JSON-lines journal and takes a lock file. See [Run the example bot](https://docs.covr.markets/guides/run-the-example-bot.md).

## Unknown outcomes

A quote request that times out may still have reached the gateway. The same holds for a socket that dies while sending it. The SDK reports these as `OutcomeUnknownError`, never as "not sent".

Treat that quote as **live** until one of these is true:

- your position account for that nonce exists (it filled), or
- its `validUntil` has passed and no fill landed.

Keep its cash held until then. The SDK also refuses any further request for that RFQ, so a late reply cannot be mistaken for a new one.

## Cancelling signed quotes

The gateway has no withdrawal route for desks. You stop quotes on chain, two ways:

- **Pause your mint policy.** Every fill on that mint fails until you re-enable it. Your authority or a hot watcher key can do it.
- **Raise `min_nonce`** with `configureMaker`. Every quote below the new floor can never fill. The floor never goes down.

`configureMaker` sets **both** `operator` and `minNonce`. Pass your current operator to keep it. See [Cancel quotes](https://docs.covr.markets/guides/cancel-quotes.md).

> [!TIP]
> A quote the gateway admits is valid for at most 60 seconds. The brakes matter when you must stop **now**: a bad price or a market move. A leaked quote key needs more: see [Security](https://docs.covr.markets/resources/security.md#if-your-quote-key-leaks).

---

Source: https://docs.covr.markets/concepts/signing-and-nonces · Part of covr Docs, https://docs.covr.markets/llms.txt
