{"id":26469764,"url":"https://github.com/ocdbytes/zk","last_synced_at":"2025-03-19T17:09:20.063Z","repository":{"id":193711348,"uuid":"688715304","full_name":"ocdbytes/ZK","owner":"ocdbytes","description":"This repository includes all the code implementations for zk-snark verifying systems from simple arithmetics behind it to the circuit design and working.","archived":false,"fork":false,"pushed_at":"2024-02-11T13:44:53.000Z","size":2703,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T10:46:09.977Z","etag":null,"topics":["arithmetic","circom","sagemath","zero-knowledge"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/ocdbytes.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}},"created_at":"2023-09-08T00:27:13.000Z","updated_at":"2024-01-01T12:55:17.000Z","dependencies_parsed_at":"2023-09-09T15:44:40.074Z","dependency_job_id":"7a769e12-f77a-4499-b180-dade5086a312","html_url":"https://github.com/ocdbytes/ZK","commit_stats":null,"previous_names":["ocdbytes/zk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FZK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FZK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FZK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2FZK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocdbytes","download_url":"https://codeload.github.com/ocdbytes/ZK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244470251,"owners_count":20457908,"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":["arithmetic","circom","sagemath","zero-knowledge"],"created_at":"2025-03-19T17:09:19.610Z","updated_at":"2025-03-19T17:09:20.051Z","avatar_url":"https://github.com/ocdbytes.png","language":"Jupyter Notebook","readme":"# ZK\n\nThis repository includes all the code implementations for zk-snark verifying systems from simple arithmetics behind it to the circuit design and working.\n\n```sh\nprove(inputs, algorithm_description) -\u003e (encrypted_inputs, proof, public_output)\n\nverify(encrypted_inputs, proof, algorithm_description) == public_output\n```\n\n**Languages Used :**\n\n- Sage (for solving equations over a field and plotting)\n- Python (for visualising the proofs of theorems and polynomial operations)\n- Circom (to design zk circuits)\n- Markdown (for readme)\n\n**Modules :**\n\n- `ZK Arithmetics`\n  - `Zk-Arithmetics-1.ipynb`\n    - Basic Operations\n    - Eucledean Division\n    - Extended Eucledean Division (G.C.D.)\n    - Number Representation\n  - `Zk-Arithmetics-2.ipynb`\n    - Modular Arithmetics\n    - Fermat's little theorem\n    - Solving Equations (using compatibility theorems)\n    - Chinese Remainder Theorem\n    - Remainder Class Representation\n    - Modular Arithmetic \u0026 Operations\n  - `Zk-Arithmetics-3.ipynb`\n    - Polynomial Arithmetic\n    - Operation on polynomial equations\n    - Eucledean Division with polynomials\n    - Irreducable Polinomial (prime factoring in polynomials)\n    - Lagrange Interpolation\n- `Zk Algebra`\n  - `Zk-Algebra-1.ipynb`\n    - Hashing Functions\n    - Hashing to group\n    - SHA256\n  - `Set Theory`\n    - Binary Operations in set theory\n- `ECC (Eliptical Curve Cryptography)`\n  - `ECC_1.ipynb`\n    - ECC under finite field\n  - `ECC_2.ipynb`\n    - ECC under cyclic group\n  - `ECC_3.ipynb`\n    - Generator Points\n    - ECC addition and modular addition homomorphism\n    - Accosiativity\n  - `ECC_4.ipynb`\n    - ZK Proof Example using ECC\n    - ECDSA malleability attack\n- `Bilinear Pairings`\n  - `BP_1.ipynb`\n    - Bilinear Pairing Concepts\n  - `precompile_test/`\n    - 0x08 Precompile implementation\n    - Simple test for working\n- `R1CS`\n  - `main.ipynb`\n    - Transformation of Different Equations\n    - Addition with constants\n    - Multiplication with constants\n  - `circuit/`\n    - Multiply2()\n    - witness generation\n  - `circuit2/`\n    - Multiply4()\n- `Q.A.P`\n  - `main.ipynb`\n    - Example showing addition of two vectors is homomorphic to addition of two polynomials\n    - Example showing hadamard product of two vectors is homomorphic to multiplication of two polynomials\n    - Ex : Multiplying a vector by a scalar is homomorphic to multiplying the polynomial by the same scalar\n\n**Setup :**\n\n```sh\n# For running the sage compiler\nsage -n jupyter\n```\n\n**Sources :**\n\n- [Moon Math manual](./main-moonmath.pdf)\n- [zkSecureum puzzles](./zkSecureum_notes.pdf)\n- [RareSkills ZK book](https://www.rareskills.io/zk-book)\n- [0xPARC](https://learn.0xparc.org/materials/circom/learning-group-1/intro-zkp/)\n\n**Dev Tools :**\n\n- [Hardhat Circom](https://github.com/projectsophon/hardhat-circom)\n- [Online Circom Compiler](https://zkrepl.dev/)\n- [CircomLib](https://github.com/iden3/circomlib)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fzk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focdbytes%2Fzk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Fzk/lists"}