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

# Wallet Standard

> Learn how Phantom implements Wallet Standard for standardized wallet-dapp interactions on Solana.

[Wallet Standard](https://github.com/wallet-standard/wallet-standard) is a chain-agnostic set of interfaces and conventions that aim to improve how applications interact with injected wallets such as Phantom. The standard was pioneered on Solana and is used as the foundation for the [Solana Wallet Adapter](https://github.com/solana-labs/wallet-adapter). Phantom supports the Wallet Standard and is open to working with others to bring this innovation to other ecosystems.

Wallet Standard introduces an event-based model that:

1. Standardizes the way wallets attach themselves to the window.
2. Defines a set of standard APIs that dapps can rely upon.

At a high-level, Wallet Standard defines the following [Window interface](https://github.com/wallet-standard/wallet-standard/blob/ce280f05f6eb16d0e77939827e0b7fa294460e1f/packages/core/base/src/window.ts#L16-L25) for events:

```typescript theme={null}
export interface WalletEventsWindow extends Omit<Window, 'addEventListener' | 'dispatchEvent'> {
    /** Add a listener for {@link WindowAppReadyEvent}. */
    addEventListener(type: WindowAppReadyEventType, listener: (event: WindowAppReadyEvent) => void): void;
    /** Add a listener for {@link WindowRegisterWalletEvent}. */
    addEventListener(type: WindowRegisterWalletEventType, listener: (event: WindowRegisterWalletEvent) => void): void;
    /** Dispatch a {@link WindowAppReadyEvent}. */
    dispatchEvent(event: WindowAppReadyEvent): void;
    /** Dispatch a {@link WindowRegisterWalletEvent}. */
    dispatchEvent(event: WindowRegisterWalletEvent): void;
}
```

When a wallet is ready to inject into a website, it will [dispatch](https://github.com/wallet-standard/wallet-standard/blob/ce280f05f6eb16d0e77939827e0b7fa294460e1f/packages/core/wallet/src/register.ts#L27-L38) a `register-wallet` event and listen for an `app-ready` event. Conversely, an app will [dispatch](https://github.com/wallet-standard/wallet-standard/blob/master/packages/core/app/src/wallets.ts#L39-L50) an `app-ready` event and listen for `register-wallet` events.

## For app developers

Phantom comes with built-in support for Wallet Standard on **Solana**. To get started, simply update the [Solana Wallet Adapter](https://github.com/solana-labs/wallet-adapter) to the latest release. For a demo, check out the [Wallet Adapter](https://anza-xyz.github.io/wallet-adapter/example/) example.

> [!WARNING]
>
> If you are migrating an existing Solana dapp to use Wallet Standard, please ensure that you are not mutating transactions in place. Failure to do so will result in a breaking change.

## Check Solana v1 signing support

Solana version 1 support is a feature on the connected wallet, not a property of the app. Check the feature you are about to call. `solana:signTransaction` and `solana:signAndSendTransaction` are separate features. A wallet can advertise one and omit the other.

The selected account must list the chain and `solana:signTransaction`. A wallet can expose the feature while the connected account does not. A successful browser-extension test does not establish the same behavior for the Phantom mobile app, deep links, or an embedded wallet. If the feature list does not include numeric version `1`, show the user that this wallet cannot sign a version 1 transaction and continue with a version 0 transaction when your app allows it.

```typescript theme={null}
import { SolanaSignTransaction, type SolanaSignTransactionFeature } from "@solana/wallet-standard-features";
import type { Wallet, WalletAccount } from "@wallet-standard/base";

type SolanaChain = "solana:devnet" | "solana:mainnet";

type V1SignWallet = Wallet & { features: SolanaSignTransactionFeature };

export function supportsV1SignTransaction(
  wallet: V1SignWallet,
  account: WalletAccount,
  chain: SolanaChain,
): boolean {
  const feature = wallet.features[SolanaSignTransaction];
  return (
    account.chains.includes(chain) &&
    account.features.includes(SolanaSignTransaction) &&
    feature.supportedTransactionVersions.includes(1)
  );
}
```

Use the same check with `SolanaSignAndSendTransaction` when the app calls that feature. The [version 1 transaction recipe](/recipes/transactions/send-solana-v1-transaction) shows the extension signing flow after this check.

## Further reading

[Wallet Standard design document](https://github.com/wallet-standard/wallet-standard/blob/master/DESIGN.md)
