Introduction to Scroll-prover
Scroll-prover is a comprehensive project designed to facilitate smart contract verification and efficiency improvement for blockchain developers. It aims to enhance the prover and verifier functionalities within the Ethereum ecosystem, focusing on zero-knowledge proofs, which are essential for maintaining privacy and security in decentralized applications.
Latest Release
The latest version of scroll-prover, v0.10.3, is currently in use on the Scroll Mainnet. This project is under continuous development, with the main
branch being the focal point for the latest features and enhancements.
Prerequisites
To utilize scroll-prover, developers need to install the Solidity compiler, solc
, version 0.8.19
. This can be achieved using svm-rs
, which facilitates the required setup via Cargo, a package manager for Rust:
cargo install svm-rs
svm install 0.8.19
In addition to the compiler, developers must download the setup parameters (SRS) for degrees 20
, 24
, and 26
. These parameters are critical for the configuration and performance of the system and can be downloaded as follows:
make download-setup -e degree=20
make download-setup -e degree=24
make download-setup -e degree=26
Alternatively, developers can specify a custom degree or target directory if needed.
Testing the System
Scroll-prover offers a multi-level circuit constraint system for testing:
make test-chunk-prove
andmake test-e2e-prove
are essential for understanding system functionality.make test-inner-prove
is geared towards testing the initial level of circuits.make test-batch-prove
evaluates the final stages in the testing process.
These commands help developers comprehend the system's working by examining the corresponding codebases.
Running Binaries
Developers can locally run scroll-prover binaries conveniently. The zkevm prover generates chunk proofs with the following command executed from the ./integration
directory:
cargo run --release --bin trace_prover -- --params=params --trace=tests/extra_traces/batch_34700/chunk_1236462/block_4176564.json
Verifier Contract Details
As part of the aggregation tests (make test-e2e-prove
), both the YUL and bytecode for the verifier contract are generated. These outputs are organized in a newly created folder within the integration
directory. This folder contains various files relevant to the verification process:
- Chunk Protocol: Details of the chunk communication are found in
chunk_chunk_0.protocol
. - Verification Keys (VKs): These are essential for verifying the smart contracts, listed as
vk_chunk_0.vkey
for individual chunks andvk_batch_agg.vkey
for batch processing. - Verifier Code: The YUL source (
evm_verifier.yul
) and bytecode (evm_verifier.bin
) are key components for deploying and verifying smart contracts on Ethereum.
The YUL source code generation is based on specific parameters, VK, and the proof's numerical instances. Developers can refer to specialized functions in the snark-verifier
codebase for details on generating and compiling the verifier components.
Licensing
Scroll-prover is available under two licenses:
- Apache License, Version 2.0
- MIT License
Both licenses are permissive, allowing for flexibility and broad usage across different projects.