tutus-chain/pkg/core/state
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
..
annos.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
collocatio.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
contract.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
contract_invocation.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
contract_invocation_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
contract_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
deposit.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
deposit_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
eligere.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
lex.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
mpt_root.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
mpt_root_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_state.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_state_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
notification_event.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
notification_event_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
opus.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
oracle.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
oracle_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
palam.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
pons.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
role_registry.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
salus.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
scire.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
sese.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
state_anchors.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
storage_item.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
tokens.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
tokens_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
tribute.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
validator.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
vita.go Add VPP (Vita Presence Protocol) to native Vita contract 2025-12-27 17:01:59 +00:00
vts.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00