{"id":18757765,"url":"https://github.com/zzghzz/installzokratesonmac","last_synced_at":"2026-04-29T08:34:01.791Z","repository":{"id":101044483,"uuid":"191487615","full_name":"zzGHzz/InstallZokratesOnMac","owner":"zzGHzz","description":"Install ZoKrates on Mac with all proving schemes enabled","archived":false,"fork":false,"pushed_at":"2019-06-12T03:32:51.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-20T15:07:29.953Z","etag":null,"topics":["libsnark","mac","zokrates"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzGHzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-12T03:05:28.000Z","updated_at":"2019-06-12T03:32:53.000Z","dependencies_parsed_at":"2023-07-09T22:45:24.293Z","dependency_job_id":null,"html_url":"https://github.com/zzGHzz/InstallZokratesOnMac","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zzGHzz/InstallZokratesOnMac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzGHzz%2FInstallZokratesOnMac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzGHzz%2FInstallZokratesOnMac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzGHzz%2FInstallZokratesOnMac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzGHzz%2FInstallZokratesOnMac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzGHzz","download_url":"https://codeload.github.com/zzGHzz/InstallZokratesOnMac/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzGHzz%2FInstallZokratesOnMac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32417877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libsnark","mac","zokrates"],"created_at":"2024-11-07T17:44:32.277Z","updated_at":"2026-04-29T08:34:01.774Z","avatar_url":"https://github.com/zzGHzz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installing ZoKrates on Mac with All Proving Schemes Enabled\n\nI recently started to learn how to use ZoKrates. The default installation only supports the proving scheme G16, which is malleable, that is, an attacker can easily generate another valid proof if he/she sees a valid proof. \n\nIt took me quite some time to figure out how to properly install ZoKrates on my Mac to enable the other two proving schemes and I feel like it is worth sharing with others.\n\n## Installation Step\n\n1. Download ZoKrates using `git clone https://github.com/Zokrates/ZoKrates.git`\n\n2. Modify `$zokrates_home/zokrates_core/build.rs` as follows:\n\t\n\t```rust\n\tlet libsnark = cmake::Config::new(libsnark_source_path)\n            .define(\"WITH_SUPERCOP\", \"OFF\")\n            .define(\"WITH_PROCPS\", \"OFF\")\n            .define(\"CURVE\", \"ALT_BN128\")\n            .define(\"USE_PT_COMPRESSION\", \"OFF\")\n            .define(\"MONTGOMERY_OUTPUT\", \"ON\")\n            .define(\"BINARY_OUTPUT\", \"ON\")\n            .build();       \n\t```\n\t\n3. Make sure that `openssl` has been installed. Otherwise, install via `brew install openssl`.\n\n4. Set `export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig`\n\n5. Set `export WITH_LIBSNARK=1`\n\n6. Run `build_release.sh` and the compiled executable `zokrates` can be found in `$zokrates_home/target/release/`\n\n## A Simple Example\n\nAs a simple example, I want to prove my knowledge of two secret numbers whose sum equals 10. To do that using ZoKrates, we first write file `simple_add.code` as:\n\n```\ndef main(private field a, private field b) -\u003e (field):\n    a+b == 10\n    return 1\n```\n\nSuppose we want to use proving scheme `GM17` and the secret numbers are 3 and 7, we do:\n\n```\nzokrates setup -s gm17\nzokrates export-verifier -s gm17\nzokrates compute-witness -a 3 7 \nzokrates generate-proof -s gm17\n```\n\nWithin the current folder, we can see the exported contract `verifier.sol` that implements the verification function and the proof `proof.json`. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzghzz%2Finstallzokratesonmac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzghzz%2Finstallzokratesonmac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzghzz%2Finstallzokratesonmac/lists"}