{"id":20109978,"url":"https://github.com/distributed-lab/bp-pp","last_synced_at":"2025-05-06T10:31:34.963Z","repository":{"id":229037530,"uuid":"775580854","full_name":"distributed-lab/bp-pp","owner":"distributed-lab","description":"Bulletproofs++ implementation on Rust","archived":false,"fork":false,"pushed_at":"2024-06-20T12:53:35.000Z","size":62,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T03:03:42.201Z","etag":null,"topics":["bulletproofs","range-proofs","rust","zkp"],"latest_commit_sha":null,"homepage":"https://distributedlab.com/whitepaper/Bulletproofs-Construction-and-Examples.pdf","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/distributed-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-21T16:47:44.000Z","updated_at":"2024-11-06T04:23:30.000Z","dependencies_parsed_at":"2024-03-21T18:38:56.727Z","dependency_job_id":"8731a3ef-91e1-4c42-b26e-4a183173a5a1","html_url":"https://github.com/distributed-lab/bp-pp","commit_stats":null,"previous_names":["distributed-lab/bp-pp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fbp-pp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fbp-pp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fbp-pp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fbp-pp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/distributed-lab","download_url":"https://codeload.github.com/distributed-lab/bp-pp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252665995,"owners_count":21785182,"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":["bulletproofs","range-proofs","rust","zkp"],"created_at":"2024-11-13T18:09:58.384Z","updated_at":"2025-05-06T10:31:34.610Z","avatar_url":"https://github.com/distributed-lab.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bulletproofs++ implementation on Rust\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/distributed-lab/bp-pp/issues)\n\u003ca href=\"https://github.com/distributed-lab/bp-pp\"\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/distributed-lab/bp-pp?style=social\"/\u003e\n\u003c/a\u003e\n\n⚠️ __Please note - this crypto library has not been audited, so use it at your own risk.__\n\n## Abstract\n\nPresent Rust library contains the implementation of Bulletproofs++\nover [secp256k1 curve](https://docs.rs/k256/latest/k256/) that includes: weight norm linear argument protocol,\narithmetic circuit protocol and reciprocal range proofs described in Distributed\nLab's [Bulletproofs++ Construction and Examples](https://distributedlab.com/whitepaper/Bulletproofs-Construction-and-Examples.pdf).\nAlso, contains the `u64` range proof protocol as a primary use-case for reciprocal range proofs.\n\nThis implementation uses [Merlin transcript](https://doc.dalek.rs/merlin/index.html) for challenges generation as was\nrecommended by Bulletproofs protocol authors.\n\nAll `Proof` data models has corresponding `SerializeProof` models where [serde](https://serde.rs/) `Serialize`\nand `Deserialize` was implemented.\n\n## Performance\n\nImplemented solution has 2G points advantage over existing BP and BP+ protocols on proving of one 64-bit value and this\nadvantage will increase for more values per proof.\n\n| Protocol | G  | F |\n|----------|----|---|\n| BP       | 16 | 5 |\n| BP+      | 15 | 3 |\n| Our BP++ | 13 | 3 |\n\nOn MacBook M3Pro 36GB MacOS 14.1 Rust 1.78.0 it [consumes](./macbook-m3-pro-36GB-bench-result.txt):\n\n- 14.361 ms average for proof generation\n- 3.8080 ms average for proof verification\n\n## Example of usage\n\nUse [tests](./src/tests.rs) to run the provided example:\n\n```rust\nuse k256::elliptic_curve::{Group, rand_core::OsRng};\nuse k256::ProjectivePoint;\n\nuse bp_pp::range_proof;\nuse bp_pp::range_proof::u64_proof::G_VEC_FULL_SZ;\nuse bp_pp::range_proof::u64_proof::H_VEC_FULL_SZ;\nuse bp_pp::range_proof::reciprocal::{SerializableProof, self};\n\nfn main() {\n    let mut rand = OsRng::default();\n\n    let x = 123456u64; // private value to create proof for.\n    let s = k256::Scalar::generate_biased(\u0026mut rand); // blinding value\n\n    // Base points\n    let g = k256::ProjectivePoint::random(\u0026mut rand);\n    let g_vec = (0..G_VEC_FULL_SZ).map(|_| k256::ProjectivePoint::random(\u0026mut rand)).collect::\u003cVec\u003cProjectivePoint\u003e\u003e();\n    let h_vec = (0..H_VEC_FULL_SZ).map(|_| k256::ProjectivePoint::random(\u0026mut rand)).collect::\u003cVec\u003cProjectivePoint\u003e\u003e();\n\n    let public = range_proof::u64_proof::U64RangeProofProtocol {\n        g,\n        g_vec,\n        h_vec,\n    };\n\n    // transcript will be used for challenge generation - to move from interactive to non-interactive protocol.\n    // transcript should be the new instance but with same label for prover and verifier. \n    let mut pt = merlin::Transcript::new(b\"u64 range proof\");\n    let proof = public.prove(x, \u0026s, \u0026mut pt, \u0026mut rand);\n\n    // value commitment: `commitment = x*g + s*h_vec[0]`\n    let commitment = public.commit_value(x, \u0026s);\n\n    println!(\"{}\", serde_json::to_string_pretty(\u0026reciprocal::SerializableProof::from(\u0026proof)).unwrap());\n\n    let mut vt = merlin::Transcript::new(b\"u64 range proof\");\n    assert!(public.verify(\u0026commitment, proof, \u0026mut vt));\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fbp-pp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistributed-lab%2Fbp-pp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fbp-pp/lists"}