A brief study of cross-chain: from principle to technology.
January 11th, 2022

1 Abstract

The cross-chain technology is essentially a technology that safely and reliably transfers the data D (or information I, or message M) on the A chain to the B chain and produces the desired effect on the B chain. Because the blockchain system is originally a special distributed ledger database system, the most common data transferred is the data of assets, such as token balances.

At present, the mainstream blockchain cross-chain technical solutions mainly include: notary mechanism, hash lock, side chain & relay chain, and distributed private key control according to their specific implementation methods.

At present, the most famous cross-chain projects are Cosmos and Polkadot, both of which use a multi-chain and multi-layer architecture based on the relay chain. It can be seen that side chain & relay chain technology will be the main force of future cross-chain technology.

This article first briefly introduces the technical principles of cross-chain. It will briefly introduce the notary mechanism, hash lock, and detail the side chain & relay chain technology. Then this article will introduce several related cross-chain projects, including ETH-based Plasma, Polkadot-based Darwin network, and Cosmos-based IRIS.

2 Notary mechanism and hash lock[1]

Cross-chain interaction can be divided into homogeneous chain cross-chain and heterogeneous chain cross-chain according to the underlying technology platform of the blockchain. The security mechanism, consensus algorithm, network topology, and block generation verification logic between isomorphic chains are consistent, and the cross-chain interaction between them is relatively simple. The cross-chain interaction of heterogeneous chains is relatively complex. For example, Bitcoin uses the PoW algorithm and Fabric uses the traditional deterministic consensus algorithm. The composition of the blocks and the deterministic guarantee mechanism are very different, and the direct cross-chain interaction mechanism is not easy to design. Cross-chain interactions between heterogeneous chains generally require third-party auxiliary services to assist cross-chain interactions.

In order to achieve security and credibility across chains, there must be some requirements for cross-chain mechanisms and steps, the most important of which is the atomicity of cross-chain transactions. For ordinary on-chain transactions, the transaction needs to support atomicity - if the transaction fails, it needs to be rolled back. The same is true for cross-chain transactions. When it fails, the transactions involving two or more chains of this transaction must be rolled back.

2.1 Notary schemes

The notary is also called the witness mechanism, which is an intermediary method. Assuming that blockchains A and B themselves cannot be directly interoperable, they can introduce a mutually trusted third party as an intermediary, and this mutually trusted intermediary can verify and forward cross-chain messages. Many times, this notary/intermediary is the exchange. The advantage is that it supports heterogeneous blockchain cross-chain, and the disadvantage is that there is a risk of centralization, and only exchanges can be realized, but transfers cannot be realized.

Cross-chain transaction example: Suppose Alice wants to exchange 1 BTC for 50 ETH with Bob

Alice deposits her 1 BTC to the exchange's Bitcoin address; Bob deposits her 50 ETH to the exchange's Ethereum address; Alice places an order on the exchange: 1 BTC for 50 ETH; Bob completes it through the exchange Transaction with Alice, Alice gets 50 ETH, Bob gets 1 BTC



There will be many forms here. One is that Bob puts out an order to buy bitcoin, and the exchange matches it. One is that Bob directly sees Alice placing a sell order, and then directly asks for the sell order.
  1. Alice withdraws 50 ETH from the transaction to her Ethereum account; Bob withdraws 1 BTC from the transaction to her Bitcoin account;

The exchange of BTC and ETH of Alice and Bob is completed by introducing an intermediary. From this example, it can be seen that the exchange method can only support the exchange of assets at present, and the atomicity and security of the asset exchange are completely guaranteed by the centralized exchange, so there is a certain centralization risk.

2.2 Hash-locking

A typical implementation of hash lock is the hash time lock contract HTLC (Hashed TimeLock Contract). Hash timelock first appeared on Bitcoin's Lightning Network. Hash time lock cleverly adopts hash lock and time lock, forcing the receiver of the asset to determine the payment within the deadline and generate a proof of payment to the payer, otherwise the asset will be returned to the payer. Proof of receipt can be used by the payer to acquire an amount of assets of equal value on the recipient's blockchain or to trigger other events. Hash lock can only be exchanged but not the transfer of assets or information, so its usage scenarios are limited.

Cross-chain transaction example (take the transaction requirements in the previous section as an example):

Alice randomly constructs a string s and calculates its hash h; Alice sends h to Bob; Alice locks 1 BTC asset of her own through the contract, sets a longer lock time T1, and then sets the method to obtain the BTC. Condition: Bob provides the original value s of h; Bob locks 50 ETH to his contract and sets a relatively short lock time T2 (T2 < T1). Then set the acquisition conditions of 50ETH: Alice provides the original value s of h; Alice sends the string s to Bob's contract to get 50 ETH; Bob observes the value of Alice's s in step 5, and sends it to Alice's contract to obtain it successfully 1 BTC; At this point, the exchange of assets is completed. If it times out, the locked asset is returned to the original owner.

From the above process, it can be seen that the hash time lock contract has some constraints:

Both parties must be able to parse the internal data of the contract of both parties, such as s, such as the proof of locked assets, etc.; the timeout period of the hash lock needs to be set to ensure that there is a time difference, so that the other party can withdraw its assets in time when cheating unilaterally.

2.3 Distributed private key control

The domestic blog about distributed private key control is really suffocating, the technology of cure Multi-Part Computation and Threshold Key Sharing Scheme. In fact, distributed private key control has nothing to do with cross-chain, nor does it solve one of the two difficulties in cross-chain. It divides the private key of the relay chain account into redundant copies, and then distributes them to the validator, which can prevent a validator from unilaterally doing evil in the unlocking and locking stage of the cross-chain asset exchange, because there are only multiple validator sets. Only have the private key.

The domestic blog about distributed private key control is really suffocating. If you want to know more about distributed private key control, please see Wanchain's white paper.

Subscribe to 0x5D44…d7E2
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from 0x5D44…d7E2

Skeleton

Skeleton

Skeleton