Offline signing on solana online rpc submission
Posted: Sun Mar 15, 2026 1:48 am
Prepare online a signature that remains live for 60-90 seconds:
prepare.sh (online)
solana-cli software needed. (offline sign)
sign.sh
Online submission with curl
Verify transaction with response signature
prepare.sh (online)
Code: Select all
RPC_URL="https://api.devnet.solana.com"
BLOCKHASH=$(curl -s -X POST $RPC_URL -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0", "id": 1,
"method": "getLatestBlockhash",
"params": [{"commitment": "finalized"}]
}' | jq -r '.result.value.blockhash')
echo "Blockhash: $BLOCKHASH"
sign.sh
Code: Select all
RECIPIENT="GKvqsuNcnwWqPzzuhLmGi4rzzh55FhJtGizkhHaEJqiV" # example pubkey
AMOUNT_LAMPORTS=100000000 # 0.1 SOL
solana transfer $RECIPIENT 0.1 \
--blockhash $BLOCKHASH \
--from ~/my-wallet.json \
--fee-payer ~/my-wallet.json \
--output-file signed-tx-base58.txt \
--url none
Online submission with curl
Code: Select all
curl -s -X POST $RPC_URL \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sendTransaction",
"params": [
"PASTE_YOUR_FULL_BASE58_SIGNED_TX_HERE",
{
"skipPreflight": false,
"preflightCommitment": "confirmed",
"maxRetries": 5
}
]
}' | jq
Code: Select all
curl -s -X POST $RPC_URL -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0", "id": 1,
"method": "getSignatureStatuses",
"params": [["YOUR_SIGNATURE_FROM_RESPONSE"], {"searchTransactionHistory": true}]
}' | jq