Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a Secure Interchain Messaging dApp: A technical Deep Dive

Building a Secure Interchain Messaging dApp: A technical Deep Dive

Building a Secure Interchain Messaging dApp: A technical Deep Dive

Olubisi Idris Ayinde

November 29, 2023
Tweet

More Decks by Olubisi Idris Ayinde

Other Decks in Education

Transcript

  1. By a show of hands, how many of you have

    directly interacted with a blockchain application before?
  2. The concept of blockchain Blockchain creates a safe and open

    way of recording transactions with a shared and unchangeable digital record, eliminating the need for middlemen.
  3. Decentralized Applications • Your backend runs on 1000s of computers

    • Instead of paying Amazon, you pay gas to validators • Immutability • Trade-offs between speed, cost, privacy, and more
  4. How do you take advantage of the new world? •

    What if you didn’t care which chain you were on? • What if you took advantage of chain differences? • What if you could be where your users are?
  5. A deposit address is a temporary special address created and

    monitored by Axelar's Relayer Services on behalf of the requester. const sdk = new AxelarAssetTransfer({ environment: "testnet" }); const depositAddress = await sdk.getDepositAddress({ fromChain, // source chain name toChain, // destination chain name destinationAddress, // destination chain address Asset // asset to transfer }); Deposit Addresses
  6. sendToken is a function in Axelar's gateway EVM contract that

    facilitates token transfers between EVM and Cosmos chains. sendToken( "avalanche", // destination chain name "0xF16DfB26e1FEc993E085092563ECFAEaDa7eD7fD", // destination address "USDC", // asset symbol 100000000 // amount (in atomic units) ) sendToken()
  7. Interchain Tokens Interchain Tokens allow you to send tokens cross-chain,

    build your own asset bridges, build asset transfers into your interchain dApp and many more. How is this different? - Create a standardized ERC-20 token on multiple chains via the Interchain Portal - Build a custom token on every chain with built-in methods for sending - Upgrade an existing token by deploying a wrapper on every chain - Make Interchain Tokens executable alongside GMP messages for enhanced functionality.
  8. Axelar's GMP enables a developer building on one chain to

    call any function on any other connected chain. callContract() // Src Chain function callContract( string memory destinationChain, string memory contractAddress, bytes memory payload ) external; // Dest Chain function _execute( string memory sourceChain, string memory sourceAddress, bytes calldata payload ) internal virtual {}
  9. Axelar's GMP enables a developer building on one chain to

    call any function on any other connected chain. callContractWithToken() // Src Chain function callContractWithToken( string memory destinationChain, string memory contractAddress, bytes memory payload, string memory symbol, uint256 amount ) external; // Dest Chain function _executeWithToken( string memory sourceChain, string memory sourceAddress, bytes calldata payload, string memory tokenSymbol, uint256 amount ) internal virtual {}
  10. Dapp Dapp Source Chain (eg Ethereum) Destination Chain (eg Polygon)

    Gateway 1. callContract() 4. _execute() Gateway 2. Emit event 3. approveContractCall() Axelar Network Validators & Consensus
  11. Demo 1. Clone a simple Next.js UI 2. Write a

    smart contract 3. Deploy the smart contract 4. Wire/connect the smart contract to the frontend 5. Test the application bit.ly/interchain-messaging-dap p-workshop
  12. What Next ??? It’s Easy to Build Interchain-Native dApps For

    support, visit #developers on Axelar's Discord