Commit Graph

5 Commits

Author SHA1 Message Date
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
Tutus Development f006f1623c Native contracts complete - all tests passing 2025-12-27 15:45:47 +00:00
Tutus Development a63b3dcb70 Migrate from GitHub to git.marketally.com
Update all module paths and import statements from github.com/tutus-one
to git.marketally.com/tutus-one for self-hosted Git server migration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 09:54:31 -05:00
Tutus Development 3eaae08a38 Implement ADR-008 on-chain security features
Add three key security mechanisms for the Tutus blockchain:

1. Commit-Reveal for Investments (collocatio.go)
   - Two-phase investment pattern to prevent front-running attacks
   - User commits hash(amount || nonce || investor), waits 10 blocks,
     then reveals actual amount with nonce for verification
   - Methods: commitInvestment, revealInvestment, cancelCommitment
   - InvestmentCommitment state type with CommitmentStatus enum
   - Configurable delay (10 blocks) and reveal window (1000 blocks)

2. Whale Concentration Limits (collocatio.go)
   - Enforces max 5% (configurable) of opportunity pool per investor
   - Prevents wealth concentration in investment opportunities
   - Check performed in invest() method before accepting investment

3. Sybil Resistance Vesting (vita.go)
   - New Vita tokens have 30-day vesting period (2,592,000 blocks)
   - VestedUntil field added to Vita state struct
   - Methods: setVesting (committee), isFullyVested, getVestingInfo
   - Cross-contract methods: IsFullyVestedInternal, GetVestedUntil
   - Prevents mass creation of fake identities for manipulation

Documentation:
- Added docs/ADR-008-UI-Implementation-Guide.md for frontend developers
  with code examples, flow diagrams, and error handling guidance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:23:54 +00:00
Tutus Development f03564d676 Add free GAS for Vita holders with cross-chain fee splitting
Rename PersonToken to Vita (soul-bound identity token) and implement
fee exemption system for citizens:

- Add Federation native contract for cross-chain Vita coordination
  - Visitor registry for Vita holders from other chains
  - Configurable visiting fee percentage (default 50%)
  - Inter-chain debt tracking for settlement between chains

- Modify GAS contract to burn fees from Treasury for Vita holders
  - Local Vita: 100% paid by local Treasury
  - Visiting Vita: Split between local Treasury and inter-chain debt
  - Deficit tracking when Treasury is underfunded

- Update mempool and blockchain to skip fee checks for Vita exempt users
  - Add IsVitaFeeExempt() to Feer interface
  - Modify verifyAndPoolTx() to allow zero-fee transactions

- Rename PersonToken -> Vita across codebase
  - Update state, native contract, and tests
  - Maintain same functionality with clearer naming

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 04:27:55 +00:00