{"id":19947362,"url":"https://github.com/firstbatchxyz/hollowdb-prover-rust","last_synced_at":"2025-06-13T12:09:17.059Z","repository":{"id":238808834,"uuid":"674217875","full_name":"firstbatchxyz/hollowdb-prover-rust","owner":"firstbatchxyz","description":"Zero-knowledge prover utility for HollowDB.","archived":false,"fork":false,"pushed_at":"2023-08-29T10:38:35.000Z","size":1133,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T14:18:41.039Z","etag":null,"topics":["arkworks","circom","groth16","hollowdb","rust"],"latest_commit_sha":null,"homepage":"https://docs.hollowdb.xyz/","language":"Rust","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/firstbatchxyz.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":"2023-08-03T12:09:39.000Z","updated_at":"2024-05-08T15:03:05.000Z","dependencies_parsed_at":"2024-05-08T08:51:33.330Z","dependency_job_id":"47355e3b-1198-4af8-956e-4858e2370e15","html_url":"https://github.com/firstbatchxyz/hollowdb-prover-rust","commit_stats":null,"previous_names":["firstbatchxyz/hollowdb-prover-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/firstbatchxyz/hollowdb-prover-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstbatchxyz","download_url":"https://codeload.github.com/firstbatchxyz/hollowdb-prover-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-rust/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259642352,"owners_count":22888995,"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":["arkworks","circom","groth16","hollowdb","rust"],"created_at":"2024-11-13T00:35:47.287Z","updated_at":"2025-06-13T12:09:12.029Z","avatar_url":"https://github.com/firstbatchxyz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/firstbatchxyz/hollowdb/master/logo.svg\" alt=\"logo\" width=\"142\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003e\n    HollowDB Prover\n  \u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ci\u003eProof generator crate for HollowDB.\u003c/i\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\n        \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/license-MIT-yellow.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.hollowdb.xyz/zero-knowledge-proofs/hollowdb-prover\" target=\"_blank\"\u003e\n        \u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/docs-hollowdb-3884FF.svg?logo=gitbook\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/firstbatchxyz/hollowdb\" target=\"_blank\"\u003e\n        \u003cimg alt=\"GitHub: HollowDB\" src=\"https://img.shields.io/badge/github-hollowdb-5C3EFE?logo=github\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/2wuU9ym6fq\" target=\"_blank\"\u003e\n        \u003cimg alt=\"Discord\" src=\"https://dcbadge.vercel.app/api/server/2wuU9ym6fq?style=flat\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\nWe use [ark_circom](https://crates.io/crates/ark-circom) to generate Groth16 proofs for HollowDB. PLONK is not supported as of yet.\n\n### Generating Proofs\n\nTo create a prover:\n\n```rs\nlet prover = HollowProver::new(\n    wasmPath,\n    r1csPath,\n    proverKeyPath,\n)?;\n```\n\nThe `prove` function accepts any type for the current value and next value, where the inputs will be stringified and then hashed. The resulting string should match that of `JSON.stringify` in JavaScript. Here is an example of creating a proof:\n\n```rs\n#[derive(Serialize)]\nstruct MyStruct {\n    foo: i32,\n    bar: bool,\n    baz: String,\n}\n\nlet preimage = BigUint::from_str(\"123456789\")?;\nlet cur_value = MyStruct {\n    foo: 123,\n    bar: true,\n    baz: \"zab\".to_owned(),\n};\nlet next_value = MyStruct {\n    foo: 789,\n    bar: false,\n    baz: \"baz\".to_owned(),\n};\n\nlet (proof, public_signals) = prover.prove(preimage, cur_value, next_value)?;\n```\n\nNote that if you are using the value at both JS and Rust, you need to ensure that keys are ordered the same so that the resulting hashes match.\n\n### Computing Key\n\nTo compute the key (i.e. the Poseidon hash of your preimage) without generating a proof, you can use the `ComputeKey` function.\n\n```rs\nlet preimage = BigUint::from_str(\"123456789\")?;\nlet key = compute_key(preimage)?;\n```\n\n### Hashing to Group\n\nIf you would like to compute the hashes manually, you can use `hash_to_group` function. It accepts any argument that is serializable.\n\n## Testing\n\nRunning the tests will generate a proof and public signals under out folder, which can be verified using SnarkJS. You can run all tests with:\n\n```sh\nyarn test\n```\n\nwhich will run all tests, and then run SnarkJS to verify the resulting proofs. To verify generated proofs you can also type `yarn verify`. To run tests without SnarkJS, you can do:\n\n```sh\ncargo test --release\n```\n\nNote that due to an [issue](https://github.com/arkworks-rs/circom-compat/issues/27) in `ark-circom` we have to run in release mode, otherwise it hangs.\n\n## See Also\n\nWe have prover implementations in Go and JavaScript as well:\n\n-   [Go](https://github.com/firstbatchxyz/hollowdb-prover-go)\n-   [JavaScript](https://github.com/firstbatchxyz/hollowdb-prover)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-rust/lists"}