paint-brush
EYWA Protocol: How cross-chain should actually work?by@eywaprotocol
441 reads
441 reads

EYWA Protocol: How cross-chain should actually work?

by Eywa protocolFebruary 18th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

EYWA protocol team is developing the infrastructure that allows the transfer of data from one blockchain to another in a decentralized, reliable and secure manner. The protocol is designed to transfer information from one chain to another, in a secure and reliable manner. It is highly probable that in the upcoming several years these two concepts will exist together, and the choice of architecture will depend on the context of a particular business objective. We are confident that the number of teams using cross-chain architecture for their applications will be constantly increasing.

Company Mentioned

Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - EYWA Protocol: How cross-chain should actually work?
Eywa protocol HackerNoon profile picture

Introduction

Within the DeFi sector there are more new projects and applications emerging. Such highly competitive environment imposes a number of requirements for the market participants:

  • a wide range of tools for maximizing earnings
  • unified and understandable UX
  • high degree of reliability and safety

Moreover, a necessity for each project to be represented on different blockchains is becoming more obvious as this significantly increases the user base and, accordingly, improves the business performance of the project. At the same time, this need brings many technological complexities and ambiguities for which best practices have not yet been elaborated.

Currently, developers can pick one of the following approaches to spread their presence across multiple blockchain networks:

Multi-chain approach. In this case, projects deploy copies of their smart contracts within different networks. These smart contracts do not interact with each other in any way, existing in different worlds / blockchains independently from each other.

Regardless the seaming simplicity, such a straightforward approach leads to several problems simultaneously: the separation of the project economy, the fragmentation of liquidity pools, the fragmentation of the overall application state among smart contracts of different networks, a significant decrease in the quality of UX, and many other less obvious issues.

Cross-chain approach. In the given case, the project represents a single infrastructure of smart contracts in different blockchain networks that interact with each other due to an intermediate transport layer. This approach improves the developer experience allowing much more detailed construction of a single smart contract architecture on different blockchains that contain the business logic of the application, which allows to implement a consistent and understandable UX.

Nevertheless, the core issue in the implementation of such an architecture is a creation of the independent and secure transport layer, which, in addition, must have a high throughput.

As paradoxical as it may seem, but on the current technological level, dApp developers, when implementing cross-chain functionality, in most cases rely on centralized solutions that allow to quickly implement program logic and obtain a high extent of throughput, however, at the same time such solutions do not have high trust in the crypto community due to the fact that they have shown their unreliability many times in an aggressive environment with a high frequency of hacks.

Multi-chain and cross-chain solutions are not mutually exclusive and incompatible. It is highly probable that in the upcoming several years these two concepts will exist together, and the choice of architecture will depend on the context of a particular business objective. Herewith, we are confident that the number of teams using cross-chain architecture for their applications will be constantly increasing over time precisely due to the fact that certain user stories can only be implemented within the paradigm of cross-chain interactions of smart contracts. That is why our EYWA protocol team is developing the infrastructure that allows the transfer of data from one blockchain to another in a decentralized, reliable and secure manner.

EYWA Transport Protocol Architecture

In order to transfer information from one blockchain to another, the following systems elements are required:

  • EYWA Smart Contract Infrastructure in Blockchain A.
  • EYWA node-relay network.
  • EYWA Smart Contract Infrastructure in Blockchain B.

We are going to describe step by step down below how the EYWA Protocol works when transferring data from Blockchain A to Blockchain B.

Step 1. Any smart contract in Blockchain A network can call the Bridge A smart contract related to the EYWA transport protocol infrastructure by attaching data to its transaction, which must be transferred to the telic Blockchain B smart contract. Data comprises the identifier of Blockchain B, smart contract address, function identifier and arguments with which the function should be called.

Step 2. As a result of the call, Bridge A smart contract sends an event to the Blockchain A log.

Step 3. EYWA relay nodes collect consensus related to the events emitted by the Bridge A smart contract in order to make sure that the information is not distorted by malicious nodes, and if the consensus of ⅔ nodes is collected, the events are added to the EYWA blockchain in the block form signed by the nodes participating in the consensus.

To choose validators from the total number of nodes, in EYWA, there is the implemented epoch system with a VRF selection of participants for each epoch. These measures almost eliminate the probability of a concentration of malicious nodes within the same era.

Step 4. The party carrying out the transaction can receive the signed event from the EYWA blockchain through the API of the witness node system and send it to the Bridge B smart contract located in Blockchain B.

Step 5. Bridge B smart contract validates the signature of the epoch participants for the event, and if the validation goes correctly, then it parses the event into the arguments with which it calls the telic smart contract. Also, the Bridge B smart contract emits information about the execution of the event in the destination network, which is also recorded in the EYWA blockchain.

Each of the described above steps is a complex task and for the implementation we used interesting and non-trivial approaches, which we will discuss in our future articles.

Services based on EYWA protocol

The presence of the EYWA transport protocol among blockchains opens up wide opportunities for implementing the logic of decentralized applications, including the development of DeFi projects. In parallel with the team working on the technical implementation of the cross-chain data transfer protocol, in EYWA, several teams  are involved into the work on the development of products based on this protocol:

  • Cross-chain DEX
  • Bridge for tokens using the lock/mint mechanism.
  • Protocols for staking and farming of tokens
  • Cross-chain DAO

Cross-chain DEX

Cross-chain DEX is the infrastructure of smart contracts deployed in several blockchains, the core part of which is the system of interconnected curve-pools in a hub-chain, where the latter serves as a kind of transshipment base for crypto assets of different networks. As the hub-chain, our team chose Harmony One blockchain, which has a fast block finalization and low transaction costs.

Cross-chain DEX will allow users to exchange tokens of the same nature within different blockchains with a minimal slippage:

Exchange of stablecoins of different networks. With the growth of the ecosystem of any blockchain, an increasing demand for stablecoins appears inside of it, where holding stablecoins allow to minimize the losses during market turbulence. With the help of cross-chain DEX, users will be able to quickly and cheaply move stablecoins among different networks, which will allow not to balk investment opportunities and maximize investment income.

BTC wrapped versions exchange. Bitcoin has been holding the title of the first cryptocurrency on the market for a very long time. Large institutional players consider it to be one of the most reliable crypto assets, which is why it is Bitcoin that makes up the vastest part of their portfolio. A creation of wrapped versions of bitcoin in different networks facilitates a significant inflow of capital into DeFi projects. With the help of cross-chain DEX, users will be able to directly exchange wrapped versions of bitcoin from different blockchains among themselves, without the need to manually build complex trajectories among networks.

ETH wrapped versions exchange. As Bitcoin, ETH is the asset that is in demand by market participants in all networks without exception. Cross-chain DEX will allow the transfer of wrapped versions of ETH from and among different blockchains, which will significantly increase the liquidity of user assets.

An important detail of the cross-chain DEX architecture is the usage of the GSN nodes system to implement transactions. This means that the user does not need to have native tokens of Blockchain A, Blockchain B, nor hub-chain tokens in order to move assets among networks. Payment for gas in all networks is made directly from the body of the transaction, which significantly improves UX and removes the user's concern about maintaining balances of native tokens in all networks. 

According to the plan, at the first stage of the project launch the pools for the exchange of stablecoins will be deployed in the hub-chain, and the pools for ETH and BTC will be deployed in the third quarter of 2022.

Bridge for tokens

On each of the supported blockchains, EYWA deploys the smart contract infrastructure that allows projects to move their tokens among these blockchains. This process looks as the following:

Project tokens are locked in the Portal smart contract that is deployed by EYWA in Blockchain A.

Synthesis B smart contract, which is also deployed by EYWA, mints synthetic tokens in Blockchain B.

Synthesis B smart contract transfers synthetic tokens to the BridgedTokenFactory smart contract deployed by the project team, which moves the token from one network to another.

BridgedTokenFactory blocks synthetic tokens and issues native tokens for this blockchain.

It is important to note that before being added to the bridge, smart contracts of projects and their tokens undergo a detailed audit from our side regarding the presence of backdoors that can potentially lead to the loss of user funds. The audit takes into account many characteristics of the project, and also the code of smart contracts gets examined for the presence of logic for moving and blocking tokens, which leaves the possibility of manipulating user assets for third parties. Only those projects whose code complies with all security rules are allowed into the bridge.

Staking and framing tokens protocols

The EYWA protocol also offers market participants wide opportunities for earning.

EYWA tokens staking. The node-relay network operates on the Roll-DPoS consensus. To participate in the consensus, a node must pledge at least 100,000 EYWA tokens as collateral into the smart contract. In case of proper operation, the node will be granted a reward in EYWA tokens. If the node does not do its work, it receives penalties, in other words, its deposit will be slashed.

In order to earn on staking, the user does not have to raise his / her  own node and fully pay the deposit. Instead, in the interface, he / she can specify the address of the validator node, which he / she trusts to work, and receive a stable income from delegated EYWA tokens. In the interface for token delegation, the user will be given a ranked list of node-relays based on historical data.

Cross-chain stablecoin farming. The user can provide liquidity to the stablecoin cross-chain exchange pool. As a consequence, he / she will receive the pool's LP token, which is called EUSD and is also the stablecoin.

The user can send the EUSD token to the farming smart contract and receive interest from transactions within the pool. To receive the reward in EYWA tokens, besides the interest for operations, the user must have EYWA tokens locked in staking (see the previous paragraph). The amount of the reward and the feasible allocation of EUSD into the farming pool depends on the number of locked EYWA tokens.

EYWA liquidity farming. The user can provide liquidity to the EYWA-EUSD pool located in the hub-chain and earn from it. For the increase of APY, the user must have EYWA tokens locked in staking. The increase of APY depends on the number of locked tokens.

Cross-chain DAO

Cross-chain voting is the very example when the decentralized application needs a single source of state. The presence of the EYWA transport protocol opens up the following possibilities:

Carry out voting in different blockchains and after that aggregate the voting results in one blockchain with a high degree of trust.

The feasibility  to significantly reduce the cost of participation in on-chain voting for all DAO participants.

The possibility  to update the parameters of smart contracts in all blockchains based on the results of on-chain voting from the DAO.

The EYWA Protocol project is currently in active alpha testing. Due to the increasing hacking of protocols that ensure the transfer of assets from one blockchain to another, we are making all efforts to enter the public network with reliable and secure smart contracts. To implement this, EYWA protocol works with several audit companies that independently from one another examine our code in terms of the presence of vulnerabilities.

In spring of 2022, the operation of the node-relay network will be tested in public test networks. Anyone who wishes to participate in the testing procedure can find the detailed information in our Discord in the Nodes section. Testing participants will receive special conditions in terms of the EYWA token presale.