{"id":21465253,"url":"https://github.com/alexmllo/zk-hashes","last_synced_at":"2025-03-17T05:43:33.603Z","repository":{"id":242849734,"uuid":"810738815","full_name":"alexmllo/zk-hashes","owner":"alexmllo","description":"Rust implementation of some Arithmetization-Oriented cryptographic primitives in the Plonk framework","archived":false,"fork":false,"pushed_at":"2024-06-18T09:23:17.000Z","size":66346,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T15:17:49.789Z","etag":null,"topics":["anemoi","arion","arithmetic-circuits","arithmetization-oriented","griffin","hash-functions","plonk","plonky2","poseidon","rescue","zero-knowledge"],"latest_commit_sha":null,"homepage":"","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/alexmllo.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-06-05T09:10:24.000Z","updated_at":"2024-08-06T14:51:35.000Z","dependencies_parsed_at":"2024-06-15T12:08:26.747Z","dependency_job_id":null,"html_url":"https://github.com/alexmllo/zk-hashes","commit_stats":null,"previous_names":["alexmllo/zk-hashes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmllo%2Fzk-hashes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmllo%2Fzk-hashes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmllo%2Fzk-hashes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmllo%2Fzk-hashes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmllo","download_url":"https://codeload.github.com/alexmllo/zk-hashes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982141,"owners_count":20378605,"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":["anemoi","arion","arithmetic-circuits","arithmetization-oriented","griffin","hash-functions","plonk","plonky2","poseidon","rescue","zero-knowledge"],"created_at":"2024-11-23T08:09:42.715Z","updated_at":"2025-03-17T05:43:33.573Z","avatar_url":"https://github.com/alexmllo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero-knowledge Library for hash functions\n\nThis repository constains the implementation of two Zero-Knowledge Proof (ZK) libraries for ZK-Friendly Hash Functions named zk-lib and zk-dusk, developed as part of the bachelor thesis. The libraries provides plain and zero-knowledge circuit implementation for various hash functions in the Polygon's Plonky2 and Dusk Plonk's Plonk proof systems for generating zero-knowledge proofs, in the Rust programming language.\n\nHash functions: MiMC, Poseidon, Rescue-prime, Griffin, Anemoi and Arion.\n\n## Requirements\nTo use this library, ensure you satisfy one of the following prerequisites:\n\n- Rust compiler with recent nightly toolchain. You can set up with the following command:\n\n```\nrustup override set nightly-YYYY-MM-DD\n```\nMake sure to replace YYYY-MM-DD with the appropriate date for your setup.\n\n- Copy the rust-toolchain file in your project directory. It can be changed to a more recent nightly version.\n\n## Code Structure\n\n- mimc-python: \n    - Implementation of the MiMC hash function Python, primarily used for testing purposes.\n- zk-lib: \n    - Library containing implementation of the MiMC, Poseidon, Rescue-Prime, Griffin, Anemoi and Arion hash functions, as well as the zero-knowledge circuit for each one using Plonky2 as the proof system.\n    - Benchmarking of the hashes and the zero-knowledge circuit for each hash function.\n- zk-dusk\n    - Library containing implementation of the MiMC, Poseidon, Rescue-Prime, Griffin, Anemoi and Arion hash functions, as well as the zero-knowledge circuit for each one using PLONK as the proof system.\n    - Benchmarking of the hashes and the zero-knowledge circuit for each hash function.\n\n## Benchmarks\nMeasurements were conducted on a system configured with a 1.4 GHz Quad-Core Intel Core i5 processor, 8 GB LPDDR3 RAM with a transfer rate of 2133 MHz, and running macOS 14.5. The system was clocked at 1.4 GHz and utilized Rust’s Nightly build dated 2024-02-01. Benchmarking was performed using Criterion 0.5, with Plonky2 version 0.1.4 and dusk-plonk version 0.19.\n\n### Plain performance\n\u003cdiv style=\"display: flex; justify-content: space-between;\"\u003e\n  \u003cimg src=\"https://github.com/alexmllo/zk-hashes/assets/125358906/f0e520b1-7f8f-400b-a025-eb04f3af9bb1\" alt=\"image\" width=\"490\" height=\"170\"\u003e\n  \u003cimg src=\"https://github.com/alexmllo/zk-hashes/assets/125358906/19a6a1f7-ce71-4ed9-96d1-110e3d06459d\" alt=\"image\" width=\"500\" height=\"220\"\u003e\n\u003c/div\u003e\n\n### Plonky2 performance\n![image](https://github.com/alexmllo/zk-hashes/assets/125358906/35f7896a-befb-46f8-b596-04e4d9ebbae1)\n\n### Plonk performance\n#### Number of constraints\n\u003cimg src=\"https://github.com/alexmllo/zk-hashes/assets/125358906/712fa09f-aec0-4e71-93b3-8b3e0bc6950b\" alt=\"image\" width=\"500\" height=\"220\"\u003e\n\n#### Performance\n\u003cimg src=\"https://github.com/alexmllo/zk-hashes/assets/125358906/1bbb4b6f-8d3e-464f-a768-ac88e0e5fcac)\" alt=\"image\" width=\"540\" height=\"260\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmllo%2Fzk-hashes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmllo%2Fzk-hashes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmllo%2Fzk-hashes/lists"}