Skip to main content
You have a funded devnet keypair from the Quickstart. This guide shows what comes next: your first real transaction. You’ll move SOL between two accounts by building a transfer instruction, compiling it into a transaction, signing, submitting, and monitoring the result — using the System Program and Transaction Service together.

What you’ll build

A transaction that transfers lamports from one account to another using the System Program’s Transfer instruction, compiled and submitted via the Transaction Service.

Prerequisites

Build the transfer instruction

The System Program’s Transfer method returns a SolanaInstruction — it does not execute anything on-chain. The instruction describes the intent (move lamports from A to B); the Transaction Service executes it when you compile, sign, and submit. See Instructions & Transactions for the underlying pattern.

Compile the transaction

Wrap the instruction in a Transaction object in DRAFT state, then call CompileTransaction. Protochain fetches a recent blockhash automatically when recent_blockhash is left empty — this is the standard pattern. The sender’s public key is the fee payer.

Sign the transaction

Call SignTransaction with the compiled transaction and the sender’s private key. The transaction advances from COMPILED to FULLY_SIGNED state.
Private keys are transmitted in plaintext over the gRPC connection. Always use TLS in production. Never call SignTransaction over an unencrypted connection with real keys.

Submit the transaction

Call SubmitTransaction. The call returns immediately with a signature — it does not wait for on-chain confirmation.
SUBMISSION_RESULT_SUBMITTED means the transaction was accepted for broadcast, not confirmed on-chain. Pass the returned signature to MonitorTransaction to track the actual result.

Monitor the result

Pass the signature from SubmitTransaction to MonitorTransaction. The stream emits a status update each time the transaction advances, and closes when a terminal state is reached: FINALIZED, FAILED, DROPPED, or TIMEOUT.

Next steps