Skip to main content

Cross Domain Messaging (XDM) Guide

Міждоменний обмін повідомленнями в мережі Autonomys.

This guide explains what XDM is and walks you through how to transfer assets between consensus and domain chains.

Introducing Cross Domain Messaging (XDM)

Cross Domain Messaging (XDM) is a core feature of the Autonomys Network that enables secure and seamless communication between independent blockchain domains, such as the consensus chain and specialized domains like Auto EVM. XDM allows these separate blockchains to exchange assets, messages, and data reliably, enhancing interoperability and collaboration across the entire Autonomys ecosystem.

Якщо ви хочете дізнатися більше про технічні нюанси XDM, ви можете знайти більш детальну інформацію в наших специфікаціях протоколу.

XDM Підтвердження і таймінг

Для забезпечення безпеки існує період очікування, який має сплинути під час переведення токенів між доменами та консенсусним ланцюжком. Токени не стають повністю доступними для використання доти, доки не мине час підтвердження. Ознайомтеся з таблицею нижче, щоб зрозуміти блоки підтвердження і приблизний час:

ДжерелоПризначенняБлоки підтвердженняЧас підтвердження
ConsensusДомен100 консенсус~10 хвилин
Домен AДомен B14,400 домен~1 день
ДоменConsensus14,400 домен~1 день

Повернення коштів у разі невдачі під час виконання XDM-переказу займе загалом 28,800 блоків.

Поки XDM підтверджується на вихідному ланцюжку (100 консенсусних блоків або 14,400 блоків домену), XDM можна переказати та виконати на цільовому ланцюжку (переказ відбувається).

Цільовий ланцюжок генерує відповідь XDM, яку буде відправлено назад на вихідний ланцюжок після того, як відповідь XDM буде підтверджено на цільовому ланцюжку (100 консенсусних блоків або 14,400 блоків домену). Однак відповідь XDM здебільшого не чинить дії (no-op) і корисна тільки в разі невдачі XDM, коли необхідно повернути кошти відправникові на вихідному ланцюжку.

Комісії XDM

XDM-переказ у будь-якому напрямку коштує 2 tAI3 на Taurus. Розмір цієї комісії ще не визначений для основної мережі і планується зробити її динамічною. The price is also likely to change based on the outcomes of the SR Labs security audit report.

Що відбувається з комісією XDM?

tAI3 заробляється операторами за обробку транзакції. Вони діляться комісією за виконання зі своїми номінаторами. Частина коштів також йде фармерам за зберігання транзакції.

Виконання XDM-переказів

Консенсус до домену Auto EVM

Відвідайте https://astral.autonomys.xyz/taurus/transfer

Астрал - Переказ

Select networks for XDM Consensus → Auto EVM. Введіть суму для переказу.

Astral - XDM Сума

Hit Send token and you will be asked to approve the signature request.

SubWallet - Консенсус до Auto EVM

After hitting Approve you will see an extrinsic hash.

Astral - Зовнішній хеш

Which you can search on Astral.

Astral - Search Extrinsic

Astral - View Extrinsic

Наш цільовий акаунт спочатку не має токенів.

SubWallet - No Tokens

We can also check the balance on the Auto EVM explorer at https://blockscout.taurus.autonomys.xyz/

Blockscout - No Tokens

We wait 10 minutes for the confirmation…

SubWallet - Tokens Arrived

Blockscout - Tokens Arrived

І ми успішно завершили перехід XDM від консенсусу до Auto EVM.

Auto EVM domain to consensus with SubWallet and PolkadotJS

Отже, тепер у нас є кілька токенів на домені Auto EVM, давайте спробуємо відправити деякі з них у зворотному напрямку.

По-перше, нам знадобиться 0x відкритий ключ облікового запису, на який ви хочете відправити токени на основі консенсусу. Якщо у вас його немає, ви можете завантажити його з [ss58.org] (http://ss58.org), як показано на скріншоті нижче.

Convert Public Key

Next, you will need to navigate to the Auto EVM domain in PolkadotJS by either selecting it in the network switcher or following this link: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fauto-evm.taurus.autonomys.xyz%2Fws#/extrinsics

Working from the top down:

  1. Select the account you want to XDM from.
  2. Select the transporter.transfer() extrinsic.
  3. Select Consensus in the dstLocation chainId.
  4. Enter the 0x account address we got above in the AccountId32 textbox. NOTE: it is possible to use the “Substrate: 42” address that starts with a 5 in this box if you find that easier.
  5. Enter the amount, which will be the number of tokens with 18 zeroes afterwards as the value is in Shannons.
  6. Submit Transaction.

PolkadotJS

Auto EVM domain to consensus with Talisman

Transferring tokens from Auto EVM to Consensus can be tricky in SubWallet because of its unified accounts design. With the Talisman Wallet, the flow is far simpler - just as easy as sending tokens from Consensus to Auto EVM.

In your wallet you should have both a consensus account and an EVM account listed.

Talisman

Make sure that you have some funds in your EVM wallet. For this demonstration, there are 10 tAI3 tokens in both the consensus and EVM accounts.

Talisman

Talisman

Відвідайте https://astral.autonomys.xyz/taurus/transfer

Астрал - Переказ

Select networks for Auto EVM → Consensus. Enter an amount to transfer, and a destination address.

Talisman

Hit Send token and you will be asked to approve the signature request.

Talisman

After hitting Approve you will see an extrinsic hash.

Astral - Зовнішній хеш

Checking the EVM account balance, you can see that it is now 7. 1 tAI3 token was sent and 2 tAI3 was used for the transaction fee.

Talisman

After waiting 14,400 domain blocks (can be from 1-2 days depending on block production speed), you can see that the Consensus account balance has increased by 1 tAI3 to 11 tAI3.

Talisman

Automated XDM

It is possible to use the Auto SDK’s @autonomys/auto-xdm package to submit these transactions if you’d like to automate them in some way.