Inspiration

ETNCall’s vision is to build a decentralized system that connects the Electroneum Network to other existing blockchain networks, enabling cross-chain communications and asset transfers seamlessly. Our main goals are interoperability, user experience, and facilitating secure and efficient cross-chain transactions. Ultimately, we seek to connecting the Electroneum ecosystem to the existing Web3 world to foster users adoption and smoothen developers transition to the Electroneum Network.

What it does

ETNCall is a blockchain interoperability infrastructure that aims to connect the Electroneum Network to other blockchain networks. It provides a decentralized network of relayers (called Node) that facilitate secure and efficient cross-chain transactions. The Node uses the proof of stake consensus mechanism as a security layer, which validators are required to stake $ETC as collateral to validate relayed transactions.

ETNCall is not a token bridge but a general messaging passing (GMP) protocol that can be use to send and receive any arbitrary size of data from Electroneum Network to any other chain and vice versa, which serves as the underlying API to build any type of bridge on or other interoperability structures.

The ETNCall is shipped with its own transaction Explorer including APIs, tools, and a user interface that enables anyone to index, query or visualize the transactions and activities happening within the ETNCall network.

Start building.

How we built it

  • Smart Contracts: The core smart contracts include:

ETNCallMessage: This contract is responsible for encoding outgoing messages and decoding incoming messages. It implements the messaging logic and defines the structure of both outgoing and incoming messages.

ETNCallPay: This contract enables pre-funding of gas fees, allowing developers to cover transaction fees on behalf of their users, enhancing the user experience.

TokenPool: This contract holds tokens that are used as collateral or for transferring value in cross-chain messages.

ETNCall (Router): The central contract that orchestrates message sending and receiving between chains. It validates the messages and routes them to the appropriate chain and contract.

  • Node:

Written in typescript with Nestjs framework, Ot uses redis to create a memory worker to constantly scan the blockchain contracts events to process cross chain messages and records those messages and their status in a mongodb database, and includes rest api endpoints to query the node.

  • Frontend and Design:

After deliberating on the project's architecture and user flow, we used Figjam to visualize and plan the design. Once we established the specific user experience we aim to address, we proceeded with the design of the user interface.

We used the Vue.js framework and various libraries such as Viem, wagmi, time-ago, and others. We streamlined the development process of the frontend application, enabling us to achieve greater efficiency and speed.

Architecture

Fees and Pre-funding

To send an inter-chain message it is required to pay some gas in the native coin of the origination chain, this gas amount varies depending on the destination chain for example in most cases interacting with the Ethereum chain would be costly compared to the Polygon chain. However developers can improve the user experience of their dApps by paying the gas fees upfront for their users through the ETNCallPay contract.

Token bridge

ETNCall Token Bridge is an open source decentralized token bridge. At its core the DEx uses the GMP feature of ETNCall to perform swapping across different chains. It is open sourced to showcase how developers can make integrate ETNCall in their dApps and the best practices to follow.

Use Token Bridge

Potential Impact on Electroneum

  1. Interoperability on Electroneum will enable the transfer of assets and data to different chains, expanding its reach and capabilities.

  2. Ecosystem Expansion: Electroneum can tap into a wider network of interconnected chains and dApps. This can help attract developers, users, and projects that are already part of the existing blockchains, fostering growth and adoption.

  3. The ETNCall Token Bridge facilitates cross-chain asset transfers, allowing Electroneum to send and receive assets like stable-coins from other blockchains. This can enhance liquidity and enable seamless integration with existing decentralized finance (DeFi) platforms and exchanges.

Supported Chains

The following comprises the list of blockchains that are currently implemented in the ETNCall network: Electroneum Testnet, Polygon Amoy, Scroll Sepolia.

Developers Guide

Send Message

Data.OutgoingMessage memory message = Data.OutgoingMessage({
  toChainId: toChainId,
  receiver: _contracts[toChainId],
  payload: abi.encode(_msgSender()),
  tokens: tokens,
  payMaster: Data.PayMaster.SENDER
});

uint256 fee = _etnCall.estimateFee(toChainId);

bytes32 messageId = _etnCall.sendMessage{value: fee}(message, tokenPool);

Receive Message

function _etnCallReceive(
  Data.IncomingMessage memory message
) internal override {
  address data = abi.decode(message.payload, (address)); 
}
Share this project:

Updates