This feature is currently in beta and might be subject to changes - Please contact your CSM for any additional information.
Overview of Solana Programs and Transactions
Solana programs are on-chain executable codes that power the decentralized applications (dApps) and other functionalities within the Solana blockchain. They enable smart contract-like behavior, where developers can write logic to process transactions and manage state.
Solana Transactions
A Solana transaction is a set of instructions bundled together to be executed atomically on the blockchain. It typically consists of the following components:
- Signatures: A list of cryptographic signatures to authorize the transaction.
- Message: The core of the transaction, which includes:
- Instructions: The set of actions to be performed, where each instruction:
- Targets a specific program on the blockchain.
- Includes accounts to be accessed or modified.
- Contains any necessary data for the operation.
- Account Keys: A list of all accounts involved in the transaction.
- Recent Blockhash: A reference to a recent block to ensure the transaction is processed promptly and prevent replay attacks.
- Instructions: The set of actions to be performed, where each instruction:
When a transaction is submitted, it is signed by the relevant parties and serialized before being broadcast to the network.
Interacting with Solana Programs via the Fireblocks API
Fireblocks simplifies interacting with Solana programs by allowing you to use the createTransaction endpoint. This endpoint supports Solana program calls through the PROGRAM_CALL operation, ensuring secure transaction signing and execution.
Configuring your workspace:
- Solana Program Call requires a Transaction Authorization Policy rule with operation type
Program Call
.- Currently, Solana Program Calls are possible with the One Time Address feature enabled only. Learn more about One Time Address feature in Fireblocks .
How it Works
To make a Solana program call using the Fireblocks API, you will:
- Build the Solana Transaction: Use the Solana
web3.js
library or other tools to construct the unsigned transaction. Ensure the transaction includes all necessary instructions and accounts. - Serialize and Encode: Serialize the unsigned transaction object and encode it in Base64 format.
- Call Fireblocks API:
- Use the Create Transaction endpoint.
- Set the operation parameter to
PROGRAM_CALL
. - Pass the serialized, Base64 encoded transaction object in the
programCallData
parameter within theextraParams
object.
Fireblocks securely signs the transaction using your organization’s private key, ensuring seamless execution without exposing sensitive cryptographic materials.
Example Transaction Structure
Below is a sample payload for invoking a Solana program using the Create Transaction API :
{
"operation": "PROGRAM_CALL",
"assetId": "SOL",
"source": {
"type": "VAULT_ACCOUNT",
"id": "\<your_vault_account_id>"
},
"extraParams": {
"programCallData": "\<base64_encoded_transaction>"
}
}
Parameters
- operation: Must be
PROGRAM_CALL
for Solana program calls. - assetId: Use SOL for Solana mainnet transactions, SOL_TEST for devnet.
- source: The vault account ID that holds the funds and signs the transaction.
- extraParams.programCallData: The unsigned, serialized transaction object (Base64 encoded).
Durable Nonce
When you submit a transaction, Fireblocks automatically includes a durable nonce by adding an
AdvanceNonce
instruction to your transaction object.
Learn more about Solana Durable Nonces.
Fireblocks Solana Web3 Connection Adapter - Work In Progress
The Fireblocks Solana Web3 Connection Adapter serves as a bridge between the Fireblocks API and Solana blockchain, streamlining transaction submissions via Fireblocks when using Solana's official web3.js
library.