|
| 1 | +# Scroll Security Council Tools |
| 2 | + |
| 3 | +The repository offers tools for the Security Council to run and validate certain operations against Scroll's ZkVM [release](https://github.com/scroll-tech/zkvm-prover/releases/tag/v0.2.0) |
| 4 | + |
| 5 | +### Setup |
| 6 | + |
| 7 | +- Clone the `scroll-sc-tools` repository: |
| 8 | +```shell |
| 9 | +$ git clone [email protected]:scroll-tech/scroll-sc-tools.git && cd scroll-sc-tools |
| 10 | +``` |
| 11 | +- [Install Rust](https://www.rust-lang.org/tools/install) |
| 12 | +- Install Specific Nightly Toolchain (specified in [rust-toolchain.toml](./rust-toolchain.toml)) |
| 13 | +``` |
| 14 | +rustup toolchain install nightly-2025-02-14 |
| 15 | +``` |
| 16 | + |
| 17 | +### Generate Verifier |
| 18 | + |
| 19 | +Scroll's ZkVM architecture proves Scroll's L2 blocks in layers (chunking -> batching -> bundling) where only the final layer (aka bundle) is an EVM-verifiable SNARK proof. |
| 20 | + |
| 21 | +This proof is verified as part of the Bundle Finalization on-chain transaction. |
| 22 | + |
| 23 | +The proof itself is verified by a `Verifier` contract, that's essentially a PLONK-verifier constructed using OpenVM's SDK. The `Verifier` contract is deployed on Sepolia and Mainnet. |
| 24 | + |
| 25 | +The `generate-verifier` command allows one to trustlessly re-generate the verifier contract and prints out its codehash, that can be validated against on-chain available data. |
| 26 | + |
| 27 | +```shell |
| 28 | +$ cargo run -- generate-verifier |
| 29 | +``` |
| 30 | + |
| 31 | +### Compute Digests |
| 32 | + |
| 33 | +The final layer (aka bundle) circuit is identified by two digests, namely `digest_1` and `digest_2`. |
| 34 | + |
| 35 | +- `digest_1`: Attestation to the circuit code/logic. Any modification to the circuitry, to any layer including and below the final layer, will trigger a change to this digest value. |
| 36 | +- `digest_2`: Attestation to the circuit config. The `openvm.toml` files configure each circuit (chunk/batch/bundle) and finally this digest value will change if any of those was modified. |
| 37 | + |
| 38 | +An important requirement for "proof generation" to "on-chain verification" is that the on-chain verifier must populate these digests (constants) so as to disallow proof submitter to |
| 39 | +potentially post digests for malicious circuitry. These digests are available on-chain in the deployed contracts on Sepolia and Mainnet. |
| 40 | + |
| 41 | +An independent party can re-compute these digests from the ZkVM released circuitry and validate against on-chain values. |
| 42 | + |
| 43 | +```shell |
| 44 | +# Euclid Phase-1 |
| 45 | +$ cargo run -- compute-digest --phase-1 |
| 46 | + |
| 47 | +# Euclid Phase-2 |
| 48 | +$ cargo run -- compute-digest --phase-2 |
| 49 | +``` |
0 commit comments