BotTx|Documentation

Advanced

Binary-Tx

Send raw binary serialized transactions for minimal payload size and lowest possible latency.

POST/v1/send/binary

Why Binary?

The standard JSON API requires base64-encoding your transaction, which expands every 3 bytes into 4 characters — a ~33% size increase. The binary endpoint accepts the raw serialized transaction bytes directly, offering several advantages for latency-sensitive applications.

AdvantageDescription
Smaller payload~25% smaller than a base64-encoded payload (binary avoids the 33% base64 expansion), reducing bandwidth usage
Avoid TCP fragmentationCompact payloads are more likely to fit in a single TCP packet, avoiding fragmentation overhead
Lower latencyNo base64 encode/decode step on either side, and faster parsing on the server
Zero-copy processingServer can forward the transaction bytes directly without deserialization

Request

Headers

HeadersValueRequired
AuthorizationBearer YOUR_API_KEYRequired
Content-Typeapplication/octet-streamRequired

Body

The request body is the raw binary bytes of the signed, serialized transaction. No JSON wrapping, no base64 encoding — just the raw bytes. The endpoint applies our default settings (skip preflight, 3 retries, Anti-MEV enabled). If you need custom options, use the JSON endpointinstead.

Examples

cURL
curl -X POST https://bolttx.io/v1/send/binary \
  -H "Authorization: Bearer btx_live_abc123" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @transaction.bin
JavaScript
const transaction = new Transaction().add(/* instructions */);
transaction.sign(keypair);

// Serialize to raw bytes (no base64)
const rawBytes = transaction.serialize();

const response = await fetch("https://bolttx.io/v1/send/binary", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/octet-stream",
  },
  body: rawBytes,
});

const result = await response.json();
console.log("Signature:", result.signature);
Rust
use reqwest::Client;
use solana_sdk::transaction::Transaction;

let tx = Transaction::new(/* instructions */);
let raw_bytes = bincode::serialize(&tx)?;

let client = Client::new();
let res = client
    .post("https://bolttx.io/v1/send/binary")
    .header("Authorization", "Bearer YOUR_API_KEY")
    .header("Content-Type", "application/octet-stream")
    .body(raw_bytes)
    .send()
    .await?;

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

Response

Success (200)

The response format is identical to the standard Send Transaction endpoint.

{
  "success": true,
  "signature": "5xKnR8qXe...",
  "slot": 234567890
}

Further reading