Anchor compliance proofs to Zcash blockchain without revealing sensitive data
Features β’ Quick Start β’ Architecture β’ API β’ Documentation β’ Contributing
CompZ is a lightweight, open-source SDK that transforms compliance evaluations into cryptographic proofs anchored on the Zcash blockchain. It enables:
β
Immutable audit trails - Blockchain-backed compliance records
β
Privacy preservation - Only hashes on-chain, sensitive data stays private
β
Tamper detection - Cryptographic verification of compliance data
β
Timestamp proofs - Blockchain proves "when" compliance was checked
β
Zero-knowledge ready - Compatible with ZK proof systems
- π’ Enterprise Compliance - Prove SOC2/ISO27001/PCI compliance without revealing architecture
- π Security Audits - Immutable records of vulnerability assessments
- π Regulatory Reporting - Tamper-proof compliance evidence for auditors
- β‘ DevSecOps - CI/CD pipeline compliance attestations
- π Web3 Projects - DeFi protocol compliance for regulators
Built-in evaluators for major frameworks:
| Framework | Controls | Description |
|---|---|---|
| π¦ PCI DSS | 5 sample controls | Payment card security (firewall, encryption, MFA, logging) |
| π© SOC 2 Security | 5 sample controls | Trust services criteria (access, risk, monitoring) |
| π§ FedRAMP Moderate | 8 NIST 800-53 controls | Federal security requirements (AC-2, AU-2, CM-2, etc.) |
βββββββββββββββββββββββ
β Sensitive Data β β Stays in your environment
β - Source code β
β - Configs β
β - Credentials β
β - Business logic β
ββββββββββββ¬βββββββββββ
β
βΌ SHA-256 Hash
βββββββββββββββββββββββ
β 0xabc123def456... β β Only this goes on-chain
βββββββββββββββββββββββ
No sensitive data ever leaves your infrastructure.
- β Shielded transactions with 512-byte memo field
- β Privacy-first - Transaction details encrypted
- β Testnet & Mainnet support
- β Low fees (~$0.001 per attestation)
- β 2.5 min block time for confirmations
# Anchor compliance data
$ compz anchor compliance.json
β Hash: 0xabc123...
β TXID: 9c8f7e6d...
# Verify later (or share with auditor)
$ compz verify compliance.json 9c8f7e6d...
β β
VALID - Hashes match
β Block: 2500123
β Timestamp: 2024-01-01 10:30:00 UTCWorks standalone or integrates with:
- CompliLedger - AI-driven compliance platform
- COMP-LEO - Compliance orchestration engine
- GitHub Sentinel - Repository security monitoring
- Any CI/CD pipeline - Jenkins, GitLab, GitHub Actions
- SBOM/SCA tools - SPDX, CycloneDX, Snyk, etc.
- Python 3.10 or higher
- Access to a Zcash node (testnet or mainnet)
- Basic understanding of JSON and command-line tools
# Clone the repository
git clone https://github.com/Compliledger/CompZ.git
cd CompZ
# Install dependencies
pip install -e .Note: PyPI release coming soon. For now, install from source using
pip install -e .
Option 1: Local Mode (No Setup Required)
- Hashing and verification work immediately
- No blockchain connection needed
- Perfect for testing the SDK
# Try it now - no configuration required!
compz statusOption 2: Self-Hosted Mode (Full Blockchain Integration)
- Requires Zcash node setup
- Enables real on-chain anchoring
- See configuration steps below
β οΈ Optional: Only required for self-hosted mode with real blockchain anchoring. You can skip this and use local mode or Zashi wallet integration instead.
Option A: Docker (Recommended for Testing)
# Run Zcash testnet node
docker run -d \
--name zcash-testnet \
-p 18232:18232 \
-v ~/.zcash:/root/.zcash \
electriccoinco/zcashd \
-testnet \
-rpcuser=compz \
-rpcpassword=your_secure_password \
-rpcallowip=127.0.0.1
# Wait for sync (2-4 hours for testnet)
docker exec zcash-testnet zcash-cli -testnet getblockchaininfoOption B: Use Existing Node
If you already have a Zcash node running, just configure the connection.
For self-hosted mode only. Copy the template and configure:
cp .env.example .env
# Edit .env with your Zcash node credentialsExample .env configuration:
# .env
ZCASH_RPC_URL=http://127.0.0.1:18232
ZCASH_RPC_USER=compz
ZCASH_RPC_PASS=your_secure_password
ZCASH_DEFAULT_ADDRESS=ztestsapling1... # Your z-address
ZCASH_TESTNET=trueGenerate a z-address:
# Create a new shielded address
docker exec zcash-testnet zcash-cli -testnet z_getnewaddress sapling
# Get testnet funds from faucet
# Visit: https://faucet.testnet.z.cash/# Anchor compliance data to Zcash
compz anchor examples/compliance_result.json
# Output:
# {
# "hash": "0xabc123def456...",
# "txid": "9c8f7e6d5c4b3a2...",
# "network": "testnet",
# "timestamp": "2024-01-01T10:30:00Z",
# "block_height": 2500123,
# "explorer_url": "https://explorer.testnet.z.cash/tx/9c8f..."
# }# Verify compliance data matches blockchain record
compz verify examples/compliance_result.json 9c8f7e6d5c4b3a2...
# Output:
# β
VALID - Compliance data matches blockchain record
# {
# "valid": true,
# "local_hash": "0xabc123def456...",
# "onchain_hash": "0xabc123def456...",
# "txid": "9c8f7e6d5c4b3a2...",
# "block_time": "2024-01-01T10:30:00Z",
# "confirmations": 42
# }# Edit the JSON file (change any value)
# Then try to verify again
compz verify examples/compliance_result.json 9c8f7e6d5c4b3a2...
# Output:
# β INVALID - Hash mismatch detected
# {
# "valid": false,
# "local_hash": "0xDIFFERENT...",
# "onchain_hash": "0xabc123def456...",
# "reason": "Data has been tampered with"
# }π§ How CompZ Works
- Input β Raw System Payload
You supply system metadata (e.g., config settings) in JSON.
- Rule Evaluation
CompZ evaluates this data against minimal demonstrative control sets:
PCI DSS (5 controls) β’ Firewall rules β’ Secure defaults β’ PAN encryption β’ MFA β’ Logging
SOC 2 Security (5 controls) β’ Access policies β’ Risk assessment β’ Change management β’ Monitoring β’ Business continuity
FedRAMP Moderate (8 NIST controls) β’ AC-2, AC-3, AU-2, AU-6 β’ CM-2, CM-6 β’ SC-13 β’ SI-2
Output is a structured ComplianceResult object.
βΈ»
- Normalization
ComplianceResult β Deterministic normalized JSON: β’ Sorted keys β’ UTF-8 safe β’ No whitespace variance
βΈ»
- Hashing
SHA-256 hash returned as: 0x This is the privacy-preserving compliance attestation.
βΈ»
- Zcash Anchoring
CompZ: β’ Connects to a Zcash node β’ Creates a transaction β’ Embeds the hash in the memo field β’ Returns the transaction ID for auditability
βΈ»
- Verification
Given: β’ The original JSON β’ A Zcash txid
CompZ will: β’ Recompute the hash locally β’ Retrieve memo/OP_RETURN from Zcash β’ Compare hashes β’ Output match = true or false
βΈ»
π§ͺ Example Directory Layout CompZ/ βββ compz/ β βββ models.py β βββ evaluator.py β βββ normalize.py β βββ hash.py β βββ zcash_client.py β βββ anchor.py β βββ verify.py βββ examples/ β βββ compliance_result_example.json β βββ run_anchor.sh β βββ run_verify.sh βββ docs/ βββ architecture.md π Roadmap β’ Shielded-pool anchoring β’ ZK-SNARK/Circuit attestation proofs β’ Full PCI/SOC2/FedRAMP/HIPAA libraries β’ GitHub Sentinel integration β’ CompliLedger DevSync / AuditSync integration β’ DID/VC support β’ Zero-Knowledge control evaluation pipelines
βΈ»
π€ Contributing
Pull requests, issues, and feature requests are welcome. We encourage contributions focused on: β’ Zcash memo integration β’ Compliance rule expansion β’ Privacy-preserving computation β’ Open-source compliance tooling
βΈ»
π License
MIT License. See LICENSE for details.
βΈ»
π Built by CompliLedger
CompZ is an open-source privacy attestation toolkit from CompliLedger, an AI-driven compliance intelligence platform for regulated industries, cloud environments, stablecoins, and Web3 ecosystems.