Try โ€‚โ€‰HackMD

Project proposal: CraneZisk

Index document: CraneZisk index

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Project Info

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Project Name: CraneZisk

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Team: Andrew Borg in collaboration with Polygon

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Expected timeline: October 2024 - February 2025

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Summary

The proposal to build an efficient compiler from Rust to Zisk zkVM based on the Cranelift toolchain.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Background

During collaboration between Polygon Hermez and NEAR we've built a backend for Cranelift compiler that can compile Rust and WASM programs to zkEVM and zkASM.

This approach showed a lot of promise, being able to generate zkASM for Keccak hash function benchmark with performance within 10x (cycles) of the hand-written state machine.

The next leap in performance can come from switching to zkVM that is better tailored to compilation from Cranelift IR (efficient 32-bit operations, efficient access to registers and memory).

Zisk is the new zkVM memory-based architecture that would be a great target for Cranelift compilation.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Stages and objectives

Problem Formulation: Enable efficient compilation of Rust and WASM programs to Zisk

1. PoC Cranelift-based compiler from Rust to Zisk

Goal: Build a proof-of-concept Cranelift Zisk backend that can compile multiple representative Rust benchmarks and surpass the performance of RiscV based backend:

  • Iterative SHA256
  • Iterative Keccak
  • ECDSA verification
  • Fibonacci numbers

Note, that we don't aim to support all possible Rust programs at this point and instead focus on benchmarks only.

Time-estimate: 2 months of work by Andrew with basic support from Zisk team

2. Feature-complete compiler from Rust to Zisk

Goals:

  • Extend the PoC Zisk backend to support all relevant Rust programs (e.g. feature parity with SP1)
  • Onboard engineer(s) from Polygon to co-own of the project

Time-estimate: 2 months of work by Andrew + 1 collaborator from Polygon

3. Production-ready compiler from Rust to Zisk

Goals:

  • Compiler easily available to the end-users
  • High test coverage
  • Performance regression tests

Time-estimate: 2 months of work by Andrew + 2 collaborators from Polygon

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Timeline

Item Date Note
Submit Proposal 13 August
Review Proposal
Start implementation
Present results

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’
Reference

  1. ZKWASM project index
  2. Risc0 benchmarks
  3. Risc0 examples