Attestations (EAS)
WEFA uses the Ethereum Attestation Service (EAS) for portable, verifiable receipts of player actions. All attestations are offchain-first with optional onchain timestamping.
Schemas
wefa.careEvent
| Field | Type | Description |
|---|---|---|
playerId | string | Player identifier |
plantId | string | Plant being cared for |
actionMask | uint32 | Bitmask of care actions performed |
photoHash | bytes32 | Hash of the care photo (not the photo itself) |
streakDays | uint16 | Current streak length |
energyEarned | uint16 | Energy rewarded |
timestamp | uint64 | When the care event occurred |
wefa.gameResult
| Field | Type | Description |
|---|---|---|
sessionId | string | Game session identifier |
gameType | uint8 | Enum: tic-tac-toe, mancala, ludo |
mode | uint8 | Enum: device, local, world |
players | address[] | Two player addresses/DIDs |
winner | uint8 | 0, 1, or 255 (draw) |
joinCodeHash | bytes32 | Hash of join code (never raw) |
timestamp | uint64 | When the match ended |
wefa.evolution
| Field | Type | Description |
|---|---|---|
creatureId | string | Creature that evolved |
fromStage | uint8 | Previous stage |
toStage | uint8 | New stage |
xpSpent | uint32 | XP consumed |
timestamp | uint64 | When evolution occurred |
Trust Levels
Meaning comes from who signs, not whether it's onchain or offchain:
| Level | Signer | Description |
|---|---|---|
| L0 | None | Local-only (Dexie), no attestation |
| L1 | Self | Player signs their own receipt |
| L2 | Peer | Both players sign matching game result |
| L3 | Witness | Shrine host or event organizer co-signs |
| L4 | Issuer | Green Goods or partner org verifies evidence |
Job Queue Integration
Events automatically queue attestation jobs:
plant care event → queue 'care-event' job
creature nurture → queue 'nurture-event' job
creature evolution → queue 'evolution-event' job
game completion → queue 'game-result' job
badge earned → queue 'badge-earned' job
Job handlers load the event from Dexie, encode the schema data, sign an offchain EAS attestation (EIP-712), and store the attestation UID back in Dexie.
Privacy
- Photo hashes only: Attestations contain
photoHash, never raw images - Join code hashes only: Never store raw session codes in attestations
- Offchain by default: No gas costs, instant, private
- Opt-in sharing: Players choose whether to publish proof references via AT Protocol
Key Files
src/modules/attestation/eas-offchain.ts- EAS signing and verificationsrc/modules/attestation/schemas.ts- Schema definitionssrc/modules/job-queue/handlers.ts- Job handlers for each event typesrc/types/attestation.ts- AttestationService interface