Issue #54
[FEAT] Implement Reputation Scoring Engine with Sybil Resistance
馃敶 Priority: High
Difficulty: Hard
Estimated Effort: 3-4 days
Relevant Files: src/modules/reputation/reputation.service.ts, src/jobs/calculateReputation.job.ts
Labels: core-logic, reputation, priority:high
Requirements
-
Trust Score Calculation
- Everyone starts at 50. Implement time-decay logic (recent transactions weigh more heavily).
- Successful escrow/swap:
+1 point. Lost dispute: -15 points. Dispute raised: -5 points pending investigation.
- Reward streak bonus of
+5 for users with >10 consecutive successful transactions.
-
Sybil Resistance
- Limit reputation gain between the same two parties to a maximum of 3 transactions.
- Transactions under $20 USDC equivalent do NOT positively impact the Trust Score.
- If a user's score drops below 20, automatically suspend their ability to create new listings.
-
Asynchronous Job
- Create a BullMQ job
CalculateReputationJob that triggers immediately when an escrow completes and runs an hourly sweep for active users.
- Cache the resulting score in
user_profiles for instant reads by the frontend.
-
Testing Requirements
- Unit tests: Provide mocked transaction histories and assert the exact expected score output.
- Sybil test: Feed 50 transactions between the same two users and assert the score barely increases after the 3rd transaction.
Issue #54
[FEAT] Implement Reputation Scoring Engine with Sybil Resistance
馃敶 Priority: High
Difficulty: Hard
Estimated Effort: 3-4 days
Relevant Files:
src/modules/reputation/reputation.service.ts,src/jobs/calculateReputation.job.tsLabels:
core-logic,reputation,priority:highRequirements
Trust Score Calculation
+1point. Lost dispute:-15points. Dispute raised:-5points pending investigation.+5for users with >10 consecutive successful transactions.Sybil Resistance
Asynchronous Job
CalculateReputationJobthat triggers immediately when an escrow completes and runs an hourly sweep for active users.user_profilesfor instant reads by the frontend.Testing Requirements