{"id":19947354,"url":"https://github.com/firstbatchxyz/hollowdb-prover-go","last_synced_at":"2026-06-10T00:31:11.007Z","repository":{"id":238808622,"uuid":"674229727","full_name":"firstbatchxyz/hollowdb-prover-go","owner":"firstbatchxyz","description":"Zero-knowledge prover utility for HollowDB.","archived":false,"fork":false,"pushed_at":"2023-08-29T10:38:41.000Z","size":1117,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T05:28:30.506Z","etag":null,"topics":["circom","go","groth16","hollowdb","zero-knowledge"],"latest_commit_sha":null,"homepage":"https://docs.hollowdb.xyz/","language":"Go","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:43:52.000Z","updated_at":"2024-05-08T15:03:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd82ad63-c33c-4069-b497-6f5b7bd3a7aa","html_url":"https://github.com/firstbatchxyz/hollowdb-prover-go","commit_stats":null,"previous_names":["firstbatchxyz/hollowdb-prover-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fhollowdb-prover-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstbatchxyz","download_url":"https://codeload.github.com/firstbatchxyz/hollowdb-prover-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241374550,"owners_count":19952545,"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":["circom","go","groth16","hollowdb","zero-knowledge"],"created_at":"2024-11-13T00:35:45.826Z","updated_at":"2026-06-10T00:31:11.001Z","avatar_url":"https://github.com/firstbatchxyz.png","language":"Go","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 package 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 [Go RapidSnark](https://github.com/iden3/go-rapidsnark) to create witnesses and generate Groth16 proofs. As for the WASM execution engine, it currently uses [RapidSnark Wasmer](https://github.com/iden3/go-rapidsnark/tree/main/witness/wasmer). The prover does not support PLONK at the moment.\n\n### Generating Proofs\n\nTo create a prover:\n\n```go\nprover, err := hollowprover.Prover(wasmPath, pkeyPath)\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```go\nproof, publicSignals, err := prover.Prove(\n  preimage,\n  map[string]interface{}{\n\t\t\"foo\":     123,\n\t\t\"hollow\":  true,\n\t\t\"awesome\": \"yes\",\n\t},\n  map[string]interface{}{\n\t\t\"foo\":     123789789,\n\t\t\"hollow\":  false,\n\t\t\"awesome\": \"yes\",\n\t})\n```\n\nThe resulting proof and public signals are stringified JSON objects.\n\nThe user must be aware of the following with regards to Go's JSON marshalling logic with respect to the user inputs:\n\n- Maps have their keys sorted lexicographically\n- Structs keys are marshalled in the order defined in the struct\n\nThe effect of this is that if you have the following object `{b: 1, a: 2}` in a Map then Go will stringify it as `{\"a\":2,\"b\":1}` but JavaScript may have it as `{\"b\":1,\"a\":2}`, resulting in different hashes of the \"same\" object! We suggest using struct for the inputs to the prover, but if you really have to use maps you can perhaps hash them elsewhere with more care on their keys, and then use `proveHashed` function.\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```go\npreimage, ok := new(big.Int).SetString(\"0xDEADBEEF\", 0)\nkey, err := hollowprover.ComputeKey(preimage)\n```\n\n### Hashing to Group\n\nIf you would like to compute the hashes manually, you can use `HashToGroup` function.\n\n```go\nhash, err := hollowprover.HashToGroup(\n  // accepts anything!\n  struct {\n    Foo int    `json:\"foo\"`\n    Bar bool   `json:\"bar\"`\n    Baz string `json:\"baz\"`\n  }{\n    123,\n    true,\n    \"zab\",\n  })\n```\n\nNotice that the JSON field names must be provided if you are using a struct, so that they can be stringified.\n\n## Testing\n\nRunning the Go 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 Go tests, and then run SnarkJS to verify the proofs. To verify generated proofs you can also type `yarn verify`. To run Go tests without SnarkJS, you can do:\n\n```sh\ngo test ./test/*.go -test.v\n```\n\nYou can also run benchmarks with:\n\n```sh\ngo test -bench=.\n```\n\n## See Also\n\nWe have prover implementations in Rust and JavaScript as well:\n\n- [Rust](https://github.com/firstbatchxyz/hollowdb-prover-rust)\n- [JavaScript](https://github.com/firstbatchxyz/hollowdb-prover)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fhollowdb-prover-go/lists"}