# Private Transactions

The **`blxr_private_tx`** endpoint allows users to send a single transaction that is added directly to the blocks generated by block builders.\
\
Private txs are automatically enrolled in the BackRunMe service and will pay back searchers a portion of the profit. The endpoint returns a transaction hash.

This service is available via both the **Cloud API** and **Gateway API**.

## Submission Endpoint

* Method: `blxr_private_tx`
* Endpoint: `api.blxrbdn.com` (Cloud API)
* Gateway API Endpoint: `127.0.0.1:28333/ws` (assumes WebSocket port 28333)
* Request type: *`HTTPS,WSS`*

### Parameters

| Parameter                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`transaction`**          | *\[Mandatory]* Raw transaction bytes without **`0x`** prefix.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **`timeout`**              | *\[Optional]* An integer value that represents the time, in seconds, needed to wait for a Private Transaction to be included in a block. If omitted, it defaults to 0. If **`timeout`** is not 0 and the transaction is not mined after the timeout value, it will be sent publicly. If the **`timeout`** is 0, no public transaction will be sent.                                                                                                                                                                                                                                                                                           |
| **`mev_builders`**         | <p><em>\[Optional, default: <code>all</code> builder]</em> A dictionary of MEV builders that should receive the private transaction. Please provide empty string as signature for each builder. Possible MEV builders are:</p><ul><li><code>flashbots</code>: flashbots builder</li><li><code>beaverbuild</code>: <a href="https://beaverbuild.org/">beaverbuild.org</a></li><li><code>rsync-builder</code> : <a href="https://rsync-builder.xyz">rsync-builder.xyz</a></li><li><code>all</code>: all builders</li></ul><p>Traders can refer to <a href="/pages/bW8Ii2GXp6IY1Uk60tWS">List of External Builders page</a> for a full list.</p> |
| **`node_validation`**      | *\[Optional, default: false]* Transaction would be validated by a blockchain node, and Cloud-API returns an error message (e.g. "invalid sender" or "nonce too low") in case the raw transaction byte fails validation check.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **`refund_recipient`**     | *\[Optional]* A string representing the wallet address to receive refund when `priority_fee_refund` flag is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `backrunme_reward_address` | *\[Optional]* String – valid ETH address specifying where backrun rewards should be shared - See [Backrunme program](/backrunme-program/overview.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Example

{% tabs %}
{% tab title="HTTPS - Cloud API" %}

```bash
curl https://api.blxrbdn.com \
    --insecure \
    -X POST \
    -H "Content-Type: application/json" \
    -H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
    -d '{
         "id": "1", 
         "method": "blxr_private_tx", 
         "params": {
            "transaction": "f86b0184...e0b58219",
            "mev_builders": {
                "flashbots": "",
                "beaverbuild": "",
                "all": ""
	     }
          }
        }'
```

{% endtab %}

{% tab title="wscat - Cloud API " %}

```bash
wscat -c wss://api.blxrbdn.com/ws --header "Authorization: <YOUR-AUTHORIZATION-HEADER>" --no-check
> {
	"jsonrpc": "2.0", 
	"id": 1, 
	"method": "blxr_private_tx", 
	"params": {
		"transaction": "f86b0184...e0b58219",
		"mev_builders": {
			"bloxroute": "",
			"flashbots": "",
			"beaverbuild": "",
			"all": ""
		}
	}
}
```

{% endtab %}
{% endtabs %}

#### Response

{% tabs %}
{% tab title="Cloud-API" %}

```bash
{
    "jsonrpc": "2.0", 
    "id": "1", 
    "result": "0xffd59870844e5...bfa54a69"        
}    
```

{% endtab %}
{% endtabs %}


---

# 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.bloxroute.com/eth/sending-transactions/frontrunning-protection.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.
