{"id":18512381,"url":"https://github.com/kroma-network/rules_circom","last_synced_at":"2025-10-31T19:30:36.045Z","repository":{"id":228394972,"uuid":"773762097","full_name":"kroma-network/rules_circom","owner":"kroma-network","description":"Bazel rules for circom","archived":false,"fork":false,"pushed_at":"2024-07-05T05:55:35.000Z","size":36,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T15:05:58.803Z","etag":null,"topics":["bazel","bazel-rules","circom"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kroma-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-18T10:59:35.000Z","updated_at":"2024-09-13T13:52:07.000Z","dependencies_parsed_at":"2024-03-27T13:45:47.487Z","dependency_job_id":"d28bd035-5c90-435d-9aa1-bbbded2195e9","html_url":"https://github.com/kroma-network/rules_circom","commit_stats":null,"previous_names":["kroma-network/rules_circom"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kroma-network%2Frules_circom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kroma-network%2Frules_circom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kroma-network%2Frules_circom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kroma-network%2Frules_circom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kroma-network","download_url":"https://codeload.github.com/kroma-network/rules_circom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239225800,"owners_count":19603174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bazel","bazel-rules","circom"],"created_at":"2024-11-06T15:33:58.768Z","updated_at":"2025-10-31T19:30:36.017Z","avatar_url":"https://github.com/kroma-network.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rules Circom\n\nBazel Rule for Circom!\n\nPlease take a look at [kroma-network/circomlib](https://github.com/kroma-network/circomlib) for real examples!\n\n## Prerequisites\n\n### Bazel\n\nFollow the instructions [here](https://bazel.build/install).\n\n## How to use\n\nAdd this to your `WORKSPACE`:\n\n```bazel\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"kroma_network_rules_circom\",\n    sha256 = \"\u003csha256\u003e\",\n    strip_prefix = \"rules_circom-\u003ccommit\u003e\",\n    urls = [\"https://github.com/kroma-network/rules_circom/archive/\u003ccommit\u003e.tar.gz\"],\n)\n\nload(\"@kroma_network_rules_circom//:rules_circom_deps.bzl\", \"rules_circom_deps\")\n\nrules_circom_deps()\n\nload(\"@rules_rust//rust:repositories.bzl\", \"rules_rust_dependencies\", \"rust_register_toolchains\")\n\nrules_rust_dependencies()\n\nrust_register_toolchains(\n    edition = \"2021\",\n    versions = [\n        \"1.66.1\",\n    ],\n)\n\nload(\"@rules_rust//crate_universe:repositories.bzl\", \"crate_universe_dependencies\")\n\ncrate_universe_dependencies()\n\nload(\"@rules_rust//crate_universe:defs.bzl\", \"crates_repository\")\n\ncrates_repository(\n    name = \"crate_index\",\n    cargo_lockfile = \"@kroma_network_rules_circom//:Cargo.lock\",\n    lockfile = \"@kroma_network_rules_circom//:Cargo.Bazel.lock\",\n    manifests = [\"@kroma_network_rules_circom//:Cargo.toml\"],\n)\n\nload(\"@crate_index//:defs.bzl\", \"crate_repositories\")\n\ncrate_repositories()\n```\n\n### How to compute sha256\n\n```shell\ncurl -LO https://github.com/kroma-network/rules_circom/archive/\u003ccommit\u003e.tar.gz\nshasum -a 256 \u003ccommit\u003e.tar.gz\n```\n\nAnd then, add this to your `BUILD.bazel`:\n\n```bazel\nload(\"@kroma_network_rules_circom//:build_defs.bzl\", \"circom_library\", \"compile_circuit\")\n\ncircom_library(\n    name = \"\u003ccircom_lib_name\u003e\",\n    srcs = [\n      \"foo.circom\",\n      \"bar.circom\",\n    ],\n)\n\ncompile_circuit(\n    name = \"\u003ccompile_circuit_name\u003e\",\n    main = \"baz.circom\",\n    deps = [\":\u003ccircom_lib_name\u003e\"]\n)\n```\n\n## Rules\n\n### circom_library\n\n- `srcs`: a list of sources. The files should end with **.circom**.\n- `includes`: a list of directory to be linked. The list is going to be passed to [compile_circuit](#compile_circuit) as **-l** options.\n- `deps`: a list of dependencies. Only the target defined by [circom_library](#circom_library) can be added.\n\n### compile_circuit\n\n- `srcs`: a list of sources. The files should end with **.circom**.\n- `main`: a single file that contains main component.\n- `includes`: a list of directory to be linked. The list is going to be passed to [compile_circuit](#compile_circuit) as **-l** options.\n- `deps`: a list of dependencies. Only the target defined by [circom_library](#circom_library) can be added.\n\nThe followings flags are defined by [circom v2.1.8](https://github.com/iden3/circom/releases/tag/v2.1.8).\n\n- `O0`: no simplification is applied.\n- `O1`: only applies signal to signal and signal to constant simplification.\n- `O2`: full constraint simplification.\n- `verbose`: shows logs during compilation.\n- `inspect`: does an additional check over the constraints produced.\n- `use_old_simplification_heuristics`: applies the old version of the heuristics when performing linear .simplification\n- `simplification_substitution`: outputs the substitution applied in the simplification phase in json.\n- `prime`: to choose the prime number to use to generate the circuit. It should be either one of (\"bn128\", \"bls12381\", \"goldilocks\", \"grumpkin\", \"pallas\", \"vesta\", \"secq256r1\"). By default, \"bn128\".\n- `O2round`: maximum number of rounds of the simplification process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkroma-network%2Frules_circom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkroma-network%2Frules_circom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkroma-network%2Frules_circom/lists"}