Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 67d688f

Browse files
committed
updates to the adapter x chain accounts page
1 parent 513f380 commit 67d688f

File tree

1 file changed

+89
-7
lines changed

1 file changed

+89
-7
lines changed

apps/nextra/pages/en/build/sdks/wallet-adapter/x-chain-accounts.mdx

Lines changed: 89 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "X-Chain Accounts"
33
---
44

5-
import { Callout } from "nextra/components";
5+
import { Callout, Tabs, Steps } from "nextra/components";
66

77
# X-Chain Accounts
88

@@ -21,7 +21,7 @@ This functionality enables a variety of use cases for dApps, enhancing user expe
2121
When a user enters a dApp that supports x-chain accounts, the interaction and experience feel the same as with any Aptos wallet.
2222
The user connects with a x-chain account (e.g., Phantom for Solana) and can view their Derivable Abstracted Account (DAA) details, sign messages, and submit transactions to the Aptos chain.
2323

24-
When a dapp submits a transaction using a x-chain account, the wallet adapter utilizes the `signIn` function (defined in the x-chain account standard) for domain verification and security.
24+
When a dapp submits a transaction using a x-chain account, the wallet adapter utilizes the `signIn` function (defined in the x-chain account standard) for domain verification and security. If a specific wallet does not support the `signIn` method, the adapter falls back to using the default `signMessage`.
2525
The wallet is requested to sign a message to submit a transaction on the Aptos network. Once the wallet approves the transaction, it is submitted to the Aptos chain, where it undergoes a signature verification process.
2626

2727
### How does DAA work in a x-chain account?
@@ -34,7 +34,7 @@ The computation of the DAA address is done using the `authenticationFunction` an
3434
- `authenticationFunction`: This is a function that exists on-chain and is used to verify the signature of the x-chain account.
3535
- `accountIdentity`: This represents the identity of the account used in the on-chain authentication function to verify the signature of the x-chain account.
3636
In the Wallet Adapter, the `accountIdentity` is based on the original x-chain account's public key and the dApp domain (e.g., mydomain.com). The format is:
37-
`${originWallet.publicKey}${domain}`
37+
`${originWalletAddress}${domain}`
3838

3939
<Callout>
4040
Since the account identity is based on the dApp domain, it is scoped to the dApp context. As a result, each account has a different DAA address on different dApps.
@@ -43,32 +43,115 @@ In the Wallet Adapter, the `accountIdentity` is based on the original x-chain ac
4343

4444
### How to integrate x-chain accounts in my dApp?
4545

46+
Currently, the adapter supports Solana and EVM chains
47+
48+
<Tabs items={['Solana', 'EVM']}>
49+
{/* Solana */}
50+
51+
52+
<Tabs.Tab>
53+
54+
The wallet adapter follows the [Solana Wallet Standard](https://github.com/wallet-standard/wallet-standard/blob/master/DESIGN.md) to discover wallets.
55+
Currently, the wallets that have been tested and support cross-chain accounts are:
56+
57+
| | Aptos Devnet | Aptos Testnet | Aptos Mainnet |
58+
|----------|--------------|---------------|---------------|
59+
| Phantom || |
60+
| Solflare || |
61+
| Backpack || |
62+
| OKX || |
63+
64+
4665
Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx)
4766

4867
Supporting x-chain accounts in a dApp requires only a 2-step installation process.
4968

69+
<Steps>
70+
71+
### Install the `@aptos-labs/derived-wallet-solana` package
72+
5073
```bash
5174
npm install @aptos-labs/derived-wallet-solana
5275
```
5376

77+
### Import the `setupAutomaticSolanaWalletDerivation` function
78+
5479
Once you have installed the `@aptos-labs/derived-wallet-solana` package, you can import and use it.
5580
In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following:
5681

57-
```ts
82+
```tsx filename="WalletProvider.tsx"
5883
import { setupAutomaticSolanaWalletDerivation } from "@aptos-labs/derived-wallet-solana";
5984

60-
setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.TESTNET }); // this is the Aptos network your dapp is working with
85+
setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.DEVNET }); // this is the Aptos network your dapp is working with
86+
87+
.....
88+
89+
<AptosWalletAdapterProvider
90+
dappConfig={{
91+
network: Network.DEVNET,
92+
}}
93+
>
94+
{children}
95+
<AptosWalletAdapterProvider/>
96+
```
97+
</Steps>
98+
</Tabs.Tab>
99+
100+
{/* EVM */}
101+
<Tabs.Tab>
102+
103+
The wallet adapter follows the [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) to discover wallets.
104+
Currently, the wallets that have been tested and support cross-chain accounts are:
105+
106+
| | Aptos Devnet | Aptos Testnet | Aptos Mainnet |
107+
|----------|--------------|----------------|---------------|
108+
| Metamask | ✅ | |
109+
| Phantom | ✅ | |
110+
| Coinbase | ✅ | |
111+
| OKX | ✅ | |
112+
| Exodus | ✅ | |
113+
| Backpack | ✅ | |
114+
115+
116+
Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx)
117+
118+
Supporting x-chain accounts in a dApp requires only a 2-step installation process.
119+
120+
<Steps>
121+
122+
### Install the `@aptos-labs/derived-wallet-ethereum` package
123+
124+
```bash
125+
npm install @aptos-labs/derived-wallet-ethereum
126+
```
127+
128+
### Import the `setupAutomaticEthereumWalletDerivation` function
129+
130+
Once you have installed the `@aptos-labs/derived-wallet-ethereum` package, you can import and use it.
131+
In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following:
132+
133+
```tsx filename="WalletProvider.tsx"
134+
import { setupAutomaticEthereumWalletDerivation } from "@aptos-labs/derived-wallet-ethereum";
135+
136+
setupAutomaticEthereumWalletDerivation({ defaultNetwork: Network.DEVNET }); // this is the Aptos network your dapp is working with
61137

62138
.....
63139

64140
<AptosWalletAdapterProvider
65141
dappConfig={{
66-
network: Network.TESTNET,
142+
network: Network.DEVNET,
67143
}}
68144
>
69145
{children}
70146
<AptosWalletAdapterProvider/>
71147
```
148+
</Steps>
149+
</Tabs.Tab>
150+
151+
</Tabs>
152+
153+
154+
72155

73156
That will handle the logic and implementation to include the x-chain accounts as if they were Aptos wallets.
74157

@@ -158,7 +241,6 @@ export default SignAndSubmit;
158241

159242
### Considerations
160243
- Since the origin wallet creates an x-chain account and is most likely not integrated with Aptos, simulation is not available in the wallet.
161-
- Due to the use of the `signIn` standard available on other chains, wallets that have not implemented this flow are not supported.
162244
- While the x-chain account prioritizes DAA, each account also retains the origin wallet, so developers should be able to use it and interact with it
163245

164246

0 commit comments

Comments
 (0)