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. 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 for events:

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 a register-wallet event and listen for an app-ready event. Conversely, an app will dispatch 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 to the latest release. For a demo, check out the Wallet Adapter example.

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 will result in a breaking change.

Further reading

Wallet Standard design document