telegram link : t.me/nullifiersystem
1. Summary & Core Promise
Currently, providers staking collateral in contracts/reputation/src/lib.rs must link their public Stellar wallet address to their registered provider identity in apps/api/src/lib/store.ts. This allows external observers to track provider net worth and physical cash transaction volume on-chain.
This feature implements a Zero-Knowledge Anonymous Provider Staking & Shielded Reputation Proof Engine. Providers stake collateral into a shielded Soroban pool (contracts/reputation/src/lib.rs), receive a cryptographic commitment H(secret + stake), and generate local zk-SNARK Merkle membership proofs (contracts/zk-credential/src/lib.rs) to prove minimum stake compliance without revealing their public Stellar address.
2. Background & Architectural Risks
- Financial Surveillance: Public address linkage allows competitors to track exact provider collateral balances and physical locations.
- Double-Spending Shielded Stakes: Without nullifier tracking, a provider could use a single shielded stake commitment to verify multiple fake provider profiles.
3. Database Layer Specifications
Migration SQL (032_add_shielded_provider_staking.sql)
CREATE TABLE shielded_stake_commitments (
commitment_hash VARCHAR(64) PRIMARY KEY,
merkle_leaf_index INT NOT NULL,
staked_amount_stroops BIGINT NOT NULL,
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE shielded_provider_nullifiers (
nullifier_hash VARCHAR(64) PRIMARY KEY,
provider_id VARCHAR(64) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
Data Locking (SELECT FOR UPDATE)
BEGIN;
SELECT nullifier_hash FROM shielded_provider_nullifiers WHERE nullifier_hash = $1 FOR UPDATE;
-- Verify nullifier has not been spent/used by another provider profile...
COMMIT;
4. Backend Route & Service Layer Specifications
Route: POST /api/v1/provider/shielded-stake/verify
- Validation: Zod validates ZK proof payload,
merkleRoot, and nullifierHash.
- Locking: DB transaction acquires
SELECT FOR UPDATE on shielded_provider_nullifiers.
- Proof Verification: Verifies ZK proof against on-chain Merkle root.
- Response: Returns
HTTP 200 OK with anonymous provider verification status.
5. Background Processors / Workers
(Client WASM Proof Generation + Soroban On-Chain Verifier)
6. Frontend / UI Component Specifications
Component: mobile/frontend/src/components/ShieldedStakingModal.tsx
- Modal allowing providers to deposit shielded collateral, generate local WebAssembly ZK stake proofs, and attach anonymous verification badges to their profile.
7. Rigor & Test Plan
- Rust Smart Contract Test (
contracts/reputation/src/lib.rs): Verify shielded stake commitment deposit and Merkle root update.
- Double-Verification Nullifier Test (
shielded_stake_test.ts): Assert reusing the same nullifier hash fails with 409 Conflict.
8. Relevant Files Inventory
New Files to Create
apps/api/src/db/migrations/032_add_shielded_provider_staking.sql
apps/api/src/routes/shielded-staking.ts
apps/api/src/routes/__tests__/shielded-staking.test.ts
mobile/frontend/src/components/ShieldedStakingModal.tsx
Existing Files to Modify
contracts/reputation/src/lib.rs
contracts/zk-credential/src/lib.rs
apps/api/src/lib/crypto.ts
apps/api/src/lib/stellar.ts
apps/api/src/app.ts
mobile/frontend/src/pages/Dashboard.tsx
9. Acceptance Criteria
10. Contributor Notes
- ⚠️ Nullifier Safety: ALWAYS check
shielded_provider_nullifiers in a SELECT FOR UPDATE block to prevent identity cloning.
telegram link : t.me/nullifiersystem
1. Summary & Core Promise
Currently, providers staking collateral in
contracts/reputation/src/lib.rsmust link their public Stellar wallet address to their registered provider identity inapps/api/src/lib/store.ts. This allows external observers to track provider net worth and physical cash transaction volume on-chain.This feature implements a Zero-Knowledge Anonymous Provider Staking & Shielded Reputation Proof Engine. Providers stake collateral into a shielded Soroban pool (
contracts/reputation/src/lib.rs), receive a cryptographic commitmentH(secret + stake), and generate local zk-SNARK Merkle membership proofs (contracts/zk-credential/src/lib.rs) to prove minimum stake compliance without revealing their public Stellar address.2. Background & Architectural Risks
3. Database Layer Specifications
Migration SQL (
032_add_shielded_provider_staking.sql)Data Locking (
SELECT FOR UPDATE)4. Backend Route & Service Layer Specifications
Route:
POST /api/v1/provider/shielded-stake/verifymerkleRoot, andnullifierHash.SELECT FOR UPDATEonshielded_provider_nullifiers.HTTP 200 OKwith anonymous provider verification status.5. Background Processors / Workers
(Client WASM Proof Generation + Soroban On-Chain Verifier)
6. Frontend / UI Component Specifications
Component:
mobile/frontend/src/components/ShieldedStakingModal.tsx7. Rigor & Test Plan
contracts/reputation/src/lib.rs): Verify shielded stake commitment deposit and Merkle root update.shielded_stake_test.ts): Assert reusing the same nullifier hash fails with409 Conflict.8. Relevant Files Inventory
New Files to Create
apps/api/src/db/migrations/032_add_shielded_provider_staking.sqlapps/api/src/routes/shielded-staking.tsapps/api/src/routes/__tests__/shielded-staking.test.tsmobile/frontend/src/components/ShieldedStakingModal.tsxExisting Files to Modify
contracts/reputation/src/lib.rscontracts/zk-credential/src/lib.rsapps/api/src/lib/crypto.tsapps/api/src/lib/stellar.tsapps/api/src/app.tsmobile/frontend/src/pages/Dashboard.tsx9. Acceptance Criteria
10. Contributor Notes
shielded_provider_nullifiersin aSELECT FOR UPDATEblock to prevent identity cloning.