diff --git a/.gitignore b/.gitignore index 59be11d..46e1ed7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ Cargo.lock target/ -.vscode.DS_Store -.idea/ \ No newline at end of file +.vscode +.DS_store +.idea/ +.ipynb_checkpoints/ diff --git a/emmarin/cl/Cargo.toml b/emmarin/cl/Cargo.toml index f466036..711436f 100644 --- a/emmarin/cl/Cargo.toml +++ b/emmarin/cl/Cargo.toml @@ -17,3 +17,7 @@ opt-level = 3 [profile.release] debug = 1 lto = true + +[patch.crates-io] +# add RISC Zero accelerator support for all downstream usages of the following crates. +sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" } diff --git a/emmarin/cl/bundle_risc0_proof/Cargo.toml b/emmarin/cl/bundle_risc0_proof/Cargo.toml index ba3bd56..9fc94ba 100644 --- a/emmarin/cl/bundle_risc0_proof/Cargo.toml +++ b/emmarin/cl/bundle_risc0_proof/Cargo.toml @@ -4,14 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -risc0-zkvm = { version = "1.0", default-features = false, features = ['std'] } +risc0-zkvm = { version = "3.0.3", default-features = false, features = ['std'] } cl = { path = "../cl" } risc0_images = { path = "../risc0_images" } hex = "0.4" - [patch.crates-io] # add RISC Zero accelerator support for all downstream usages of the following crates. sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" } -crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } -curve25519-dalek = { git = "https://github.com/risc0/curve25519-dalek", tag = "curve25519-4.1.2-risczero.0" } diff --git a/emmarin/cl/cl/Cargo.toml b/emmarin/cl/cl/Cargo.toml index 5b0254c..7f83a7b 100644 --- a/emmarin/cl/cl/Cargo.toml +++ b/emmarin/cl/cl/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" serde = {version="1.0", features = ["derive"]} rand_core = "0.6.0" hex = "0.4.3" -risc0-zkvm = "1.2" +risc0-zkvm = "3.0.3" itertools = "0.14" bincode = "1" diff --git a/emmarin/cl/cl/src/ds/mmr.rs b/emmarin/cl/cl/src/ds/mmr.rs index ea9265f..6d295f7 100644 --- a/emmarin/cl/cl/src/ds/mmr.rs +++ b/emmarin/cl/cl/src/ds/mmr.rs @@ -356,7 +356,7 @@ mod test { assert!(x_mmr.verify_proof(&x, &x_pf)); for (y, _, y_mmr) in proofs.iter() { - x_pf.update(&x, x_mmr.folds(y)); + x_pf.update(&x, &x_mmr.folds(y)); assert!(y_mmr.verify_proof(&x, &x_pf)); x_mmr.push(y); diff --git a/emmarin/cl/gen_risc0_images.sh b/emmarin/cl/gen_risc0_images.sh index 0f5e38f..08c569e 100755 --- a/emmarin/cl/gen_risc0_images.sh +++ b/emmarin/cl/gen_risc0_images.sh @@ -14,10 +14,10 @@ for proof in $proofs; do # Run the cargo risczero build command and process output line by line cargo risczero build --manifest-path "$proof/Cargo.toml" | while read -r line; do # Parse out the - if [[ $line =~ ImageID:\ ([0-9a-f]+)\ -\ \"(.+)\" ]]; then + if [[ $line =~ ImageID:\ ([0-9a-f]+)\ -\ (.+\.bin) ]]; then image_id="${BASH_REMATCH[1]}" image_elf="${BASH_REMATCH[2]}" - image_name=$(basename $image_elf | tr '[:lower:]' '[:upper:]') + image_name=$(basename $image_elf .bin | tr '[:lower:]' '[:upper:]') echo "${image_name}_ID: $image_id" echo "${image_name}_ELF: $(cat $image_elf | xxd -p | head -c 32)..." diff --git a/emmarin/cl/ledger/Cargo.toml b/emmarin/cl/ledger/Cargo.toml index 6c824c2..39f6b25 100644 --- a/emmarin/cl/ledger/Cargo.toml +++ b/emmarin/cl/ledger/Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" [dependencies] cl = { path = "../cl" } ledger_proof_statements = { path = "../ledger_proof_statements" } -risc0_images = { path = "../risc0_images", features = ["elf"]} -risc0-zkvm = { version = "1.0", features = ["prove", "metal"] } -risc0-groth16 = { version = "1.0" } +risc0_images = { path = "../risc0_images", features = ["elf"] } +risc0-zkvm = { version = "3.0.3" } +risc0-groth16 = { version = "3.0.2" } rand = "0.8.5" rand_core = "0.6.0" thiserror = "1.0.62" diff --git a/emmarin/cl/ledger/tests/simple_transfer.rs b/emmarin/cl/ledger/tests/simple_transfer.rs index 70e3b7b..4ab413e 100644 --- a/emmarin/cl/ledger/tests/simple_transfer.rs +++ b/emmarin/cl/ledger/tests/simple_transfer.rs @@ -1,7 +1,7 @@ use cl::{ crust::{ balance::{UnitWitness, NOP_COVENANT}, - BundleWitness, InputWitness, NoteCommitment, Nullifier, NullifierCommitment, + InputWitness, NoteCommitment, Nullifier, NullifierCommitment, NullifierSecret, OutputWitness, TxWitness, }, ds::mmr::{MMRProof, MMR}, diff --git a/emmarin/cl/ledger_proof_statements/Cargo.toml b/emmarin/cl/ledger_proof_statements/Cargo.toml index 35b4a87..bc43629 100644 --- a/emmarin/cl/ledger_proof_statements/Cargo.toml +++ b/emmarin/cl/ledger_proof_statements/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] cl = { path = "../cl" } serde = { version = "1.0", features = ["derive"] } -risc0-zkvm = "1.2" +risc0-zkvm = "3.0.3" diff --git a/emmarin/cl/ledger_risc0_proof/Cargo.toml b/emmarin/cl/ledger_risc0_proof/Cargo.toml index d785f44..08793c6 100644 --- a/emmarin/cl/ledger_risc0_proof/Cargo.toml +++ b/emmarin/cl/ledger_risc0_proof/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -risc0-zkvm = { version = "1.0", default-features = false, features = ['std'] } +risc0-zkvm = { version = "3.0.3", default-features = false, features = ['std'] } serde = { version = "1.0", features = ["derive"] } cl = { path = "../cl" } ledger_proof_statements = { path = "../ledger_proof_statements" } @@ -14,5 +14,3 @@ hex = "0.4" [patch.crates-io] # add RISC Zero accelerator support for all downstream usages of the following crates. sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" } -crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } -curve25519-dalek = { git = "https://github.com/risc0/curve25519-dalek", tag = "curve25519-4.1.2-risczero.0" } diff --git a/emmarin/cl/risc0_images/src/BUNDLE_ELF b/emmarin/cl/risc0_images/src/BUNDLE_ELF index 99a8ed1..e4de0a8 100755 Binary files a/emmarin/cl/risc0_images/src/BUNDLE_ELF and b/emmarin/cl/risc0_images/src/BUNDLE_ELF differ diff --git a/emmarin/cl/risc0_images/src/BUNDLE_ID b/emmarin/cl/risc0_images/src/BUNDLE_ID index 827648b..6140e8a 100644 --- a/emmarin/cl/risc0_images/src/BUNDLE_ID +++ b/emmarin/cl/risc0_images/src/BUNDLE_ID @@ -1 +1 @@ -2aceb7181ab1155497eaf932c71dfe8bd9fcab476c543d7e03163fe083b15e19 \ No newline at end of file +0ecb30628832729bebe6d5a2068dcbc485f4e0737908dcfd7a314bf4d0d3920d \ No newline at end of file diff --git a/emmarin/cl/risc0_images/src/LEDGER_ELF b/emmarin/cl/risc0_images/src/LEDGER_ELF index c843400..a17e413 100755 Binary files a/emmarin/cl/risc0_images/src/LEDGER_ELF and b/emmarin/cl/risc0_images/src/LEDGER_ELF differ diff --git a/emmarin/cl/risc0_images/src/LEDGER_ID b/emmarin/cl/risc0_images/src/LEDGER_ID index ae3954f..ede9fde 100644 --- a/emmarin/cl/risc0_images/src/LEDGER_ID +++ b/emmarin/cl/risc0_images/src/LEDGER_ID @@ -1 +1 @@ -4e5e4fdaa2448d4bb16aecf2b0c6279ef7a573df3ccb999201a1f1b7400f8732 \ No newline at end of file +de1e1f86099d03720ea21ddf8b15c17433451f798a567a73b4168d6cb13fac6b \ No newline at end of file diff --git a/emmarin/cl/risc0_images/src/STF_NOP_ELF b/emmarin/cl/risc0_images/src/STF_NOP_ELF index 38ee837..8698758 100755 Binary files a/emmarin/cl/risc0_images/src/STF_NOP_ELF and b/emmarin/cl/risc0_images/src/STF_NOP_ELF differ diff --git a/emmarin/cl/risc0_images/src/STF_NOP_ID b/emmarin/cl/risc0_images/src/STF_NOP_ID index dc8a847..0634b8d 100644 --- a/emmarin/cl/risc0_images/src/STF_NOP_ID +++ b/emmarin/cl/risc0_images/src/STF_NOP_ID @@ -1 +1 @@ -557a0804bbf1220e66f4a695c24d57de02cb9fd52d646cb99dd43572561a6807 \ No newline at end of file +809c39ebcd239c125d2771d8ab6fe0b163643faa49c1659e032c42bee4223a82 \ No newline at end of file diff --git a/emmarin/cl/risc0_images/src/TX_ELF b/emmarin/cl/risc0_images/src/TX_ELF index d732c3a..1a9df64 100755 Binary files a/emmarin/cl/risc0_images/src/TX_ELF and b/emmarin/cl/risc0_images/src/TX_ELF differ diff --git a/emmarin/cl/risc0_images/src/TX_ID b/emmarin/cl/risc0_images/src/TX_ID index c86fd29..c586703 100644 --- a/emmarin/cl/risc0_images/src/TX_ID +++ b/emmarin/cl/risc0_images/src/TX_ID @@ -1 +1 @@ -70c7de2aaee012e499f1a7c659d84ce35acadf59c8714931fd1e60cc7ef28067 \ No newline at end of file +17635f051fb3b1efb43cffb32b17872e67ae951d9a229ff38b143a9b2ec61eca \ No newline at end of file diff --git a/emmarin/cl/risc0_proofs/Cargo.toml b/emmarin/cl/risc0_proofs/Cargo.toml index 8852e99..4881e09 100644 --- a/emmarin/cl/risc0_proofs/Cargo.toml +++ b/emmarin/cl/risc0_proofs/Cargo.toml @@ -4,14 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -risc0-zkvm = { version = "1.0", default-features = false, features = ['std'] } +risc0-zkvm = { version = "3.0.3", default-features = false, features = ['std'] } serde = { version = "1.0", features = ["derive"] } cl = { path = "../cl" } ledger_proof_statements = { path = "../ledger_proof_statements" } - [patch.crates-io] # add RISC Zero accelerator support for all downstream usages of the following crates. sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" } -crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } -curve25519-dalek = { git = "https://github.com/risc0/curve25519-dalek", tag = "curve25519-4.1.2-risczero.0" }