lucid_reputation program stores verifiable reputation data for AI assets on Solana. It tracks feedback scores, third-party validations, and supports revocation — all linked to cryptographic receipt hashes.
Program ID (devnet): 4FWEH1XQb7p1pU9r8Ap8xomDYVxdSdwk6fFT8XD63G3A
Instructions
| Instruction | Description |
|---|---|
init_stats | Initialize a PassportStats PDA with zeroed counters |
submit_feedback | Submit a score (1-100) linked to a receipt hash |
submit_validation | Validate a receipt (confirms an interaction occurred) |
revoke_feedback | Revoke previously submitted feedback (original submitter only) |
Account Structures
PassportStats
PDA seeds:["stats", passport_id_bytes]
Rolling aggregates maintained atomically on every feedback submission or revocation.
| Field | Type | Description |
|---|---|---|
passport_id | String | Passport identifier (max 64 chars) |
feedback_count | u32 | Total feedback entries ever created |
validation_count | u32 | Total validation entries |
total_score | u64 | Sum of non-revoked scores |
avg_score | u16 | Average score * 100 (2-decimal precision) |
last_updated | i64 | Last modification timestamp |
FeedbackEntry
PDA seeds:["feedback", passport_id_bytes, index_le_bytes]
| Field | Type | Description |
|---|---|---|
passport_id | String | Target passport |
from | Pubkey | Submitter |
score | u8 | Score (1-100) |
category | String | Feedback category (max 32 chars, e.g., “accuracy”) |
receipt_hash | [u8; 32] | Receipt proving the interaction |
asset_type | u8 | 0=model, 1=compute, 2=tool, 3=agent, 4=dataset |
metadata | String | Additional context (max 256 chars) |
timestamp | i64 | Submission time |
revoked | bool | Whether this feedback was revoked |
index | u32 | Sequential index (used as PDA seed) |
ValidationEntry
PDA seeds:["validation", passport_id_bytes, receipt_hash]
| Field | Type | Description |
|---|---|---|
passport_id | String | Target passport |
validator | Pubkey | Validator |
valid | bool | Whether the receipt is confirmed valid |
receipt_hash | [u8; 32] | Receipt being validated |
asset_type | u8 | Asset type code |
metadata | String | Validation context (max 256 chars) |
timestamp | i64 | Validation time |
Usage
Revocation
Only the original submitter can revoke their feedback. On revocation:feedback.revokedis set totruestats.total_scoreis decremented by the revoked scorestats.avg_scoreis recomputed from remaining non-revoked entriesstats.feedback_countis not decremented (it tracks total entries for PDA derivation)
Events
| Event | Emitted When |
|---|---|
FeedbackSubmitted | New feedback created (includes passport_id, score, index, receipt_hash) |
ValidationSubmitted | New validation created (includes valid flag, receipt_hash) |
FeedbackRevoked | Feedback revoked (includes original score for off-chain reconciliation) |
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)