tutus-chain/pkg
Tutus Development c250c16e89 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>
2025-12-27 17:01:59 +00:00
..
compiler Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
config Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
consensus Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
core Add VPP (Vita Presence Protocol) to native Vita contract 2025-12-27 17:01:59 +00:00
crypto Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
encoding Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
interop Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
io Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
network Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
rpcclient Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
services Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
smartcontract Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
storage Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
tutusrpc Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
tutustest Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
util Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
vm Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
wallet Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00