Skip to main content

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

FieldTypeDescription
playerIdstringPlayer identifier
plantIdstringPlant being cared for
actionMaskuint32Bitmask of care actions performed
photoHashbytes32Hash of the care photo (not the photo itself)
streakDaysuint16Current streak length
energyEarneduint16Energy rewarded
timestampuint64When the care event occurred

wefa.gameResult

FieldTypeDescription
sessionIdstringGame session identifier
gameTypeuint8Enum: tic-tac-toe, mancala, ludo
modeuint8Enum: device, local, world
playersaddress[]Two player addresses/DIDs
winneruint80, 1, or 255 (draw)
joinCodeHashbytes32Hash of join code (never raw)
timestampuint64When the match ended

wefa.evolution

FieldTypeDescription
creatureIdstringCreature that evolved
fromStageuint8Previous stage
toStageuint8New stage
xpSpentuint32XP consumed
timestampuint64When evolution occurred

Trust Levels

Meaning comes from who signs, not whether it's onchain or offchain:

LevelSignerDescription
L0NoneLocal-only (Dexie), no attestation
L1SelfPlayer signs their own receipt
L2PeerBoth players sign matching game result
L3WitnessShrine host or event organizer co-signs
L4IssuerGreen 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 verification
  • src/modules/attestation/schemas.ts - Schema definitions
  • src/modules/job-queue/handlers.ts - Job handlers for each event type
  • src/types/attestation.ts - AttestationService interface