DFINITY < > Ethereum: how to achieve interoperability of smart contracts?

blockpunk
ICP League
Published in
7 min readJun 1, 2021

In a previous ICP League article, I mentioned DFINITY core cryptography technology — ChainKey, and in describing its features, I predicted that DFINITY would be able to call other blockchains like Ethereum via ChainKey signatures.

And in a recent tweet and article by Dominic, the founder of DFINITY, detailing the design of interoperable contracts without intermediaries from DFINITY to Ethereum, it shows us the huge potential of integrating the two.

Summaries

  1. The ChainKey technology allows DFINITY blockchain to have a single public key with a size of 48KB.
  2. DFINITY smart contract can sign and issue Bitcoin and Ethereum type transactions based on ECDSA.
  3. The 48KB single public key stored in the Ethereum smart contract can verify messages sent by the chain to guarantee the validity of transactions and status.
  4. Implementing an Ethereum light node in a DFINITY smart contract (4GB of running memory) that verifies blocks to obtain call return values.
  5. No need for middleware, cross-chain bridges, hubs, prophecy machines, DFINITY interoperates directly with Ethereumnet contracts via a point-to-point approach.
  6. The ability to use DFINITY to scale applications such as DeFi for Ethereum, for example by having DFINITY run instructions for data manipulation for a particular Ethereum game, which is then settled directly via Ethereum.
  7. The seamless integration of the two will hit a huge business potential, with DFINITY being able to scale unlimited capacity for Ethereum and decentralise the full stack of middleware, front-end resources, business logic, etc.

ChainKey

ChainKey is the technology at the core of Internet Computing and is the principle that enables the interoperable magic of the above contracts.

In Ethereum, as blocks are competed using the PoW mechanism, nodes sign the blockchain with their private key and broadcast it, and when you go to verify the block, you need to get the node’s public key. Because the nodes may be different each time a block is issued, you need to keep a lot of signature information and synchronise the blocks. So a user wanting to verify an Ethereum transaction would need to synchronise 400GB of blocks. The average user only has access to this through the full node of Infura, the middleware running on AWS.

In DFINITY, based on VRF +BLS+ non-interactive DKG, the blockchain is guaranteed to have only a single immutable public key, and all block signatures can be verified using this 48KB single public key to guarantee the trustworthiness of the interaction and the blocks.

The DFINITY chain has a single public key, but not a corresponding single private key. The nodes that make up the chain keep shares of the private key, which they use to sign blocks, and only after collecting enough shares of the private key can they aggregate a complete signature that can be verified by the single public key. This is how DFINITY achieves consistent consensus.

Non-interactive Distributed Key Distribution (DKG) distributes private key shares to nodes, and because of its non-interactive nature, the distribution of private key shares is basically very low bandwidth intensive, and nodes can join and leave the network at will, which ensures overall decentralisation.

So any device, even a smart contract on another blockchain, can verify the messages, events and state of the DFINITY chain itself, as long as it has this public key stored.

The ChainKey technology is the basis for the interoperability of contracts.

Calling Ethereum contracts using DFINITY

ChainKey supports ECDSA, the cryptographic primitive used by both Bitcoin and Ethereum, so it is possible to sign smart contracts on DFINITY via ChainKey proxy without the need to generate a corresponding private key (using the BLS valued signature technique). After signing with a ChainKey single to a chain, a transaction is sent via P2P that satisfies both Bitcoin and Ethereum formats. The final call is made to the Ethereum smart contract.

Also DFINITY smart contracts use the actor’s asynchronous message processing model, so it is possible to set a wait for the return of an Ethereum call.

(0) Deploy a proxy-signed contract on DFINITY, running ChainKey mock-signed code.

(1) Contracts on DFINITY invoke proxy-signed contracts.

(2) Contracts on DFINITY need to call Ethereum to send the contract address, invocation method, and parameters to the signing contract.

(3) The transaction is signed using the chain’s single public key to produce an Ethereum-formatted transaction, which is broadcast on the Ethereum network via P2P and awaits confirmation of the transaction.

(4) There are two options for getting the return of the Ethereum invocation: a) early on, a query contract can be deployed on Ethereum specifically for returning the result of the Ethereum invocation to DFINITY, but this is still costly. b) later on, a light node synchronising the Ethereum state can be created directly in the container of DFINITY to directly verify and return the result.

However, there is still some problems in getting the return of the Ethereum call. Deploying a query contract on Ethereum is costly because each return requires sending an additional contract call; and creating a light validation node on DFINITY may be constrained by the 4GB limit on the current container running memory, and the Ethereum state may have to be stored separately in many containers. So we may need developers to implement more efficient and innovative solutions.

What does direct interoperability entail?

DFINITY underlying cryptographic innovations do bring some breakthroughs in the experience, allowing users to enjoy end-to-end blockchain-level security without the need for middleware. This also has the opportunity to help Ethereum achieve directly interoperable scaling.

As this interoperability between cross-chain contracts becomes widespread, middleware such as chainlink, TheGraph and Infura will either be replaced or deployed directly on DFINITY for unlimited scalability and decentralisation benefits. Writing database containers on DFINITY to replace middleware is a good direction and one of our key areas of focus. From this perspective, DFINITY looks like a middleware and front-end service with general-purpose computing power. Commercial attempts that combine the features of both will shine more brightly, such as a dedicated NFT platform that can quickly validate NFT video, images and other resources on Ethereum and extend with computing power.

At the same time DFINITY can also help Ethereum to scale, maintaining and processing large amounts of data on the chain quickly and cost-effectively. And this scaling capability is once and for all, because as an asynchronous message processing machine, DFINITY has the ability to scale with unlimited subnets. Whereas a 1GB smart contract on Ethereum costs tens of millions of dollars, on DFINITY it costs only $5 per year.

Because of the interoperability at the contract level, the high security of the DFINITY chain itself and the lack of dependency on cloud services such as AWS, cross-chain bridges running on just a few nodes, Layer 2 state chains, etc., the liquidity, centralisation and security issues of traditional Layer 2 scaling solutions are also avoided.

There are many possibilities to use DFINITY as a command layer for the operational settlement layer on Ethereum. At the same time, the DFINITY-based identity system and the reverse-gas model greatly reduce the threshold of use, so that users do not even need to pay for gas to use Ethereum contracts.

I can foresee a business: implements third-party front-ends on DFINITY in the aggregated form of Compound, AAVE, DYDX, and then dispenses with the gas used by users. The creator of the third-party front-end can pay for the gas on Ethereum and earn money at the same time by recommending strategies and receiving a certain percentage of revenue.

For example, the logic of a complete centralised transaction can be implemented in DFINITY, including the aggregation of order books and market making, with the DFINITY blockchain recording the flow of value and assets in an untamperable way, and finally settling on Ethereum, which ensures decentralised security, license-less and public ownership, as well as the experience of a centralised traditional exchange.

It is even possible to host ETH FlashBot arbitrage bot on DFINITY without having to deploy a centralised server and host your private key on the centralised server. Since containers do not share state, your strategy can be set to “Private” and you can also gain by sharing your strategy (DFINITY eco-project ENSO).

--

--

blockpunk
ICP League

Co-founder of ICP League & Ourea Group, obsessed with Social Tokens, DAO & NFT.