Sitemap
Aptos Labs

Bringing the Future On-Chain

Build With X-Chain Accounts on Aptos

--

The world is moving on-chain, powered by the Aptos Global Trading Engine. X-Chain Accounts push that vision forward by letting users bring existing accounts on Ethereum or Solana to Aptos dApps.

Use your favorite wallets like Phantom or MetaMask inside a dApp without extra steps or new seed phrases.

  • Access any dApp on Aptos with your existing Ethereum or Solana wallet (e.g., MetaMask or Phantom). You don’t need an Aptos account or wallet; your existing wallet and crypto balance are all you need.
  • A unique account is automatically generated and securely tied to your Ethereum or Solana wallet key. No additional keys or downloads are necessary.
  • Move your USDC from Ethereum or Solana onto Aptos in seconds with Circle’s Cross-Chain Transfer Protocol (CCTP).
  • Once connected, you can authorize session keys, which let you approve transactions within the dApp without repeated wallet pop-ups.

X-Chain Accounts have been launched in the v1.30 release and are live on Aptos devnet, supporting accounts on Ethereum or Solana. Testnet and mainnet releases will follow shortly.

Developer Overview: X-Chain Accounts

TL;DR: Any account whose signature scheme is whitelisted can submit and sign transactions as if it were native to Aptos.

What does this mean?

Let’s start with the native wallet flow. When you use an Aptos-native wallet like Petra, you connect to a dApp through @aptos-labs/wallet-adapter-react; this returns an existing Aptos address tied to the key.

Build a transaction, get it signed and submit it. The signature is checked at runtime.

Accessing Aptos through an X-Chain account follows a similar sequence, with one additional plugin import and sign-in:

Step 1: The same wallet adapter is used, with the X-Chain Adapter plugin for the external wallet (e.g., Phantom for Solana) imported. X-Chain Adapter is a lightweight plugin built on top of the standard Aptos wallet adapter.

npm install @aptos-labs/derived-wallet-solana

import { setupAutomaticSolanaWalletDerivation } from "@aptos-labs/derived-wallet-solana"
setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.DEVNET })

Step 2: ‘Connect with Phantom’ appears, and the user signs a single message. The X-Chain plugin computes the Aptos account address derived from the Phantom public key, the website domain, and the on-chain authentication function.

Step 3: You can now build a transaction with the new derivedAddress as the sender. Phantom signs it.

Step 4: The signature is checked at runtime.

Developers can optionally layer this with sub-accounts, session keys and gas‑sponsored transactions for tailored UX. We will explore this more in the sections ahead.

The user’s Solana key now controls an Aptos account specific to the dApp. The interaction and experience feel the same as any Aptos wallet.

Note: The account on Aptos is scoped to the dApp’s domain. In the future, we might explore global accounts to improve interoperability. But, Aptos doesn’t currently have an interoperable account management interface to track account activity across applications, and users will have to maintain an account/balance at each application.

Components of X-Chain Accounts

Derivable Account Abstraction

When a Phantom (Solana) user arrives at an Aptos dApp like Amnis, the X-Chain Adapter must create an Aptos account that Phantom can legally control. Aptos achieves this with Derivable Account Abstraction (DAA).

The process starts with an authentication function that verifies the signature of the X-Chain Accounts.

Next, the adapter builds an account identity string by joining the visitor’s Phantom public key with your dApp’s domain name, for example: <Phantom Public Key> + amnis.finance.

A 32-byte output becomes the user’s derived Aptos address.

Sub-Accounts

A sub-account on Aptos is a resource account created and owned by a parent signer. This is a full account, useful for compartmentalizing risks and isolating different DeFi positions.

  • The user still signs with the same root key
  • Each sub-account can also have its session keys and spending limits
  • The feature works identically for native and derived accounts

Session Keys

A session key is an ephemeral secondary key-pair that a parent account can authorize for a limited set of actions. The session keys record the new public key, a list of allowed functionalities, a cap on spending, and the expiry block.

Until expiry, the dApp can sign specific transactions locally with the session key, bypassing repeated wallet pop-ups.

Once users approve the first signature, every subsequent trade or game move can happen with a single click.

Integrate X-Chain

Support X-Chain Accounts on your dApp with a few simple steps:

Step 1: Add two lines of code that attach Solana Phantom support in the standard Aptos wallet adapter.

Step 2: Build a transaction, get it signed, sponsor gas (optional but recommended), and submit it.

Build With X-Chain

The endgame of cross-chain interoperability is here.

Get started.

--

--

Aptos Labs
Aptos Labs

Written by Aptos Labs

Aptos Labs is a premier Web3 studio of engineers, researchers, strategists, designers, and dreamers building on Aptos, the Layer 1 blockchain.

No responses yet