> For the complete documentation index, see [llms.txt](/llms.txt).

# Solana signer (Ed25519)

For Solana chains, the SDK exposes a `TransactionSigner` from `@solana/signers` via `useWeb3Auth().web3Auth.signer`. This replaces the v8 `SolanaWallet` from `@web3auth/solana-provider`.

## Configuration[​](#configuration "Direct link to Configuration")

Ensure your `web3authConfig.ts` uses `CHAIN_NAMESPACES.SOLANA`:

web3authConfig.ts

```
import {
  CHAIN_NAMESPACES,
  WEB3AUTH_NETWORK,
  type Web3AuthContextConfig,
} from '@web3auth/react-native-sdk'

const web3AuthConfig: Web3AuthContextConfig = {
  web3AuthOptions: {
    clientId: 'YOUR_CLIENT_ID',
    redirectUrl: 'yourapp://auth',
    network: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
    chains: [
      {
        chainNamespace: CHAIN_NAMESPACES.SOLANA,
        chainId: '0x2', // Solana Testnet
        rpcTarget: 'https://api.testnet.solana.com',
        displayName: 'Solana Testnet',
        blockExplorerUrl: 'https://explorer.solana.com',
        ticker: 'SOL',
        tickerName: 'Solana',
      },
    ],
    defaultChainId: '0x2',
  },
}

```

## Get the signer[​](#get-the-signer "Direct link to Get the signer")

```
import { useWeb3Auth } from '@web3auth/react-native-sdk'
import type { TransactionSigner } from '@solana/signers'

function SolanaView() {
  const { web3Auth } = useWeb3Auth()
  const solanaSigner = web3Auth?.signer as TransactionSigner | null

  const getAddress = () => (solanaSigner ? String(solanaSigner.address) : null)
}

```

## Get balance[​](#get-balance "Direct link to Get balance")

```
import { useWeb3Auth } from '@web3auth/react-native-sdk'
import type { TransactionSigner } from '@solana/signers'
import { Connection, PublicKey } from '@solana/web3.js'

function SolanaBalance() {
  const { web3Auth } = useWeb3Auth()
  const solanaSigner = web3Auth?.signer as TransactionSigner | null

  const getBalance = async () => {
    if (!solanaSigner) return null
    const connection = new Connection('https://api.testnet.solana.com', 'confirmed')
    const lamports = await connection.getBalance(new PublicKey(String(solanaSigner.address)))
    return lamports / 1e9 // Convert lamports to SOL
  }
}

```

## Sign a message[​](#sign-a-message "Direct link to Sign a message")

```
import { Button } from 'react-native'
import { useWeb3Auth } from '@web3auth/react-native-sdk'
import type { TransactionSigner } from '@solana/signers'
import { signBytes } from '@solana/signers'

function SignMessageView() {
  const { web3Auth } = useWeb3Auth()

  const signSolanaMessage = async (message: string) => {
    const solanaSigner = web3Auth?.signer as TransactionSigner | null
    if (!solanaSigner) throw new Error('Not connected')

    const encoded = new TextEncoder().encode(message)
    const signature = await signBytes(solanaSigner, encoded)
    return Buffer.from(signature).toString('base64')
  }

  return <Button title="Sign message" onPress={() => signSolanaMessage('Hello')} />
}

```

## Related[​](#related "Direct link to Related")

- [useWeb3Auth hook reference](/embedded-wallets/sdk/react-native/hooks/useWeb3Auth/)
- [Solana chain configuration](/embedded-wallets/sdk/react-native/advanced/#chain-configuration)
