STATUS: RELEASE v2.0 β | 7 Scientific Modules β | zkVerify Integrated π
v2.0 RELEASE: Complete ADMET compliance system with 7 scientific modules
Zero-knowledge proofs for pharmaceutical validation using Circom/Groth16/zkVerify.
IMPLEMENTED SCIENTIFIC MODULES:
- β LogP: Partition coefficient (RDKit)
- β Multi: Full Lipinski rule (RDKit)
- β pKa: Acidity constant (MolGpKa API + fallback)
- β Docking: Molecular affinity (AutoDock Vina + fallback)
- β QSAR: Toxicity prediction (ML models + heuristics)
- β Dynamics: Molecular simulation (GROMACS + fallback)
- β CYP450: Enzymatic metabolism (ML + heuristics)
FULL PIPELINE:
- β Witness Generation: 7 fully functional scientific modules
- β ZK Proofs: Circom circuits + Groth16 via snarkjs
- β Verification: Local and zkVerify fully integrated
- β REST API: Endpoints for all modules
- β Robust Fallbacks: Guaranteed operation without external dependencies
graph TD
A[SMILES Input] --> B[Witness Generator]
B --> C{Scientific Module}
C -->|LogP| D[RDKit LogP]
C -->|Multi| E[Lipinski Rule]
C -->|pKa| F[MolGpKa API]
C -->|Docking| G[AutoDock Vina]
C -->|QSAR| H[ML Toxicity]
C -->|Dynamics| I[GROMACS]
C -->|CYP450| J[ML Metabolism]
D --> K[Witness JSON]
E --> K
F --> K
G --> K
H --> K
I --> K
J --> K
K --> L[Circom Circuit]
L --> M[snarkjs Groth16]
M --> N[zkVerify Blockchain]
- Backend: Python 3.13 + FastAPI
- Scientific Calculations: RDKit, MolGpKa, AutoDock Vina, GROMACS
- ZK Circuits: Circom v2.2.2
- Proof System: snarkjs + Groth16
- Blockchain: zkVerify (Polkadot ecosystem)
- API: REST endpoints for all ADMET modules
ZK_COMPLY v2.0 is a complete ADMET compliance system (Absorption, Distribution, Metabolism, Excretion, Toxicity) that enables pharmaceutical companies to prove regulatory compliance without revealing:
- Proprietary molecular structures
- Specific test results
- Experimental methods used
- Sensitive intellectual property data
| Module | ADMET Area | Technology | Fallback | Status |
|---|---|---|---|---|
| LogP | Absorption | RDKit | β | β |
| Multi | Absorption | RDKit (Lipinski) | β | β |
| pKa | Distribution | MolGpKa API | RDKit heuristics | β |
| Docking | Distribution | AutoDock Vina | Molecular descriptors | β |
| CYP450 | Metabolism | ML models | Substructure analysis | β |
| Dynamics | Excretion | GROMACS | Property estimation | β |
| QSAR | Toxicity | ML models | Toxicophore analysis | β |
- Privacy: SMILES and results are never revealed
- Verifiability: Mathematical proofs of compliance
- Integrity: Impossible to falsify results
- Auditability: Immutable trace on blockchain
- LogP: Partition coefficient (solubility)
- pKa: Acid dissociation constant
- Docking: Protein-drug molecular docking
- QSAR: Toxicity analysis via machine learning
- Dynamics: Molecular dynamics simulation
- CYP450: Hepatic enzymatic metabolism
- Circom circuits for each scientific module
- Automatic witness generation
- snarkjs usage for proving backends
- Cryptographic verification of compliance
- FastAPI with endpoints for all modules
- Batch processing of molecules
- Automatic documentation (Swagger/OpenAPI)
- Integrated end-to-end tests
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Computation β β Zero-Knowledge β β Verification β
β Scientific β ββ β Circuits β ββ β Blockchain β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
RDKit Circom Language zkVerify Chain
AutoDock Vina snarkjs Compiler Smart Contracts
GROMACS ML Groth16 Prover Proof Registry
- Python 3.13+
- Node.js 18+ (for snarkjs and zkverifyjs)
- RDKit (pip install rdkit)
# 1. Clone the repository
git clone https://github.com/your-user/ZK_COMPLY.git
cd ZK_COMPLY
# 2. Install Python dependencies
pip install -r requirements.txt
# 3. Install Node.js dependencies
npm install
# 4. Configure the environment
chmod +x setup.sh
./setup.sh
# 5. Run the API
python main.py# LogP (Absorption)
python src/witness_generator.py "CCO" logp
# Lipinski Rule (Absorption)
python src/witness_generator.py "CCO" multi
# pKa (Distribution)
python src/witness_generator.py "CCO" pka
# Docking (Distribution)
python src/witness_generator.py "CCO" docking
# Toxicity (Toxicity)
python src/witness_generator.py "CCO" qsar
# Molecular Dynamics (Excretion)
python src/witness_generator.py "CCO" dynamics
# CYP450 (Metabolism)
python src/witness_generator.py "CCO" cyp450# Generate ZK proof for LogP
python src/zk_pipeline.py --smiles "CCO" --module logp
# With submission to zkVerify
python src/zk_pipeline.py --smiles "CCO" --module logp --submit# Start server
python main.py
# Test endpoint (new terminal)
curl -X POST "http://localhost:8000/compute/logp" \
-H "Content-Type: application/json" \
-d '{"smiles": "CCO"}'
# Full pipeline
curl -X POST "http://localhost:8000/pipeline" \
-H "Content-Type: application/json" \
-d '{"smiles": "CCO", "module": "logp"}'import requests
# Test a molecule (Aspirin)
response = requests.post("http://localhost:8000/test-all",
json={"smiles": "CC(=O)OC1=CC=CC=C1C(=O)O"})
print(response.json())
# {
# "results": {
# "logp": {"status": "success", "compliant": true},
# "pka": {"status": "success", "compliant": true},
# ...
# },
# "overall_compliance": true
# }cd /home/user/Documents/ZK_COMPLY
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000curl -X POST "http://localhost:8000/generate-zk-proof" \
-H "Content-Type: application/json" \
-d '{
"smiles": "CCO",
"circuit_type": "logp",
"submit_to_zkverify": false
}'{
"pipeline_id": "pipeline_20250725_XXXXXX",
"smiles": "CCO",
"success": true,
"compliance_result": true,
"transaction_hash": null,
"stages": {
"witness_generation": {"success": true},
"proof_generation": {"success": true}
}
}ZK_COMPLY/
βββ main.py # Main FastAPI backend
βββ src/ # Python services
β βββ witness_generator.py # Witness generation for Circom
β βββ snarkjs_service.py # snarkjs integration
β βββ zkverify_service.py # Submission to zkVerify
β βββ zk_pipeline.py # Full pipeline
βββ circuits/ # Circom circuits
β βββ simple_compliance.circom # LogP compliance circuit
β βββ compliance_circuit.circom # Multi-criteria circuit
β βββ circuit.zkey # Proving key
β βββ verification_key.json # Verification key
βββ proofs/ # Generated proofs and witnesses
βββ scripts/ # Auxiliary scripts
βββ docs/ # Technical documentation
- Ethanol (CCO): LogP = -0.001 β β Compliant
- Paracetamol derivative: LogP = 3.224 β β Compliant
- C20 Chain: LogP = 8.048 β β Non-Compliant
["1", "hash"]= Compliant + molecule hash["0", "hash"]= Non-Compliant + molecule hash
zk-comply/
βββ π circuits/ # Circom Circuits
β βββ compliance_circuit.circom# Multi-criteria circuit
β βββ simple_compliance.circom # LogP compliance circuit
β βββ circuit.zkey # Proving key
β βββ verification_key.json # Verification key
βββ π src/ # Python services
β βββ witness_generator.py # Witness generation for Circom
β βββ snarkjs_service.py # snarkjs integration
β βββ zkverify_service.py # Submission to zkVerify
β βββ zk_pipeline.py # Full pipeline
βββ π main.py # Main FastAPI API
βββ π test_api.py # API tests
βββ π requirements.txt # Python dependencies
βββ π README.md # This file
# Test full API
python test_api.py
# Test specific module
python src/witness_generator.py "CCO" logp
# Test Circom circuit pipeline
python src/zk_pipeline.py --smiles "CCO" --module logpEach module allows configuring compliance thresholds:
// input.json (used by snarkjs to generate witness)
{
"smiles_hash": "123...456",
"min_logp": "-5000",
"max_logp": "5000",
"logp": "2300"
}For zkVerify integration:
# Automatic proof submission
await zk_comply.submit_to_zkverify(
smiles="CC(=O)OC1=CC=CC=C1C(=O)O",
proofs=generated_proofs
)- Phase 1: Scientific core + ZK circuits (β Complete)
- Phase 2: Circom migration + zkVerify integration (β Complete)
- Phase 3: Web interface + industrial partnerships
- Phase 4: Multi-chain + advanced AI
- Fork the project
- Create your feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
This project is private property and is protected by a proprietary license.
For commercial licensing inquiries, contact via GitHub Issues.
- Iden3 for snarkjs and Circom ecosystem
- RDKit for the computational chemistry library
- ZK Community for support and tools
- Issues: GitHub Issues
- Commercial Licensing: Contact via marcossantos7955@gmail.com
ZK_COMPLY - The future of pharmaceutical compliance is private, verifiable, and decentralized. π
Β© 2025 Marcos Antonio Morais Braga - All rights reserved. Commercial use not authorized.