> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Solana

> Network-specific features, signature kinds, supported assets, and integration requirements for Solana wallets on the DFNS platform.

Solana is a high-performance blockchain known for fast transaction speeds and low costs. This guide covers Solana-specific features when using DFNS wallets.

## Transaction structure

Solana transactions can include multiple **instructions** in a single transaction. The [Transfer API](/api-reference/wallets/transfer-asset) creates one instruction per transaction, while the [Broadcast API](/api-reference/wallets/sign-and-broadcast-transaction) allows you to combine multiple instructions.

Each transaction is identified by its **signature** (the transaction ID is the signature itself).

## Receiving SPL tokens

Before a wallet can receive an SPL token, it needs an **Associated Token Account (ATA)** for that specific token. This is a Solana network requirement.

* **Automatic**: When using the [Transfer Asset](/api-reference/wallets/transfer-asset) endpoint, set `createDestinationAccount: true` to automatically create the recipient's ATA.
* **Manual**: To create an ATA using the Broadcast API with the `@solana/spl-token` library, see the [Solana SDK examples](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/solana) for complete implementation details.

<Note>
  Creating an ATA costs a small amount of SOL (rent). When using `createDestinationAccount: true`, the sender pays this fee.
</Note>

## Recent blockhash and transaction timing

Solana transactions require a **recent blockhash** that must be within the last \~100 blocks (approximately 10 seconds). This short window can cause issues when:

* Policies require approval before broadcast
* Network latency is high
* Multiple signatures are needed

If the blockhash expires before broadcast, the transaction will fail.

**Durable nonce accounts**: For transactions that need more time (such as those requiring policy approval), use a durable nonce account. This replaces the recent blockhash with a nonce that doesn't expire.

```mermaid theme={null}
flowchart TD
    A[Build transaction] --> B{Needs approval?}
    B -->|No| C[Use recent blockhash]
    B -->|Yes| D[Use durable nonce]
    C --> E[~10 second window]
    D --> F[No expiration]
    E --> G[Broadcast quickly]
    F --> H[Broadcast anytime]
```

Two ways to use durable nonces with DFNS wallets:

* **Transfer Asset (recommended)**: bootstrap a nonce account pool on the wallet with `kind: CreateSolanaNonceAccounts` via [Sign and Broadcast Transaction](/api-reference/wallets/sign-and-broadcast-transaction), then set `useDurableNonce: true` on subsequent SOL or SPL transfers. DFNS picks a nonce from the pool server-side.
* **Broadcast API**: build the durable-nonce transaction yourself using `@solana/web3.js`. See the [durable nonce SDK example](https://github.com/dfns/dfns-sdk-ts/blob/m/examples/libs/solana/durable-nonce-tx/main.ts).

## Transfers

Use the [Transfer Asset](/api-reference/wallets/transfer-asset) endpoint for all Solana transfers:

* **Native SOL**: Use `kind: Native` with amount in lamports (1 SOL = 1,000,000,000 lamports)
* **SPL tokens**: Use `kind: Spl` with the token's mint address in `contract`
* **Token Extensions (SPL 2022)**: Use `kind: Spl2022` with the token's mint address

SPL token transfers support an optional `memo` field (alphanumeric, max 64 characters).

<Note>
  Solana accounts must keep a **rent-exempt minimum** balance (about 0.00089 SOL for a basic account). A native SOL transfer that would drain the sender below this minimum, or that funds a brand-new account with less than the minimum, is rejected during transaction simulation (often surfaced as a compute-unit / simulation error). Leave enough SOL to stay above the minimum and to cover fees.
</Note>

## Compute budget and fees

Solana fees are based on **compute units** consumed by the transaction. The fee is calculated by simulating the transaction and converting compute units to SOL.

For complex transactions, you may need to set a higher compute budget using the Compute Budget Program.

## SDK integration

For full transaction control, use the DFNS SDK with [@solana/web3.js](https://solana.com/docs/clients/official/javascript). See complete examples:

* [Basic transaction](https://github.com/dfns/dfns-sdk-ts/blob/m/examples/libs/solana/basic-tx/main.ts)
* [Durable nonce](https://github.com/dfns/dfns-sdk-ts/blob/m/examples/libs/solana/durable-nonce-tx/main.ts)

## Related resources

* [Solana broadcast examples](/api-reference/broadcast/solana)
* [Solana signing examples](/api-reference/sign/solana)
* [Supported networks](/networks)
* [Solana documentation](https://docs.solana.com/)
