> For the complete documentation index, see [llms.txt](https://raiden-4.gitbook.io/raiden.wtf.docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raiden-4.gitbook.io/raiden.wtf.docs/bolt-low-latency/http-submission/send-raw-transaction.md).

# Send Binary Transaction

Binary transaction submission for lower overhead

Submit a signed Solana transaction as raw binary bytes — no JSON-RPC wrapping, no base64 encoding.

## Why Use This?

|                       | sendTransaction (JSON-RPC)                      | sendRawTransaction (Binary)          |
| --------------------- | ----------------------------------------------- | ------------------------------------ |
| **Request format**    | JSON body with base64-encoded transaction       | Raw transaction bytes                |
| **Client-side steps** | Serialize → base64 encode → wrap in JSON → send | Serialize → send                     |
| **Payload size**      | \~33% larger (base64 + JSON framing)            | Minimal — just the transaction bytes |
| **Content-Type**      | `application/json`                              | `application/octet-stream`           |
| **Response format**   | JSON-RPC envelope                               | Simple JSON                          |

## Request

```
POST /api/v1/sendRawTransaction
Content-Type: application/octet-stream
api-x-token: YOUR_API_KEY

<raw transaction bytes>
```

The request body is the serialized Solana transaction — the same bytes from `transaction.serialize()`. No base64 encoding, no JSON wrapping.

## Response

```json
{
  "success": true,
  "signature": "5VERv8NrdMSiGjLEoGKPqmCsR4WxgEfnTAbVnriGjLK..."
}
```

| Field       | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| `success`   | boolean | `true` if the transaction was accepted |
| `signature` | string  | Solana transaction signature           |

## Error Response

```json
{
  "success": false,
  "error": "Failed to decode transaction: ..."
}
```

| HTTP Status | Meaning                                            |
| ----------- | -------------------------------------------------- |
| `400`       | Invalid or empty transaction bytes, or missing tip |
| `401`       | Invalid or missing API key                         |
| `429`       | Rate limit exceeded                                |
| `500`       | Internal error — retry the request                 |

## Examples

{% tabs %}
{% tab title="Python" %}

```python
import requests

# tx_bytes = transaction.serialize() from solana-py / solders
tx_bytes = b"..."

response = requests.post(
    "http://fra.bolt.raiden.wtf/api/v1/sendRawTransaction",
    headers={
        "Content-Type": "application/octet-stream",
        "api-x-token": "YOUR_API_KEY",
    },
    data=tx_bytes,
)

result = response.json()
if result["success"]:
    print(f"Signature: {result['signature']}")
else:
    print(f"Error: {result['error']}")
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const txBytes = transaction.serialize();

const response = await fetch("http://fra.bolt.raiden.wtf/api/v1/sendRawTransaction", {
  method: "POST",
  headers: {
    "Content-Type": "application/octet-stream",
    "api-x-token": "YOUR_API_KEY",
  },
  body: txBytes,
});

const result = await response.json();
console.log(`Signature: ${result.signature}`);
```

{% endtab %}

{% tab title="Rust" %}

```rust
let tx_bytes: Vec<u8> = transaction.serialize();

let response = reqwest::Client::new()
    .post("http://fra.bolt.raiden.wtf/api/v1/sendRawTransaction")
    .header("Content-Type", "application/octet-stream")
    .header("api-x-token", "YOUR_API_KEY")
    .body(tx_bytes)
    .send()
    .await?;

let result: serde_json::Value = response.json().await?;
println!("Signature: {}", result["signature"]);
```

{% endtab %}

{% tab title="Go" %}

```go
txBytes := transaction.MarshalBinary() // from gagliardetto/solana-go

req, _ := http.NewRequest("POST",
    "http://fra.bolt.raiden.wtf/api/v1/sendRawTransaction",
    bytes.NewReader(txBytes))
req.Header.Set("Content-Type", "application/octet-stream")
req.Header.Set("api-x-token", "YOUR_API_KEY")

resp, err := http.DefaultClient.Do(req)
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST http://fra.bolt.raiden.wtf/api/v1/sendRawTransaction \
  -H "Content-Type: application/octet-stream" \
  -H "api-x-token: YOUR_API_KEY" \
  --data-binary @tx.bin
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
`sendRawTransaction` is recommended for new integrations. The JSON-RPC `sendTransaction` endpoint remains fully supported.
{% endhint %}
