Ethereum’s success has led to a thriving ecosystem of decentralized applications, but scalability challenges have become increasingly apparent. Developers are left with a difficult choice: limit the functionality and data richness of their applications or bear the burden of excessive gas fees or gas limits. What if there was a way for developers to bypass these limitations?
Steel, the Alloy-based view call proof library by RISC Zero, represents a huge shift in how developers interact with Ethereum L1 or EVM-based chains. By harnessing the power of zero-knowledge proofs and the RISC Zero zkVM, Steel enables developers to execute view calls and provably read and compute over Ethereum’s state in a scalable, secure, and economically efficient manner.
Steel bridges the gap between Ethereum’s app development and zero-knowledge technology, making it easier than ever for developers to harness the power of ZK in their smart contracts. Combined with the capabilities of the 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 gain the ability to:
With Steel, executing a view call is as simple as specifying the desired Solidity methods. Whether retrieving an ERC-20 token balance (example) or accessing any aspect of Ethereum’s state, Steel simplifies the process while ensuring security and efficiency through seamless integration with the RISC Zero zkVM. Our tests have shown Steel’s ability to handle over 100K SLOAD operations in a single view call, potentially saving thousands of dollars in gas fees on mainnet. We can prove this in about 15 minutes using Bonsai. This would take at least 210M gas, exceeding the block limit by 7x.
In the code snippets below, we demonstrate the process of proving the balance of a specific address for a deployed ERC-20 contract on Ethereum using Steel. This example showcases how developers can utilize Steel to interact with on-chain Ethereum data within the confines of a zkVM. You can find the full code here.
Defining the View Function Signature
Start by defining the ERC-20 balanceOf function signature using the sol! macro. This will parse Solidity syntax to generate a corresponding Rust struct, which implements the SolCall trait. This struct can be used to call the balanceOf method, which takes an account address and returns the associated ERC-20 token balance.
Preparing the Call
Next, set up the call by instantiating the balanceOfCall struct with the target account address. Also, define constants for the address of the contract you wish to query and the caller’s address.
Executing the Call in Main
The main function is executed in the zkVM, producing a zero-knowledge proof. It starts by reading the input environment, then constructs a ViewCallEnv object, ensuring the current state matches the expected state root. After committing to the relevant block hash and number, the view call is executed, and the balance is printed.
Steel simplifies the process of proving Solidity code execution in the RISC Zero zkVM in three simple steps:
With traditional storage proofs, developers must manually select which storage slots their smart contract uses, and re-implement smart contract logic. With steel, all storage slots are discovered and fetched automatically based on the view call execution. This saves developers a significant amount of time and decreases the room of implementation errors, reducing the chance of security vulnerabilities.
When using the blockhash opcode for validation in Ethereum smart contracts the commitment for validation must reference a blockhash no more than 256 blocks old. Given an average block time of 12 seconds, this sets a narrow time frame of approximately 50 minutes to complete the proof generation and confirm the inclusion of the validating transaction within a block.
When a verified block hash older than 256 blocks is needed on-chain, a number of strategies can be used:
We envision a future where there is a seamless integration of off-chain computation with on-chain validation. Steel is our contribution to making this vision a reality, by enabling developers to provably access and compute over the full history of Ethereum inside the zkVM to create the next wave of data-rich and more functional on-chain applications.
Steel is a key component of RISC Zero’s commitment to launching zkVM 1.0, a milestone towards cheap, secure on-chain proof verification and universal zero-knowledge proofs. Get started with Steel today by visiting our GitHub repo for documentation, code examples, and resources to help you integrate Steel into your project.
Ethereum’s success has led to a thriving ecosystem of decentralized applications, but scalability challenges have become increasingly apparent. Developers are left with a difficult choice: limit the functionality and data richness of their applications or bear the burden of excessive gas fees or gas limits. What if there was a way for developers to bypass these limitations?
Steel, the Alloy-based view call proof library by RISC Zero, represents a huge shift in how developers interact with Ethereum L1 or EVM-based chains. By harnessing the power of zero-knowledge proofs and the RISC Zero zkVM, Steel enables developers to execute view calls and provably read and compute over Ethereum’s state in a scalable, secure, and economically efficient manner.
Steel bridges the gap between Ethereum’s app development and zero-knowledge technology, making it easier than ever for developers to harness the power of ZK in their smart contracts. Combined with the capabilities of the 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 gain the ability to:
With Steel, executing a view call is as simple as specifying the desired Solidity methods. Whether retrieving an ERC-20 token balance (example) or accessing any aspect of Ethereum’s state, Steel simplifies the process while ensuring security and efficiency through seamless integration with the RISC Zero zkVM. Our tests have shown Steel’s ability to handle over 100K SLOAD operations in a single view call, potentially saving thousands of dollars in gas fees on mainnet. We can prove this in about 15 minutes using Bonsai. This would take at least 210M gas, exceeding the block limit by 7x.
In the code snippets below, we demonstrate the process of proving the balance of a specific address for a deployed ERC-20 contract on Ethereum using Steel. This example showcases how developers can utilize Steel to interact with on-chain Ethereum data within the confines of a zkVM. You can find the full code here.
Defining the View Function Signature
Start by defining the ERC-20 balanceOf function signature using the sol! macro. This will parse Solidity syntax to generate a corresponding Rust struct, which implements the SolCall trait. This struct can be used to call the balanceOf method, which takes an account address and returns the associated ERC-20 token balance.
Preparing the Call
Next, set up the call by instantiating the balanceOfCall struct with the target account address. Also, define constants for the address of the contract you wish to query and the caller’s address.
Executing the Call in Main
The main function is executed in the zkVM, producing a zero-knowledge proof. It starts by reading the input environment, then constructs a ViewCallEnv object, ensuring the current state matches the expected state root. After committing to the relevant block hash and number, the view call is executed, and the balance is printed.
Steel simplifies the process of proving Solidity code execution in the RISC Zero zkVM in three simple steps:
With traditional storage proofs, developers must manually select which storage slots their smart contract uses, and re-implement smart contract logic. With steel, all storage slots are discovered and fetched automatically based on the view call execution. This saves developers a significant amount of time and decreases the room of implementation errors, reducing the chance of security vulnerabilities.
When using the blockhash opcode for validation in Ethereum smart contracts the commitment for validation must reference a blockhash no more than 256 blocks old. Given an average block time of 12 seconds, this sets a narrow time frame of approximately 50 minutes to complete the proof generation and confirm the inclusion of the validating transaction within a block.
When a verified block hash older than 256 blocks is needed on-chain, a number of strategies can be used:
We envision a future where there is a seamless integration of off-chain computation with on-chain validation. Steel is our contribution to making this vision a reality, by enabling developers to provably access and compute over the full history of Ethereum inside the zkVM to create the next wave of data-rich and more functional on-chain applications.
Steel is a key component of RISC Zero’s commitment to launching zkVM 1.0, a milestone towards cheap, secure on-chain proof verification and universal zero-knowledge proofs. Get started with Steel today by visiting our GitHub repo for documentation, code examples, and resources to help you integrate Steel into your project.