A privacy-preserving worker reputation system built on Midnight Network.
Workers register a private score on-chain using ZK commitments. Employers verify the score meets a threshold without ever seeing the actual score.
- Worker calls
register()— score is committed on-chain usingpersistentCommit, never stored raw - Employer requests verification with a minimum threshold
- Worker's local proof server generates a ZK proof that
score >= threshold - Network verifies the proof. Score stays private.
trustwork-proof/
├── contract/
│ └── src/
│ ├── trustwork.compact # Compact smart contract
│ ├── witnesses.ts # Private state witness implementations
│ ├── index.ts # Contract exports
│ └── managed/trustwork/ # Compiled artifacts (generated)
├── api/
│ ├── tsconfig.json
│ └── src/
│ └── index.ts # TypeScript API using Midnight SDK
├── cli/
│ ├── tsconfig.json
│ └── src/
│ ├── index.ts # Interactive CLI
│ └── providers.ts # Wallet + provider setup
└── package.json
- Node.js >= 22
- Docker (for the proof server)
- Compact compiler:
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | shgit clone https://github.com/barnazaka/trustwork-proof
cd trustwork-proof
npm installStart the proof server:
docker run -p 6300:6300 midnightntwrk/proof-server:7.0.0 -- midnight-proof-server -vCompile the contract:
npm run compile-contractBuild:
npm run buildRun:
npm startMIDNIGHT_PROOF_SERVER_URL=http://127.0.0.1:6300
MIDNIGHT_INDEXER_URL=http://127.0.0.1:8088/api/v1/graphql
MIDNIGHT_NODE_URL=http://127.0.0.1:9944
- Midnight Network
- Compact
- Midnight JS SDK
- TypeScript