From 2c32905112a0681ca95a4e75cd11002867839dff Mon Sep 17 00:00:00 2001 From: David Rusu Date: Thu, 1 Aug 2024 16:57:20 +0400 Subject: [PATCH] aat: scaffolding for the user ptx --- .gitignore | 2 ++ goas/atomic_asset_transfer/Cargo.toml | 11 ++--------- goas/atomic_asset_transfer/executor/Cargo.toml | 4 ++-- goas/atomic_asset_transfer/user/Cargo.toml | 18 ++++++++++++++++++ goas/atomic_asset_transfer/user/src/main.rs | 8 ++++++++ 5 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 .gitignore create mode 100644 goas/atomic_asset_transfer/user/Cargo.toml create mode 100644 goas/atomic_asset_transfer/user/src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e7caa9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Cargo.lock +target/ diff --git a/goas/atomic_asset_transfer/Cargo.toml b/goas/atomic_asset_transfer/Cargo.toml index 7cc3b61..457d42f 100644 --- a/goas/atomic_asset_transfer/Cargo.toml +++ b/goas/atomic_asset_transfer/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = [ "common", "executor", "proof_statements", "risc0_proofs"] +members = [ "common", "executor", "proof_statements", "risc0_proofs", "user"] # Always optimize; building and running the guest takes much longer without optimization. [profile.dev] @@ -8,11 +8,4 @@ opt-level = 3 [profile.release] debug = 1 -lto = true - -[patch.crates-io] -# Placing these patch statement in the workspace Cargo.toml will add RISC Zero SHA-256 and bigint -# multiplication 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" } -#k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } -#crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" } +lto = true \ No newline at end of file diff --git a/goas/atomic_asset_transfer/executor/Cargo.toml b/goas/atomic_asset_transfer/executor/Cargo.toml index 47ce798..0441c2f 100644 --- a/goas/atomic_asset_transfer/executor/Cargo.toml +++ b/goas/atomic_asset_transfer/executor/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "host" +name = "executor" version = "0.1.0" edition = "2021" -default-run = "host" +default-run = "executor" [dependencies] goas_risc0_proofs = { path = "../risc0_proofs", package = "goas_risc0_proofs" } diff --git a/goas/atomic_asset_transfer/user/Cargo.toml b/goas/atomic_asset_transfer/user/Cargo.toml new file mode 100644 index 0000000..5ca776f --- /dev/null +++ b/goas/atomic_asset_transfer/user/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "user" +version = "0.1.0" +edition = "2021" + +[dependencies] +goas_risc0_proofs = { path = "../risc0_proofs", package = "goas_risc0_proofs" } +risc0-zkvm = { version = "1.0", features = ["prove", "metal"] } +risc0-groth16 = { version = "1.0" } +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +serde = "1.0" +blake2 = "0.10" +bincode = "1" +common = { path = "../common" } +tempfile = "3" +clap = { version = "4", features = ["derive"] } +rand = "0.8.5" +cl = { path = "../../cl/cl" } diff --git a/goas/atomic_asset_transfer/user/src/main.rs b/goas/atomic_asset_transfer/user/src/main.rs new file mode 100644 index 0000000..bc2aa13 --- /dev/null +++ b/goas/atomic_asset_transfer/user/src/main.rs @@ -0,0 +1,8 @@ +fn main() { + // Initialize tracing. In order to view logs, run `RUST_LOG=info cargo run` + tracing_subscriber::fmt() + .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env()) + .init(); + + println!("TODO: impl user side of the atomic asset transfer"); +}