---
title: Syscall Reference
description:
  Complete reference for all sBPF syscalls available to Solana programs,
  including compute unit costs for hashing, cryptography, CPI, logging, memory
  operations, and more.
url: /docs/core/programs/syscall-reference
type: reference
prerequisites:
  - /docs/core/programs
  - /docs/core/programs/program-execution
related:
  - /docs/core/fees/compute-budget
  - /docs/core/cpi/cpi-cost-model
  - /docs/core/constants-reference
---

<Callout type="info" title="Summary">
  Programs interact with the runtime through syscalls covering logging, hashing,
  cryptography, CPI, sysvars, memory operations, and more. Each deducts compute
  units from the transaction's shared budget.
</Callout>

## Syscalls

Programs interact with the runtime through syscalls registered in
[`create_program_runtime_environment_v1()`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L282).
Each syscall deducts compute units from the transaction's compute budget.

### Syscall costs

Each syscall's base compute unit cost constants are defined in
[`SVMTransactionExecutionCost`](https://github.com/anza-xyz/agave/blob/v3.1.8/program-runtime/src/execution_budget.rs#L198-L236).
Some syscalls combine these constants into more complex formulas in their
implementation (e.g., scaling with input size or adding `syscall_base_cost`
overhead). See the individual syscall source links below for exact cost
calculations.

### Available syscalls

The complete set of syscalls available to sBPF programs, as registered in
[`create_program_runtime_environment_v1()`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L282).
Feature-gated syscalls are only available when the corresponding feature is
active on the cluster.

#### Control flow

| Syscall      | Description                                                                                              | Source                                                                                   |
| ------------ | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `abort`      | Halts the program immediately. Inserted by LLVM for untenable conditions; not intended for explicit use. | [`SyscallAbort`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L691) |
| `sol_panic_` | Halts the program with a file name, line, and column number for diagnostics.                             | [`SyscallPanic`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L710) |

#### Logging

| Syscall                  | Description                                            | Source                                                                                                   |
| ------------------------ | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| `sol_log_`               | Logs a UTF-8 string message to the program log.        | [`SyscallLog`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/logging.rs#L5)                 |
| `sol_log_64_`            | Logs five `u64` values as hex to the program log.      | [`SyscallLogU64`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/logging.rs#L37)             |
| `sol_log_pubkey`         | Logs a `Pubkey` as a base58 string to the program log. | [`SyscallLogPubkey`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/logging.rs#L84)          |
| `sol_log_compute_units_` | Logs the remaining compute units to the program log.   | [`SyscallLogBpfComputeUnits`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/logging.rs#L60) |
| `sol_log_data`           | Logs arbitrary byte slices as base64-encoded data.     | [`SyscallLogData`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/logging.rs#L109)           |

#### PDA

| Syscall                        | Description                                                                                                                    | Source                                                                                                   |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| `sol_create_program_address`   | Derives a program address from seeds and a program ID. Returns 1 if the derived address is on the Ed25519 curve (invalid PDA). | [`SyscallCreateProgramAddress`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L798)  |
| `sol_try_find_program_address` | Finds a valid PDA by iterating bump seeds from 255 down to 1. Returns the address and bump.                                    | [`SyscallTryFindProgramAddress`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L836) |

#### Hashing

| Syscall         | Description                                                         | Source                                                                                                    |
| --------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `sol_sha256`    | Computes a SHA-256 hash over one or more byte slices.               | [`SyscallHash<Sha256Hasher>`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1912)    |
| `sol_keccak256` | Computes a Keccak-256 hash over one or more byte slices.            | [`SyscallHash<Keccak256Hasher>`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1912) |
| `sol_blake3`    | Computes a Blake3 hash over one or more byte slices. Feature-gated. | [`SyscallHash<Blake3Hasher>`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1912)    |
| `sol_poseidon`  | Computes a Poseidon hash over inputs. Feature-gated.                | [`SyscallPoseidon`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1737)              |

#### Cryptography

| Syscall                     | Description                                                                                                    | Source                                                                                                             |
| --------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `sol_secp256k1_recover`     | Recovers a secp256k1 public key from a signed message hash and recovery ID.                                    | [`SyscallSecp256k1Recover`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L888)                |
| `sol_curve_validate_point`  | Validates that a byte array is a valid point on Curve25519 (Edwards or Ristretto). Feature-gated.              | [`SyscallCurvePointValidation`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L946)            |
| `sol_curve_group_op`        | Performs Curve25519 group operations (add, subtract, multiply) on Edwards or Ristretto points. Feature-gated.  | [`SyscallCurveGroupOps`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1009)                  |
| `sol_curve_multiscalar_mul` | Performs multi-scalar multiplication on Curve25519 Edwards or Ristretto points. Feature-gated.                 | [`SyscallCurveMultiscalarMultiplication`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1237) |
| `sol_alt_bn128_group_op`    | Performs alt_bn128 (BN254) group operations: G1 addition, G1 multiplication, and pairing check. Feature-gated. | [`SyscallAltBn128`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1558)                       |
| `sol_alt_bn128_compression` | Compresses and decompresses alt_bn128 G1 and G2 points. Feature-gated.                                         | [`SyscallAltBn128Compression`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1823)            |
| `sol_big_mod_exp`           | Computes big integer modular exponentiation (base^exp mod modulus). Feature-gated.                             | [`SyscallBigModExp`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1662)                      |

#### CPI

| Syscall                  | Description                                                                                                                     | Source                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `sol_invoke_signed_rust` | Invokes a cross-program instruction from a Rust program. Serializes instruction, accounts, and signer seeds using the Rust ABI. | [`SyscallInvokeSignedRust`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/cpi.rs#L11) |
| `sol_invoke_signed_c`    | Invokes a cross-program instruction from a C program. Uses the C `SolInstruction` ABI for serialization.                        | [`SyscallInvokeSignedC`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/cpi.rs#L78)    |

#### Sysvars

| Syscall                         | Description                                                                                                                    | Source                                                                                                         |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| `sol_get_clock_sysvar`          | Writes the Clock sysvar to a program-provided buffer.                                                                          | [`SyscallGetClockSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L44)            |
| `sol_get_epoch_schedule_sysvar` | Writes the EpochSchedule sysvar to a program-provided buffer.                                                                  | [`SyscallGetEpochScheduleSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L66)    |
| `sol_get_rent_sysvar`           | Writes the Rent sysvar to a program-provided buffer.                                                                           | [`SyscallGetRentSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L135)            |
| `sol_get_epoch_rewards_sysvar`  | Writes the EpochRewards sysvar to a program-provided buffer.                                                                   | [`SyscallGetEpochRewardsSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L88)     |
| `sol_get_last_restart_slot`     | Writes the LastRestartSlot sysvar to a program-provided buffer. Feature-gated.                                                 | [`SyscallGetLastRestartSlotSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L157) |
| `sol_get_fees_sysvar`           | Writes the deprecated Fees sysvar to a program-provided buffer. Feature-gated (deprecated).                                    | [`SyscallGetFeesSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L110)            |
| `sol_get_sysvar`                | Generic sysvar access: reads a byte slice from any cached sysvar by its pubkey, offset, and length (SIMD-0127). Feature-gated. | [`SyscallGetSysvar`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/sysvar.rs#L184)                |

#### Memory operations

| Syscall        | Description                                                                                                        | Source                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| `sol_memcpy_`  | Copies `n` bytes from source to destination. Aborts if regions overlap in VM address space.                        | [`SyscallMemcpy`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/mem_ops.rs#L26)  |
| `sol_memmove_` | Copies `n` bytes from source to destination, handling overlapping regions correctly.                               | [`SyscallMemmove`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/mem_ops.rs#L49) |
| `sol_memcmp_`  | Compares `n` bytes of two memory regions. Writes the result (first differing byte comparison) to a result address. | [`SyscallMemcmp`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/mem_ops.rs#L67)  |
| `sol_memset_`  | Fills `n` bytes of a memory region with a given byte value.                                                        | [`SyscallMemset`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/mem_ops.rs#L113) |

#### Program data

| Syscall                                 | Description                                                                                                                                   | Source                                                                                                             |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `sol_set_return_data`                   | Sets return data (max 1,024 bytes) for the current instruction. Readable by the caller after the CPI returns.                                 | [`SyscallSetReturnData`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1354)                  |
| `sol_get_return_data`                   | Reads the return data set by the most recent CPI. Returns the data length and the program ID that set it.                                     | [`SyscallGetReturnData`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1402)                  |
| `sol_get_processed_sibling_instruction` | Retrieves a previously executed sibling instruction at the same stack height (by reverse index). Returns program ID, data, and account metas. | [`SyscallGetProcessedSiblingInstruction`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1450) |
| `sol_get_stack_height`                  | Returns the current call stack height. Height 1 = top-level instruction; each CPI increments by 1.                                            | [`SyscallGetStackHeight`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1538)                 |

#### Compute

| Syscall                       | Description                                                                             | Source                                                                                                    |
| ----------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `sol_remaining_compute_units` | Returns the number of compute units remaining in the transaction budget. Feature-gated. | [`SyscallRemainingComputeUnits`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1803) |

#### Epoch stake

| Syscall               | Description                                                                                                                               | Source                                                                                            |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `sol_get_epoch_stake` | Returns total cluster stake (null pointer) or a specific vote account's delegated stake for the current epoch (SIMD-0133). Feature-gated. | [`SyscallGetEpochStake`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L1974) |

#### Memory allocation

| Syscall           | Description                                                                                                                                     | Source                                                                                       |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `sol_alloc_free_` | Legacy bump allocator for dynamic memory allocation. Disabled for new deployments; only available to programs deployed before the feature gate. | [`SyscallAllocFree`](https://github.com/anza-xyz/agave/blob/v3.1.8/syscalls/src/lib.rs#L735) |
