Caduceus Metaverse Protocol and the evolution of Virtual Machines
Virtual Machines (VM) have proved integral to the continuous evolution of blockchain technology – from cryptocurrency transactions in the 1.0 era, to Ethereum and smart contracts in the 2.0 era, as well as the explosion of DApps in the 3.0 era.So, what are the functions implemented by VM in the blockchain field? As a DApp developer, what are the benefits of choosing a compatible EVM, and what problems will non-compatible EVMs encounter?
Indispensable ‘components’ for VM
In the world of blockchain, virtual machines are mainly responsible for running smart contracts and providing an operating environment for them. The execution code of smart contracts is distributed and stored on the computer of each node, which solves the problem of interactive instructions (decentralised execution). The blockchain virtual machine has eight major characteristics:
1) Security code runs a sandbox, if errors occur, all changes can be rolled back
2) Results are confirmed and there is no possibility of ambiguities. When this logic is executed on all nodes of the blockchain, the results therefore are consistent
3) High efficiency – uses compilers and interpreters to improve execution efficiency
4) Strong scalability – significantly lowers the technical application threshold
5) Specific technical features – the virtual machine can handle encryption operations, such as supporting elliptic curve algorithms, accessing transaction and chain status, obtaining blockhash, tx-related content etc
6) Simplicity – deployment and structure code is simple
7) Framework – designs a precise permission transfer model and grammar model
8) Saves space – the virtual machine components are compact and easy to integrate into blockchain services
Ethereum is the most mature developer platform and decentralised application in the blockchain space. The EVM corresponding to the Ethereum ecosystem has the most mature feature set and tool suite. Therefore, from a DApp development perspective, we have choosen to adopt the EVM strategy.
The Ethereum Virtual Machine
EVM is a lightweight virtual machine designed to run smart contracts on the Ethereum network. As a virtual machine, the function of EVM is slightly different from traditional operating systems (such as Windows).
Generally speaking, a VM is a high-level abstraction that simulates a physical machine based on the native operating system. They allow the same platform to run on many different hardware architectures and operating systems, which makes VM very suitable for distributed networks like Ethereum.
In addition to being a virtual machine, EVM is also a ‘stack machine’ and a ‘state machine’. The ‘state machine’ is one that can read inputs and transform them into a new state based on those inputs. The stack-based virtual machine is a virtual machine that organises the memory structure into a stack and accesses it as a stack.
At the macro level, EVM is composed of world state, machine state and virtual ROM. The world state is the storage of all accounts on the network. The machine state includes the program counter, available gas, stack, and memory. The virtual read-only memory (ROM) is an immutable ‘EVM bytecode’, which only EVM can understand. Throughout the entire blockchain ecosystem, EVM is at the contract level, with the advantages of high scalability, availability, and high performance, allowing smart contracts to run smoothly in it.
(Blockchain ecosystem diagram)
(EVM business flow chart)
It’s important to understand, the code running inside the EVM cannot have any connection with the outside. This has been designed for safety reasons, with the following restrictions:
- Each calculation step in the execution of the program must be paid in advance to prevent Denial-of-Service (DoS, Denial-of-Service) attacks
- Programs can only interact by transmitting a byte array of arbitrary length; they cannot access each other’s state
- The program execution is sandboxed; the EVM program can access and modify its own internal state, and can trigger the execution of other EVM programs, but cannot do anything else
- The program execution is completely deterministic, and for any consistent realisation, starting from the same state will inevitably lead to the same state transition
When building a new smart contract platform, compatibility with EVM can play a part in expanding the DApp ecosystem and interacting with other Ethereum projects. For example, it can meet the consistency requirements of multiple VMs faster, and make cross-VM calls. This leads to our next question.
What are the specific advantages of EVM?
The first is Turing Completeness. Turing completeness is a concept for a set of data manipulation rules. The data manipulation rules can be a programming language or a set of instructions implemented in a computer. When this set of rules can realise all the functions in the Turing machine model, it is said to have Turing completeness.
It is worth noting that the smart contract in Blockchain 2.0 – including the virtual machine it runs, and the writing language – is Turing complete. While in blockchain 1.0, Bitcoin’s ledger transactions – which are executed in scripts, and its scripting language, are not Turing complete.
From a functional point of view, EVM is relatively extensible, and it can solve all the problems you give it. And because of the non-tamperable nature of the blockchain, it is also reliable in terms of operating results. Everyone has to act according to the same logic or principle, and the results of the operation will also be sent to the blockchain for permanent storage.
The learning threshold of contract language is another factor. As a high-level language for smart contracts, Solidity runs on the Ethereum Virtual Machine (EVM). Its main structure is a contract, which is like a class in an object-oriented language.
The design purpose of Solidity is to provide a unified logic for the blockchain, so that the same code can run on each node of the blockchain, and with the help of consensus algorithms, the data of the blockchain can be changed in a unified way to achieve consistent results across the globe.
Arguably, Solidity is currently the best choice for developing new smart contract projects. It provides a powerful ecosystem of tools, documentation, and examples. Today, many smart contracts and decentralised applications use Solidity to build and deploy the Ethereum blockchain. As Solidity creates a new standard for smart contracts in Ethereum, the language will become more secure.
Moreover, it’s based on the Truffle and Remix development tools provided by the EVM ecosystem. It has built-in smart contract code writing and compilation functions:
- Scripted and visual deployment tools and release frameworks,
- Bytecode binary contract bytecode management
- Contract automatic testing and debugging functions, which can be deployed to any number of public or private networks.
At the same time, they have an interactive console that can directly communicate with the contract, cooperate with the construction process, support tight integration, and facilitate the rapid development, testing and deployment of developers.
Finally, the contract calls the SDK threshold. From the perspective of DApp developers, after the front-end page is developed, the contract needs to be called to implement the corresponding DApp functions. Convenience and speed is important here, so Caduceus has choosen to be compatible with the Ethereum RPC interface. Ethereum supports the interaction with blockchain nodes as follows:
Most users interact with the blockchain through remote procedure call protocol JSON RPC to transfer data, and implement functions. Developers directly use JSON RPC to call smart contracts that require complex coding. By integrating the web3j development library and other front-end components, this process can be simplified. DApp developers only need to introduce the ABI interface of the contract to quickly implement it.
Compatible EVM for developers
At present, the Ethereum network has gathered the best DApp ecosystem and the most active user base in the encryption field. In this case, drainage will be the most significant problem that many developers need to solve, and a compatible EVM is the best choice. The main advantages are as follows:
- Existing experienced users can be migrated
- Inherit the existing DApp; technology maturity is higher
- It is easier to achieve interoperability with the Ethereum ecosystem, which is the so-called ‘network effect’
- The threshold is low, and it can be used only by modifying the network parameters
The disadvantages of being incompatible with EVM are clear. For example, the development is likely to encounter the following problems:
- Need to use a new language/framework/development environment
- Barriers to entry for users: new wallets/interfaces/applications need to be used
- Building the user base from scratch
- Due to the island state, the network effect is reduced – cross-chain DeFi composability
It’s important to consider that platforms that are not compatible with EVM need to provide a model that is significantly different from the Ethereum model, and need to increase their user and developer base from scratch. These projects will have to demonstrate why their smart contract or execution environment is equal or better, and use incentive plans and funding to drive adoption.
In addition, if a set of DApps is deployed on all EVM chains, but in a non-EVM space (each chain), then the DApp of each platform needs to be maintained independently, which will further increase the technical cost and affect development efficiency.
From VM to EVM, the entire blockchain ecosystem is evolving. EVM is the world’s first blockchain specific virtual machine, and most DApps choose to support it. In order to allow these applications to be seamlessly migrated to our chain, and to consider the need for a unified Virtual Machine for future DApp cross-chains, Caduceus has chosen to be compatible with EVM and JSON RPC interfaces.
This will greatly reduce the learning threshold for developers and make full use of existing tools and development environments that developers are familiar with. EVM itself has some limitations. In the future, Caduceus plans to support other virtual machines such as WASM to make up for the shortcomings of EVM to a certain extent, and to provide developers with more choices and ultimately bring the best solutions within the blockchain space all to Caduceus.
For more information: caduceus.foundation/
Email: [email protected]
The above article is taken from the Metaverse public chain, Caduceus Metaverse Protocol official Medium.