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/zone/.gitignore b/goas/atomic_asset_transfer/.gitignore similarity index 100% rename from goas/zone/.gitignore rename to goas/atomic_asset_transfer/.gitignore diff --git a/goas/atomic_asset_transfer/Cargo.toml b/goas/atomic_asset_transfer/Cargo.toml new file mode 100644 index 0000000..457d42f --- /dev/null +++ b/goas/atomic_asset_transfer/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +resolver = "2" +members = [ "common", "executor", "proof_statements", "risc0_proofs", "user"] + +# Always optimize; building and running the guest takes much longer without optimization. +[profile.dev] +opt-level = 3 + +[profile.release] +debug = 1 +lto = true \ No newline at end of file diff --git a/goas/zone/LICENSE b/goas/atomic_asset_transfer/LICENSE similarity index 100% rename from goas/zone/LICENSE rename to goas/atomic_asset_transfer/LICENSE diff --git a/goas/zone/README.md b/goas/atomic_asset_transfer/README.md similarity index 100% rename from goas/zone/README.md rename to goas/atomic_asset_transfer/README.md diff --git a/goas/zone/common/Cargo.toml b/goas/atomic_asset_transfer/common/Cargo.toml similarity index 100% rename from goas/zone/common/Cargo.toml rename to goas/atomic_asset_transfer/common/Cargo.toml diff --git a/goas/zone/common/src/lib.rs b/goas/atomic_asset_transfer/common/src/lib.rs similarity index 100% rename from goas/zone/common/src/lib.rs rename to goas/atomic_asset_transfer/common/src/lib.rs diff --git a/goas/atomic_asset_transfer/executor/Cargo.toml b/goas/atomic_asset_transfer/executor/Cargo.toml new file mode 100644 index 0000000..0441c2f --- /dev/null +++ b/goas/atomic_asset_transfer/executor/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "executor" +version = "0.1.0" +edition = "2021" +default-run = "executor" + +[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/zone/executor/src/bin/groth16.rs b/goas/atomic_asset_transfer/executor/src/bin/groth16.rs similarity index 100% rename from goas/zone/executor/src/bin/groth16.rs rename to goas/atomic_asset_transfer/executor/src/bin/groth16.rs diff --git a/goas/zone/executor/src/main.rs b/goas/atomic_asset_transfer/executor/src/main.rs similarity index 100% rename from goas/zone/executor/src/main.rs rename to goas/atomic_asset_transfer/executor/src/main.rs diff --git a/goas/zone/proof_statements/Cargo.toml b/goas/atomic_asset_transfer/proof_statements/Cargo.toml similarity index 100% rename from goas/zone/proof_statements/Cargo.toml rename to goas/atomic_asset_transfer/proof_statements/Cargo.toml diff --git a/goas/zone/proof_statements/src/lib.rs b/goas/atomic_asset_transfer/proof_statements/src/lib.rs similarity index 100% rename from goas/zone/proof_statements/src/lib.rs rename to goas/atomic_asset_transfer/proof_statements/src/lib.rs diff --git a/goas/zone/proof_statements/src/zone_funds.rs b/goas/atomic_asset_transfer/proof_statements/src/zone_funds.rs similarity index 100% rename from goas/zone/proof_statements/src/zone_funds.rs rename to goas/atomic_asset_transfer/proof_statements/src/zone_funds.rs diff --git a/goas/zone/risc0_proofs/Cargo.toml b/goas/atomic_asset_transfer/risc0_proofs/Cargo.toml similarity index 100% rename from goas/zone/risc0_proofs/Cargo.toml rename to goas/atomic_asset_transfer/risc0_proofs/Cargo.toml diff --git a/goas/zone/risc0_proofs/build.rs b/goas/atomic_asset_transfer/risc0_proofs/build.rs similarity index 100% rename from goas/zone/risc0_proofs/build.rs rename to goas/atomic_asset_transfer/risc0_proofs/build.rs diff --git a/goas/zone/risc0_proofs/spend_zone_funds/Cargo.toml b/goas/atomic_asset_transfer/risc0_proofs/spend_zone_funds/Cargo.toml similarity index 100% rename from goas/zone/risc0_proofs/spend_zone_funds/Cargo.toml rename to goas/atomic_asset_transfer/risc0_proofs/spend_zone_funds/Cargo.toml diff --git a/goas/zone/risc0_proofs/spend_zone_funds/src/main.rs b/goas/atomic_asset_transfer/risc0_proofs/spend_zone_funds/src/main.rs similarity index 100% rename from goas/zone/risc0_proofs/spend_zone_funds/src/main.rs rename to goas/atomic_asset_transfer/risc0_proofs/spend_zone_funds/src/main.rs diff --git a/goas/zone/risc0_proofs/src/lib.rs b/goas/atomic_asset_transfer/risc0_proofs/src/lib.rs similarity index 100% rename from goas/zone/risc0_proofs/src/lib.rs rename to goas/atomic_asset_transfer/risc0_proofs/src/lib.rs diff --git a/goas/zone/risc0_proofs/zone_state/Cargo.toml b/goas/atomic_asset_transfer/risc0_proofs/zone_state/Cargo.toml similarity index 100% rename from goas/zone/risc0_proofs/zone_state/Cargo.toml rename to goas/atomic_asset_transfer/risc0_proofs/zone_state/Cargo.toml diff --git a/goas/zone/risc0_proofs/zone_state/src/main.rs b/goas/atomic_asset_transfer/risc0_proofs/zone_state/src/main.rs similarity index 100% rename from goas/zone/risc0_proofs/zone_state/src/main.rs rename to goas/atomic_asset_transfer/risc0_proofs/zone_state/src/main.rs diff --git a/goas/zone/rust-toolchain.toml b/goas/atomic_asset_transfer/rust-toolchain.toml similarity index 100% rename from goas/zone/rust-toolchain.toml rename to goas/atomic_asset_transfer/rust-toolchain.toml diff --git a/goas/zone/executor/Cargo.toml b/goas/atomic_asset_transfer/user/Cargo.toml similarity index 93% rename from goas/zone/executor/Cargo.toml rename to goas/atomic_asset_transfer/user/Cargo.toml index 47ce798..5ca776f 100644 --- a/goas/zone/executor/Cargo.toml +++ b/goas/atomic_asset_transfer/user/Cargo.toml @@ -1,8 +1,7 @@ [package] -name = "host" +name = "user" version = "0.1.0" edition = "2021" -default-run = "host" [dependencies] goas_risc0_proofs = { path = "../risc0_proofs", package = "goas_risc0_proofs" } 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"); +} diff --git a/goas/zone/Cargo.toml b/goas/zone/Cargo.toml deleted file mode 100644 index 7cc3b61..0000000 --- a/goas/zone/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[workspace] -resolver = "2" -members = [ "common", "executor", "proof_statements", "risc0_proofs"] - -# Always optimize; building and running the guest takes much longer without optimization. -[profile.dev] -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" }