{"id":23639056,"url":"https://github.com/fabohax/zkk","last_synced_at":"2026-05-14T20:03:33.319Z","repository":{"id":269245527,"uuid":"906846747","full_name":"fabohax/zkk","owner":"fabohax","description":"Zero Knowledge Prover of Bitcoin Private Keys","archived":false,"fork":false,"pushed_at":"2026-04-29T17:16:19.000Z","size":39805,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-29T19:17:23.449Z","etag":null,"topics":["binius","bitcoin","zkp"],"latest_commit_sha":null,"homepage":"","language":"Python","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/fabohax.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,"zenodo":null}},"created_at":"2024-12-22T04:42:53.000Z","updated_at":"2026-04-29T17:16:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b8dffc8-7e0e-4868-a390-5f7263085ba9","html_url":"https://github.com/fabohax/zkk","commit_stats":null,"previous_names":["fabohax/zkk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fabohax/zkk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabohax%2Fzkk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabohax%2Fzkk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabohax%2Fzkk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabohax%2Fzkk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabohax","download_url":"https://codeload.github.com/fabohax/zkk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabohax%2Fzkk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33041205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["binius","bitcoin","zkp"],"created_at":"2024-12-28T08:11:49.222Z","updated_at":"2026-05-14T20:03:33.314Z","avatar_url":"https://github.com/fabohax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔑 ZKK: Zero-Knowledge Key\n\nZKK is a proof-of-concept project demonstrating the use of **Zero-Knowledge Proofs (ZKP)** to validate a Bitcoin private key without exposing its value. The project generates a ZKP proving that a given private key corresponds to a derived public key and encodes the proof in a QR code for easy sharing and validation.\n\n## Features\n\n- Validate Bitcoin private keys.\n- Derive public keys and addresses from private keys.\n- Generate Zero-Knowledge Proofs (ZKP) using `zk-SNARKs`.\n- Encode ZKP into a QR code for secure sharing.\n- Display and save QR codes as SVG images.\n\n## Prerequisites\n\n1. **Python 3.8 or later**: Ensure you have Python installed.\n2. **Environment Setup**: Create and activate a virtual environment:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n3. **Dependencies**:\n   - `bitcoinlib`: For Bitcoin key derivation.\n   - `qrcode`: For QR code generation.\n   - `snarkjs`: For zk-SNARK proof generation.\n\nInstall dependencies using:\n```bash\npip install bitcoinlib qrcode snarkjs\n```\n\n## Installation\n\nClone the repository and navigate to the project directory:\n```bash\ngit clone https://github.com/fabohax/zkk.git\ncd zkk\n```\n\n## Use Cases\n\nZKK can be used in scenarios where you want to prove knowledge or ownership of a Bitcoin private key without revealing the key itself. Example use cases include:\n\n- **Anonymous Authentication:** Prove you control a Bitcoin address (or cryptographic identity) without revealing your public key or address. Useful for privacy-preserving logins or gated access.\n- **Private Ownership Proof:** Show you own a specific Bitcoin address to a third party (e.g., for KYC, asset verification, or escrow) without exposing your private key or even your public key.\n- **Selective Disclosure:** Prove you control one address from a set (e.g., “I own one of these addresses”) without revealing which one, useful for anonymous group membership or voting.\n- **On-chain Privacy Protocols:** Integrate with smart contracts or privacy-focused blockchains to prove transaction validity or ownership without leaking sensitive information.\n- **Credential Systems:** Use as a building block for decentralized identity, where you prove attributes (like age, membership, or asset ownership) without revealing your identity.\n- **Secure Messaging or Signing:** Prove you can decrypt or sign messages without revealing your key, enabling secure, private communication channels.\n\n## Project Structure\n\n```\nzkk/\n├── bin/\n│   └── cli.py                 # CLI script for ZKP generation and verification\n├── src/\n│   ├── snarks/                # zk-SNARK proof-related code\n│   │   ├── proof.py           # Proof generation and verification logic\n│   │   ├── constraints.circom # Circom circuit for zk-SNARKs\n│   │   ├── utils.py           # Utility functions for evaluation\n│   │   └── merkle.py          # Merkle tree implementation\n│   ├── bitcoin/\n│   │   └── key_utils.py       # Functions for key derivation and validation\n│   └── qr/\n│       └── generate_qr.py     # QR code generation utilities\n├── tests/                     # Unit and integration tests\n├── examples/                  # Example scripts for usage\n├── README.md                  # Project documentation\n└── requirements.txt           # Python dependencies\n```\n\n## How It Works\n\n1. **Validate and Derive Public Key**:\n   - The script validates a given Bitcoin private key.\n   - It derives the corresponding public key and Bitcoin address.\n\n2. **Generate ZKP**:\n   - Using `zk-SNARKs`, the private key is input into a Circom circuit.\n   - The proof is generated via `snarkjs` based on the circuit constraints.\n   - The output is a ZKP that can be validated without exposing the private key.\n\n3. **Encode in QR Code**:\n   - The generated ZKP is serialized and encoded into a QR code for sharing.\n   - The QR code is saved as an SVG image.\n\n## Usage\n\n### 1. Run the Script\nGenerate a proof and QR code for a given Bitcoin private key:\n```bash\npython bin/cli.py \u003cBitcoinPrivateKey\u003e\n```\n\n### 2. Example Output\n**Console Output:**\n```\nValidating and deriving public key...\nPublic Key: 02c2977508521f90683cae95a21824b89e5ee4604869c5e383cb85cdd4c2148c00\nAddress: 19cf4bxogLyzo3yCEedyLq3nwdy6r43RsF\nGenerating ZKP...\nZKP Generated Successfully.\nQR Code saved as zkp_qr.svg\n```\n\n**Generated QR Code (in Terminal):**\n```\n█████████████████████████████\n████ ▄▄▄▄▄ █▄▀█▄▄▄ ▄▄▄▄▄ ████\n████ █   █ █▀▄ ▄▄▄ █   █ ████\n████ █▄▄▄█ █▄▀▄▀▄█ █▄▄▄█ ████\n████▄▄▄▄▄▄▄█▄█▄█▄█▄▄▄▄▄▄▄████\n████ ▄▄▄▄▄ ██▄▄ ▀▄▄ ▄█▄█▄████\n████ █   █ █ ▀▀▄█▄▀█▀▄▀▄ ████\n████ █▄▄▄█ █ ▀▄█▄▀ ▄█▀ ▄█████\n████▄▄▄▄▄▄▄█▄█▄█▄▄█▄▄▄██▄████\n████ ▄▄▄▄▄ ██ ▀█▄ ▄▄█ ▄▀█████\n████ █   █ █▄▄▄█ ▀█ ▀▄██▀████\n████ █▄▄▄█ █ ▄▄▄▄ ▀ ▄▄▄▄█████\n████▄▄▄▄▄▄▄█▄▄▄▄▄█▄█▄▄▄▄▄████\n█████████████████████████████\n```\n\n### 3. Verify the Proof\nRun the verification script to confirm proof validity:\n```bash\npython bin/cli.py --verify \u003cpath_to_proof_file\u003e\n```\n\n## Contributing\n\nContributions are welcome! Feel free to submit issues or pull requests.\n\n## License\n\nOpen Source Code Made With ❤️\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabohax%2Fzkk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabohax%2Fzkk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabohax%2Fzkk/lists"}