diff --git a/simple-identity-sp1/README.md b/simple-identity-sp1/README.md index 74f8d7d..45c1170 100644 --- a/simple-identity-sp1/README.md +++ b/simple-identity-sp1/README.md @@ -28,6 +28,7 @@ To build all methods and register the smart contract on the local node from the cd script cargo run -- register-contract ``` + The expected output is `📝 Registering new contract simple_identity`. ### Register an account / Sign up @@ -35,21 +36,24 @@ The expected output is `📝 Registering new contract simple_identity`. To register an account with a username (alice) and password (abc123), execute: ```sh -cargo run -- register-identity alice.simple_identity abc123 +cargo run -- register-identity alice@simple_identity abc123 ``` + The node's logs will display: ```sh INFO hyle_verifiers: ✅ SP1 proof verified. ``` + ### Verify identity / Login To verify alice's identity: ```sh -cargo run -- verify-identity alice.simple_identity abc123 0 +cargo run -- verify-identity alice@simple_identity abc123 0 ``` + This command will: 1. Send a blob transaction to verify `alice`'s identity. @@ -63,4 +67,3 @@ Upon reception of the proof, the node will: 1. Update the contract's state. The node's logs will display: - diff --git a/simple-identity/Cargo.lock b/simple-identity/Cargo.lock index 2f45ecd..7ef4a2a 100644 --- a/simple-identity/Cargo.lock +++ b/simple-identity/Cargo.lock @@ -38,6 +38,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -111,21 +117,24 @@ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "ark-bn254" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ "ark-ec", "ark-ff", + "ark-r1cs-std", "ark-std", ] [[package]] name = "ark-crypto-primitives" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ + "ahash", + "ark-crypto-primitives-macros", "ark-ec", "ark-ff", "ark-relations", @@ -135,74 +144,91 @@ dependencies = [ "blake2", "derivative", "digest", + "fnv", + "merlin", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ark-crypto-primitives-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash", "ark-ff", "ark-poly", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools 0.13.0", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", "digest", - "itertools 0.10.5", + "educe", + "itertools 0.13.0", "num-bigint", "num-traits", "paste", - "rustc_version", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-groth16" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ "ark-crypto-primitives", "ark-ec", @@ -215,22 +241,41 @@ dependencies = [ [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ + "ahash", "ark-ff", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-std", + "educe", + "num-bigint", + "num-integer", + "num-traits", + "tracing", ] [[package]] name = "ark-relations" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ "ark-ff", "ark-std", @@ -240,32 +285,33 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive", "ark-std", + "arrayvec", "digest", "num-bigint", ] [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-snark" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ "ark-ff", "ark-relations", @@ -275,19 +321,25 @@ dependencies = [ [[package]] name = "ark-std" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", ] [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" @@ -295,6 +347,60 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "axum" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -325,6 +431,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -375,9 +487,9 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "1.2.5" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f5c3a53e931b20e0535a53fbf4de86e164c07c7f329beed25f25280c4dd7d4" +checksum = "0bce8d6acc5286a16e94c29e9c885d1869358885e08a6feeb6bc54e36fe20055" dependencies = [ "duplicate", "maybe-async", @@ -389,9 +501,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ "borsh-derive", "cfg_aliases", @@ -399,9 +511,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate", @@ -436,6 +548,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.10.1" @@ -465,16 +583,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] @@ -551,6 +669,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "colorchoice" version = "1.0.3" @@ -677,6 +801,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.100", +] + [[package]] name = "derive_more" version = "2.0.1" @@ -764,6 +919,18 @@ dependencies = [ "proc-macro-error", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "either" version = "1.15.0" @@ -776,6 +943,18 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -785,6 +964,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -813,15 +1012,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - [[package]] name = "foreign-types" version = "0.5.0" @@ -829,7 +1019,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared 0.3.1", + "foreign-types-shared", ] [[package]] @@ -843,12 +1033,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -864,6 +1048,21 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -880,6 +1079,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -915,6 +1125,7 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -973,25 +1184,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "h2" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.8.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1000,9 +1192,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] @@ -1012,6 +1204,18 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] [[package]] name = "heck" @@ -1047,6 +1251,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" name = "host" version = "0.1.0" dependencies = [ + "anyhow", "borsh", "clap", "contract-identity", @@ -1080,12 +1285,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -1097,10 +1302,16 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "hyle-bonsai-runner" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "bincode", @@ -1108,6 +1319,7 @@ dependencies = [ "borsh", "bytemuck", "hex", + "hyle-net", "risc0-zkvm", "serde", "tracing", @@ -1115,14 +1327,14 @@ dependencies = [ [[package]] name = "hyle-client-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "borsh", "hyle-bonsai-runner", "hyle-contract-sdk", - "reqwest", + "hyle-net", "risc0-zkvm", "serde", "serde_json", @@ -1131,18 +1343,19 @@ dependencies = [ [[package]] name = "hyle-contract-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", "hyle-model", "serde", + "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hyle-model" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "base64", @@ -1155,11 +1368,33 @@ dependencies = [ "serde_json", "serde_with", "sha3", - "strum", - "strum_macros", + "strum 0.27.1", + "strum_macros 0.27.1", "utoipa", ] +[[package]] +name = "hyle-net" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" +dependencies = [ + "anyhow", + "axum", + "borsh", + "bytes", + "futures", + "http-body-util", + "hyle-contract-sdk", + "hyper", + "hyper-util", + "paste", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hyper" version = "1.6.0" @@ -1169,10 +1404,10 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1198,22 +1433,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -1401,6 +1620,12 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "include_bytes_aligned" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" + [[package]] name = "indexmap" version = "1.9.3" @@ -1437,9 +1662,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1506,6 +1731,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] [[package]] name = "libc" @@ -1575,6 +1803,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "maybe-async" version = "0.2.10" @@ -1592,6 +1826,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core", + "zeroize", +] + [[package]] name = "metal" version = "0.29.0" @@ -1601,7 +1847,7 @@ dependencies = [ "bitflags 2.9.0", "block", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "log", "objc", "paste", @@ -1641,21 +1887,10 @@ dependencies = [ ] [[package]] -name = "native-tls" -version = "0.2.14" +name = "no_std_strings" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] +checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" [[package]] name = "nu-ansi-term" @@ -1735,50 +1970,6 @@ version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" -[[package]] -name = "openssl" -version = "0.10.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" -dependencies = [ - "bitflags 2.9.0", - "cfg-if", - "foreign-types 0.3.2", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -1839,10 +2030,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.32" +name = "postcard" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] [[package]] name = "powerfmt" @@ -2098,23 +2295,19 @@ checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -2126,9 +2319,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-util", "tower", @@ -2158,43 +2349,52 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d893807e609dd44942644aef5137ad87d178a032c5932b0c68cdec538c3370" +checksum = "0f147f96a8a3058e699a5d39fc7e59d982f633751543ff4437cc0fb21f40b2e0" dependencies = [ "anyhow", "borsh", + "derive_more", "elf", + "lazy_static", + "postcard", "risc0-zkp", "risc0-zkvm-platform", + "semver", "serde", "tracing", ] [[package]] name = "risc0-build" -version = "1.2.5" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98bcfd51f182f7e94209249ca3a0c64df0ab0dbfe151bd5fcbe2b708c4f9f17f" +checksum = "eb85162c19a2ba2151c02f1f157804cd89e163ca694afda399fc3f415c03a3de" dependencies = [ "anyhow", "cargo_metadata", + "derive_builder", "dirs", "docker-generate", "hex", "risc0-binfmt", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", + "rzup", + "semver", "serde", "serde_json", + "stability", "tempfile", ] [[package]] name = "risc0-circuit-keccak" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d1d4f248ccf111a9d58a6cd9ae5bfb4c3830e100e75874c39622a2952ef5a9" +checksum = "dc6af6fc80443a05d9e8e25aeba78082fc58e8a3c6a6b92017cae0a404494ba9" dependencies = [ "anyhow", "bytemuck", @@ -2208,9 +2408,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ab005ed38c1119c0511b9260cd18d95adbb226ad849eccfdb650eebecd769c" +checksum = "1c7bdd11df4ed470b3c032ac4c5bfb2729f6151af33ee255b66169de0c35611e" dependencies = [ "anyhow", "bytemuck", @@ -2223,35 +2423,38 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.2.5" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d64420292f716e468cba1e17eb56146a525d612d967ee09566eda80b423a54a" +checksum = "c98a4d9e438aac2e661b8376f6dd48b17a0949b29dbb0aed6e88e62de0bd5940" dependencies = [ "anyhow", - "metal", + "bit-vec", + "bytemuck", + "derive_more", + "paste", "risc0-binfmt", "risc0-core", "risc0-zkp", - "risc0-zkvm-platform", "serde", "tracing", ] [[package]] name = "risc0-core" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2492abd92da4eb2a6e5e9e74757d00b1c29c03bb867266c85752cb22a03a920" +checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" dependencies = [ "bytemuck", + "bytemuck_derive", "rand_core", ] [[package]] name = "risc0-groth16" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017c18151e017a154f4b4bbeec2a0656a3a7822fab3cd0dc1a15e2654dde4fe" +checksum = "a800c55717c52f764325bdb18a164843d417a4c8c8a123b7d4206705c11a54c3" dependencies = [ "anyhow", "ark-bn254", @@ -2268,11 +2471,21 @@ dependencies = [ "stability", ] +[[package]] +name = "risc0-zkos-v1compat" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa44e7cc6642e621c6f3eea56f57a765f8e599bf327f4d0f74921693234a5d62" +dependencies = [ + "include_bytes_aligned", + "no_std_strings", +] + [[package]] name = "risc0-zkp" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a6e3c078d7a7d27eda9383db8d080f7200ac4e5e65c1971d454a0286c00cae" +checksum = "023ed128cab28e4078330fffb65e9d079b3198958e3de6835f70c7ff285afeb4" dependencies = [ "anyhow", "blake2", @@ -2289,14 +2502,15 @@ dependencies = [ "risc0-zkvm-platform", "serde", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", + "stability", "tracing", ] [[package]] name = "risc0-zkvm" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd97c60815994da62fa000dec9470c0d0e3045a554354e279695f2213b0182f" +checksum = "5881af78a17ca292037ef38383233f8d617ab679d68cc07c865e3ddabef1db80" dependencies = [ "anyhow", "bincode", @@ -2304,6 +2518,7 @@ dependencies = [ "borsh", "bytemuck", "bytes", + "derive_more", "getrandom 0.2.15", "hex", "lazy-regex", @@ -2315,9 +2530,11 @@ dependencies = [ "risc0-circuit-rv32im", "risc0-core", "risc0-groth16", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", + "rzup", "semver", "serde", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2328,9 +2545,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e0235c87d8e18f13da5c71bfe69b1beb7c08694c75d19eae9dbed09a59c57" +checksum = "fed76ab12e5af4c93a3996e0609696cfdd0caebe8746af171ef583fa6e4af134" dependencies = [ "bytemuck", "cfg-if", @@ -2361,15 +2578,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "1.0.2" @@ -2439,12 +2647,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "schannel" -version = "0.1.27" +name = "rzup" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "400558bf12d4292a7804093b60a437ba8b0219ea7d53716b2c010a0d31e5f4a8" dependencies = [ - "windows-sys 0.59.0", + "semver", + "serde", + "strum 0.26.3", + "tempfile", + "thiserror 2.0.12", + "toml", + "yaml-rust2", ] [[package]] @@ -2453,29 +2667,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.26" @@ -2517,6 +2708,25 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2639,6 +2849,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stability" version = "0.2.1" @@ -2661,12 +2877,34 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + [[package]] name = "strum" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "strum_macros" version = "0.27.1" @@ -2728,27 +2966,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tempfile" version = "3.18.0" @@ -2908,16 +3125,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.2" @@ -2930,9 +3137,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -2941,11 +3148,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -2954,6 +3176,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap 2.8.0", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -2971,6 +3195,7 @@ dependencies = [ "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3144,12 +3369,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -3538,6 +3757,17 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "yaml-rust2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + [[package]] name = "yoke" version = "0.7.5" diff --git a/simple-identity/Cargo.toml b/simple-identity/Cargo.toml index f0e0486..50f4200 100644 --- a/simple-identity/Cargo.toml +++ b/simple-identity/Cargo.toml @@ -4,8 +4,8 @@ members = ["host", "contract", "methods"] default-members = ["host", "contract"] [workspace.dependencies] -sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", tag = "v0.13.0-rc.1" } # don't forget to update methods/guest/Cargo.toml -client-sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-client-sdk", tag = "v0.13.0-rc.1" } +sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", tag = "v0.13.0-rc.4" } # don't forget to update methods/guest/Cargo.toml +client-sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-client-sdk", tag = "v0.13.0-rc.4" } # Always optimize; building and running the guest takes much longer without optimization. [profile.dev] diff --git a/simple-identity/README.md b/simple-identity/README.md index 65b39dc..704a990 100644 --- a/simple-identity/README.md +++ b/simple-identity/README.md @@ -8,26 +8,33 @@ This is a Risc0 example called simple_identity. - [Install Rust](https://www.rust-lang.org/tools/install) (you'll need `rustup` and Cargo). - For our example, [install RISC Zero](https://dev.risczero.com/api/zkvm/install). -- [Start a single-node devnet](https://docs.hyle.eu/developers/quickstart/devnet/). We recommend using [dev-mode](https://dev.risczero.com/api/generating-proofs/dev-mode) with `-e RISC0_DEV_MODE=1` for faster iterations during development. +- Run a local devnet node: + +Clone the [hyle](https://github.com/Hyle-org/hyle) repo, checkout the version you need, and run: + +```sh +export RISC0_DEV_MODE=1 +cargo run -- --pg +``` ## Quickstart -### Build and register the identity contract +### Build and register the contract -To build all methods and register the smart contract on the local node [from the source](https://github.com/Hyle-org/examples/blob/simple_erc20/simple-token/host/src/main.rs), run: +To build and register the smart contract on the local node, run: ```bash cargo run -- register-contract ``` -The expected output is `📝 Registering contract simple_identity`. +The expected output on the node is `📝 Registering contract counter`. ### Register an account / Sign up To register an account with a username (`alice`) and password (`abc123`), execute: ```sh -cargo run -- register-identity alice.simple_identity abc123 +cargo run -- register-identity alice@simple_identity abc123 ``` The node's logs will display: @@ -41,7 +48,7 @@ INFO hyle_verifiers: ✅ Risc0 proof verified. To verify `alice`'s identity: ```bash -cargo run -- verify-identity alice.simple_identity abc123 0 +cargo run -- verify-identity alice@simple_identity abc123 0 ``` This command will: @@ -70,6 +77,12 @@ During development, faster iteration upon code changes can be achieved by levera RISC0_DEV_MODE=1 cargo run ``` +### Execute the contract & send a tx on-chain + +```sh +RISC0_DEV_MODE=1 cargo run -- increment +``` + @@ -101,7 +114,7 @@ applications, which we think is a good starting point for your applications. ```text project_name ├── Cargo.toml -├── contract +├── contract │ ├── Cargo.toml │ └── src │ └── lib.rs <-- [Contract code goes here, common to host & guest] @@ -121,6 +134,7 @@ project_name ``` + [cargo-risczero]: https://docs.rs/cargo-risczero [crates]: https://github.com/risc0/risc0/blob/main/README.md#rust-binaries [dev-docs]: https://dev.risczero.com diff --git a/simple-identity/contract/src/lib.rs b/simple-identity/contract/src/lib.rs index a6048ca..9187944 100644 --- a/simple-identity/contract/src/lib.rs +++ b/simple-identity/contract/src/lib.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Serialize}; use sdk::RunResult; use sha2::{Digest, Sha256}; -impl sdk::HyleContract for IdentityContractState { +impl sdk::ZkContract for IdentityContractState { /// Entry point of the contract's logic - fn execute(&mut self, contract_input: &sdk::ContractInput) -> RunResult { + fn execute(&mut self, calldata: &sdk::Calldata) -> RunResult { // Parse contract inputs - let (action, ctx) = sdk::utils::parse_raw_contract_input::(contract_input)?; + let (action, ctx) = sdk::utils::parse_raw_calldata::(calldata)?; // Extract private information - let password = core::str::from_utf8(&contract_input.private_input).unwrap(); + let password = core::str::from_utf8(&calldata.private_input).unwrap(); // Execute the given action let res = match action { diff --git a/simple-identity/host/Cargo.toml b/simple-identity/host/Cargo.toml index c64eedf..233441d 100644 --- a/simple-identity/host/Cargo.toml +++ b/simple-identity/host/Cargo.toml @@ -11,5 +11,6 @@ contract-identity = { path = "../contract" } methods-identity = { path = "../methods" } tracing-subscriber = { version = "0.3", features = ["env-filter"] } clap = { version = "4.5.23", features = ["derive"] } -borsh = "1.5.5" +borsh = "1.5.7" tokio = { version = "1.42.0", features = ["full", "tracing"] } +anyhow = "1.0.96" diff --git a/simple-identity/host/src/main.rs b/simple-identity/host/src/main.rs index 6ada0ef..5c12b31 100644 --- a/simple-identity/host/src/main.rs +++ b/simple-identity/host/src/main.rs @@ -1,12 +1,13 @@ +use anyhow::Result; use clap::{Parser, Subcommand}; use client_sdk::helpers::risc0::Risc0Prover; use contract_identity::IdentityAction; use contract_identity::IdentityContractState; use sdk::api::APIRegisterContract; use sdk::BlobTransaction; -use sdk::ContractInput; -use sdk::HyleContract; use sdk::ProofTransaction; +use sdk::{Calldata, ZkContract}; + // These constants represent the RISC-V ELF and the image ID generated by risc0-build. // The ELF is used for proving and the ID is used for verification. use methods_identity::{GUEST_ELF, GUEST_ID}; @@ -18,13 +19,10 @@ struct Cli { #[command(subcommand)] command: Commands, - #[clap(long, short)] - reproducible: bool, - #[arg(long, default_value = "http://localhost:4321")] pub host: String, - #[arg(long, default_value = "simple_identity")] + #[arg(long, default_value = "counter")] pub contract_name: String, } @@ -43,7 +41,7 @@ enum Commands { } #[tokio::main] -async fn main() { +async fn main() -> Result<()> { // 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()) @@ -51,10 +49,11 @@ async fn main() { let cli = Cli::parse(); - let client = client_sdk::rest_client::NodeApiHttpClient::new(cli.host).unwrap(); - + // Client to send requests to the node + let client = client_sdk::rest_client::NodeApiHttpClient::new(cli.host)?; let contract_name = &cli.contract_name; + // Will be used to generate zkProof of the execution. let prover = Risc0Prover::new(GUEST_ELF); match cli.command { @@ -71,9 +70,7 @@ async fn main() { state_commitment: initial_state.commit(), contract_name: contract_name.clone().into(), }) - .await - .unwrap(); - + .await?; println!("✅ Register contract tx sent. Tx hash: {}", res); } Commands::RegisterIdentity { identity, password } => { @@ -111,19 +108,25 @@ async fn main() { let identity = blob_tx.identity.clone(); // Build the contract input - let inputs = ContractInput { - state: initial_state.as_bytes().unwrap(), - identity, + let inputs = Calldata { + identity: identity.clone().into(), tx_hash: blob_tx_hash, private_input: password.into_bytes().to_vec(), tx_ctx: None, - blobs: blobs.clone(), + blobs: blobs.clone().into(), index: sdk::BlobIndex(0), + tx_blob_count: blobs.len(), }; + let (program_outputs, _, _) = initial_state.clone().execute(&inputs).unwrap(); + println!("🚀 Executed: {}", program_outputs); // Generate the zk proof - let proof = prover.prove(inputs).await.unwrap(); + let proof = prover + .prove(initial_state.as_bytes().unwrap(), inputs) + .await + .unwrap(); + // Build the Proof transaction let proof_tx = ProofTransaction { proof, contract_name: contract_name.clone().into(), @@ -169,18 +172,18 @@ async fn main() { // ---- // Build the contract input - let inputs = ContractInput { - state: initial_state.as_bytes().unwrap(), + let inputs = Calldata { identity: blob_tx.identity.clone(), tx_hash: blob_tx_hash.clone(), private_input: password.into_bytes().to_vec(), tx_ctx: None, - blobs: blobs.clone(), + blobs: blobs.clone().into(), + tx_blob_count: blobs.len(), index: sdk::BlobIndex(0), }; // Generate the zk proof - let proof = prover.prove(inputs).await.unwrap(); + let proof = prover.prove(initial_state.commit(), inputs).await.unwrap(); let proof_tx = ProofTransaction { proof, @@ -192,5 +195,6 @@ async fn main() { println!("✅ Proof tx sent. Tx hash: {}", proof_tx_hash); } } - } + }; + Ok(()) } diff --git a/simple-identity/methods/Cargo.toml b/simple-identity/methods/Cargo.toml index f663ffa..5fe8d97 100644 --- a/simple-identity/methods/Cargo.toml +++ b/simple-identity/methods/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [build-dependencies] -risc0-build = { version = "1.2.4" } +risc0-build = { version = "2.1.0" } [package.metadata.risc0] methods = ["guest"] diff --git a/simple-identity/methods/guest/Cargo.lock b/simple-identity/methods/guest/Cargo.lock index 802c9fb..81c2b59 100644 --- a/simple-identity/methods/guest/Cargo.lock +++ b/simple-identity/methods/guest/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "anyhow" version = "1.0.97" @@ -22,21 +28,24 @@ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "ark-bn254" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ "ark-ec", "ark-ff", + "ark-r1cs-std", "ark-std", ] [[package]] name = "ark-crypto-primitives" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ + "ahash", + "ark-crypto-primitives-macros", "ark-ec", "ark-ff", "ark-relations", @@ -46,74 +55,91 @@ dependencies = [ "blake2", "derivative", "digest", + "fnv", + "merlin", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ark-crypto-primitives-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash", "ark-ff", "ark-poly", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown", "itertools", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", "digest", + "educe", "itertools", "num-bigint", "num-traits", "paste", - "rustc_version", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "ark-groth16" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ "ark-crypto-primitives", "ark-ec", @@ -126,22 +152,41 @@ dependencies = [ [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ + "ahash", "ark-ff", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-std", + "educe", + "num-bigint", + "num-integer", + "num-traits", + "tracing", ] [[package]] name = "ark-relations" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ "ark-ff", "ark-std", @@ -151,32 +196,33 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive", "ark-std", + "arrayvec", "digest", "num-bigint", ] [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "ark-snark" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ "ark-ff", "ark-relations", @@ -186,20 +232,32 @@ dependencies = [ [[package]] name = "ark-std" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -238,9 +296,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ "borsh-derive", "cfg_aliases", @@ -248,9 +306,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate", @@ -297,6 +355,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "const-oid" version = "0.9.6" @@ -372,6 +436,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "unicode-xid", +] + [[package]] name = "digest" version = "0.10.7" @@ -390,6 +475,18 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "either" version = "1.13.0" @@ -402,12 +499,50 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.5.0" @@ -465,20 +600,14 @@ dependencies = [ "risc0-zkvm", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] [[package]] name = "hex" @@ -494,27 +623,35 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hyle-contract-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", "hyle-model", "risc0-zkvm", "serde", + "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hyle-model" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", + "derive_more", "hex", "readonly", "serde", "strum", ] +[[package]] +name = "include_bytes_aligned" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" + [[package]] name = "indexmap" version = "2.7.0" @@ -522,14 +659,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -540,6 +677,24 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + [[package]] name = "libc" version = "0.2.169" @@ -573,6 +728,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core", + "zeroize", +] + [[package]] name = "metal" version = "0.29.0" @@ -588,6 +755,12 @@ dependencies = [ "paste", ] +[[package]] +name = "no_std_strings" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" + [[package]] name = "num-bigint" version = "0.4.6" @@ -643,6 +816,18 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -718,24 +903,28 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d893807e609dd44942644aef5137ad87d178a032c5932b0c68cdec538c3370" +checksum = "0f147f96a8a3058e699a5d39fc7e59d982f633751543ff4437cc0fb21f40b2e0" dependencies = [ "anyhow", "borsh", + "derive_more", "elf", + "lazy_static", + "postcard", "risc0-zkp", "risc0-zkvm-platform", + "semver", "serde", "tracing", ] [[package]] name = "risc0-circuit-keccak" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d1d4f248ccf111a9d58a6cd9ae5bfb4c3830e100e75874c39622a2952ef5a9" +checksum = "dc6af6fc80443a05d9e8e25aeba78082fc58e8a3c6a6b92017cae0a404494ba9" dependencies = [ "anyhow", "bytemuck", @@ -749,9 +938,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ab005ed38c1119c0511b9260cd18d95adbb226ad849eccfdb650eebecd769c" +checksum = "1c7bdd11df4ed470b3c032ac4c5bfb2729f6151af33ee255b66169de0c35611e" dependencies = [ "anyhow", "bytemuck", @@ -764,35 +953,38 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.2.5" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d64420292f716e468cba1e17eb56146a525d612d967ee09566eda80b423a54a" +checksum = "c98a4d9e438aac2e661b8376f6dd48b17a0949b29dbb0aed6e88e62de0bd5940" dependencies = [ "anyhow", - "metal", + "bit-vec", + "bytemuck", + "derive_more", + "paste", "risc0-binfmt", "risc0-core", "risc0-zkp", - "risc0-zkvm-platform", "serde", "tracing", ] [[package]] name = "risc0-core" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2492abd92da4eb2a6e5e9e74757d00b1c29c03bb867266c85752cb22a03a920" +checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" dependencies = [ "bytemuck", + "bytemuck_derive", "rand_core", ] [[package]] name = "risc0-groth16" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017c18151e017a154f4b4bbeec2a0656a3a7822fab3cd0dc1a15e2654dde4fe" +checksum = "a800c55717c52f764325bdb18a164843d417a4c8c8a123b7d4206705c11a54c3" dependencies = [ "anyhow", "ark-bn254", @@ -809,11 +1001,21 @@ dependencies = [ "stability", ] +[[package]] +name = "risc0-zkos-v1compat" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa44e7cc6642e621c6f3eea56f57a765f8e599bf327f4d0f74921693234a5d62" +dependencies = [ + "include_bytes_aligned", + "no_std_strings", +] + [[package]] name = "risc0-zkp" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a6e3c078d7a7d27eda9383db8d080f7200ac4e5e65c1971d454a0286c00cae" +checksum = "023ed128cab28e4078330fffb65e9d079b3198958e3de6835f70c7ff285afeb4" dependencies = [ "anyhow", "blake2", @@ -830,18 +1032,20 @@ dependencies = [ "risc0-zkvm-platform", "serde", "sha2 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", + "stability", "tracing", ] [[package]] name = "risc0-zkvm" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd97c60815994da62fa000dec9470c0d0e3045a554354e279695f2213b0182f" +checksum = "5881af78a17ca292037ef38383233f8d617ab679d68cc07c865e3ddabef1db80" dependencies = [ "anyhow", "borsh", "bytemuck", + "derive_more", "getrandom", "hex", "risc0-binfmt", @@ -850,6 +1054,7 @@ dependencies = [ "risc0-circuit-rv32im", "risc0-core", "risc0-groth16", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", @@ -862,9 +1067,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e0235c87d8e18f13da5c71bfe69b1beb7c08694c75d19eae9dbed09a59c57" +checksum = "fed76ab12e5af4c93a3996e0609696cfdd0caebe8746af171ef583fa6e4af134" dependencies = [ "bytemuck", "cfg-if", @@ -883,15 +1088,6 @@ dependencies = [ "paste", ] -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "ryu" version = "1.0.18" @@ -903,6 +1099,9 @@ name = "semver" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +dependencies = [ + "serde", +] [[package]] name = "serde" @@ -957,6 +1156,12 @@ dependencies = [ "digest", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stability" version = "0.2.1" @@ -1072,6 +1277,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "valuable" version = "0.1.0" diff --git a/simple-identity/methods/guest/Cargo.toml b/simple-identity/methods/guest/Cargo.toml index 3b9ee74..dc59fd4 100644 --- a/simple-identity/methods/guest/Cargo.toml +++ b/simple-identity/methods/guest/Cargo.toml @@ -6,7 +6,9 @@ edition = "2021" [workspace] [dependencies] -sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", features = ["risc0"], tag = "v0.13.0-rc.1" } -contract-identity = { path = "../../contract"} +sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", features = [ + "risc0", +], tag = "v0.13.0-rc.4" } +contract-identity = { path = "../../contract" } -risc0-zkvm = { version = "1.2.5", default-features = false, features = ['std'] } +risc0-zkvm = { version = "2.0.1", default-features = false, features = ['std'] } diff --git a/simple-identity/methods/guest/src/main.rs b/simple-identity/methods/guest/src/main.rs index f4c4ad9..9bc8719 100644 --- a/simple-identity/methods/guest/src/main.rs +++ b/simple-identity/methods/guest/src/main.rs @@ -3,16 +3,19 @@ extern crate alloc; +use alloc::vec::Vec; use contract_identity::IdentityContractState; use sdk::guest::execute; use sdk::guest::GuestEnv; use sdk::guest::Risc0Env; +use sdk::Calldata; risc0_zkvm::guest::entry!(main); fn main() { let env = Risc0Env {}; - let input = env.read(); - let (_, output) = execute::(&input); + let (commitment_metadata, calldata): (Vec, Calldata) = env.read(); + + let output = execute::(&commitment_metadata, &calldata); env.commit(&output); } diff --git a/simple-token-sp1/README.md b/simple-token-sp1/README.md index 1d5ca0c..1fb8efb 100644 --- a/simple-token-sp1/README.md +++ b/simple-token-sp1/README.md @@ -33,8 +33,8 @@ cargo run --release -- register 1000 ```sh cd script -cargo run --release -- transfer faucet.simple_token bob.simple_token 100 +cargo run --release -- transfer faucet@simple_token bob@simple_token 100 ``` -This will send the transactions to transfer 100 token from faucet to bob. The suffix `.simple_token` is for identity management. +This will send the transactions to transfer 100 token from faucet to bob. The suffix `@simple_token` is for identity management. It is the default name of this contract when it was registered. See [hyle documentation](https://docs.hyle.eu/developers/general-doc/identity/) for further details. diff --git a/simple-token-sp1/script/src/bin/main.rs b/simple-token-sp1/script/src/bin/main.rs index df59e0c..3131106 100644 --- a/simple-token-sp1/script/src/bin/main.rs +++ b/simple-token-sp1/script/src/bin/main.rs @@ -60,7 +60,7 @@ async fn main() -> anyhow::Result<()> { match cli.command { Commands::Register { supply } => { // Build initial state of contract - let initial_state = SimpleToken::new(supply, format!("faucet.{}", contract_name)); + let initial_state = SimpleToken::new(supply, format!("faucet@{}", contract_name)); println!("Initial state: {:?}", initial_state); let vk = serde_json::to_vec(&prover.vk).unwrap(); diff --git a/simple-token/Cargo.lock b/simple-token/Cargo.lock index fabaf05..da975dc 100644 --- a/simple-token/Cargo.lock +++ b/simple-token/Cargo.lock @@ -38,6 +38,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -111,21 +117,24 @@ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "ark-bn254" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ "ark-ec", "ark-ff", + "ark-r1cs-std", "ark-std", ] [[package]] name = "ark-crypto-primitives" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ + "ahash", + "ark-crypto-primitives-macros", "ark-ec", "ark-ff", "ark-relations", @@ -135,74 +144,91 @@ dependencies = [ "blake2", "derivative", "digest", + "fnv", + "merlin", "sha2", ] +[[package]] +name = "ark-crypto-primitives-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash", "ark-ff", "ark-poly", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools 0.13.0", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", "digest", - "itertools 0.10.5", + "educe", + "itertools 0.13.0", "num-bigint", "num-traits", "paste", - "rustc_version", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-groth16" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ "ark-crypto-primitives", "ark-ec", @@ -215,22 +241,41 @@ dependencies = [ [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ + "ahash", "ark-ff", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown 0.15.2", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-std", + "educe", + "num-bigint", + "num-integer", + "num-traits", + "tracing", ] [[package]] name = "ark-relations" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ "ark-ff", "ark-std", @@ -240,32 +285,33 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive", "ark-std", + "arrayvec", "digest", "num-bigint", ] [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.100", ] [[package]] name = "ark-snark" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ "ark-ff", "ark-relations", @@ -275,19 +321,25 @@ dependencies = [ [[package]] name = "ark-std" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", ] [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" @@ -295,6 +347,60 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "axum" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -325,6 +431,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -375,9 +487,9 @@ dependencies = [ [[package]] name = "bonsai-sdk" -version = "1.2.5" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f5c3a53e931b20e0535a53fbf4de86e164c07c7f329beed25f25280c4dd7d4" +checksum = "0bce8d6acc5286a16e94c29e9c885d1869358885e08a6feeb6bc54e36fe20055" dependencies = [ "duplicate", "maybe-async", @@ -389,9 +501,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ "borsh-derive", "cfg_aliases", @@ -399,9 +511,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate", @@ -436,6 +548,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.10.1" @@ -465,16 +583,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] @@ -551,6 +669,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "colorchoice" version = "1.0.3" @@ -674,6 +798,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.100", +] + [[package]] name = "derive_more" version = "2.0.1" @@ -761,6 +916,18 @@ dependencies = [ "proc-macro-error", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "either" version = "1.15.0" @@ -773,6 +940,18 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -782,6 +961,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -810,15 +1009,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - [[package]] name = "foreign-types" version = "0.5.0" @@ -826,7 +1016,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared 0.3.1", + "foreign-types-shared", ] [[package]] @@ -840,12 +1030,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -861,6 +1045,21 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -877,6 +1076,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -912,6 +1122,7 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -970,25 +1181,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "h2" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.8.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -997,9 +1189,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] @@ -1009,6 +1201,18 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] [[package]] name = "heck" @@ -1044,6 +1248,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" name = "host" version = "0.1.0" dependencies = [ + "anyhow", "borsh", "clap", "contract", @@ -1077,12 +1282,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -1094,10 +1299,16 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + [[package]] name = "hyle-bonsai-runner" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "bincode", @@ -1105,6 +1316,7 @@ dependencies = [ "borsh", "bytemuck", "hex", + "hyle-net", "risc0-zkvm", "serde", "tracing", @@ -1112,14 +1324,14 @@ dependencies = [ [[package]] name = "hyle-client-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "borsh", "hyle-bonsai-runner", "hyle-contract-sdk", - "reqwest", + "hyle-net", "risc0-zkvm", "serde", "serde_json", @@ -1128,18 +1340,19 @@ dependencies = [ [[package]] name = "hyle-contract-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", "hyle-model", "serde", + "sha2", ] [[package]] name = "hyle-model" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "anyhow", "base64", @@ -1152,11 +1365,33 @@ dependencies = [ "serde_json", "serde_with", "sha3", - "strum", - "strum_macros", + "strum 0.27.1", + "strum_macros 0.27.1", "utoipa", ] +[[package]] +name = "hyle-net" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" +dependencies = [ + "anyhow", + "axum", + "borsh", + "bytes", + "futures", + "http-body-util", + "hyle-contract-sdk", + "hyper", + "hyper-util", + "paste", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hyper" version = "1.6.0" @@ -1166,10 +1401,10 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1195,22 +1430,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -1398,6 +1617,12 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "include_bytes_aligned" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" + [[package]] name = "indexmap" version = "1.9.3" @@ -1434,9 +1659,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1503,6 +1728,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] [[package]] name = "libc" @@ -1572,6 +1800,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "maybe-async" version = "0.2.10" @@ -1589,6 +1823,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core", + "zeroize", +] + [[package]] name = "metal" version = "0.29.0" @@ -1598,7 +1844,7 @@ dependencies = [ "bitflags 2.9.0", "block", "core-graphics-types", - "foreign-types 0.5.0", + "foreign-types", "log", "objc", "paste", @@ -1638,21 +1884,10 @@ dependencies = [ ] [[package]] -name = "native-tls" -version = "0.2.14" +name = "no_std_strings" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] +checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" [[package]] name = "nu-ansi-term" @@ -1732,50 +1967,6 @@ version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" -[[package]] -name = "openssl" -version = "0.10.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" -dependencies = [ - "bitflags 2.9.0", - "cfg-if", - "foreign-types 0.3.2", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -1836,10 +2027,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.32" +name = "postcard" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] [[package]] name = "powerfmt" @@ -2095,23 +2292,19 @@ checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -2123,9 +2316,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-util", "tower", @@ -2155,43 +2346,52 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d893807e609dd44942644aef5137ad87d178a032c5932b0c68cdec538c3370" +checksum = "0f147f96a8a3058e699a5d39fc7e59d982f633751543ff4437cc0fb21f40b2e0" dependencies = [ "anyhow", "borsh", + "derive_more", "elf", + "lazy_static", + "postcard", "risc0-zkp", "risc0-zkvm-platform", + "semver", "serde", "tracing", ] [[package]] name = "risc0-build" -version = "1.2.5" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98bcfd51f182f7e94209249ca3a0c64df0ab0dbfe151bd5fcbe2b708c4f9f17f" +checksum = "eb85162c19a2ba2151c02f1f157804cd89e163ca694afda399fc3f415c03a3de" dependencies = [ "anyhow", "cargo_metadata", + "derive_builder", "dirs", "docker-generate", "hex", "risc0-binfmt", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", + "rzup", + "semver", "serde", "serde_json", + "stability", "tempfile", ] [[package]] name = "risc0-circuit-keccak" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d1d4f248ccf111a9d58a6cd9ae5bfb4c3830e100e75874c39622a2952ef5a9" +checksum = "dc6af6fc80443a05d9e8e25aeba78082fc58e8a3c6a6b92017cae0a404494ba9" dependencies = [ "anyhow", "bytemuck", @@ -2205,9 +2405,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ab005ed38c1119c0511b9260cd18d95adbb226ad849eccfdb650eebecd769c" +checksum = "1c7bdd11df4ed470b3c032ac4c5bfb2729f6151af33ee255b66169de0c35611e" dependencies = [ "anyhow", "bytemuck", @@ -2220,35 +2420,38 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.2.5" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d64420292f716e468cba1e17eb56146a525d612d967ee09566eda80b423a54a" +checksum = "c98a4d9e438aac2e661b8376f6dd48b17a0949b29dbb0aed6e88e62de0bd5940" dependencies = [ "anyhow", - "metal", + "bit-vec", + "bytemuck", + "derive_more", + "paste", "risc0-binfmt", "risc0-core", "risc0-zkp", - "risc0-zkvm-platform", "serde", "tracing", ] [[package]] name = "risc0-core" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2492abd92da4eb2a6e5e9e74757d00b1c29c03bb867266c85752cb22a03a920" +checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" dependencies = [ "bytemuck", + "bytemuck_derive", "rand_core", ] [[package]] name = "risc0-groth16" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017c18151e017a154f4b4bbeec2a0656a3a7822fab3cd0dc1a15e2654dde4fe" +checksum = "a800c55717c52f764325bdb18a164843d417a4c8c8a123b7d4206705c11a54c3" dependencies = [ "anyhow", "ark-bn254", @@ -2265,11 +2468,21 @@ dependencies = [ "stability", ] +[[package]] +name = "risc0-zkos-v1compat" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa44e7cc6642e621c6f3eea56f57a765f8e599bf327f4d0f74921693234a5d62" +dependencies = [ + "include_bytes_aligned", + "no_std_strings", +] + [[package]] name = "risc0-zkp" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a6e3c078d7a7d27eda9383db8d080f7200ac4e5e65c1971d454a0286c00cae" +checksum = "023ed128cab28e4078330fffb65e9d079b3198958e3de6835f70c7ff285afeb4" dependencies = [ "anyhow", "blake2", @@ -2286,14 +2499,15 @@ dependencies = [ "risc0-zkvm-platform", "serde", "sha2", + "stability", "tracing", ] [[package]] name = "risc0-zkvm" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd97c60815994da62fa000dec9470c0d0e3045a554354e279695f2213b0182f" +checksum = "5881af78a17ca292037ef38383233f8d617ab679d68cc07c865e3ddabef1db80" dependencies = [ "anyhow", "bincode", @@ -2301,6 +2515,7 @@ dependencies = [ "borsh", "bytemuck", "bytes", + "derive_more", "getrandom 0.2.15", "hex", "lazy-regex", @@ -2312,9 +2527,11 @@ dependencies = [ "risc0-circuit-rv32im", "risc0-core", "risc0-groth16", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", + "rzup", "semver", "serde", "sha2", @@ -2325,9 +2542,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e0235c87d8e18f13da5c71bfe69b1beb7c08694c75d19eae9dbed09a59c57" +checksum = "fed76ab12e5af4c93a3996e0609696cfdd0caebe8746af171ef583fa6e4af134" dependencies = [ "bytemuck", "cfg-if", @@ -2358,15 +2575,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "1.0.2" @@ -2436,12 +2644,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "schannel" -version = "0.1.27" +name = "rzup" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "400558bf12d4292a7804093b60a437ba8b0219ea7d53716b2c010a0d31e5f4a8" dependencies = [ - "windows-sys 0.59.0", + "semver", + "serde", + "strum 0.26.3", + "tempfile", + "thiserror 2.0.12", + "toml", + "yaml-rust2", ] [[package]] @@ -2450,29 +2664,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.26" @@ -2514,6 +2705,25 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2626,6 +2836,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stability" version = "0.2.1" @@ -2648,12 +2864,34 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + [[package]] name = "strum" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", +] + [[package]] name = "strum_macros" version = "0.27.1" @@ -2715,27 +2953,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tempfile" version = "3.18.0" @@ -2895,16 +3112,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.2" @@ -2917,9 +3124,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -2928,11 +3135,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -2941,6 +3163,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap 2.8.0", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -2958,6 +3182,7 @@ dependencies = [ "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -3131,12 +3356,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -3525,6 +3744,17 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "yaml-rust2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + [[package]] name = "yoke" version = "0.7.5" diff --git a/simple-token/Cargo.toml b/simple-token/Cargo.toml index 775e6ce..0f7139c 100644 --- a/simple-token/Cargo.toml +++ b/simple-token/Cargo.toml @@ -3,8 +3,8 @@ resolver = "2" members = ["host", "contract", "methods"] [workspace.dependencies] -sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", tag = "v0.13.0-rc.1" } # don't forget to update methods/guest/Cargo.toml -client-sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-client-sdk", tag = "v0.13.0-rc.1" } +sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", tag = "v0.13.0-rc.4" } # don't forget to update methods/guest/Cargo.toml +client-sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-client-sdk", tag = "v0.13.0-rc.4" } # Always optimize; building and running the guest takes much longer without optimization. [profile.dev] diff --git a/simple-token/README.md b/simple-token/README.md index fa99b68..c8ac351 100644 --- a/simple-token/README.md +++ b/simple-token/README.md @@ -6,13 +6,20 @@ Welcome to the simple_token Risc0 example. - [Install Rust](https://www.rust-lang.org/tools/install) (you'll need `rustup` and Cargo). - For our example, [install RISC Zero](https://dev.risczero.com/api/zkvm/install). -- [Start a single-node devnet](https://docs.hyle.eu/developers/quickstart/devnet/). We recommend using [dev-mode](https://dev.risczero.com/api/generating-proofs/dev-mode) with `-e RISC0_DEV_MODE=1` for faster iterations during development. +- Run a local devnet node: + +Clone the [hyle](https://github.com/Hyle-org/hyle) repo, checkout the version you need, and run: + +```sh +export RISC0_DEV_MODE=1 +cargo run -- --pg +``` ## Quickstart ### Build and register the contract -To build all methods and register the smart contract on the local node [from the source](https://github.com/Hyle-org/examples/blob/simple_erc20/simple-token/host/src/main.rs), run: +To build and register the smart contract on the local node, run: ```bash cargo run -- register 1000 @@ -25,7 +32,7 @@ The expected output is `📝 Registering contract simple_token`. To transfer 2 tokens from `faucet` to `Bob`: ```bash -cargo run -- transfer faucet.simple_token bob.simple_token 2 +cargo run -- transfer faucet@simple_token bob@simple_token 2 ``` This command will: @@ -51,7 +58,7 @@ INFO hyle_verifiers: ✅ Risc0 proof verified. And on the following slot: ```bash -INFO hyle::node_state: ✨ Settled tx [...] +INFO hyle::node_state: ✨ Settled tx [...] ``` #### Check onchain balance @@ -59,21 +66,27 @@ INFO hyle::node_state: ✨ Settled tx [...] Verify onchain balances: ```bash -cargo run -- balance faucet.simple_token -cargo run -- balance bob.simple_token +cargo run -- balance faucet@simple_token +cargo run -- balance bob@simple_token ``` !!! note - In this example, we do not verify the identity of the person who initiates the transaction. We use `.simple_token` as a suffix for the "from" and "to" transfer fields: usually, we'd use the identity scheme as the suffix. +In this example, we do not verify the identity of the person who initiates the transaction. We use `@simple_token` as a suffix for the "from" and "to" transfer fields: usually, we'd use the identity scheme as the suffix. ### Executing the Project Locally in Development Mode -During development, faster iteration upon code changes can be achieved by leveraging [dev-mode], we strongly suggest activating it during your early development phase. +During development, faster iteration upon code changes can be achieved by leveraging [dev-mode], we strongly suggest activating it during your early development phase. ```bash RISC0_DEV_MODE=1 cargo run ``` +### Execute the contract & send a tx on-chain + +```sh +RISC0_DEV_MODE=1 cargo run -- increment +``` + @@ -105,7 +118,7 @@ applications, which we think is a good starting point for your applications. ```text project_name ├── Cargo.toml -├── contract +├── contract │ ├── Cargo.toml │ └── src │ └── lib.rs <-- [Contract code goes here, common to host & guest] @@ -125,6 +138,7 @@ project_name ``` + [cargo-risczero]: https://docs.rs/cargo-risczero [crates]: https://github.com/risc0/risc0/blob/main/README.md#rust-binaries [dev-docs]: https://dev.risczero.com diff --git a/simple-token/contract/Cargo.toml b/simple-token/contract/Cargo.toml index 03d324d..1b5ef3c 100644 --- a/simple-token/contract/Cargo.toml +++ b/simple-token/contract/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] sdk = { workspace = true } serde = { version = "1.0", default-features = false, features = [ - "derive", - "alloc", + "derive", + "alloc", ] } -borsh = { version = "1.5.5" } +borsh = { version = "1.5.7" } diff --git a/simple-token/contract/src/lib.rs b/simple-token/contract/src/lib.rs index fc179d5..00ec02b 100644 --- a/simple-token/contract/src/lib.rs +++ b/simple-token/contract/src/lib.rs @@ -14,12 +14,11 @@ use serde::{Deserialize, Serialize}; use sdk::RunResult; -impl sdk::HyleContract for SimpleToken { +impl sdk::ZkContract for SimpleToken { /// Entry point of the contract's logic - fn execute(&mut self, contract_input: &sdk::ContractInput) -> RunResult { + fn execute(&mut self, calldata: &sdk::Calldata) -> RunResult { // Parse contract inputs - let (action, ctx) = - sdk::utils::parse_raw_contract_input::(contract_input)?; + let (action, ctx) = sdk::utils::parse_raw_calldata::(calldata)?; // Execute the given action let res = match action { @@ -105,3 +104,21 @@ impl From for SimpleToken { .unwrap() } } + +impl sdk::ContractAction for SimpleTokenAction { + fn as_blob( + &self, + contract_name: sdk::ContractName, + caller: Option, + callees: Option>, + ) -> sdk::Blob { + sdk::Blob { + contract_name, + data: sdk::BlobData::from(sdk::StructuredBlobData { + caller, + callees, + parameters: self.clone(), + }), + } + } +} diff --git a/simple-token/host/Cargo.toml b/simple-token/host/Cargo.toml index 05cc767..daf0397 100644 --- a/simple-token/host/Cargo.toml +++ b/simple-token/host/Cargo.toml @@ -6,10 +6,11 @@ edition = "2021" [dependencies] sdk = { workspace = true } client-sdk = { workspace = true, features = ["rest", "risc0"] } -contract = { path = "../contract", package = "contract"} +contract = { path = "../contract", package = "contract" } methods = { path = "../methods" } tracing-subscriber = { version = "0.3", features = ["env-filter"] } clap = { version = "4.5.23", features = ["derive"] } -borsh = "1.5.5" +borsh = "1.5.7" tokio = { version = "1.42.0", features = ["full", "tracing"] } +anyhow = "1.0.96" diff --git a/simple-token/host/src/main.rs b/simple-token/host/src/main.rs index 78523fb..10a2b2c 100644 --- a/simple-token/host/src/main.rs +++ b/simple-token/host/src/main.rs @@ -1,3 +1,4 @@ +use anyhow::Result; use clap::{Parser, Subcommand}; use client_sdk::helpers::risc0::Risc0Prover; use contract::SimpleToken; @@ -5,7 +6,7 @@ use contract::SimpleTokenAction; use sdk::api::APIRegisterContract; use sdk::BlobTransaction; use sdk::ProofTransaction; -use sdk::{ContractInput, HyleContract}; +use sdk::{Calldata, ZkContract}; // These constants represent the RISC-V ELF and the image ID generated by risc0-build. // The ELF is used for proving and the ID is used for verification. @@ -18,13 +19,10 @@ struct Cli { #[command(subcommand)] command: Commands, - #[clap(long, short)] - reproducible: bool, - #[arg(long, default_value = "http://localhost:4321")] pub host: String, - #[arg(long, default_value = "simple_token")] + #[arg(long, default_value = "counter")] pub contract_name: String, } @@ -44,25 +42,25 @@ enum Commands { } #[tokio::main] -async fn main() { +async fn main() -> Result<()> { // 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(); - let cli = Cli::parse(); - let client = client_sdk::rest_client::NodeApiHttpClient::new(cli.host).unwrap(); - + // Client to send requests to the node + let client = client_sdk::rest_client::NodeApiHttpClient::new(cli.host)?; let contract_name = &cli.contract_name; + // Will be used to generate zkProof of the execution. let prover = Risc0Prover::new(GUEST_ELF); match cli.command { Commands::Register { supply } => { // Build initial state of contract let initial_state = - SimpleToken::new(supply, format!("faucet.{}", contract_name).into()); + SimpleToken::new(supply, format!("faucet@{}", contract_name).into()); println!("Initial state: {:?}", initial_state); // Send the transaction to register the contract @@ -73,8 +71,7 @@ async fn main() { state_commitment: initial_state.commit(), contract_name: contract_name.clone().into(), }) - .await - .unwrap(); + .await?; println!("✅ Register contract tx sent. Tx hash: {}", res); } Commands::Balance { of } => { @@ -122,13 +119,13 @@ async fn main() { // ---- // Build the contract input - let inputs = ContractInput { - state: initial_state.as_bytes().unwrap(), + let inputs = Calldata { identity: from.clone().into(), tx_hash: blob_tx_hash, private_input: vec![], tx_ctx: None, - blobs: blobs.clone(), + blobs: blobs.clone().into(), + tx_blob_count: blobs.len(), index: sdk::BlobIndex(0), }; @@ -137,8 +134,9 @@ async fn main() { // Generate the zk proof // - let proof = prover.prove(inputs).await.unwrap(); + let proof = prover.prove(initial_state.commit(), inputs).await.unwrap(); + // Build the Proof transaction let proof_tx = ProofTransaction { proof, contract_name: contract_name.clone().into(), @@ -149,4 +147,5 @@ async fn main() { println!("✅ Proof tx sent. Tx hash: {}", proof_tx_hash); } } + Ok(()) } diff --git a/simple-token/methods/Cargo.toml b/simple-token/methods/Cargo.toml index f3bbd70..792604a 100644 --- a/simple-token/methods/Cargo.toml +++ b/simple-token/methods/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [build-dependencies] -risc0-build = { version = "1.2.4" } +risc0-build = { version = "2.1.0" } [package.metadata.risc0] methods = ["guest"] diff --git a/simple-token/methods/guest/Cargo.lock b/simple-token/methods/guest/Cargo.lock index a06812a..e2f2b15 100644 --- a/simple-token/methods/guest/Cargo.lock +++ b/simple-token/methods/guest/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "anyhow" version = "1.0.95" @@ -22,21 +28,24 @@ checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-bn254" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ "ark-ec", "ark-ff", + "ark-r1cs-std", "ark-std", ] [[package]] name = "ark-crypto-primitives" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" dependencies = [ + "ahash", + "ark-crypto-primitives-macros", "ark-ec", "ark-ff", "ark-relations", @@ -46,74 +55,91 @@ dependencies = [ "blake2", "derivative", "digest", + "fnv", + "merlin", "sha2", ] +[[package]] +name = "ark-crypto-primitives-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash", "ark-ff", "ark-poly", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown", "itertools", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", "digest", + "educe", "itertools", "num-bigint", "num-traits", "paste", - "rustc_version", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] name = "ark-groth16" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" dependencies = [ "ark-crypto-primitives", "ark-ec", @@ -126,22 +152,41 @@ dependencies = [ [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ + "ahash", "ark-ff", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-std", + "educe", + "num-bigint", + "num-integer", + "num-traits", + "tracing", ] [[package]] name = "ark-relations" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" dependencies = [ "ark-ff", "ark-std", @@ -151,32 +196,33 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive", "ark-std", + "arrayvec", "digest", "num-bigint", ] [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] name = "ark-snark" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" dependencies = [ "ark-ff", "ark-relations", @@ -186,20 +232,32 @@ dependencies = [ [[package]] name = "ark-std" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -238,9 +296,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" dependencies = [ "borsh-derive", "cfg_aliases", @@ -248,9 +306,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" dependencies = [ "once_cell", "proc-macro-crate", @@ -297,6 +355,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "const-oid" version = "0.9.6" @@ -369,6 +433,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "unicode-xid", +] + [[package]] name = "digest" version = "0.10.7" @@ -387,6 +472,18 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.91", +] + [[package]] name = "either" version = "1.13.0" @@ -399,12 +496,50 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.5.0" @@ -462,20 +597,14 @@ dependencies = [ "risc0-zkvm", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] [[package]] name = "hex" @@ -491,27 +620,35 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hyle-contract-sdk" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", "hyle-model", "risc0-zkvm", "serde", + "sha2", ] [[package]] name = "hyle-model" -version = "0.13.0-rc.1" -source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.1#0bd510806f961ff13c0edbda57d6e2350cb706ad" +version = "0.13.0-rc.4" +source = "git+https://github.com/hyle-org/hyle?tag=v0.13.0-rc.4#b9e666191fef168e4b7fab84a585c26aa0424819" dependencies = [ "borsh", + "derive_more", "hex", "readonly", "serde", "strum", ] +[[package]] +name = "include_bytes_aligned" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" + [[package]] name = "indexmap" version = "2.7.0" @@ -519,18 +656,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + [[package]] name = "libc" version = "0.2.169" @@ -564,6 +719,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core", + "zeroize", +] + [[package]] name = "metal" version = "0.29.0" @@ -579,6 +746,12 @@ dependencies = [ "paste", ] +[[package]] +name = "no_std_strings" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" + [[package]] name = "num-bigint" version = "0.4.6" @@ -634,6 +807,18 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -709,24 +894,28 @@ dependencies = [ [[package]] name = "risc0-binfmt" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d893807e609dd44942644aef5137ad87d178a032c5932b0c68cdec538c3370" +checksum = "0f147f96a8a3058e699a5d39fc7e59d982f633751543ff4437cc0fb21f40b2e0" dependencies = [ "anyhow", "borsh", + "derive_more", "elf", + "lazy_static", + "postcard", "risc0-zkp", "risc0-zkvm-platform", + "semver", "serde", "tracing", ] [[package]] name = "risc0-circuit-keccak" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d1d4f248ccf111a9d58a6cd9ae5bfb4c3830e100e75874c39622a2952ef5a9" +checksum = "dc6af6fc80443a05d9e8e25aeba78082fc58e8a3c6a6b92017cae0a404494ba9" dependencies = [ "anyhow", "bytemuck", @@ -740,9 +929,9 @@ dependencies = [ [[package]] name = "risc0-circuit-recursion" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ab005ed38c1119c0511b9260cd18d95adbb226ad849eccfdb650eebecd769c" +checksum = "1c7bdd11df4ed470b3c032ac4c5bfb2729f6151af33ee255b66169de0c35611e" dependencies = [ "anyhow", "bytemuck", @@ -755,35 +944,38 @@ dependencies = [ [[package]] name = "risc0-circuit-rv32im" -version = "1.2.5" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d64420292f716e468cba1e17eb56146a525d612d967ee09566eda80b423a54a" +checksum = "c98a4d9e438aac2e661b8376f6dd48b17a0949b29dbb0aed6e88e62de0bd5940" dependencies = [ "anyhow", - "metal", + "bit-vec", + "bytemuck", + "derive_more", + "paste", "risc0-binfmt", "risc0-core", "risc0-zkp", - "risc0-zkvm-platform", "serde", "tracing", ] [[package]] name = "risc0-core" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2492abd92da4eb2a6e5e9e74757d00b1c29c03bb867266c85752cb22a03a920" +checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" dependencies = [ "bytemuck", + "bytemuck_derive", "rand_core", ] [[package]] name = "risc0-groth16" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017c18151e017a154f4b4bbeec2a0656a3a7822fab3cd0dc1a15e2654dde4fe" +checksum = "a800c55717c52f764325bdb18a164843d417a4c8c8a123b7d4206705c11a54c3" dependencies = [ "anyhow", "ark-bn254", @@ -800,11 +992,21 @@ dependencies = [ "stability", ] +[[package]] +name = "risc0-zkos-v1compat" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa44e7cc6642e621c6f3eea56f57a765f8e599bf327f4d0f74921693234a5d62" +dependencies = [ + "include_bytes_aligned", + "no_std_strings", +] + [[package]] name = "risc0-zkp" -version = "1.2.5" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a6e3c078d7a7d27eda9383db8d080f7200ac4e5e65c1971d454a0286c00cae" +checksum = "023ed128cab28e4078330fffb65e9d079b3198958e3de6835f70c7ff285afeb4" dependencies = [ "anyhow", "blake2", @@ -821,18 +1023,20 @@ dependencies = [ "risc0-zkvm-platform", "serde", "sha2", + "stability", "tracing", ] [[package]] name = "risc0-zkvm" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd97c60815994da62fa000dec9470c0d0e3045a554354e279695f2213b0182f" +checksum = "5881af78a17ca292037ef38383233f8d617ab679d68cc07c865e3ddabef1db80" dependencies = [ "anyhow", "borsh", "bytemuck", + "derive_more", "getrandom", "hex", "risc0-binfmt", @@ -841,6 +1045,7 @@ dependencies = [ "risc0-circuit-rv32im", "risc0-core", "risc0-groth16", + "risc0-zkos-v1compat", "risc0-zkp", "risc0-zkvm-platform", "rrs-lib", @@ -853,9 +1058,9 @@ dependencies = [ [[package]] name = "risc0-zkvm-platform" -version = "1.2.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e0235c87d8e18f13da5c71bfe69b1beb7c08694c75d19eae9dbed09a59c57" +checksum = "fed76ab12e5af4c93a3996e0609696cfdd0caebe8746af171ef583fa6e4af134" dependencies = [ "bytemuck", "cfg-if", @@ -874,20 +1079,14 @@ dependencies = [ "paste", ] -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "semver" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +dependencies = [ + "serde", +] [[package]] name = "serde" @@ -920,6 +1119,12 @@ dependencies = [ "digest", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stability" version = "0.2.1" @@ -1035,6 +1240,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "valuable" version = "0.1.0" diff --git a/simple-token/methods/guest/Cargo.toml b/simple-token/methods/guest/Cargo.toml index 124bb2e..cb3f754 100644 --- a/simple-token/methods/guest/Cargo.toml +++ b/simple-token/methods/guest/Cargo.toml @@ -6,7 +6,9 @@ edition = "2021" [workspace] [dependencies] -sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", features = ["risc0"], tag = "v0.13.0-rc.1" } -contract = { path = "../../contract", package = "contract"} +sdk = { git = "https://github.com/hyle-org/hyle", package = "hyle-contract-sdk", features = [ + "risc0", +], tag = "v0.13.0-rc.4" } +contract = { path = "../../contract", package = "contract" } -risc0-zkvm = { version = "1.2.5", default-features = false, features = ['std'] } +risc0-zkvm = { version = "2.0.1", default-features = false, features = ['std'] } diff --git a/simple-token/methods/guest/src/main.rs b/simple-token/methods/guest/src/main.rs index 9ecadb1..f3306d2 100644 --- a/simple-token/methods/guest/src/main.rs +++ b/simple-token/methods/guest/src/main.rs @@ -3,16 +3,19 @@ extern crate alloc; +use alloc::vec::Vec; use contract::SimpleToken; use sdk::guest::execute; use sdk::guest::GuestEnv; use sdk::guest::Risc0Env; +use sdk::Calldata; risc0_zkvm::guest::entry!(main); fn main() { let env = Risc0Env {}; - let input = env.read(); - let (_, output) = execute::(&input); + let (commitment_metadata, calldata): (Vec, Calldata) = env.read(); + + let output = execute::(&commitment_metadata, &calldata); env.commit(&output); } diff --git a/ticket-app/README.md b/ticket-app/README.md index 4a91383..46618c7 100644 --- a/ticket-app/README.md +++ b/ticket-app/README.md @@ -27,28 +27,27 @@ cargo run -- --contract-name id register-contract Now we have an identity contract called `id` we can use to declare a user. Let's declare one! ```bash -cargo run -- --contract-name id register-identity bob.id pass -cargo run -- --contract-name id register-identity alice.id pass +cargo run -- --contract-name id register-identity bob@id pass +cargo run -- --contract-name id register-identity alice@id pass ``` -We now have a user called *bob* on the contract `id`. We can refer to it with `bob.id`. His password is `pass`. Same for *alice*. +We now have a user called _bob_ on the contract `id`. We can refer to it with `bob@id`. His password is `pass`. Same for _alice_. Let's verify it quickly with: ```bash -cargo run -- --contract-name id verify-identity bob.id pass 0 +cargo run -- --contract-name id verify-identity bob@id pass 0 ``` -`0` is the nonce. Every time we verify successfully *bob*'s identity, it increments. Now if we want to verify it again, we should use `1` as nonce. -And for *alice*: +`0` is the nonce. Every time we verify successfully _bob_'s identity, it increments. Now if we want to verify it again, we should use `1` as nonce. +And for _alice_: ```bash -cargo run -- --contract-name id verify-identity alice.id pass 0 +cargo run -- --contract-name id verify-identity alice@id pass 0 ``` ### Filling Bob's and Alice's bag - Go to `./simple-token` folder and run: ```bash @@ -59,30 +58,29 @@ On the node's logs, you will see: > 📝 Registering new contract simple_token -You just registered a token contract named simple-token with an initial supply of 1000. Now let's transfer some tokens to our user *bob*. +You just registered a token contract named simple-token with an initial supply of 1000. Now let's transfer some tokens to our user _bob_. -To send `50` tokens to *bob* and `10` to *alice* +To send `50` tokens to _bob_ and `10` to _alice_ ```bash -cargo run -- --contract-name simple-token transfer faucet.simple-token bob.id 50 -cargo run -- --contract-name simple-token transfer faucet.simple-token alice.id 10 +cargo run -- --contract-name simple-token transfer faucet@simple-token bob@id 50 +cargo run -- --contract-name simple-token transfer faucet@simple-token alice@id 10 ``` The node's log will show: > INFO hyle_verifiers: ✅ Risc0 proof verified. -> Check onchain balance: ```bash -cargo run -- --contract-name simple-token balance faucet.simple-token +cargo run -- --contract-name simple-token balance faucet@simple-token -cargo run -- --contract-name simple-token balance bob.id -cargo run -- --contract-name simple-token balance alice.id +cargo run -- --contract-name simple-token balance bob@id +cargo run -- --contract-name simple-token balance alice@id ``` -Now that *bob* has some tokens, let's buy him a ticket. +Now that _bob_ has some tokens, let's buy him a ticket. Register the ticket app by going to `./ticket-app` folder and running: @@ -92,30 +90,29 @@ cargo run -- --contract-name ticket-app register simple-token 15 Our ticket app is called `ticket-app`, and sells a ticket for `15` simple-token. -Let's buy a ticket for *bob*: +Let's buy a ticket for _bob_: ```bash -cargo run -- --contract-name ticket-app --user bob.id --pass pass --nonce 1 buy-ticket +cargo run -- --contract-name ticket-app --user bob@id --pass pass --nonce 1 buy-ticket ``` -Check that *bob* has a ticket: +Check that _bob_ has a ticket: ```bash -cargo run -- --contract-name ticket-app --user bob.id has-ticket +cargo run -- --contract-name ticket-app --user bob@id has-ticket ``` You can also check Bob's balance and see he now has `35` tokens. -Let's try with *alice*: +Let's try with _alice_: ```bash -cargo run -- --contract-name ticket-app --user alice.id buy-ticket +cargo run -- --contract-name ticket-app --user alice@id buy-ticket ``` Alice has insufficient balance, so the buy-ticket blob will have a failure proof and the node will print -> INFO hyle::node_state ⛈️ Settled tx [...] has failed - +> INFO hyle::node_state ⛈️ Settled tx [...] has failed ### Executing the Project Locally in Development Mode @@ -158,7 +155,7 @@ applications, which we think is a good starting point for your applications. ```text project_name ├── Cargo.toml -├── contract +├── contract │ ├── Cargo.toml │ └── src │ └── lib.rs <-- [Contract code goes here, common to host & guest] @@ -178,6 +175,7 @@ project_name ``` + [cargo-risczero]: https://docs.rs/cargo-risczero [crates]: https://github.com/risc0/risc0/blob/main/README.md#rust-binaries [dev-docs]: https://dev.risczero.com diff --git a/ticket-app/host/src/main.rs b/ticket-app/host/src/main.rs index 84d05b0..df7788b 100644 --- a/ticket-app/host/src/main.rs +++ b/ticket-app/host/src/main.rs @@ -32,7 +32,7 @@ struct Cli { #[arg(long, default_value = "simple_ticket_app")] pub contract_name: String, - #[arg(long, default_value = "examples.simple_ticket_app")] + #[arg(long, default_value = "examples@simple_ticket_app")] pub user: String, #[arg(long, default_value = "pass")] @@ -107,7 +107,7 @@ async fn main() { nonce: cli.nonce.parse().unwrap(), }; - let identity_contract_name = cli.user.rsplit_once(".").unwrap().1.to_string(); + let identity_contract_name = cli.user.rsplit_once("@").unwrap().1.to_string(); let blobs = vec![ sdk::Blob {