← Back to blog
solana
crypto
fast
secure

how to do solona transactions

To perform a Solana transaction, first connect the user’s wallet, such as Phantom, and get their public key. Then create a transaction and add the required instructions, such as transferring SOL or interacting with a smart contract. After setting the latest blockhash, request the user to sign the transaction through their wallet. Once signed, send the transaction to the Solana network and wait for confirmation to verify that it was successfully completed.

September 2, 2026

Sure — here is a detailed version with paragraphs and bullet points:

How to Perform a Solana Transaction

A Solana transaction is the process of sending instructions to the Solana blockchain. These instructions can be used for different purposes, such as transferring SOL from one wallet to another, sending SPL tokens, interacting with a smart contract, minting an NFT, swapping tokens, or performing actions within a decentralized application (dApp). Every transaction must be created, signed by the appropriate wallet, sent to the Solana network, and confirmed by the blockchain.

The general flow of a Solana transaction is:

  • Connect the user's wallet
  • Get the user's public key
  • Create a transaction
  • Add the required instructions
  • Get the latest blockhash
  • Request the wallet signature
  • Send the transaction to the Solana network
  • Wait for confirmation
  • Handle success or errors

1. Connect the User's Wallet

The first step is connecting a Solana wallet to the application. Wallets such as Phantom allow users to connect their accounts and approve transactions securely. The application does not need access to the user's private key. Instead, the wallet handles sensitive operations, including signing the transaction.

Once the wallet is connected, the application can access the user's public key. The public key acts as the user's blockchain address and can be used to identify the account that will send the transaction.

Important points include:

  • The user must approve the wallet connection.
  • The application receives the public wallet address.
  • The private key remains securely inside the wallet.
  • The user must approve transactions before they are sent.
  • The application should check whether the wallet is connected before allowing transaction-related actions.

2. Get the User's Public Key

After successfully connecting the wallet, the application retrieves the user's public key. This public key represents the sender's Solana account.

For example, if the user wants to send SOL or interact with a smart contract, the public key identifies which account is performing the transaction. The public key can safely be displayed or used within the application because it is public information.

The application may also need to verify information such as:

  • Whether the wallet is still connected.
  • Whether the user has enough SOL to pay transaction fees.
  • Whether the account has enough tokens for the requested operation.
  • Whether the user is connected to the correct Solana network.

Solana supports different networks, including:

  • Mainnet Beta – The production network where real assets are used.
  • Devnet – Primarily used for development and testing.
  • Testnet – Used for testing network functionality.

During development, it is generally safer to test transactions on Devnet before using Mainnet.

3. Create the Transaction

The next step is creating a transaction object. A transaction acts as a container for one or more instructions that will be executed by the Solana blockchain.

For a simple SOL transfer, the transaction may contain an instruction that specifies:

  • The sender's wallet address.
  • The recipient's wallet address.
  • The amount of SOL to transfer.

However, a transaction is not limited to transferring SOL. It can contain instructions for many different blockchain operations. For example, a single transaction may interact with a decentralized application, update data on-chain, or execute multiple related operations.

The transaction itself describes what should happen, but it cannot be processed until it has been properly prepared and signed.

4. Add Transaction Instructions

Instructions are the individual actions that the Solana blockchain should execute. Each transaction can contain one or more instructions.

For example, if the user is transferring SOL, the instruction tells the Solana System Program to move a specific amount from one account to another.

Common types of instructions include:

  • Transferring SOL.
  • Transferring SPL tokens.
  • Creating a token account.
  • Interacting with a Solana program.
  • Swapping tokens through a decentralized exchange.
  • Minting or transferring NFTs.
  • Staking SOL.
  • Calling custom smart contract functionality.

The exact instruction depends on the functionality being implemented. For example, a basic SOL transfer is relatively simple, while interacting with a custom Solana program may require multiple accounts, program IDs, and additional data.

It is important to validate all transaction data before requesting the user's signature. The application should ensure that addresses, amounts, and other parameters are correct because blockchain transactions are generally irreversible after confirmation.

5. Get the Latest Blockhash

Before sending a transaction, it usually needs a recent blockhash. The blockhash helps the Solana network determine whether the transaction is recent and valid.

The application requests the latest blockhash from a Solana RPC connection and adds it to the transaction. This helps protect the network from old or replayed transactions.

The transaction also typically includes information about the fee payer. In many cases, the connected user's wallet acts as the fee payer, meaning the transaction fee is deducted from that wallet.

At this stage, the transaction contains the necessary information to be signed and submitted.

The preparation flow can be summarized as:

  1. Create the transaction.
  2. Add the required instruction or instructions.
  3. Fetch the latest blockhash.
  4. Set the recent blockhash.
  5. Define the transaction fee payer.
  6. Prepare the transaction for signing.

6. Request the User to Sign the Transaction

Once the transaction is prepared, the application sends it to the connected wallet for approval. The wallet, such as Phantom, displays a confirmation request to the user.

The user can then review and either:

  • Approve the transaction.
  • Reject the transaction.

If the user approves it, the wallet signs the transaction using the user's private key. The private key itself is not shared with the application. This is one of the main security features of wallet-based blockchain applications.

Before approving, the user should be able to understand what they are signing. Depending on the wallet and transaction type, the wallet may show information about the transaction, such as the amount being transferred, recipient, or estimated network fee.

If the user rejects the request, the application should handle this properly and show a clear message. Rejecting a transaction should not be treated as a technical failure because the user may simply decide not to continue.

7. Send the Signed Transaction

After the user signs the transaction, it can be sent to the Solana network through an RPC connection. The network receives the signed transaction and validates it.

During validation, the Solana network checks several things, including:

  • Whether the transaction is correctly formatted.
  • Whether the signature is valid.
  • Whether the sender has sufficient funds.
  • Whether the transaction instructions are valid.
  • Whether the referenced accounts exist or meet the required conditions.
  • Whether the transaction has not expired.

If the transaction is accepted, the network returns a transaction signature. This signature acts as a unique identifier for the transaction.

The application can store this signature temporarily and use it to track the transaction status.

8. Wait for Transaction Confirmation

Receiving a transaction signature does not necessarily mean that the transaction has been fully confirmed. The application should wait for confirmation from the Solana network.

The confirmation process helps verify that the transaction was successfully processed. Depending on the application's requirements, it may use different levels of commitment or confirmation.

After confirmation, the application can determine whether the transaction:

  • Successfully completed.
  • Failed during execution.
  • Was rejected.
  • Timed out.
  • Needs to be checked again.

A successful confirmation means the blockchain has processed the transaction according to its instructions.

The transaction flow at this point becomes:

Create → Sign → Send → Receive Signature → Confirm → Check Result

9. Handle Success and Errors

A good implementation should always handle both successful and unsuccessful transactions. Blockchain operations can fail for many reasons, so the application should provide clear feedback to the user.

Common reasons for failure include:

  • The user rejected the transaction.
  • The wallet was disconnected.
  • The sender has insufficient SOL.
  • The sender has insufficient tokens.
  • The recipient address is invalid.
  • The transaction blockhash expired.
  • The RPC connection failed.
  • A smart contract instruction failed.
  • Network congestion or temporary RPC issues occurred.

For a successful transaction, the application can display a message such as:

  • Transaction completed successfully.
  • Your transaction has been confirmed.
  • Payment was successfully processed.

For an unsuccessful transaction, it should provide a meaningful error message instead of displaying a technical error without explanation.

Complete Solana Transaction Flow

The complete process can be represented as follows:

  • Step 1: User connects their Solana wallet.
  • Step 2: The application retrieves the user's public key.
  • Step 3: The application validates the transaction details.
  • Step 4: A transaction object is created.
  • Step 5: Required instructions are added.
  • Step 6: The latest blockhash is fetched.
  • Step 7: The fee payer is configured.
  • Step 8: The transaction is sent to the user's wallet.
  • Step 9: The user reviews and approves the transaction.
  • Step 10: The wallet signs the transaction securely.
  • Step 11: The signed transaction is submitted to the Solana network.
  • Step 12: The application receives a transaction signature.
  • Step 13: The application waits for blockchain confirmation.
  • Step 14: The final result is checked.
  • Step 15: The user is informed whether the transaction succeeded or failed.

In summary, performing a Solana transaction involves connecting the user's wallet, preparing the required transaction instructions, adding a recent blockhash, and requesting the user to sign the transaction. After the wallet signs it, the application sends the signed transaction to the Solana blockchain and waits for confirmation. The most important part of the process is that the user's private key remains inside their wallet, while the application only prepares the transaction and requests approval. A properly implemented transaction flow should also validate inputs, handle wallet rejection, manage network errors, wait for confirmation, and clearly communicate the final result to the user.