Skip to content

aaronjmars/contxdoteth

Repository files navigation

🧠 The context layer of Ethereum - contx.eth

Transform your X profile into an AI-aware .contx.eth identity in 30 seconds.

Preview Preview 2 Preview 3

✨ What is contx.eth?

contx.eth creates AI-enhanced ENS profiles by analyzing your X (Twitter) account and storing rich context in .contx.eth domains. This enables personalized AI interactions across any platform that supports ENS lookups.

🎯 Value Proposition

  • 30-second setup: From X profile to AI-enhanced ENS
  • Universal compatibility: Works with Claude, ChatGPT, and future AI agents
  • Self-sovereign: You own your AI context on-chain
  • Base mainnet optimized: Low gas fees and instant transactions
  • Complete resolution: Forward and reverse lookup with custom registry

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Privy App ID
  • OpenAI Api Key
  • Twitter Api Key
  • Base mainnet RPC URL
  • Base mainnet ETH

Installation

# Clone the repository
git clone https://github.com/aaronjmars/contxdoteth
cd contxdoteth

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your values

Environment Variables

# Required
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
NEXT_PUBLIC_BASE_RPC_URL=https://mainnet.base.org

# Contract Addresses
NEXT_PUBLIC_BASE_REGISTRY_ADDRESS=0xa2bbe9b6a4ca01806b1cfac4174e4976ce2b0d70
NEXT_PUBLIC_ETH_RESOLVER_ADDRESS=0x20cb27a5f5c77968650aaaa66e11ba9334689068

# Required for AI context generation
TWITTER_API_KEY=your_twitterapi_io_key_here
OPENAI_API_KEY=your_openai_api_key_here

# Optional
NEXT_PUBLIC_ETHEREUM_RPC_URL=https://eth.llamarpc.com
NEXT_PUBLIC_BASESCAN_URL=https://basescan.org

Development

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm run start

# Lint code
npm run lint

Open http://localhost:3000 to see the app.

πŸ—οΈ How It Works

1. Connect X Account

  • Secure OAuth via Privy
  • Extracts profile data and recent tweets
  • Analyzes communication style and interests

2. Generate AI Context

  • GPT-4o powered analysis of 50-100 recent tweets
  • Extracts personality traits, communication style, and expertise areas
  • Creates rich, personalized context optimized for AI interactions
  • Real AI analysis (not template-based) for authentic profiles

3. Deploy to Custom Registry

  • Registers .contx.eth domain via ContxRegistry contract
  • Atomic transaction: Registration + AI context storage + forward resolution
  • Stores comprehensive AI context in contract text records during registration
  • Instant registration with complete functionality and AI-enhanced profile

4. AI-Enhanced Interactions

  • Any AI agent can read your ENS profile
  • Personalized responses based on your stored context
  • Universal compatibility across platforms

πŸ“Š AI Context Schema

The app stores structured AI-generated data in ENS text records:

{
  "name": "aaronjmars",
  "bio": "Architect of onchain realities and venture explorer, Aaron navigates Web3 with wit and insight. A critic of industry absurdities and advocate for innovative context engineering.",
  "lore": "From early fascination with systems architecture to becoming a key voice in onchain innovation, sparked by desire to redefine digital interaction parameters.",
  "messageExamples": ["Hey! What's your take on this?", "That's a fascinating perspective", "Let me know if you want to dive deeper"],
  "postExamples": ["Just shipped something interesting πŸš€", "The intersection of AI and Web3 is wild", "Context engineering is the future"],
  "adjectives": ["analytical", "witty", "insightful", "innovative", "technical"],
  "topics": ["web3", "onchain architecture", "AI", "venture capital", "context engineering"],
  "style": {
    "tone": "casually insightful with irreverence",
    "humor": "dry and sarcastic", 
    "technicality": "balances depth with accessibility",
    "engagement": "provocative and norm-questioning"
  },
  "knowledge": ["onchain architecture", "venture capital", "AI context engineering", "crypto markets"],
  "avatar": "https://pbs.twimg.com/profile_images/...",
  "description": "Turning architecture into onchain adventures with a wink and a nudge"
}

All fields are dynamically generated by GPT-4o analysis of actual Twitter content.

πŸ› οΈ Technical Architecture

Core Technologies

  • Frontend: Next.js 15, TypeScript, Tailwind CSS 4
  • Authentication: Privy (Web3 + Social)
  • Blockchain: Base mainnet, viem, wagmi
  • Design: Apple-inspired minimal aesthetic
  • AI: GPT-4o via OpenAI API for rich context analysis
  • Data: TwitterAPI.io for real tweet fetching and analysis

Key Components

src/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ ai/            # GPT-4o AI context generation
β”‚   β”‚   β”œβ”€β”€ ccip-read/     # CCIP-Read ENS resolution
β”‚   β”‚   └── x-data/        # Registration data processing
β”‚   β”œβ”€β”€ dashboard/         # User dashboard
β”‚   └── page.tsx          # Landing page
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ Hero.tsx          # Landing page hero
β”‚   β”œβ”€β”€ LandingPage.tsx   # Main landing page
β”‚   β”œβ”€β”€ TwitterConnectionScreen.tsx # Twitter auth flow
β”‚   └── ui/               # Reusable components
β”œβ”€β”€ lib/                   # Utilities
β”‚   β”œβ”€β”€ ens.ts            # ENS contracts & helpers
β”‚   └── hooks/            
β”‚       β”œβ”€β”€ useENS.ts     # Main ENS integration hook
β”‚       └── useTwitterConnection.ts # Twitter auth handling
└── providers/            # Context providers
    └── PrivyProvider.tsx  # Web3 auth wrapper

Smart Contracts

Custom Implementation:

  • ContxRegistry: Custom ENS subdomain registry with key-value profile storage
  • ContxResolver: CCIP-Read resolver for ENS compatibility

Key Implementation Features:

  • βœ… Custom registry: .contx.eth domains with ContxRegistry contract
  • βœ… AI context storage: All AI data stored as text records during registration
  • βœ… Forward resolution: name.contx.eth β†’ address
  • βœ… Text records: Complete AI context automatically stored on-chain
  • βœ… Real-time verification: Instant status checking post-registration
  • βœ… Profile management: View and update ENS records through dashboard

🎨 Design System

Apple-inspired minimal aesthetic:

  • Colors: Primary (#0071e3), Success (#34c759), Warning (#ff9500)
  • Typography: SF Pro Display/Text system fonts
  • Components: Rounded corners, subtle shadows, smooth transitions
  • Responsive: Mobile-first design with seamless desktop experience

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow existing component patterns
  • Maintain Apple-style design consistency
  • Test manually through dashboard interface

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Transform your X profile into an AI-aware .contx.eth identity in 30 seconds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published