Original title: Introducing Steel

Compiled by: Chris, Techub News

Steel, connecting RISC Zero and Ethereum

The success of the Ethereum network has driven the booming DApp ecosystem, but with it comes increasingly severe scalability challenges. Developers are faced with a dilemma: either limit the functionality and data richness of their applications, or endure high gas fees and usage restrictions. So, what if developers can find a way to bypass these restrictions?

RISC Zero is one of the zkVM developers. You may often hear about zkEVM, but you are not familiar with its derivative concept zkVM. RISC Zero recently launched a new technology called Steel, a view call proof library based on Alloy, which will completely change the way developers interact with Ethereum L1 or other EVM-compatible chains. By leveraging zero-knowledge proofs and RISC Zero's zkVM technology, Steel provides developers with a scalable, secure, and cost-effective way to perform view calls and verifiably read and compute Ethereum state.

The convenience of Solidity, with the power of ZK

Steel bridges the gap between Ethereum application development and zero-knowledge proof technology, greatly facilitating the process of developers applying zero-knowledge proof (ZK) technology in smart contracts. By integrating RISC Zero's zkVM functionality, Steel provides developers with tools to build more secure, scalable, and efficient applications on Ethereum L1 or any EVM-compatible chain.

Using Steel, developers can achieve significant improvements in:

  1. Direct execution of complex on-chain logic: Directly execute Solidity smart contracts on zkVM to support more complex on-chain logic.

  1. Access historical states: Access historical Ethereum states in zkVM to provide a wider range of resources for data analysis and verification.

  1. Break through computational limitations: Use continuations for computation without being limited by block size or transaction data size.

  1. Ensure the security of off-chain computing: Ensure that the security of off-chain computing is as reliable as on-chain execution.

  1. Proven zkVM: Leverage the first zkVM that has been rigorously tested by multiple partners and is used in production environments.

  1. Private Computing: Perform private computation on Ethereum state to enhance data protection.

  1. Open source flexibility: Implemented through an open source code base, ensuring flexibility and freedom from vendor lock-in.

The introduction of Steel provides developers with a powerful tool to integrate advanced zero-knowledge proof technology into existing blockchain technology, promoting further innovation in blockchain application development.

Seamless integration and cost savings

With Steel, executing a view call is as simple as specifying the desired Solidity method. Whether it is retrieving ERC-20 token balances (example) or accessing aspects such as Ethereum state, Steel simplifies the process by seamlessly integrating with RISC Zero zkVM while ensuring security and efficiency. Testing has shown that Steel is capable of handling over 100K SLOAD operations in a single view call, which saves thousands of dollars in gas fees on the mainnet. We can prove it in about 15 minutes using Bonsai, which requires at least 210M of gas, 7 times more than the block limit.

Example: ERC20 balanceOf

The following code snippet demonstrates the process of using Steel to prove the balance of a specific address of an ERC-20 contract deployed on Ethereum. This example shows how developers can use Steel to interact with Ethereum on-chain data within the zkVM. The full code can be viewed here.

Define the view function signature

First, use the sol! macro to define the ERC-20 balanceOf function signature. This will parse the Solidity syntax to generate a corresponding Rust structure that implements the SolCall trait and can be used to call the balanceOf method, which accepts an account address and returns the associated ERC-20 token balance.

Prepare to call

Next, we set up the call by instantiating the balanceOfCall structure with the target account address. We also define constants for the contract address we wish to query and the address of the caller.

Execute the call in Main

The main function is executed in zkVM and generates a zero-knowledge proof. It first reads the input environment, then constructs a ViewCallEnv object, ensuring that the current state matches the expected state root. After submitting the relevant block hash and number, the view call is executed and the balance is printed.

principle

Steel simplifies the process of executing Solidity code in RISC Zero zkVM, implementing proofs of code in three clear steps:

  1. Pre-flight phase: This phase is initiated by initiating a view call to the Ethereum RPC node, which caches the required storage slots and populates the EVM database based on the query requirements. All storage slots are automatically discovered and obtained through the execution process of the view call.

  1. Storage Verification: This step involves checking the integrity of the storage, ensuring that the data in the EVM database is consistent with the state root of the blockchain, thereby verifying the legitimacy of the data.

  1. Solidity Execution: Executes the specified Solidity function on the EVM inside the RISC Zero zkVM, ensuring the code runs as expected.

Through these three steps, Steel provides an efficient and reliable method to prove and execute Solidity code in RISC Zero zkVM, greatly simplifying the entire process.

How is this different from Proof of Storage?

With traditional storage proofs, developers must manually select the storage slots used by their smart contracts and re-implement the smart contract logic. With Steel, all storage slots are automatically discovered and acquired based on the view call execution. This saves developers a lot of time and reduces the possibility of implementation errors, thereby reducing the chance of security vulnerabilities.

Get the verified block hash

When using the blockhash opcode for verification in an Ethereum smart contract, the commitment being verified must reference a block hash no older than 256 blocks. Given the average block time of 12 seconds, this sets a narrow time frame of about 50 minutes to complete proof generation and confirm that a transaction has been included in a block.

When you need to get a verified block hash on-chain that is older than 256 blocks, you can use one of the following strategies:

  • When the block hash that will be needed is known in advance (for example, when making a governance proposal), the block hash can be saved into the contract state.

  • Another approach is to use RISC Zero to prove a hash chain from the queried block to one of the most recent 256 blocks.

The future of on-chain applications

We envision a future where off-chain computation is seamlessly integrated with on-chain validation. Steel contributes significantly to this vision by enabling developers to reliably access and compute Ethereum’s full history within the zkVM, enabling the creation of the next generation of data-rich and more powerful on-chain applications.

Author: TechubNews; from the ChainDD content open platform "DeDeHao", this article only represents the author's point of view, not the official position of ChainDD. For all "DeDeHao" articles, the originality and authenticity of the content are guaranteed by the contributors. If the article is plagiarized, falsified, etc., the legal consequences will be borne by the contributors themselves. If there are any infringements, violations, or other inappropriate remarks on the DeDeHao platform, please supervise the readers. Once confirmed, the platform will be offline immediately. If you encounter any problems with the content of the article, please contact WeChat: chaindd123