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

Commit 02ea689

Browse files
authored
Updates to the adapter x chain accounts page (#931)
* updates to the adapter x chain accounts page * add evm docs
1 parent c84c27d commit 02ea689

File tree

1 file changed

+71
-8
lines changed

1 file changed

+71
-8
lines changed

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

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

5-
import { Callout, Steps } 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,6 +43,18 @@ 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+
<Callout>
49+
It is highly recommended to use the `@aptos-labs/wallet-adapter-react` package for the best experience. Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx)
50+
</Callout>
51+
52+
<Tabs items={['Solana', 'EVM']}>
53+
{/* Solana */}
54+
55+
56+
<Tabs.Tab>
57+
4658
The wallet adapter follows the [Solana Wallet Standard](https://github.com/wallet-standard/wallet-standard/blob/master/DESIGN.md) to discover wallets.
4759
Currently, the wallets that have been tested and support cross-chain accounts are:
4860

@@ -54,10 +66,6 @@ Currently, the wallets that have been tested and support cross-chain accounts ar
5466
| OKX || |
5567

5668

57-
<Callout>
58-
It is highly recommended to use the `@aptos-labs/wallet-adapter-react` package for the best experience. Make sure you integrate with the Aptos Wallet Adapter by following these [steps](./dapp.mdx)
59-
</Callout>
60-
6169
Supporting x-chain accounts in a dApp requires only a 2-step installation process.
6270

6371
<Steps>
@@ -90,6 +98,62 @@ setupAutomaticSolanaWalletDerivation({ defaultNetwork: Network.DEVNET }); // thi
9098
```
9199
</Steps>
92100

101+
</Tabs.Tab>
102+
103+
{/* EVM */}
104+
<Tabs.Tab>
105+
106+
The wallet adapter follows the [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) to discover wallets.
107+
Currently, the wallets that have been tested and support cross-chain accounts are:
108+
109+
| | Aptos Devnet | Aptos Testnet | Aptos Mainnet |
110+
|----------|--------------|----------------|---------------|
111+
| Metamask | ✅ | |
112+
| Phantom | ✅ | |
113+
| Coinbase | ✅ | |
114+
| OKX | ✅ | |
115+
| Exodus | ✅ | |
116+
| Backpack | ✅ | |
117+
118+
119+
Supporting x-chain accounts in a dApp requires only a 2-step installation process.
120+
121+
<Steps>
122+
123+
### Install the `@aptos-labs/derived-wallet-ethereum` package
124+
125+
```bash
126+
npm install @aptos-labs/derived-wallet-ethereum
127+
```
128+
129+
### Import the `setupAutomaticEthereumWalletDerivation` function
130+
131+
Once you have installed the `@aptos-labs/derived-wallet-ethereum` package, you can import and use it.
132+
In the same file where you import the other wallets, such as `WalletProvider.tsx`, you can add the following:
133+
134+
```tsx filename="WalletProvider.tsx"
135+
import { setupAutomaticEthereumWalletDerivation } from "@aptos-labs/derived-wallet-ethereum";
136+
137+
setupAutomaticEthereumWalletDerivation({ defaultNetwork: Network.DEVNET }); // this is the Aptos network your dapp is working with
138+
139+
.....
140+
141+
<AptosWalletAdapterProvider
142+
dappConfig={{
143+
network: Network.DEVNET,
144+
}}
145+
>
146+
{children}
147+
<AptosWalletAdapterProvider/>
148+
```
149+
</Steps>
150+
</Tabs.Tab>
151+
152+
</Tabs>
153+
154+
155+
156+
93157
That will handle the logic and implementation to include the x-chain accounts as if they were Aptos wallets.
94158

95159
#### Submitting a transaction
@@ -173,7 +237,6 @@ export default SignAndSubmit;
173237

174238
### Considerations
175239
- Since the origin wallet creates an x-chain account and is most likely not integrated with Aptos, simulation is not available in the wallet.
176-
- Due to the use of the `signIn` standard available on other chains, wallets that have not implemented this flow are not supported.
177240
- 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
178241

179242

0 commit comments

Comments
 (0)