Integration through VM inter-modulation protocols
- There are a number of projects on Ethereum that are developed in solidaty and run on EVM. To take advantage of these old resources, an EVM implementation has been integrated in the Polkadot project system. However, the problem now is that WASM contracts and EVM contracts cannot call each other, which limits the integration between WASM contract resources and EVM contract resources.
- With the development of technology, Polkadot is likely to support more new smart contract VMs in the future, and there is also the problem of resource integration with the original VM contracts.
- Therefore, there is a need to develop a system (Generic VM Bridge - GVM Bridge) and a standard (VM General ABI - VM GABI) to achieve resource integration through VM inter-modulation protocols, so that the resources of various different VMs can be used with each other immediately without migration, thus improving the utilization of resources.
Through the GVM Bridge system and the VM interconnection protocol, smart contracts between VMs can be invoked to achieve resource consolidation, and resources from different VMs can be used immediately without migration, thus improving resource utilization.
GVM Bridge will provide the GVM Bridge Framework component and the ABI conversion tools Trans4WABI and Trans4EABI for converting WASM ABI to VM GABI and EVM ABI to VM GABI, respectively. The WASM-Proxy pallet and the EVM-Proxy pallet specifically implement the WASM VM and EVM calls.
The functions of these components are:
- Build inter-call framework for different VM contract to provide the interface for virtual machine proxy access.
- Implement VM proxy registration.
- Provide encapsulation of public standard components AccountId, Block, etc.
- Provide ABI conversion access interface.
- Provide access to contract invocation interface.
- Implement the GVM Bridge Framework interface.
- Implement the inter-conversion of VM GABI parameters and WASM ABI parameters.
- Implement the inter-conversion between public standard components and WASM components.
- Implement the host function for contract inter-call.
- Implement the GVM Bridge Framework interface.
- Implement the inter-conversion of VM GABI parameters and EVM ABI parameters.
- Implement the inter-conversion between public standard components and EVM components.
- Implement the pre-compiled contract for contract inter-calls.
- Implement WASM ABI to VM GABI conversion.
- Implement VM GABI to WASM ABI conversion.
- Implement EVM ABI to VM GABI conversion.
- Implement VM GABI to EVM ABI conversion.
early development will only provide the GVM Bridge pallet, it include functions of GVM Bridge Framework, WASM-Proxy pallet and EVM-Proxy pallet.
- Build inter-call framework for different VM contract to provide the interface for virtual machine.
- Provide access to contract invocation interface.
- Implement the inter-conversion of VM GABI parameters and WASM ABI parameters.
- Implement the inter-conversion of VM GABI parameters and EVM ABI parameters.
- Implement the pre-compiled VM call function for contract inter-calls.
- Provide EvmChainExtention trait.
Follow the steps below to get started with GVM Bridge.
To start working with GVM Bridge you'll need to install rustup, and install toolchain nightly-2021-03-01. If using x86_64 linux, you can do:
rustup install nightly-2021-03-01
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-01-x86_64-unknown-linux-gnu
Use git git clone
command to download GVM Bridge source code:
git clone https://github.com/CycanTech/GVM-Bridge.git
cd GVM-Bridge
Use Rust's native cargo build
command to build GVM Bridge:
cargo +nightly-2021-03-01 build --verbose
Use Rust's native cargo test
command to test GVM Bridge:
cargo +nightly-2021-03-01 test
The project are currently licensed under BSL
Test cases(tests.*
) and files under /external are licensed under Apache 2.0
In order to facilitate developers to develop contract inter-call function, we will provide sample codes for WASM contract and EVM contract inter-calling, such as inter-calling ERC20 contract etc.