MOAC Technical Column ”Cross-chain Operation among All Blockchains”

David Chen
MOAC
Published in
5 min readJun 20, 2018

Currencies from two blockchains can be exchanged through one of two means. The first is to find a reliable buyer with the complimentary demand. The first user transfers Currency A to the second user, and the second user transfers the corresponding Currency B to the first user. This is an inefficient method, as it’s difficult to find someone reliable, and there is a high risk in execution. The second more widely used means is through a centralized exchange. Users deposit their currencies in the exchange, the balance of each user is recorded in the exchange system, and the transaction is made and the account balance recorded on the exchange platform until the corresponding currency is withdrawn by the user.

The defects in the centralized trading platform are readily apparent. When it lacks supervision, the centralized exchange is involved with insider dealing, counterfeit deals, misappropriating funds, and other questionable activites. And the centralized exchange can easily be controlled by sovereign institutions.

How does decentralization solve this problem? Several solutions can be attempted. The classic one was proposed by the Litecoin founder Charlie Lee, which is to utilize a cross chain between Bitcoin and Litecoin, actualized through the Lightning Network. In practice, it is actualized through Hashlock and Timelock in the Lightning Network. Refer to the following flowchart:

The most fundamental problem in cross-chain trading is solved. This is done through the two trades being unlocked at the same time through publicizing the variable X.

This solution, however, faces the following difficulties:

1.

Each chain for cross-chain transaction is required to support the Lightning Network, and Hashlock and Timelock functions must be integrated. If these functions are not available on the existing chain, a hard-fork is required. But this is not practical in most cases.

2.

The whole trading process is a manual interaction process. User B must wait for the release by User A before ensuring the information is properly transmitted to other party’s network. It would be difficult to automate the process, as extra infrastructure like Byzantine Fault Tolerance (BFT) hub support similar to Cosmos is required.

The problems mentioned above are solved perfectly by MOAC, using the system-specific timing trigger function and Microchain function.

The system timing trigger function and Microchain function are respectively described in the articles series MOAC Series — System Timed Activating and MOAC Series — Microchain in detail. In general, the system timing trigger function performs a trade at a designated future block. This is 100% guaranteed to happen. The Microchain function achieves customizable sub-blockchains capable of sharding on the lower-level POW foundation.

The specifics of MOAC’s cross-chain exchange are described below:

1.

While in the MOAC net, Party A sends (m) amount of MOAC from the address Am. Am -> Bm: m. In another Blockchain network (eg Ethereum) B sends (n) amount of ETH to the address Ae from address Be, denoted as (Am -> Bm: m ^ Be -> Ae: n).

2.

In the MOAC net, User A creates a Hashlock system timing triggered trade T: Am -> Bm: m on Block#k. User A also sends m MOAC to the system contract as a reserve fund. Then, Hash (T) is calculated.

3.

The system timing triggered trade will be executed after k block. If it is successful, m MOAC is obtained by Bm, otherwise it will be returned to Am. Its success depends on whether the Hashlock is unlocked: if there is a verifiable ETH trade Be -> Ae: n eth, and a Hash (T) mark.

4.

When User B sees the system timing triggered trade T, he/she knows k block will be 100% executed, so he/she can send the trade Be -> Ae : n eth, and put Hash (T) into the data segment without any worry.

5.

After the trade of User B in ETH is confirmed, the monitoring Microchain will use the trade information from ETH as the parameter calling system contract to unlock the Hashlock.

6.

Finally after k block, the system contract is automatically executed, and Am -> Bm: m is completed.

Here, the MOAC blockchain unlocks MOAC trade through the trade information confirmed in another blockchain to accomplish the fundamental operation.

The great advantage is that there is no new demand on the other blockchain, it only needs to exchange additional data information, and this function is integrated in every blockchain. Therefore, the cross-chain mechanism of MOAC can actualize cross-chain operations between all blockchains!

At present, the MOAC system accomplishes rapid message transmission with BFT through a Microchain.

MOAC consensus is divided into two parts, the POW consensus in the lower level is actualized through V-nodes. Each v-node is connected to one or more SCS nodes. SCS nodes actualize the sharding execution of contracts. A Microchain can be generated among SCS nodes supporting the same customized consensus protocol. To accomplish the information transmission between MOAC system and ETH blockchain, SCS nodes can be connected to a light node of ETH at the same time.

The SCS node can obtain the transaction information which needs to be monitored in ETH at any time. The corresponding operation (e.g. the calling request to unlock the system contract) is sent to the V-node level through the predefined consensus protocol among several SCS nodes, so as to actualize the BFT of cross-chain information.

All in all, MOAC provides a solution for cross-chain operation among all blockchains to achieve cross-chain information transmission and decentralized cross-chain trade. Furthermore, a decentralized exchange can be easily realized if based on this framework.

Where to Find Us

Website: https://moac.io/

GitHub: https://github.com/MOACChain/moac-core

Twitter: https://twitter.com/moac_io

Reddit: https://www.reddit.com/r/MOAC/

Medium: https://medium.com/moac

Steemit: https://steemit.com/@moac-official

Telegram(International): https://t.me/moacblockchain

Telegram(Developers): https://t.co/8m3m9RD5ix

Telegram(China): https://t.co/73rU9sHWLH

YouTube: https://www.youtube.com/channel/UCBU405W7vfOPBicLwW9-QOA

--

--