tutus-chain/pkg/core/native
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
..
native_test Add VPP (Vita Presence Protocol) to native Vita contract 2025-12-27 17:01:59 +00:00
nativehashes Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
nativeids Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
nativenames Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
nativeprices Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
noderoles Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
ancora.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
annos.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
audit_logger.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
canary_deployment.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
circuit_breaker.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
compatibility_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
config_registry.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_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
crypto.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
crypto_blspoints.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
crypto_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
designate.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
doc.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
event_archival.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
federation.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
interop.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
invariants.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
invocation_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
ledger.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
management.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
management_neotest_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
management_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_lub.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_neo_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_nep17.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_tutus.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
native_tutus_candidate.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
nativenames_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
neo_types.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
notary.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_types.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
oracle_types_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
policy.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
policy_test.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
role_registry_domain.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
std.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
std_test.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
treasury.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
util.go Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
validation.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