⚠️ Depends on: [BE-28] Wallet Linking, [BE-21] Reviews Backend — the on-chain verification check and reputation API must exist. [CONTRACT-01] — Reputation contract must be deployed.
Overview
The Soroban reputation contract computes a 0–1000 composite score from on-chain ratings, but this score is never displayed to users. There are also no on-chain verification badges visible in the UI. This issue surfaces blockchain-based reputation data across the platform.
Technical Details
1. On-Chain Reputation Score Display
Add to Carrier Public Profile (/carriers/[id]):
- Below the existing star rating section, add an "On-Chain Reputation" card:
- Reputation score (0–1000): displayed as a gauge/progress bar (e.g., 750/1000)
- On-time rate: percentage (e.g., "94% on-time")
- Total on-chain ratings: count
- "Verified on Stellar Blockchain" badge with an external link to Stellar Expert for the contract
- If the carrier has no wallet linked: show "On-chain reputation not available"
Backend endpoint needed (add to CarriersController):
GET /carriers/:id/reputation — queries the Soroban reputation contract's get_score function for the carrier's walletAddress, returns { score, onTimeRate, totalRatings }. If the carrier has no wallet, return { unavailable: true }.
2. Verification Badges
Create a reusable <VerifiedBadge /> component (frontend/components/reputation/verified-badge.tsx):
- Props:
type ('email' | 'wallet' | 'carrier'), tooltip (optional)
- Email verified: gray envelope icon + "Email Verified"
- Wallet verified: Stellar logo icon + "On-Chain Verified"
- Carrier verified (by admin): blue shield icon + "Verified Carrier"
- Show in: user menu dropdown, carrier profile cards, bid cards, shipment detail party info
3. Trust Score Panel (Shipper Dashboard — Carrier Selection Context)
On the bids tab of a shipment detail page (from [FE-06]), add a "Trust Score" summary to each bid card:
- DB rating: average stars from
GET /carriers/:id/reviews
- On-chain score: from
GET /carriers/:id/reputation
- Verified badges: email / wallet / carrier
- Overall trust label: "High Trust" (score > 700 + verified) / "Moderate" / "Unverified"
- This helps shippers make informed bid acceptance decisions
Acceptance Criteria
Overview
The Soroban reputation contract computes a 0–1000 composite score from on-chain ratings, but this score is never displayed to users. There are also no on-chain verification badges visible in the UI. This issue surfaces blockchain-based reputation data across the platform.
Technical Details
1. On-Chain Reputation Score Display
Add to Carrier Public Profile (
/carriers/[id]):Backend endpoint needed (add to
CarriersController):GET /carriers/:id/reputation— queries the Soroban reputation contract'sget_scorefunction for the carrier'swalletAddress, returns{ score, onTimeRate, totalRatings }. If the carrier has no wallet, return{ unavailable: true }.2. Verification Badges
Create a reusable
<VerifiedBadge />component (frontend/components/reputation/verified-badge.tsx):type('email' | 'wallet' | 'carrier'),tooltip(optional)3. Trust Score Panel (Shipper Dashboard — Carrier Selection Context)
On the bids tab of a shipment detail page (from [FE-06]), add a "Trust Score" summary to each bid card:
GET /carriers/:id/reviewsGET /carriers/:id/reputationAcceptance Criteria
GET /carriers/:id/reputationqueries the Soroban contract and returns the score<VerifiedBadge />renders correctly for all three badge types with correct icons