---
title: sendTransaction
description: >-
  Submits a signed transaction to the cluster and returns its first signature if
  the RPC accepts it.
url: /docs/rpc/http/sendtransaction
type: reference
hideTableOfContents: true
---

Submits a signed transaction to the cluster and returns its first signature if
the RPC accepts it.

<Callout type="info" title="Source">
  [`send_transaction`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L3796)
</Callout>

This method does not alter the transaction in any way; it relays the transaction
created by clients to the node as-is.

If the node's rpc service receives the transaction, this method immediately
succeeds, without waiting for any confirmations. A successful response from this
method does not guarantee the transaction is processed or confirmed by the
cluster.

While the rpc service will reasonably retry to submit it, the transaction could
be rejected if transaction's `recent_blockhash` expires before it lands.

Use [`getSignatureStatuses`](/docs/rpc/http/getsignaturestatuses) to ensure a
transaction is processed and confirmed.

Before submitting, the following preflight checks are performed:

1. The transaction signatures are verified
2. The transaction is simulated against the state at the preflight commitment.
   On failure an error will be returned. Preflight checks may be disabled if
   desired. It is recommended to specify the same commitment and preflight
   commitment to avoid confusing behavior.

When preflight simulation fails, the error data uses the same
[Simulation Results](/docs/rpc/json-structures#simulation-results) structure
documented for [`simulateTransaction`](/docs/rpc/http/simulatetransaction).

The returned signature is the first signature in the transaction, which is used
to identify the transaction
([transaction id](/docs/references/terminology#transaction-id)). This identifier
can be easily extracted from the transaction data before submission.

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendTransaction",
  "params": [
    // !hover transaction
    "AX9ymHgILTd01GtdBsbQZ9by5D4z4UWh+1Tsh6LDuPHuZk/Z8LrIwoKZRp3le2RTb5lywL1xcJGQ8u3M3U0tyAgBAAEDXCL+JarHftfP5QgsRxpEsr+/YiRWQeCz7PI3jfzeppEvUc61u+TNHri9ChQdLN2evWGx+1O3MwbPFKV5rIqlxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvOdVbvGn3R+uBkugNCq8C/Texc7ILBoYjbn4aVQV0OgBAgIAAQwCAAAAQEIPAAAAAAA=",
    // !hover(1:5) config
    {
      // !hover encoding
      "encoding": "base64",
      // !hover skipPreflight
      "skipPreflight": true
    }
  ]
}
```

```ts !!request title="Kit"
import {
  createSolanaRpc,
  type Base64EncodedWireTransaction
} from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover transaction
const base64Tx =
  "AbC/XNkPUUZ7/51SaG1wbG0ojrWHIGzVL73M8hRnDr73RkBAZc0ZnikluvcCeprAmqHDJrcPxPUbvEJMVBIiVQeAAQABAzfDSQC/GjcggrLsDpYz7jAlT+Gca846HqtFb8UQMM9cCWPIi4AX32PV8HrY7/1WgoRc3IATttceZsUMeQ1qx7UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgsVWEgMTiOYp63gTtuYGw+izfm6wKQdivpiXQBpNnYAQICAAEMAgAAAEBCDwAAAAAAAA==";

const signature = await rpc
  .sendTransaction(base64Tx as Base64EncodedWireTransaction, {
    encoding: "base64"
  })
  .send();

console.log(signature);
```

```ts !!request title="web3.js"
import {
  Connection,
  VersionedTransaction,
  clusterApiUrl
} from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

const base64Tx =
  "AbuRLtc5C9bZtAUT4F4Y2H5SRRUK1HwOFZOK3V4qm/78MDJt+M2de/RCCaI3iTyodDepmrkUWbss0XRHS0lk5AOAAQABAzfDSQC/GjcggrLsDpYz7jAlT+Gca846HqtFb8UQMM9cCWPIi4AX32PV8HrY7/1WgoRc3IATttceZsUMeQ1qx7UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2dTRgcJmzcoGH1R3c2WqtHah2H19KvbC1p6BxLDqfoAQICAAEMAgAAAADKmjsAAAAAAA==";

// !hover transaction
let tx = VersionedTransaction.deserialize(Buffer.from(base64Tx, "base64"));

let sig = await connection.sendTransaction(tx);

console.log(sig);
```

```rs !!request title="Rust"
use anyhow::Result;
use base64::{Engine as _, engine::general_purpose};
use solana_client::{nonblocking::rpc_client::RpcClient, rpc_config::RpcSendTransactionConfig};
use solana_commitment_config::{CommitmentConfig, CommitmentLevel};
use solana_sdk::transaction::VersionedTransaction;
use solana_transaction_status_client_types::UiTransactionEncoding;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover transaction
    let b64_tx = "AbuRLtc5C9bZtAUT4F4Y2H5SRRUK1HwOFZOK3V4qm/78MDJt+M2de/RCCaI3iTyodDepmrkUWbss0XRHS0lk5AOAAQABAzfDSQC/GjcggrLsDpYz7jAlT+Gca846HqtFb8UQMM9cCWPIi4AX32PV8HrY7/1WgoRc3IATttceZsUMeQ1qx7UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2dTRgcJmzcoGH1R3c2WqtHah2H19KvbC1p6BxLDqfoAQICAAEMAgAAAADKmjsAAAAAAA==";
    let tx_bytes = general_purpose::STANDARD.decode(b64_tx).unwrap();
    let tx: VersionedTransaction = bincode::deserialize(&tx_bytes).unwrap();

    // !hover(1:7) config
    let config = RpcSendTransactionConfig {
        // !hover skipPreflight
        skip_preflight: true,
        // !hover preflightCommitment
        preflight_commitment: CommitmentLevel::Finalized.into(),
        // !hover encoding
        encoding: UiTransactionEncoding::Base64.into(),
        // !hover maxRetries
        max_retries: None,
        // !hover  minContextSlot
        min_context_slot: None,
    };

    match client.send_transaction_with_config(&tx, config).await {
        Ok(signature) => println!("Transaction Signature: {}", signature),
        Err(err) => eprintln!("Error transferring tokens: {}", err),
    }

    Ok(())
}
```

### !params

#### !! transaction

!type string  
!required

Fully-signed Transaction, as encoded string.

#### !! config

!type object  
!optional

Configuration object containing the following fields:

##### !! encoding

!type string  
!values binary base58 base64  
!default base58

Encoding used for the transaction data.

| Encoding | Notes                                                                          |
| -------- | ------------------------------------------------------------------------------ |
| `base64` | Recommended                                                                    |
| `base58` | Slow                                                                           |
| `binary` | ⚠️ Deprecated. Legacy alias for `base58`, retained for backwards compatibility |

##### !! skipPreflight

!type bool  
!values true false  
!default false

When `true`, skip the preflight transaction checks. Default: `false`.

```json title="Example"
{ "skipPreflight": true }
```

##### !! preflightCommitment

!type string  
!values processed confirmed finalized  
!default finalized

Commitment level to use for preflight when `skipPreflight` is `false`. Default
`finalized`. When `skipPreflight` is `true`, this field is ignored and the RPC
node uses `processed` internally.

Solana RPC uses the following commitment levels:

| Value       | Description                                                                                                                                                                                                                                                                |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `processed` | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks.                                                                                         |
| `confirmed` | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. This is more stable than `processed`, but it is still a weaker guarantee than `finalized`.                                                                       |
| `finalized` | Return data from the highest slot that the cluster recognizes as finalized. In practice, this means the slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |

```json title="Example"
{ "preflightCommitment": "confirmed" }
```

##### !! maxRetries

!type usize

Maximum number of times for the RPC node to retry sending the transaction to the
leader. If this parameter not provided, the RPC node will retry the transaction
until it is finalized or until the blockhash expires.

```json title="Example"
{ "maxRetries": 5 }
```

##### !! minContextSlot

!type number  
!optional

Set the minimum slot at which to perform preflight transaction checks

```json title="Example"
{ "minContextSlot": 341197000 }
```

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover result
  "result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
  "id": 1
}
```

!type string

First Transaction Signature embedded in the transaction, as base-58 encoded
string ([transaction id](/docs/references/terminology#transaction-id))

</APIMethod>
