feat: Add ere-zisk with only compile and execute utility. (#27)

* feat: add `ere-zisk` and `compile` functionality

* fix: use `FixintEncoding` for `Input::as_bytes` to make it deterministic

* feat: implement `zkVM::execute`

* fix: make `install_zisk_sdk.sh` work with docker

* chore: add comment why use `#[should_panic]`

* feat: use command `cargo-zisk ...` for `compile`, `execute`, `prove` and `verify`

* ci

* fix: invalid proof
This commit is contained in:
Han
2025-05-28 15:49:04 +01:00
committed by GitHub
parent d106f8d65c
commit 5b5a012e26
16 changed files with 777 additions and 68 deletions

View File

@@ -0,0 +1,9 @@
[package]
name = "ere-test-zisk-guest"
version = "0.1.0"
edition = "2021"
[workspace]
[dependencies]
ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", rev = "f9a3655" }

View File

@@ -0,0 +1,14 @@
#![no_main]
ziskos::entrypoint!(main);
fn main() {
// Read an input
let n = u32::from_le_bytes(
ziskos::read_input()
.try_into()
.expect("input to be 4 bytes"),
);
// Write n*2 to output
ziskos::set_output(0, n * 2);
}

View File

@@ -0,0 +1,9 @@
[package]
name = "ere-test-zisk-guest"
version = "0.1.0"
edition = "2021"
[workspace]
[dependencies]
ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", rev = "f9a3655" }

View File

@@ -0,0 +1,16 @@
#![no_main]
ziskos::entrypoint!(main);
fn main() {
let input = ziskos::read_input();
if input.len() != 6 {
std::process::exit(1);
}
// Read an input
let n = u32::from_le_bytes(input[..4].try_into().unwrap());
let a = u16::from_le_bytes(input[4..6].try_into().unwrap()) as u32;
ziskos::set_output(0, (n + a) * 2);
}

View File

@@ -0,0 +1,9 @@
[package]
name = "ere-test-zisk-guest"
version = "0.1.0"
edition = "2021"
[workspace]
[dependencies]
ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", rev = "f9a3655" }

View File

@@ -0,0 +1,16 @@
#![no_main]
ziskos::entrypoint!(main);
fn main() {
let input = ziskos::read_input();
if input.len() != 6 {
std::process::exit(1);
}
// Read an input
let n = u32::from_le_bytes(input[..4].try_into().unwrap());
let a = u16::from_le_bytes(input[4..6].try_into().unwrap()) as u32;
ziskos::set_output(0, (n + a) * 2);
}