mirror of
https://github.com/luxfi/fhe.git
synced 2026-07-26 23:16:08 +00:00
- data-seal: Verifiable Data Integrity Seal (PIP-0010/LP-0535) FHE-encrypted tamper-proof sealing with Public/ZK/Private modes, batch sealing, homomorphic verification - content-provenance: AI & Media Content Provenance (PIP-0011/LP-7110) Model manifests, output attestation via homomorphic comparison, media derivation DAGs - encrypted-crdt: Encrypted CRDT (PIP-0013/LP-6500) LWW-Register with FHE values, OR-Set with tag-based add/remove, Lamport timestamp conflict resolution, deterministic merge - shadow-governance: Shadow Government Protocol (PIP-7010) Anonymous ministries, encrypted voting with homomorphic tallying, nullifier-based anti-fraud, quorum enforcement Each example includes Solidity contracts, Hardhat tests, CLI tasks, and README linking to corresponding PIP and LP specifications.
Shadow Governance - Anonymous Parallel Government
FHE-encrypted anonymous governance protocol for shadow government operations.
Implements: PIP-7010 / Shadow Government Protocol for pars.vote
Features
- Shadow Ministries: Parallel government departments monitoring real governance
- Anonymous Proposals: Submit proposals without revealing identity
- Encrypted Voting: FHE-encrypted ballots — homomorphic tallying without decrypting individual votes
- Nullifier-based Anti-Fraud: Prevent double-voting without linking votes to identities
- Quorum Enforcement: Configurable quorum requirements
How It Works
- Admin creates shadow ministries (Education, Health, Economy, etc.)
- Anyone submits proposals tied to a ministry
- Participants vote with encrypted ballots using unique nullifiers
- After the voting period, tally decrypts aggregate counts (not individual votes)
- Finalization checks quorum and majority to pass/reject
Anonymity Guarantees
- Vote privacy: Individual votes are FHE-encrypted; only the aggregate is decrypted
- Voter unlinkability: Nullifier = hash(secret || proposalId) — cannot link voter to vote
- Proposal anonymity: Proposals can be submitted via relay/mixer for full anonymity
Quick Start
npm install
npx hardhat compile
npx hardhat test
# Deploy
npx hardhat task:deploy-gov
# Create a ministry
# (done programmatically in deploy or via admin functions)
# Create a proposal
npx hardhat task:propose --contract <addr> --content "Reform education" --ministry <id>
# Vote anonymously
npx hardhat task:vote --contract <addr> --proposal 0 --choice yes --secret "my-secret"
# Tally after voting period
npx hardhat task:tally --contract <addr> --proposal 0
# List ministries
npx hardhat task:list-ministries --contract <addr>
Related
- Go implementation: github.com/luxfi/fhe/cmd/vote — Boolean-circuit encrypted voting
- Pars voting app: pars.vote — Production deployment
- PIP-0012: Encrypted Voting protocol
- LP-6500: fheCRDT Architecture