Technology》What is RISC-V, which Vitalik advocates? Why does CKB-VM choose RISC-V?

This article is from an article written by CKB and reprinted by wublockchain. (Synopsis: Dismantling Vitalik's strategic ambition to reconstruct Ethereum's executive layer with "RISC-V instead of EVM") (Background added: It's time for EVM to quit!) Vitalik proposes to switch to RISC-V, ZK proof performance can be improved by more than 100 times) The emergence of blockchain has made smart contracts better implemented and developed, and there is an important role between blockchain and smart contracts: virtual machines. The concept of virtual machines was proposed in the sixties of the last century, and it only became popular in the nineties. The web at that time spanned many different operating systems and browsers, and if developers wanted to make an application, they needed to adapt to all the different operating systems. As you know, app development is now divided into Android and Apple systems, and the situation was more complicated at that time. It just so happened that the Java programming language became popular, and the virtual machine built by Java can make the program only need to be written once, relying on the Java virtual machine can be executed on multiple platforms, so the slogan proposed at that time was: compile in one place, execute everywhere. We know that Bitcoin does not have a virtual machine, because Bitcoin is to transfer a number (that is, "Bitcoin") from address A to address B, and Ethereum asks, why can't the execution on the blockchain be a set of code that can implement more complex and diverse things? This is what we call a smart contract platform, where all nodes execute the same contract code and get exactly the same result. On the blockchain, the virtual machine is the execution environment of the smart contract, which is a complete computer system that can be completely isolated from the outside world. The blockchain invokes and executes smart contracts through virtual machines and requires all nodes to agree. While the nodes use different systems, some machines are 64-bit, some are 32-bit, the traditional Java virtual machine tolerates a small amount of difference in calculation results, but on the blockchain all results must be the same, so a new, blockchain-friendly virtual machine is essential. The ideal blockchain virtual machine The virtual machine design of each blockchain project will have its own artistic pursuit, and make trade-offs at different levels while pursuing many features. After doing a lot of research, we believe that the ideal blockchain virtual machine should look like this: The execution is deterministic enough, when calling the same smart contract input, the same output result should be returned, and the output result does not depend on external conditions such as time and execution environment; There is sufficient security when executing, and the execution of the virtual machine does not negatively affect the platform itself; Flexible enough for updates, so that the blockchain can be upgraded or added to cryptographic algorithms without going through a hard fork (think back to the pain of upgrading with an Ethereum hard fork); The information is transparent enough to allow the smart contract executed on the virtual machine to realize the full potential of the virtual machine; The fee mechanism is reasonable enough to ensure that the calculation of resource consumption during virtual machine execution is more reasonable and accurate. It can support compilation in different languages, giving developers the freedom to develop and use the latest technology. Before designing the Nervos CKB virtual machine, we found that many blockchain projects did not use the real CPU instruction set to construct their own virtual machines, they chose WASM to build their own virtual machines. We prefer to use the real CPU instruction set to construct our own virtual machines, because at the bottom of any sophisticated virtual machine, operations need to be turned into raw assembly instructions to perform operations on the CPU. In addition, using the real CPU instruction set does not introduce some semantic constraints at the design level and constrain the flexibility of the virtual machine. To make an inappropriate analogy, operating the CPU requires a language system, and using the real CPU instruction set is like being able to "speak" directly to the CPU with this language system, which is very convenient. Otherwise, it is like speaking Chinese first and then converting to English, no matter how perfect the level of translation, there will be certain deviations and constraints. Through the real CPU instruction set, the virtual machine can add any type of data structure or algorithm as needed, which can maximize the developer's ability to write any contract that meets the requirements. So we decided to venture out and build our own virtual machine, CKB-VM, using a real CPU instruction set. In the choice of CPU instruction set, we chose the streamlined open source instruction set RISC-V. RISC-V can meet the implementation requirements from low-power small microprocessors to high-performance data center (DC) processors, and is characterized by transparency, simplicity, modularity, breadth of support, and maturity. These features are perfectly matched to the design requirements of CKB-VM. So what is RISC-V? RISC-V RISC-V is a clear, minimalistic, open source CPU instruction set architecture born at the University of California, Berkeley. In 2010, due to the limitations of other commercial closed-source instruction sets, a research team at the university started a new project and designed a new open source instruction set from scratch. With a large number of registers and transparent instruction execution speeds, this new instruction set helps compilers and combinatorial language programmers convert practical important problems into appropriate, efficient code and contains less than 50 instructions. This instruction set is RISC-V. When architects designed RISC-V, they wanted RISC-V to work effectively on all computing devices. Since its invention in 2010, RISC-V's clean design has won broad support from industry and academia, and has been loved by the community. RISC-V Foundation The development of the RISC-V instruction set is primarily driven by the RISC-V Foundation and the community. Founded in 2015, the RISC-V Foundation is a nonprofit organization and the first open, collaborative community of hardware and software innovators. The RISC-V Foundation currently has more than 235 members, including Google, Qualcomm, Apple, IBM, Tesla, Huawei and other companies. Members can participate in the development and use of RISC-V instruction set specifications and participate in the development of related hardware and software ecosystems. Due to its streamlined, open-source design, RISC-V has become popular at academic institutions such as the University of California, Berkeley, the Massachusetts Institute of Technology, Princeton University, and the Institute of Computing at the Chinese Academy of Sciences. In addition, some government agencies, such as the Indian government and the Shanghai Municipal Economic Information Commission, also strongly support the development of RISC-V-based projects. The existing instruction set RISC-V is a very young instruction set, so what are the main instruction sets before that? In the PC era, x86 is the unshakable overlord, x86 is CISC (Complex Instruction Set Computer, complex instruction set ), and RISC (Reduced Instruction Set Computer. Unlike ) reduced instruction sets, CISC instruction sets continue to grow as they evolve. As a result, costs continue to rise, and performance and power consumption suffer. Moreover, CISC instruction set length, execution time...

View Original
The content is for reference only, not a solicitation or offer. No investment, tax, or legal advice provided. See Disclaimer for more risks disclosure.
  • Reward
  • 1
  • Share
Comment
0/400
AtTheBeginningOfOne_vip
· 04-23 13:21
Stop sending these useless things.
View OriginalReply0