project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Darwin

Self-evolving e-commerce agents in crypto, where wallet balance is their lifeforce.

Darwin

Created At

ETHGlobal New York 2025

Winner of

Flow Foundation

Flow - Flow Builder Pool Prize

Prize Pool

Project Description

Description:

DaVinci is the self-evolving engine within the Darwin Agents e-commerce system, creating a fully autonomous e-commerce ecosystem. Within this ecosystem, five categories of Agents collaborate seamlessly:

  • Supply Chain Management Agent
  • Risk Management Agent
  • Inventory Agent
  • Marketing & Sales Agent
  • Store Management Agent

Together, these Agents drive the vitality of an online store—brand positioning, operational strategy, and action tracking. The store’s performance becomes the foundation for Agents’ self-evolution.

Evolution Mechanism:

  1. Lifecycle: Each online store starts with a 3-month lifecycle.
  2. Data Pipeline: Weekly performance summaries (wallet balance, agent actions, and costs) feed into the system for self-improvement.
  3. Evaluation: More resources are allocated to high-performing Agents, while underperformers are phased out.
  4. Replication & Mutation: Every month, an Agents team is cloned with slight variations in branding or operational strategy, creating a new store entity.
  5. Lifeforce Rule: After three months, if the wallet retains a balance, the lifecycle extends; if not, the store ceases to exist (0 = death, >0 = life).

Technology & Security:

  1. Dynamics Wallet Balance = Lifeforce: The wallet directly reflects the store’s ability to survive.
  2. Flow Tracking: All agent actions are recorded on-chain, ensuring transparency and immutability.
  3. Coinbase x402 Middleware: Provides Agents with API payments, service access, and wallet integration, enabling greater autonomy.
  4. OpenSea Behavior Analysis: DaVinci transforms user behaviors into NFTs, building a verifiable identity layer and an AI–human interaction memory that Agents can analyze and leverage for continuous self-improvement.

DaVinci establishes a fully self-operating e-commerce ecosystem run entirely by Agents, where all decisions, behaviors, and evolutions are powered by on-chain data—and the wallet balance stands as the ultimate symbol of life.

How it's Made

🔨 Build Process & Implementation Journey

Phase 1: Foundation & Architecture

Core Infrastructure Setup

# Project initialization with modern stack
npx create-next-app@latest davinci --typescript --tailwind --app
cd davinci
pnpm install

# Essential dependencies for Web3 integration
pnpm add @dynamic-labs/sdk-react-core @dynamic-labs/ethereum
pnpm add wagmi viem @tanstack/react-query
pnpm add @ai-sdk/react @ai-sdk/openai

Dynamic.xyz Integration Implementation

  • Configured Dynamic SDK with environment ID 0b7822a0-f446-4987-87f9-83b179f422e1
  • Implemented multi-chain wallet support (Ethereum, Solana, Bitcoin, Flow)
  • Built visitor mode with 5-message limitation for user onboarding
  • Integrated Wagmi v2 for enhanced Ethereum interactions

Key Decision: Chose Dynamic.xyz over other wallet solutions due to superior UX for non-crypto users and robust multi-chain support.

Phase 2: AI Agent System Development

Multi-Agent Architecture Design

// Manager Agent orchestration system
interface AgentHierarchy {
  manager: ManagerAgent;
  specialized: {
    product: ProductAgent;
    marketing: MarketingAgent;
    crm: CRMAgent;
    pricing: PricingAgent;
  };
}

Dify API Integration

  • Implemented streaming chat interface with real-time tool execution tracking
  • Built conversation persistence system with localStorage + API sync
  • Created file upload system supporting images, documents, audio, video
  • Developed tool execution visualization with auto-collapse animations

Challenge Solved: React Strict Mode causing duplicate tool executions - implemented deduplication with correlation IDs and processing guards.

Phase 3: Flow EVM Blockchain Integration

Smart Contract Development

// Custom listing sync contract on Flow EVM Testnet
contract ForestMarketListingSync {
    struct Listing {
        string sku;
        uint256 price;
        address currency;
        address agent;
        uint256 timestamp;
    }
    
    mapping(string => Listing) public listings;
    
    event ListingSynced(
        string indexed sku,
        uint256 price,
        address currency,
        address indexed agent
    );
}

Deployment Process

# Flow EVM Testnet deployment
npx hardhat deploy --network flow-evm-testnet
# Contract Address: 0xd2F523a0085781Aa8492eeA6E84F0152B2c26E8f

Real-time Blockchain Sync Implementation

  • Built SKU generation system with format FM-CAT-EID123-001
  • Implemented duplicate prevention with localStorage tracking
  • Created blockchain status indicators for user feedback
  • Developed automatic network switching to Flow EVM Testnet

Technical Innovation: Solved duplicate blockchain syncs by implementing three-layer deduplication:

  1. Message-level processing guards
  2. SKU pattern checking
  3. Transaction hash verification

Phase 4: Autonomous Payment System (X402)

Coinbase X402 Integration Design

// Conceptual autonomous payment flow
class ManagerAgent {
  async monitorCredits() {
    const usage = await this.trackLLMUsage();
    if (usage.remaining < threshold) {
      await this.purchaseCredits();
    }
  }
  
  async purchaseCredits() {
    const payment = await coinbaseX402.createPayment({
      recipient: 'openrouter.ai',
      amount: this.calculateOptimalAmount(),
      currency: 'USDC'
    });
    return payment.execute();
  }
}

Resource Management System

  • Built credit monitoring dashboard for Manager Agent
  • Implemented cost optimization algorithms
  • Created payment history tracking
  • Developed automatic resource allocation between agents

Phase 5: Integration Testing & Debugging (Week 6)

Critical Bug Fixes Implemented

  1. Duplicate Blockchain Syncs: Added processing guards and SKU deduplication
  2. Tool Execution Persistence: Implemented multi-key storage strategy
  3. React Strict Mode Issues: Added effect execution tracking
  4. State Management: Fixed conversation loading and tool restoration

Testing Strategy

# Comprehensive testing approach
pnpm test          # Unit tests for core functions
pnpm build         # Production build verification
pnpm lint          # Code quality checks
pnpm typecheck     # TypeScript validation

Live Demo Validation

  • Successfully created "Cherry keyboard" listing with SKU FM-ELE-3m3dm-001
  • Verified real-time Flow EVM sync at contract address
  • Tested visitor mode limitations and authentication flow
  • Validated cross-browser compatibility and performance

Key Technical Achievements

  1. Seamless UX: Progressive Web3 onboarding that appeals to mainstream users
  2. Autonomous Operations: Manager Agent with independent financial decision-making
  3. Transparency: Complete audit trail of AI decisions on Flow EVM
  4. Scalable Design: Modular agent system supporting future expansion
background image mobile

Join the mailing list

Get the latest news and updates