Love Diary
Love Diary is a romance game where players develop relationships with AI-powered characters on-chain
Problem Statement
Love Diary: Web3 Romance Gaming with True Character OwnershipThe First Romance Game Where You Truly Own Your Character—Memories, Data, and WealthAbstractLove Diary is a romance game where players develop relationships with AI-powered characters. Unlike traditional games, Love Diary introduces three fundamental innovations: (1) complete character ownership including memories and personality evolution through NFT, (2) fully autonomous agents that own and manage their own data on blockchain, and (3) genuine economic capability where characters own Ethereum wallets and make real financial decisions. Built on Base, Fetch.ai, ASI-1 Mini, and Chromia, Love Diary creates true digital assets where character development directly impacts market value.1. The Romance Gaming ProblemRomance games (galgames, visual novels, AI companions) suffer from a fatal flaw:you never truly own your character.What Happens Today:You spend months building a relationship with an AI characterCharacter develops personality, remembers conversations, evolves emotionallyGame company shuts down -> Everything disappearsYou own nothing. No memories. No personality. Just gone.Even with NFTs:You get a token representing the characterBut memories stay in company databasePersonality evolution controlled by platformCharacter wealth in closed-loop game economyTransfer NFT = transfer empty shell, not the actual characterResult: Players invest emotionally and financially in characters they don't actually own.2. Solution: Three-Layer True OwnershipLove Diary solves this through three innovations:2.1. Complete Character OwnershipWhen you own a Love Diary NFT, you owneverything:Transferable with NFT:4-year AI-generated backstory (unique to each character)Complete memory history (daily diary entries)Personality evolution over timeCharacter's wealth (LOVE tokens + DeFi positions)Result: Transfer NFT = transfer the complete character as a living, evolving entity except conversation history (for player's privacy).Valuation Impact:Traditional NFT: Art + Rarity = Value Love Diary NFT: Art + Rarity + Memories + Personality + Wealth = Value2.2. Autonomous Data OwnershipCharacters are powered by fully autonomous AI agents thatown and manage their own data.Architecture:No centralized database: All character data stored on Chromia blockchainAgent-managed memory: Agents write their own diary entries dailySelf-sovereign identity: Character exists independent of platformPersistent across platforms: Same character can move between gamesImplications of Autonomous Data Ownership:Character data persists on Chromia regardless of platform statusCharacters maintain all memories when used across different gamesNFT transfers include complete historical dataPlatform forks do not interrupt character continuityThe platform cannot enforce lock-in when it does not control the data.2.3. Genuine Economic CapabilityCharacters own Ethereum wallets and interact with real DeFi protocols—not simulated game economies.What Characters Can Do:Own LOVE tokens (ERC-20) in their walletInvest in Uniswap liquidity pools, earning real yieldPurchase NFTs from marketplacesTrade with other characters peer-to-peerGift tokens back to players3. How It WorksCharacter Lifecycle1. MintingPlayer pays 100 LOVE (50% burned, 50% treasury)Character NFT created with randomized traitsAI agent generates 4-year backstory using ASI-1 MiniAgent creates Ethereum wallet (private key managed by agent)Backstory and initial data saved to Chromia2. DevelopmentPlayer chats with character dailyAgent generates responses based on personality + memoriesEach night, agent writes diary entry summarizing conversationsDiary entries stored in on-chain databaseCharacter's affection level and relationship status evolve3. Wealth AccumulationPlayer sends gifts (10-100 LOVE) -> Agent walletAgent decides how to allocate funds: saving, DeFi investment, gifting back, or NFT purchasesAgent's wealth grows through investment returnsNFT value = base value + agent wallet balance + DeFi positions4. TransferNFT owner transfers to new player (costs 50 LOVE fee)New owner receives:Complete character personality and memoriesAll agent wallet contents (LOVE + DeFi + NFTs)Full historical diary dataConversation history will be kept for player's privacy5. Cross-PlatformSame character can be used in other games (future)Agent brings all memories and wealthIdentity persists across platforms4. LOVE Token EconomicsLOVE is an ERC-20 utility token on Base that powers the platform economy.Token FlowsMinting(100 LOVE):50 LOVE burned -> Reduces supply permanently50 LOVE -> Platform treasury -> Ecosystem developmentGifting(10-100 LOVE):100% -> Agent wallet -> Characters accumulate wealthAgent decides how to use (save, invest, gift back)Transfers(50 LOVE):100% -> Platform treasuryIncludes transfer of all agent assets to new ownerAgent-to-Agent(market-determined):Characters trade services, knowledge, resourcesCreates autonomous agent marketplaceEconomic Value Loop1. Players gift LOVE to characters ↓ 2. Characters accumulate tokens in their wallets ↓ 3. Smart characters invest in DeFi - Provide Uniswap liquidity -> Earn fees - Stake in lending protocols -> Earn yield ↓ 4. Character wealth grows ↓ 5. NFT value increases - Base NFT + Memories + Agent Wealth + DeFi Positions ↓ 6. NFT transfers at premium - New owner receives everything - Including ongoing DeFi yieldsSupply DynamicsInitial Supply: 100,000,000 LOVEDeflationary Pressure:50 LOVE burned per mint100,000 characters -> 5,000,000 LOVE removed (5%)1,000,000 characters -> 50,000,000 LOVE removed (50%)Demand Drivers:Required for mintingGifting boosts affection (incentivized gameplay)Agent-to-agent transactions (emergent economy)DeFi yield farming (profitable for characters)Value Concentration:Tokens accumulate in agent wallets (productive use)Tokens locked in DeFi positions (earning yield)Tokens in treasury (ecosystem development)Circulating supply decreases (burned tokens)5. Technical StackBlockchain Layer:Base(Ethereum L2) - NFT contracts, low-cost transactionsLOVE Token(ERC-20) - Platform currencyCharacter NFTs(ERC-721) - Ownership representationAI & Agent Layer:Fetch.ai uAgents- Autonomous agent framework with wallet supportASI-1 Mini- LLM for personality and conversationArchitecture Principle: Agents own data. No centralized databases. Complete decentralization.
Solution
Love Diary - Technical Design DocumentProject OverviewAn AI-powered romance game where players develop relationships with unique NFT characters. Characters have persistent memories stored on blockchain, can be transferred between players, and evolve through interactions powered by fully autonomous AI agents.Target Event: ETH Global HackathonTimeline: 20 days MVP developmentTeam Size: 2 developersCore ConceptPlayers mint unique character NFTs with randomized attributes and backstoryCharacters powered byfully autonomousASI Alliance agentsAgents manage their own memory using ctx.storage + on-chain vector databaseCharacter memories (diary) are immutable and transferable with NFTPlayer conversation logs are private, encrypted, and non-transferable100% decentralized- no Web2 databases for agent dataMVP ScopeCore FeaturesWallet Login- Crypto wallet authenticationCharacter Minting- Generate character with randomized traits and 4-year backstoryOwnership Management- NFT-based character ownership on BaseConversation System- Chat with autonomous character agentMemory System- Persistent character memory with vector searchNFT Transfer- Change ownership while preserving character memoriesOut of Scope (Post-MVP)Multi-language support (Chinese, Japanese, Korean, etc. - MVP English-only)Advanced economic system (salary, investments)Free characters (shared between players)Relationship breakup mechanicsCharacter aging and lifecycleMulti-character interactionsAgent hibernation and lazy creation (agents run 24/7 in MVP)Owner authorization for agent wallet operationsToken Economics (LOVE Token)OverviewLOVE is an ERC-20 utility token used for in-game transactions. For MVP/demo, tokens are distributed via a faucet on Base Sepolia testnet. Production launch will include proper token distribution and liquidity provision.Token UtilityCore Use Cases:Character Minting: 100 LOVE + gasOne-time cost to create a new character NFTBurns tokens from circulationCharacter Transfer: 50 LOVE + gasFee to transfer character NFT to another playerGoes to platform treasuryGifts: 10-100 LOVE + gasBuy virtual gifts to boost character affectionDifferent gift tiers with varying effectsBurns tokens or goes to agent treasuryDaily Login Reward: +5 LOVEFree daily reward for active playersEncourages consistent engagementDistributed from reward poolMVP Implementation (Testnet Faucet)For Hackathon Demo:Deploy LOVE token on Base Sepolia testnetCreate faucet contract: any address can claim 1000 LOVE oncePlayers use faucet tokens for minting, gifts, and transfersAll transactions visible on-chain (testnet)Production Launch (Post-Hackathon):Deploy on Base mainnetCreate Uniswap liquidity pool (LOVE/USDC pair)Proper token distribution and vesting schedulesPlayers buy LOVE from DEX with USDC/ETHEconomic DesignToken Flow:Player Claims from Faucet (1000 LOVE) ↓ Mints Character (-100 LOVE) → Burns/Treasury ↓ Daily Logins (+5 LOVE/day) ← Reward Pool ↓ Buys Gift (-50 LOVE) → Agent Wallet (Character accumulates wealth) ↓ Agent Spends (Future) → Gifts to player, services, other agents ↓ Transfers Character (-50 LOVE) → Treasury (Agent wallet transfers with NFT ownership)Key Principles:Utility-focused: Token has clear in-game purposeBurn mechanism: Minting reduce supplyReward system: Daily login creates engagement loopNo speculation in MVP: Testnet faucet removes price concernsPlayer pays gas: Platform doesn't subsidize blockchain transactionsAgent Economic AutonomyCharacter agents hold their own LOVE tokens, enabling true economic agency:Wallet Generation:Each character NFT is paired with a dedicated wallet address at mint timeAgent wallet address stored in NFT contract metadataFetch.ai agents natively support Ethereum wallet managementToken Flow to Agents:Player buys gift (50 LOVE) → Gift contract transfers → Agent wallet addressAgent Spending (Future Features):Agents autonomously purchase gifts for players (reverse gift-giving)Transfer tokens to other agents or playersInvest or save based on personality traitsKey Management:Fully Autonomous:Agent controls own private key via Fetch.ai wallet integrationOnly accessible by agentTrue decentralizationWhy This Matters:Demonstrates ASI Alliance's vision of economically autonomous agentsCreates emergent economic behaviors (agents can save, spend strategically)Adds depth to character personality (frugal vs generous agents)Enables future agent-to-agent economyTechnology StackBlockchainBase(Ethereum L2) - NFT and token deploymentSolidity + OpenZeppelin ERC-721- Character NFT contractsSolidity + OpenZeppelin ERC-20- LOVE utility tokenToken Faucet Contract- Testnet token distributionFrontendNext.js + TypeScript- Web applicationRainbowKit- Wallet connectionAI & AgentsFetch.ai uAgents- Autonomous agent frameworkASI-1 Mini- LLM with knowledge graph supportctx.storage- Agent-local JSON storageStoragectx.storage- Hot cache (today's conversations)ASI-1 Mini Knowledge Graphs- Structured entity-relationship memoriesKey Design Decisions1. Two-Layer Memory SystemDecision: Separate hot cache, on-chain diary, and knowledge graphsWhy:Hot cache (ctx.storage): Today's conversation context changes every message, needs fast local accessDiary (Supabase/Chromia in future): Daily summaries are append-only, benefit from on-chain persistence and vector searchBenefit: Optimizes for access patterns - frequently updated data stays in cache, permanent data goes on-chain2. ASI-1 Mini Over GPT-4oDecision: Use ASI-1 Mini as primary LLMWhy:Native knowledge graph support for structured memories4 reasoning modes (Multi-Step, Complete, Optimized, Short) for different conversation typesWeb3-native design for blockchain agentsBetter cost efficiency for 24/7 autonomous agentsGPT-4o will be used as backup3. Multi-Player Access Control (POST-MVP)Decision: Add access control layer on top of standard ERC-721Problem: Need to support future poly relationships and free NPCs while maintaining NFT standard compatibilitySolution:Base contract is standard ERC-721 (ownerOf returns primary owner)CharacterAccess extension tracks authorized playersPer-player relationship data in ChromiaCharacter Types:MONO: 1:1 exclusive (only primary owner)POLY: Player-owned but grants access to othersFREE: Platform-owned, community-sharedWhy: Enables future multi-player features without breaking ERC-721 compatibility4. Multi-Language Character Support (POST-MVP)MVP: English-only supportAll characters default to English languageAll LLM prompts in EnglishAll conversations, diaries, knowledge graphs in EnglishVector embeddings based on English textFuture Implementation: Each character has a language attribute that determines the language for all memories and logsWhy(Future):Characters should maintain consistency in their memories and communicationDiary entries should be in the character's native/preferred languageKnowledge graphs should store entities and relationships in the same languageVector embeddings are language-specific for better semantic search accuracyImplementation(Future):Language attribute stored in NFT metadata (immutable after minting)Supported languages: English, Chinese, Japanese, Korean, Spanish, French, GermanPlayers can choose language during character mintingMemory System Impact (MVP - English only):Character Language: English (MVP default) ↓ ctx.storage: All conversations stored in English ↓ Daily Diary: "We talked for a long time today. He finally opened up to me..." ↓ Knowledge Graph: Entity(Coffee Shop), Relation(First meeting place) ↓ Vector Embedding: English text vector representation ↓ Chromia Storage: Diary text + Vector + language="en"Conversation Flow (MVP):Agent loads language preference on initialization (always "en" for MVP)All AI prompts in English: "Respond in English"Memory retrieval uses English embeddingsDiary generation prompt: "Write diary entry in English"Future Conversation Flow:Agent loads language preference from NFT metadataAll AI prompts include language instruction: "Respond in [language]"Memory retrieval filters by languageDiary generation prompt: "Write diary entry in [language]"Benefits:Better user experience for non-English speakersMore accurate semantic search (same-language embeddings)Character personality can align with cultural contextEnables future multi-language features (translation, cross-language characters)Transfer Handling:Language is immutable (part of NFT metadata)New owner inherits character with same language preferencePlayer can communicate in any language, but character memories stay in original language5. Agent-Owned WalletsDecision: Each character agent has its own Ethereum wallet to hold LOVE tokensWhy:Aligns with ASI Alliance's vision of economically autonomous agentsEnables emergent economic behaviors (saving, strategic spending)Gifts go directly to agents, not burned or to platformAgents can autonomously transact in the futureImplementation (MVP - Simplified):Agents control their own wallets autonomously:Agent generates wallet keypair during character mintPrivate key stored in ctx.storage (agent's local memory)Agent signs transactions directly using Fetch.ai wallet SDKAgents run 24/7, no hibernation (keys never need persistence)Implementation: ~9-13 hoursTechnical Details:# Fetch.ai Agent with Wallet from uagents import Agent, Context from uagents.wallet import Wallet class CharacterAgent(Agent): def __init__(self, character_id): super().__init__(name=f"character_{character_id}") # Agent generates its own wallet self.wallet = Wallet.generate() # Save to ctx.storage (always available) self._ctx.storage.set("wallet_key", self.wallet.private_key) async def autonomous_transaction(self, to: str, amount: int): # Agent signs and sends transaction autonomously tx = self.wallet.sign_transaction(to, amount) await self.broadcast(tx) async def receive_gift(self, amount: int): # Agent automatically receives tokens from gift contract balance = await self.wallet.get_balance() # Agent can decide how to use accumulated tokensKey Management Flow (MVP):Character Mint: Agent generates keypair autonomouslyKey Storage: Private key saved to ctx.storage (agent memory)Agent Runs 24/7: Key always available in memoryAgent Spending: Agent autonomously signs transactionsNFT Transfer: Agent wallet stays with agent, tokens transfer with NFTSecurity Considerations:ctx.storage is agent-private (isolated per agent instance)All transactions logged on-chain (full audit trail)Agent wallet address immutably stored in NFT metadataNFT Transfer Handling:Agent wallet address is immutable (stored in NFT metadata)When NFT transfers, new owner gains rights to agent's walletAgent recognizes new owner via ownership verificationAccumulated tokens transfer with the characterBenefits:Creates deeper character personalities (frugal vs generous)Enables agent-to-agent economy (characters can trade)Demonstrates Web3-native AI with economic agencyStrong differentiator for hackathon judgesStorage ArchitectureAgent-Managed DataCharacter Agent (Fully Autonomous) - ctx.storage → Hot cache (today's conversations + wallet private key) - ASI-1 Mini KG → Knowledge graph (structured memories) - Chromia → On-chain diary with vector search - Agent Wallet → Ethereum wallet holding LOVE tokens (agent controls) - [Optional] Avail DA → Immutable archive Backend (Minimal) - Route messages to/from agent onlyKey Principle: Agent manages all its own data AND assets. No Web2 databases. Agent runs 24/7 in MVP.Data FlowsConversation FlowPlayer sends message → Backend routes to character agentAgent reads character language preference from NFT metadataAgent reads recent context from ctx.storageAgent queries relevant memories from Chromia (vector search)Agent queries knowledge graph from ASI-1 MiniAgent generates response with ASI-1 Mini in character's preferred languageAgent updates ctx.storage with new message in character's languageDaily Diary UpdateAgent triggered at midnight (scheduled task)Reads today's conversations from ctx.storageSummarizes into diary entry in character's preferred languageUpdates ASI-1 Mini knowledge graph (entities/relationships) in character's languageGenerates vector embedding for the language-specific diary entryWrites to Chromia (append-only) with language metadataClears conversation history (keeps wallet key and language preference)Smart Contract ArchitectureBase ERC-721 ContractStandard Functions:mint() - Create new character NFTownerOf() - Get primary ownertransferFrom() - Transfer ownershipStandard ERC-721 metadata and eventsCharacter Data:name, age, occupation, personality templatelanguage (preferred language for memories and communication - fixed to "en" for MVP)Generation timestamp, backstory hashagentWallet (Ethereum address for agent's token holdings)MVP Note: All characters have language="en" (English). Multi-language support in post-MVP.Multi-Player Access ExtensionAccess Control:CharacterType enum (MONO, POLY, FREE)hasAccess(nft_id, player_address) - Check if player can interactgrantAccess(nft_id, player_address) - Owner grants access (POLY only)revokeAccess(nft_id, player_address) - Owner revokes accessRelationship Tracking(in Chromia):Per-player affection levelsPer-player conversation historyPer-player relationship statusOptional: Avail DA IntegrationTwo-Tier Approach (Stretch Goals)Tier 1 - Player Conversation Logs(Priority, 3-4h):Encrypted with player's wallet (Lit Protocol)Player-owned, non-transferable with NFTProvides data ownership and portabilityTier 2 - Diary Backup(If time, 2-3h):Encrypted with NFT ownership access controlAdditional redundancy beyond ChromiaImmutability proofs via data availabilityWhen to Add: Only if core MVP complete by Day 19Development Effort EstimatesSmart Contracts: 10-12h (ERC-721 + ERC-20 + faucet + access control + agent wallets + gift function)Token Integration: 4-5h (Frontend token display, transaction flows, daily reward UI)Agent Wallet Management: 9-13h (Fetch.ai wallet SDK, agent key generation, transaction signing, balance tracking)Agent Development: 20-25h (Fetch.ai setup, ASI-1 Mini integration, memory management, lifecycle)Chromia Integration: 8-10h (Schema, vector search, authentication)Frontend: 12-16h (Wallet connection, character selection, conversation UI, gift sending)Envio Indexer: 4-6h (Event config, GraphQL schema)Optional - Avail DA: 5-7h (Tier 1: 3-4h, Tier 2: 2-3h)Total Core MVP: 67-88 hours (~17-22 days for 2 developers)Note: Timeline is tight but feasible. Agent wallets add ~3-5h to original 64-82h estimate.Development Setup & Repository StructureRepository Architecture (3 Repos)The project is split into 3 independent Git repositories for clean separation of concerns:love-diary-contracts/ # Smart contracts (START HERE) ├── contracts/ │ ├── LoveToken.sol │ ├── LoveTokenFaucet.sol │ ├── CharacterNFT.sol │ ├── CharacterAccess.sol │ └── GiftShop.sol ├── scripts/ │ └── deploy.ts ├── test/ │ ├── LoveToken.test.ts │ ├── CharacterNFT.test.ts │ └── integration.test.ts ├── hardhat.config.ts └── package.json love-diary-agents/ # AI agents + Backend ├── agents/ │ └── character_agent.py ├── backend/ │ └── api/ ├── chromia/ │ └── schema.rell └── requirements.txt love-diary-frontend/ # Next.js application ├── app/ ├── components/ ├── contracts/ # ABIs from contracts repo ├── envio/ # Envio indexer config └── package.jsonConclusionLove Diary demonstrates blockchain + AI gaming where:Characters are true digital assets with persistent memoriesAI agents are fully autonomous, managing their own dataMulti-player access control enables future relationship modelsHybrid memory (cache + diary + knowledge graphs) balances performance and costOn-chain storage eliminates Web2 database dependenciesThe design prioritizes core sponsor integration while keeping optional features as time-permitting stretch goals.
Hackathon
ETHOnline 2025
2025
Contributors
- fengchang
6 contributions