Add VPP (Vita Presence Protocol) to native Vita contract
Implement real-time proof-of-humanity presence tracking as OAuth 2.0 extension:
Native Contract Methods:
- recordPresence(sessionId, deviceHash): Record heartbeat for caller's Vita
- getPresence(tokenId): Get presence record with computed status
- getPresenceStatus(tokenId): Get computed status (offline/online/away/invisible)
- setPresenceVisibility(invisible): Toggle invisible mode
- getPresenceConfig(): Get VPP configuration values
State Types (pkg/core/state/vita.go):
- PresenceStatus enum: Offline, Online, Away, Invisible
- PresenceRecord: TokenID, LastHeartbeat, SessionID, DeviceHash, Status, Invisible
- PresenceConfig: PresenceWindow (60), AwayWindow (300), MinHeartbeatInterval (15),
MaxHeartbeatInterval (60) - all in blocks (~seconds)
Security Features:
- Session and device hash must be exactly 32 bytes
- Rate limiting: Min 15 blocks between heartbeats
- Invisible mode: Heartbeats recorded but status hidden
- Caller must have active Vita token
Internal Methods for Cross-Contract Use:
- GetPresenceRecord, GetPresenceStatusInternal, IsOnline, IsPresent
Events:
- PresenceRecorded(tokenId, blockHeight, sessionId)
- PresenceVisibilityChanged(tokenId, invisible)
Tests (7 new):
- GetPresenceConfig, GetPresence_NonExistent, GetPresenceStatus_NonExistent
- RecordPresence_NoVita, RecordPresence_InvalidSession, RecordPresence_InvalidDevice
- SetPresenceVisibility_NoVita
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>