Solana RPCSending Transactions

QUIC

Transactions and bundles sent over one long-lived QUIC connection, with a path mask that picks the send paths.

Transactions and bundles are sent over one long-lived QUIC connection instead of HTTPS. The framing, reply codes and limits are shared with the zerocopy-swqos naming scheme, and constant-k adds one extension: the path mask, which picks the send paths for a transaction.

Endpoints

RegionRegular hostnameStaked hostname
United States flag New Yorkquic-newyork.constant-k.comstaked-quic-newyork.constant-k.com
Germany flag Frankfurtquic-frankfurt.constant-k.comstaked-quic-frankfurt.constant-k.com
Netherlands flag Amsterdamquic-amsterdam.constant-k.comstaked-quic-amsterdam.constant-k.com

UDP port 443. The regular hostname routes like rpc-<region>: a tip picks Jito or Astralane, otherwise Network. The staked hostname routes like staked-rpc-<region>. A path mask on the request overrides both.

Connection setup

  1. Create a client certificate whose first subject CN is the API key. A self-signed certificate is enough, and its chain is not checked.
  2. Connect with TLS 1.3, ALPN ck-send/1, and SNI set to the hostname.
  3. Present the certificate. The key is read from it.
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes \
  -keyout client.key -out client.crt -days 365 -subj "/CN=YOUR_API_KEY"

Naming schemes

ALPN ck-send/1 is the default. zerocopy-swqos/1 is also accepted, and a connection that offers it is answered in that scheme's reason names. The frames, codes, close codes, limits and path mask are the same on both.

A client that already speaks the zerocopy-swqos naming scheme connects with only the hostname and its API key changed.

Limits

ItemValue
Connections per key, per region32
Streams per connection64 bidirectional and 64 unidirectional
Idle timeout30 seconds. The server sends no keep-alive frames, so the client sends them.
Handshake3 seconds
Each request2 seconds

Every plan connects. Each path a request uses counts against that path's plan limit, as on HTTPS.

Close codes

CodeReason textMeaning
0shutdownThe server is closing. Reconnect.
1connection limitThe key already holds 32 connections in that region.
4unknown hostThe SNI is not one of this region's hostnames.
8unauthorizedNo client certificate, or the key in it is missing or unknown.

There is no paused key state, so key_paused is never sent.

Streams and payload

StreamRequestReply
UnidirectionalOne payload, no kind byteNone. The send still counts against the rate.
Bidirectional, kind 0x01[0x01][flags][payload], one transactionTransaction frame
Bidirectional, kind 0x03[0x03][payload], a bundle envelope with flag 0x02Bundle frame

On a kind 0x01 stream the flags byte is 0x00, or 0x01 to run a preflight simulation at processed commitment. No other bit may be set. A stream that starts with any other byte is refused as malformed, problem bad_stream_type, and ends without a reply.

A payload whose first byte is not 0x00 is one signed transaction in wire format. A payload that starts with 0x00 is an envelope.

Envelope

OffsetSizeField
010x00
11Flags
21Path mask, when the flags include 0x04
2 or 3restBody: one transaction, or a bundle body
FlagMeaning
0x01Declared tip. constant-k has no declared-tip billing, so the request is refused with reason unsupported (code 4). Tips are on-chain.
0x02The body is a bundle body
0x04A path mask byte follows the flags

An envelope with no flag set, or with a reserved flag, is refused as malformed, problem bad_envelope.

Bundle body

[count][length][transaction]…, repeated once per member, with nothing after the last transaction.

SizeField
1Transaction count, 1 to 5
2Length of the next transaction, u16 little endian, 1 to 4,096
lengthThe transaction's wire bytes

Size limits

ItemLimit
Payload16,403 bytes, or 16,404 bytes when the path mask byte is present
Legacy or version 0 transaction1,232 bytes
Version 1 transaction4,096 bytes
Each bundle member1 to 4,096 bytes

Worked examples

RequestPayload bytes
One transactionTX
One transaction, all four paths00 04 0F TX
Bundle of two00 02 02 L1 L1 TX1 L2 L2 TX2
Bundle of two, Jito path00 06 04 02 L1 L1 TX1 L2 L2 TX2

L1 L1 is the little endian length of TX1.

Choosing send paths

The path mask byte picks the paths a transaction is sent on. It is present when the envelope flags include 0x04.

BitPath
0x01Network
0x02SWQoS
0x04Jito
0x08Astralane
0x0FAll four
  • The chosen paths are sent at the same time, not one after another.
  • A tipped path is used only when the transaction tips that path at or above its minimum. The minimums are on the Jito and Astralane pages.
  • Each chosen path counts as one send against that path's limit, exactly like an HTTPS send. A four-path send costs what four HTTPS sends cost. The limits are on the Network, SWQoS, Jito and Astralane pages.
  • A path over its limit is skipped and named in the reply. The request is refused only when every chosen path is refused.
  • A path that has not answered within 1.5 seconds is named pending. The reply is written then.
  • A mask of 0x00, or a mask with a bit above 0x08, is refused as malformed, problem bad_envelope.
  • Without a mask the request takes the route the matching HTTPS hostname would pick, and the reply carries no path list.

Replies

FrameLayout
Transaction0x01 code LL LL detail
Bundle0x03 code 32-byte bundle id LL LL detail

LL LL is the detail length, u16 little endian. The detail of a refusal is a UTF-8 JSON object with reason, its fields, message and retryable. An accepted request has an empty detail, except for a masked transaction, which reports its paths. A refused bundle carries an all-zero bundle id.

RequestReply bytes
Accepted transaction01 00 00 00
Refused transaction01 03 LL LL {"reason":"tip_required",…}
Accepted bundle03 00 ID… (32 bytes) 00 00

Codes

CodeNameReasons
0Acceptednone
1RateLimitedrate_limited
2Unsignedunsigned
3TipRequiredtip_required
4Malformedmalformed, unsupported
5TooLargetoo_large
6SendFailedsend_failed
7NoSignaturesno_signatures
8Unauthorizedunauthorized
9Simulationsimulation_failed
10BundleInvalidbundle_size, bundle_invalid, duplicate, superseded, unsupported
11NotReadynot_ready
12Internalinternal
13PaymentRequiredpayment_required

Reason names

Only the names below change with the ALPN. Every other reason, code, frame, close code, limit and path value is the same in both schemes.

Codeck-send/1zerocopy-swqos/1
3tip_requiredmissing_tip
4bad_stream_typeinvalid_stream_kind
4not_a_transactionexpected_transaction
4not_a_bundleexpected_bundle
4bad_envelopeinvalid_envelope
6send_failedforward_failed
7no_signaturessignature_count
11retry_reason: relay_busywaiting_for: block_engine

The code 4 names appear in the problem field of a malformed reply. The code 11 pair is a detail field and its value, not a reason.

Path detail

An accepted masked transaction has code 0 and a detail that names every chosen path:

{"paths":{"network":"network","swqos":"stake1","jito":"jito","astralane":"not_eligible:no_tip"}}
ValueMeaning
network, stake1, jito, astralaneThe path was sent, and the value names the route
not_eligible:no_tipThe transaction carries no tip for that path
not_eligible:tip_below_minimumThe tip for that path is under its minimum
A refusal reason, such as rate_limited, not_ready or send_failedThe path refused the transaction
pendingThe path had not answered when the reply was written

not_eligible:no_tip and not_eligible:tip_below_minimum are the same in both naming schemes.

When no chosen path is eligible for the transaction's tip, nothing is sent and the reply is code 3:

{"reason":"tip_required","paths":{"jito":"not_eligible:no_tip"},"retryable":false}

Bundles

A bundle is a kind 0x03 stream, or a unidirectional stream whose envelope carries flag 0x02. Bundles go to Jito. A 32-byte bundle id comes back in the frame.

  • The bundle limits are the same as sendBundle over HTTPS; see Jito.
  • A bundle with no mask goes to Jito by default.
  • A mask on a bundle must include 0x04. Other bits are ignored, and a mask without it is refused with reason unsupported (code 10).
  • A bundle's tip is an on-chain transfer inside one of its transactions.

Preflight

Flag 0x01 on a kind 0x01 stream runs a simulation at processed commitment before the transaction is sent. A transaction that fails it is answered with code 9 and is not sent. The detail carries reason, err, logs, message and retryable.

A live test of a transfer larger than the wallet's balance returned InstructionError[0, Custom 1] with the log Transfer: insufficient lamports 99604169, need 1000000000000000.

When the logs make the detail longer than 65,535 bytes, the logs are cut to their first 1,024 bytes and the error is kept whole.

On this page