Commit Graph

20 Commits

Author SHA1 Message Date
Tutus Development 0e980e7342 Add Opus native contract for AI workforce integration
Implement comprehensive AI workforce management infrastructure:

- Operator profiles: Registration (requires Vita), verification,
  supervision via RoleOpusSupervisor (ID 24)

- AI Worker lifecycle: Registration, updates, suspension,
  decommissioning with operator ownership tracking

- Task system: Assignment, progress tracking, completion,
  cancellation, and dispute resolution

- Capability certification: Proficiency levels, certification
  tracking, and supervisor-managed verification

- AI Tribute: Configurable percentage of AI-generated value
  directed to Treasury for societal benefit

- Cross-contract integration:
  - Vita: Operator identity verification
  - Lex: Labor rights enforcement (RightLabor)
  - RoleRegistry: Supervisor role authorization
  - VTS: Registration fees and task payments
  - Treasury: Tribute collection

Contract ID: -22, following Tribute (-21)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 08:51:48 +00:00
Tutus Development 1d96eb7a6e Add Scire native contract for universal education
Implement the Scire (Latin for "to know/learn") contract providing
universal education infrastructure for citizens:

Core Features:
- Education accounts: One per Vita holder (soul-bound learning account)
- Learning credits: Annual allocation and spending system
- Certifications: Skill verification with expiry/renewal support
- Enrollments: Program enrollment with credit allocation

Contract Methods:
- Account management: createAccount, getAccount, allocateCredits, getCredits
- Enrollment: enroll, completeEnrollment, withdrawEnrollment, getActiveEnrollment
- Certification: issueCertification, revokeCertification, renewCertification
- Query: verifyCertification, hasCertification, getConfig

Cross-Contract Integration:
- Vita: Account tied to Vita token (one person = one account)
- Lex: Checks RightEducation via HasRightInternal (enforcement logging)
- RoleRegistry: RoleEducator (ID 20) for institutional authorization
- NEO: Committee authority for credit allocation

State Types (pkg/core/state/scire.go):
- EducationAccount, Certification, Enrollment, ScireConfig
- Status enums for each entity type

Technical Details:
- Contract ID: -18
- Storage prefixes: 0x01-0x02 (accounts), 0x10-0x13 (certs), 0x20-0x23 (enrolls)
- Fix: Use (uint64, bool) return for getVitaIDByOwner to properly handle
  TokenID 0 (first registered Vita) instead of using 0 as sentinel value

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 07:25:08 +00:00
Tutus Development 3de7f96fc7 Add IsVitaFeeExempt method to FakeChain
Implement the Feer interface method required after adding Vita fee
exemption functionality. FakeChain returns false for all accounts
since it's a test mock.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 06:53:29 +00:00
Tutus Development 48a8af58df Add Eligere native contract tests
Add basic tests for the Eligere (democratic voting) contract:
- TestEligere_GetConfig: Verify default config retrieval
- TestEligere_GetProposalCount: Verify initial count is 0
- TestEligere_GetProposal_NonExistent: Verify null for non-existent
- TestEligere_CreateProposal_NoVita: Verify Vita requirement
- TestEligere_HasVoted_NoVote: Verify hasVoted returns false
- TestEligere_Vote_NoVita: Verify Vita requirement for voting

Note: Full cross-contract tests for proposal creation/voting with actual
Vita holders would require a helper contract since Eligere uses
GetCallingScriptHash() for authorization (designed for cross-contract).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 06:44:00 +00:00
Tutus Development 9f97b39617 Fix Eligere executeLawAmendment to always create Federal-level laws
Constitutional rights (RightLife, RightLiberty, etc.) are immutable in Lex
code and cannot be amended. Constitutional proposals still require 67%
supermajority but create Federal-level laws since Lex.RatifyAmendmentInternal
correctly panics when given LawCategoryConstitutional.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 06:35:00 +00:00
Tutus Development 30b3be30ce Add Eligere native contract for democratic voting
Implement the Eligere (Latin for "to choose/elect") contract providing
democratic governance infrastructure for citizens:

Core Features:
- Proposal lifecycle: Draft -> Active -> Passed/Rejected -> Executed
- One-person-one-vote via Vita token (soul-bound identity)
- Configurable quorum (default 10%) and thresholds (50%/67%)
- Execution delay for passed proposals before implementation

Contract Methods:
- createProposal: Create proposals with categories (Law, Investment, etc)
- vote: Cast votes (Yes/No/Abstain) with Vita verification
- tallyVotes: Finalize voting after deadline with quorum checks
- executeProposal: Execute passed proposals after delay
- Query methods: getProposal, getVote, hasVoted, getConfig

Cross-Contract Integration:
- Vita: Add GetTotalTokenCount() for quorum calculations
- Lex: Add RatifyAmendmentInternal() for law amendment execution
- Wire Eligere into blockchain.go with proper validation

Test Updates:
- Update Vita suspend test to use Lex liberty restriction (due process)
- Update management tests for Federation/Eligere hardfork timing
- Add Vita registration to VTS tests for property rights checks
- Update NEP17 contracts list to include VTS

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 06:30:43 +00:00
Tutus Development 96f77823e5 Integrate Lex rights enforcement into VTS and Vita contracts
Wire Lex contract into core contracts for constitutional rights enforcement:

VTS Integration:
- Add Lex dependency to VTS struct
- Add property rights check in transferUnrestricted() - blocks transfers
  if sender's RightProperty is restricted via Lex
- Add property rights check in spend() - blocks spending if restricted

Vita Integration:
- Add Lex dependency to Vita struct
- Add liberty rights check in suspend() - requires valid liberty
  restriction order from Lex before suspension (due process)
- Add liberty rights check in revoke() - requires restriction order
  before permanent revocation

Blockchain Integration:
- Add lex field to Blockchain struct
- Add Lex initialization and validation in NewBlockchain()

Contract Wiring:
- Wire vts.Lex = lex for property rights enforcement
- Wire vita.Lex = lex for liberty rights enforcement

This ensures constitutional rights are automatically enforced:
- No property transfers without property rights
- No identity suspension/revocation without judicial due process

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 05:43:31 +00:00
Tutus Development 6d834ff9c2 Add Lex native contract for universal law and rights framework
Implement comprehensive legal framework ensuring equality for all citizens:

- Add 14 immutable constitutional rights (life, liberty, property,
  equality, due process, privacy, expression, assembly, movement,
  education, healthcare, labor, vote, asylum)

- Implement hierarchical law registry with categories:
  Constitutional, Federal, Regional, Local, Administrative

- Add configurable enforcement types per law:
  Automatic (blocks violations), Logging (emits events), Advisory

- Implement rights restriction system requiring due process:
  - All restrictions require judicial authority (RoleJudge)
  - All restrictions require a caseID (legal proceeding)
  - All restrictions must have expiration (no indefinite detention)

- Add cross-contract integration methods:
  HasRightInternal, IsRestrictedInternal, CheckPropertyRight,
  CheckMovementRight, CheckLibertyRight

- Update test data for native contract state serialization

Constitutional rights are code, not data - they cannot be amended
or removed, ensuring true immutability and universal equality.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 05:33:26 +00:00
Tutus Development 5d410f9ba0 Add asylum registry and naturalization for humanitarian protection
Extend Federation contract to protect citizens when their home government
becomes hostile:

- Add Asylum Registry for refugee protection
  - grantAsylum/revokeAsylum methods (committee only)
  - hasAsylum/getAsylumInfo query methods
  - AsylumGranted/AsylumRevoked events
  - Asylum seekers get 100% local Treasury funding with NO inter-chain
    debt to avoid funding hostile governments

- Add Naturalization (Vita Transfer) for permanent immigration
  - naturalize method for permanent citizenship transfer
  - isNaturalizedCitizen/getNaturalizationInfo query methods
  - CitizenNaturalized event
  - Naturalized citizens treated same as local Vita holders

- Add VitaExemptAsylum type for humanitarian override
  - Fee exemption priority: Local Vita > Naturalized > Visitor > Asylum
  - Asylum: 100% from local Treasury, zero inter-chain debt
  - Protects refugees even if home chain revokes their Vita

- Update IsVitaFeeExempt() to check all exemption types
  - Local Vita, naturalized citizens, visitors, and asylum seekers

The one-Vita-per-person rule remains inviolable - Vita is tied only to
a living person globally. This enables protection without duplication.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 04:55:56 +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
Tutus Development b5c1dca2c6 Add VTS PersonToken integration and age-restricted spending
- Require Vita (soul-bound identity token) for minting restricted VTS
- Add age-restricted vendor flag for age-gated purchases (e.g., alcohol)
- Add IsAdultVerified method to PersonToken for age verification
- Update spend/canSpendAt to check age verification for restricted vendors
- Add toBool helper function for boolean stackitem parsing
- Add comprehensive tests for age-restricted functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:16:33 +00:00
Tutus Development 86f5e127c0 Add VTS (Value Transfer System) native contract
VTS is programmable money with spending restrictions and automatic tax
accounting, designed to replace GAS as the primary user-facing currency.

Key features:
- NEP-17 compliant token (symbol: VTS, decimals: 8)
- Spending category restrictions (Food, Shelter, Medical, Education, Transport)
- Vendor registration and management
- Restricted VTS can only be spent at matching vendor categories
- Automatic tax withholding via payWage()
- Transaction recording for tax reporting
- Tax summary queries (getTransactions, getIncomeForPeriod, getTaxWithheld,
  getDeductibleExpenses, getTaxSummary)

Files added:
- pkg/core/native/vts.go: Main VTS contract implementation
- pkg/core/state/vts.go: VTS state structures (VTSBalance, Vendor, TaxConfig, etc.)
- pkg/core/native/native_test/vts_test.go: Comprehensive test suite

Files modified:
- pkg/core/native/contract.go: Added IVTS interface and VTS() accessor
- pkg/core/native/nativenames/names.go: Added VTS constant
- pkg/core/native/nativeids/ids.go: Added VTS ID (-14)
- pkg/core/native/nativehashes/hashes.go: Added VTS hash
- pkg/core/native/native_test/management_test.go: Updated test fixture

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:57:08 +00:00
Tutus Development de34f66286 Add RoleRegistry native contract for hierarchical RBAC
Implements RoleRegistry as a native contract for role-based access control
that integrates with PersonToken for democratic governance.

Key features:
- Built-in roles: COMMITTEE, REGISTRAR, ATTESTOR, OPERATOR
- Hierarchical roles with parent inheritance
- Permission system (resource/action/scope tuples)
- CheckCommittee() method for admin authorization
- TutusCommittee config for initial committee members

PersonToken integration:
- Added RoleRegistry field for cross-contract calls
- checkCommittee helper delegates to RoleRegistry with NEO fallback

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:35:26 +00:00
Tutus Development 99ba041a85 Add PersonToken native contract for soul-bound identity tokens
Implements PersonToken as a native contract following NeoGo patterns:

Core Token Lifecycle (Phase 1):
- register: Create new PersonToken with owner, personHash, isEntity, recoveryHash
- getToken/getTokenByID: Retrieve token by owner address or sequential ID
- exists/totalSupply: Check token existence and get total count
- suspend/reinstate: Committee-controlled token status management

Attribute Management (Phase 2):
- setAttribute/getAttribute: Manage identity attributes with attestation
- revokeAttribute/verifyAttribute: Attribute lifecycle management

Passwordless Authentication (Phase 3):
- createChallenge/fulfillChallenge/verifyAuth: Challenge-response auth flow

Key Recovery (Phase 4):
- initiateRecovery/approveRecovery/executeRecovery/cancelRecovery
- Multi-approval recovery with configurable delay

Cross-Contract Integration (Phase 5):
- validateCaller: Verify calling contract has valid PersonToken
- requireRole: Check caller has specific role assignment
- requireCoreRole: Check caller has core role (User/Verified/Committee/Attestor/Recovery)
- requirePermission: Check caller has resource/action/scope permission

Files added:
- pkg/core/native/person_token.go: Main contract implementation
- pkg/core/state/person_token.go: State structs with serialization
- pkg/core/native/native_test/person_token_test.go: Test coverage

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:04:38 +00:00
Tutus Development cf481e4137 Add Instance Beta for bridge testing
- Create protocol.tutus.beta.yml (Magic 88891)
- Update docker-compose with Alpha and Beta services
- Alpha: 172.201.0.10:10332, Beta: 172.201.0.11:11332

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:29:28 +00:00
Tutus Development b67e4865b8 Add single-node consensus configuration
- Create protocol.tutus.single.yml for local development
- Update docker-compose to use consensus config with validator wallet
- Magic 88890 for single-node, 1-second blocks, 1 validator

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:16:29 +00:00
Tutus Development 84a1caace1 Add Docker support for Tutus
- Update Dockerfile for Tutus branding and Go 1.24
- Rename and simplify entrypoint script
- Add docker-compose.yml for single-node testnet

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:02:00 +00:00
Tutus Development cf8d3ce9f2 Fix build: update branding and local interop module
- Add replace directive for local pkg/interop module
- Fix Makefile sed pattern for MODVERSION extraction
- Update CLI branding to Tutus

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 14:58:36 +00:00
Tutus Development 5598ed7d85 Update all imports from neo-go to tutus-chain
- Updated 3839 import statements in .go files
- Updated all go.mod and go.sum files
- Updated yml and md documentation files
- Module path: github.com/tutus-one/tutus-chain
2025-12-19 14:28:17 +00:00
Tutus Development 62bd7bb153 Initial Tutus chain fork from NeoGo
- Renamed module to github.com/tutus-one/tutus-chain
- Created Tutus network configurations
- Updated Makefile for tutus binary
- Updated service templates
- Added Tutus README
2025-12-19 14:23:04 +00:00