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

# Using Solana global wallets

> Sign messages and transactions with a Solana global wallet through its Wallet Standard features.

Once the wallet is [registered](https://docs.privy.io/wallets/global-wallets/integrate-a-global-wallet/solana/wallet-standard-connector.md), `@solana/wallet-adapter` drives it like any other Solana wallet. This page documents the exact surface it advertises.

> [!NOTE]
>
> Privy requires the user to confirm every signature and transaction on the provider's own page.
> Each request opens one popup there. Signing three transactions opens three popups, in sequence,
> even when one Wallet Standard call carries all three. Combine instructions into a single
> transaction instead.

Request signatures and transactions with three methods on `@solana/wallet-adapter`'s `useWallet` hook. App code never touches the feature map.

```tsx theme={"system"}
import {useConnection, useWallet} from '@solana/wallet-adapter-react';

const {connection} = useConnection();
const {publicKey, signMessage, signTransaction, sendTransaction} = useWallet();
```

`signMessage` and `signTransaction` stay `undefined` until the app connects a wallet that advertises those features. Guard on them before calling.

## What a connection covers

A connection covers one chain namespace. The handshake carries exactly one address, so a requester receives a single account per namespace. A cluster, Solana's term for a network such as mainnet or devnet, scopes each registered wallet.

* `wallet.chains` holds exactly one cluster, in alias form, such as `solana:mainnet`
* `wallet.accounts` holds zero accounts before connecting and exactly one after
* `account.address` is the base58 address, and `account.publicKey` is that address decoded to 32 bytes
* The SDK keys the stored approval per namespace, so two clusters of one provider app share it
* To add an EVM address, register a separate [EVM connector](https://docs.privy.io/wallets/global-wallets/integrate-a-global-wallet/rainbowkit-connector.md) and open a second connection

That single account is a provider convention, not a rule Privy enforces. Privy's provider SDK checks only that a Solana request names the address the connection carries. A provider chooses for itself whether to keep the user's other wallets private.

## Wallet Standard features

The wallet advertises six Wallet Standard feature keys and nothing else. It exposes no `privy:` namespace, so a provider wallet is never mistaken for a first-party Privy wallet.

| Feature | Purpose |
| - | - |
| `standard:connect` | Requests the connection and returns the account |
| `standard:disconnect` | Clears the stored connection and the account list |
| `standard:events` | Emits `change`, the only event name this spec version defines |
| `solana:signAndSendTransaction` | Signs and broadcasts a transaction |
| `solana:signTransaction` | Signs a transaction without broadcasting |
| `solana:signMessage` | Signs an arbitrary message |

App code reaches these through `useWallet` rather than calling them directly. `standard:connect` and `standard:events` are also the adapter's entry requirement. A wallet without both never appears in `wallets`.

Both transaction features declare `supportedTransactionVersions` of `['legacy', 0]`. Version 0 covers versioned transactions with address lookup tables.

The feature map has no `signTypedData` and no `switchChain`. A connection cannot switch clusters.

## Request and response encodings

The Wallet Standard methods take and return `Uint8Array`, so app code never encodes anything by hand. The encodings below are what travels between the requester and the provider, and they are not uniform. A provider implementation has to match them byte for byte.

| Method | `params[0]` | Wire result |
| - | - | - |
| `solana:signAndSendTransaction` | `{account, transaction, options?}` | base58 signature |
| `solana:signTransaction` | `{account, transaction, options?}` | base64 signed transaction |
| `solana:signMessage` | `{account, message}` | base64 signature |

`account` is the base58 address as a plain string, not a Wallet Standard account object. `transaction` and `message` are base64-encoded bytes. `params` carries exactly one element: the chain travels on the request envelope.

## signMessage

To the `signMessage` method returned by `useWallet`, pass the message as bytes, so encode a string first:

```tsx theme={"system"}
const signature = await signMessage(new TextEncoder().encode('Hello world'));
```

**message** `Uint8Array` *required*

The message the user must sign, as bytes.

**signature** `Uint8Array`

The 64-byte message signature.

## signTransaction

To the `signTransaction` method returned by `useWallet`, pass a transaction. It signs without broadcasting and returns the same transaction type it was given:

```tsx theme={"system"}
const signed = await signTransaction(transaction);
```

**transaction** `Transaction | VersionedTransaction` *required*

The transaction the user must sign.

**signed** `Transaction | VersionedTransaction`

The signed transaction. Call `signed.serialize()` for the raw bytes.

## sendTransaction

This routes to `solana:signAndSendTransaction`, so the provider broadcasts and picks the commitment. The adapter still uses the app's `connection` to prepare the transaction first:

```tsx theme={"system"}
const signature = await sendTransaction(transaction, connection);
```

**transaction** `Transaction | VersionedTransaction` *required*

The transaction to sign and broadcast.

**connection** `Connection` *required*

The app's RPC connection, used to prepare the transaction before it is sent.

**options** `SendTransactionOptions`

Options passed to the adapter, such as `signers` and `preflightCommitment`.

**signature** `TransactionSignature`

The base58 transaction signature, as a string.

## Reaching the features directly

To call a Wallet Standard feature directly, reach it through `wallet.adapter.wallet`. `useWallet` returns `{adapter, readyState}`, so the features sit one level deeper than the adapter:

```tsx theme={"system"}
const {wallet} = useWallet();

if (wallet && 'standard' in wallet.adapter) {
  const standardWallet = wallet.adapter.wallet;

  if ('solana:signTransaction' in standardWallet.features) {
    const [{signedTransaction}] = await standardWallet.features[
      'solana:signTransaction'
    ].signTransaction({
      account: standardWallet.accounts[0],
      chain: 'solana:mainnet',
      transaction: transaction.serialize()
    });
  }
}
```

`'standard' in wallet.adapter` narrows a union to `StandardWalletAdapter`, which carries `wallet` and its feature map. Wallet Standard then types that map as a union of transaction features, so the feature key needs its own check before it can be indexed.

## Cluster mismatch checks

The two transaction features compare the `chain` on the input against the cluster the connection was made on. The adapter throws that input's request, so an app using it cannot sign a devnet transaction against mainnet.

The wallet processes inputs one at a time. A mismatch on a later input throws only after the earlier ones have already signed, and in the case of `signAndSendTransaction`, broadcast.

The provider binds differently. It rejects a request whose namespace differs from the one the user approved, and a Solana request must name the account that connection carries. It does not check the cluster, so a provider that wants cluster pinning compares `request.chain` against `connection.chain` itself.
