Home > web3.0 > How does RISC Zero Steel accelerate Ethereum's ZK adoption?

How does RISC Zero Steel accelerate Ethereum's ZK adoption?

王林
Release: 2024-06-08 17:03:32
Original
925 people have browsed it

Compiled by Alex Liu, Foresight News

Ethereum has successfully brought a thriving decentralized application ecosystem, but its scalability challenges are becoming increasingly severe. Developers face a difficult choice: limit the functionality and data richness of their applications, or tolerate high gas fees and gas usage limits. What if developers had a way to bypass these restrictions?

Steel, connecting RISC Zero and Ethereum

RISC Zero is one of the major zkVM developers. If you often hear zkEVM in your ears, but don’t know the difference between it and What is zkVM? You can refer to this article. RISC Zero’s latest launch is Steel, a view call proof library based on Alloy that brings a sea change to the way developers interact with Ethereum L1 or other EVM chains. Leveraging zero-knowledge proofs and RISC Zero zkVM, Steel enables developers to perform view calls and provably read and compute Ethereum's state in a scalable, secure, and cost-effective manner.

The convenience of Solidity, the power of ZK

Steel bridges the gap between Ethereum application development and zero-knowledge technology, making it easier for developers to leverage the power of ZK in their smart contracts. Combined with the capabilities of RISC Zero zkVM, Steel enables developers to build more secure, scalable and efficient applications on Ethereum L1 or any EVM equivalent chain.

With Steel, developers can:

  • Execute Solidity smart contracts directly within zkVM, compatible with more complex on-chain logic
  • Access historical ether within zkVM Square status
  • Use continuations for calculations, not limited by block and transaction data size
  • Ensure that off-chain calculations are as safe and reliable as on-chain execution
  • Use more experience The first production-ready zkVM rigorously tested and used by partners
  • Seamless integration and cost savings
  • With Steel, performing a view call is as simple as specifying the required Solidity method. Whether it's retrieving ERC-20 token balances (example) or accessing everything from 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, saving thousands of dollars in gas costs on mainnet. We can prove it in about 15 minutes using Bonsai, which requires at least 210M Gas, which is 7x over the block limit.
Example: ERC20 balanceOf

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

Define the view function signature

First, use the sol! macro to define the balanceOf function signature of ERC-20. This will parse the Solidity syntax to generate a corresponding Rust struct 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.

Preparing to call

Next, set up the call by instantiating the balanceOfCall structure with the target account address. At the same time, define constants for the contract address you want to query and the caller's address. RISC Zero Steel 如何加速以太坊的 ZK 采用?

Execute the call in Main

The main function is executed in zkVM and generates zero-knowledge proof. It first reads the input environment and then constructs a ViewCallEnv object, ensuring that the current state matches the expected state root. After submitting the relevant block hash and number, perform a view call and print the balance. RISC Zero Steel 如何加速以太坊的 ZK 采用?

How it works

Steel proves Solidity code in RISC Zero zkVM in three steps, simplifying the execution process: RISC Zero Steel 如何加速以太坊的 ZK 采用?

Pre-flight phase: Start pre-flight by making a view call to the Ethereum RPC node, which caches the necessary storage slots and only fills the EVM database with the data required for the query. All storage slots are automatically discovered and retrieved based on view calls.

Storage verification: Perform a storage integrity check to ensure that the data in the EVM database is aligned with the state root of the blockchain to confirm its legitimacy.

    Solidity Execution: Runs the given Solidity function on the EVM within RISC Zero zkVM.
  1. How is this different from proof of storage?
  2. With traditional proof of storage, developers must manually select the storage slots used by their smart contracts and reimplement the smart contract logic. With Steel, all storage slots are automatically discovered and retrieved based on view calls. This saves developers a lot of time and reduces the chance of implementation errors, thereby reducing the chance of security vulnerabilities.
  3. Get the verified block hash

    When using the blockhash opcode for verification in an Ethereum smart contract, the verified commitment must reference a block hash no more than 256 blocks old. Considering the average block time is 12 seconds, this sets a narrow time frame of approximately 50 minutes for complete proof generation and confirmation that the validated transaction has been included in a block.

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

  • When known in advance When a block hash is needed (for example, when launching a governance proposal), this block hash can be saved into the contract state.
  • An alternative is to use RISC Zero to prove the chain of hashes from the queried block to one of the most recent 256 blocks.

The future of on-chain applications

Envision a future where off-chain computation will be seamlessly integrated with on-chain verification. Steel contributes to this vision by enabling developers to reliably access and compute the complete history of Ethereum within zkVM, allowing them to create the next generation of data-rich and more powerful on-chain applications.

The above is the detailed content of How does RISC Zero Steel accelerate Ethereum's ZK adoption?. For more information, please follow other related articles on the PHP Chinese website!

source:panewslab.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template