# Solvers

Solvers are a class of originator on Blink — they submit transactions through the standard Ethereum RPC endpoint but receive specialised auction treatment. Specifically:

* Solver transactions are forwarded to builders **without a gas recovery delay**
* Solver transactions are eligible for a dedicated **OFA fan-out** window: Blink holds the transaction until 10 seconds into the pending slot, then fans it out to other originators only if no searcher has placed a bid. This preserves searcher exclusivity while still ensuring coverage.

There are two integration paths available to solvers:

| Path                              | Best for                                                         |
| --------------------------------- | ---------------------------------------------------------------- |
| Raw transaction via RPC endpoint  | Submitting individual solver transactions                        |
| Builder endpoint (`/builder/v1/`) | Submitting and cancelling bundles using Flashbots-compatible API |

***

## Cancelling a Transaction

Solvers can cancel a pending transaction by submitting a **cancel signal** — a zero-value self-transfer with the same nonce as the transaction to cancel.

**A cancel transaction is defined as:**

* `to` — same address as the sender
* `value` — `0`
* `data` — empty

When Blink receives this, it:

1. Detects it is a cancel signal (not a real transaction)
2. Looks up the original transaction by `(sender, nonce)` in cache
3. Removes the original transaction from the auction
4. Forwards `eth_cancelBundle` requests to all active builders for the next 3 blocks

{% hint style="info" %}
The cancel signal itself is never forwarded to builders or stored — only the resulting cancellation is propagated.
{% endhint %}

***

## Builder Endpoint

Blink exposes a **builder-compatible API** at `/builder/v1/<originatorId>` that emulates the standard Flashbots builder interface. This lets solvers use the same bundle submission code they already use with direct-builder integrations.

The endpoint supports the following JSON-RPC methods:

* `eth_sendRawTransaction`
* `eth_sendBundle`
* `eth_cancelBundle`

### eth\_sendBundle

Submit a bundle targeting a specific block. Blink fans the bundle out to all active builders.

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_sendBundle",
  "params": [
    {
      "txs": [
        "0x...",
        "0x..."
      ],
      "blockNumber": "0x1488DCF",
      "replacementUuid": "d9be8dba-6954-47bf-8ee2-dab3feeb11ee",
      "revertingTxHashes": []
    }
  ]
}
```

| Field               | Type       | Required | Description                                                                                              |
| ------------------- | ---------- | -------- | -------------------------------------------------------------------------------------------------------- |
| `txs`               | `string[]` | Yes      | Array of signed raw transactions (hex-encoded)                                                           |
| `blockNumber`       | `string`   | No       | Target block number (hex). Defaults to current block                                                     |
| `replacementUuid`   | `string`   | No       | Canonical UUID string (RFC 4122); used to cancel or replace this bundle (not an arbitrary opaque string) |
| `revertingTxHashes` | `string[]` | No       | Hashes of transactions in the bundle that are allowed to revert                                          |
| `maxTimestamp`      | `number`   | No       | Latest Unix timestamp at which the bundle is valid                                                       |

**Response:**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bundleHash": "0x..."
  }
}
```

{% hint style="info" %}
Set `?solver=true` as a query parameter to enable solver-mode fan-out for bundles submitted through this endpoint.
{% endhint %}

### eth\_cancelBundle

Cancel a previously submitted bundle by its `replacementUuid`. Blink removes the bundle from its cache and forwards the cancellation to all active builders.

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_cancelBundle",
  "params": [
    {
      "replacementUuid": "d9be8dba-6954-47bf-8ee2-dab3feeb11ee"
    }
  ]
}
```

**Response:**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": 200
}
```

{% hint style="warning" %}
`replacementUuid` must match exactly what was set in the original `eth_sendBundle` call. If no matching bundle is found in cache, the cancellation is still forwarded to builders but has no effect on Blink's internal state.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blinklabs.xyz/blink/ethereum/solvers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
