SUAVE is a decentralized project developed by Flashbots. It has established a network with a TEE environment to solve problems such as key custody and mutual trust between multiple parties encountered in the MEV process. At the same time, the addition of TEE in the SUAVE project gives SUAVE more possibilities besides solving the MEV problem.
SUAVE related code base
The SUAVE project is based on Ethereum extension, so it is inherently compatible with EVM. Its current related projects on GitHub include: SUAVE-geth, SUAVE-std, SUAVE-examples, etc.
Among them, SUAVE-geth is the execution layer code extended on the basis of geth. It mainly adds an encrypted computing environment on the basis of geth, as well as some precompiles in the encrypted computing environment. It is particularly worth mentioning that the precompile of standard HTTPS requests has been added, which allows developers to use the TEE environment to provide users with the function of accessing other networks. In addition, it contains a series of precompiles based on TEE usage functions, such as obtaining encryption parameters, storing encryption information, and obtaining encryption information, which constitute the development infrastructure based on a trusted environment.
SUAVE-std is a project established for the convenience of developers and can be understood as a development tool library. For example, it wraps how to use HTTP requests, and even wraps a code library using ChatGPT on this basis, so that developers do not need to assemble ChatGPT request messages and parse ChatGPT return messages by themselves, but only need to replace their own API key when assembling HTTP request messages. The TEE security environment ensures the security of the API key because all this is done in the TEE environment. Initially, the standard library of ChatGPT used the GPT-3.5-turbo model by default, and the temperature defaulted to 0.7. Now a flexible interface has been added, and the model can also be passed in as parameters.
The SUAVE-examples project is mainly to show some cases of how to develop applications, or it is more appropriate to say that it is a beginner's tutorial. For developers who are new to SUAVE application development, they can learn and compare through the cases in this project.
SUAVE development practice
Since SUAVE is based on Ethereum extensions (its executable environment is called MEVM, i.e. Modified Ethereum Virtual Machine), the development of smart contracts is EVM-compatible, and the official development documents are all introduced in Solidity. Therefore, for developers, Solidity development experience is fully useful. In SUAVE application development, the development of smart contracts can be understood as Solidity development with encrypted computing functions in the TEE environment.
There are several key SUAVE MEVM precompiles. The first one is confidentialInputs. This precompile accepts the encrypted parameters from the application request. This parameter is usually some private information that needs to be encrypted, such as private keys, API keys, etc. Its security must require that its plain text can only appear in the TEE environment. In application development, this information is obtained through this interface. The transmission process is fully encrypted and safe and reliable. We will talk about its principle later. The second one is confidentialStore, which is used to store private information. When we get private information from the parameters, it is often not needed to participate in the calculation at that time, so it is stored for subsequent use. The third one is confidentialRetrieve. This interface is used to request data plain text from the TEE context environment when private information is needed for calculation in the future.
SUAVE's secure storage of private information allows developers to achieve the following scenario: "The user uploads the private key, and then the third party performs business calculations. When the conditions are met, the third party can directly use the user's private key to sign. In this way, the third party can use the user's private key to sign under certain rules, but the third party will never be able to obtain the private key plaintext."
SUAVE uses HTTPS requests for cross-chain operations. There is a library called gateway in its tool set that directly reads cross-chain information. Its essence is that the user sets the RPC node of a certain chain. More commonly, users upload API key information such as Infura and Etherscan, and then directly use HTTP requests to the corresponding node when they need to call. When cross-chain writing is required, there is a transaction package in the tool set that can help developers encode messages such as EIP1559, and finally broadcast transactions through the eth_sendRawTransaction interface.
Another usage scenario worth mentioning is to upload and store the compiled bytecode of Solidity as a private parameter, and then deploy and call it when the conditions are met, thus forming a private library. This usage scenario can be expanded to: private key + private bytecode library. In this way, when a third-party delegated call is made, a completely private transaction can be achieved.
SUAVE Features
The final state of SUAVE is a chain, which we call the SUAVE chain. We can regard the SUAVE chain as a chain that implements MEVM. Since it is an EVM-compatible blockchain, we can also build assets such as ERC20, ERC721 on SUAVE, and its on-chain operations are no different from those of the EVM series of chains. But its uniqueness lies in the addition of off-chain operations, such as sending transactions to nodes of other chains. The results of off-chain operations or usage conditions can be stored on the SUAVE chain, and the stored results are guaranteed by consensus. In this way, the consistency of off-chain calculations and on-chain states can be achieved. For example, developers can write a smart contract to record some conditions on the chain (which can also be modified). When accessing a certain chain network node, if the returned result meets the requirements, a pre-set ERC20 asset transfer is performed.
The above are all features brought by SUAVE's off-chain trusted computing. We know that SUAVE was developed by the Flashbots team, and SUAVE is regarded by the Flashbots team as "The Future of MEV", so bundle transaction processing must be available. Based on the SUAVE chain in a trusted environment, the MEV-related principles are very simple: assemble bundle transactions and send them to the Flashbots relay node. Private keys can be stored privately, and even codes can be stored privately, which constitutes a huge potential for use. For example, in addition to the gas reward on the target chain, the builder can also obtain certain digital assets on the SUAVE chain. For the MEV market, it is possible to flexibly define business while ensuring the security of private information, which is something that MEV cannot do at present (currently it can only provide traditional off-chain guarantees based on trust, contract, goodwill, etc.).
SUAVE development tools and infrastructure
For developers, in addition to the development of smart contracts on the chain, tools such as ether.js in front-end development are also an important part of a dapp development. In the development of SUAVE applications, because the SUAVE chain is based on EVM transformation, tools such as ether.js and web3.js can also be used. These tools are no different in interacting with smart contracts on the SUAVE chain and other EVM-compatible chains, but can only call functions in non-confidential environments. A SUAVE chain smart contract is divided into on-chain (referring to the SUAVE chain) and off-chain (cross-chain operations are also included in this category) operations. Off-chain operations actually refer to confidential environment computing. For confidential environment computing, the Flashbots team provides SDKs in two languages (Go and TypeScript), and the usage is introduced in the SUAVE documentation. When sending a privacy computing transaction (the Flashbots team calls it Confidential Compute Request) to the SUAVE node, confidentialinputs can be brought in, which is a private parameter. During the entire transmission process, this parameter will only appear in the TEE environment in plain text.
Finally, when it comes to the deployment of smart contracts, the test network of the SUAVE chain is called Regil, but it has now been upgraded to Toliman. The deployment method is detailed in the SUAVE documentation. Its deployment method, post-deployment interaction method, etc. are no different from the deployment of Ethereum smart contracts.
Kettle
After the smart contract is deployed, its actual operation mode is different from that of Ethereum. The most important execution unit of SUAVE is called Kettle. Kettle is the TEE operating environment of SUAVE (it includes a MEVM node and a confidential data store). When the developer writes and deploys the smart contract, the user sends a confidential compute request (hereinafter referred to as CCR). When the smart contract needs to use confidential compute, it is actually run by Kettle.
Kettle's structure diagram is as follows:
Preview
Gain a broader understanding of the crypto industry through informative reports, and engage in in-depth discussions with other like-minded authors and readers. You are welcome to join us in our growing Coinlive community:https://t.me/CoinliveSG