cryptomodels

Instant micropayments for LLM tasks via Yellow Network state channels

cryptomodels

Created At

HackMoney 2026

Project Description

CryptoModels aimed to enable pay per API call micropayments for AI models using Yellow Network's state channel infrastructure. The vision was simple: users deposit USDT on mainnet, get unified balance via Yellow's clearing layer, and pay freelancers (AI model providers) instantly per API call with sub cent payments settled off chain.

What we tried to build:

  • CLI tool with freelance serve, and hire <url> commands
  • Freelancers monetize AI inference with HTTP 402 Payment Required + state channel payments
  • Cross-chain deposits/withdrawals via Yellow Network's Custody Contract

Why it's incomplete: We spent the majority of hackathon time attempting to integrate Yellow Network's mainnet. The mainnet integration proved significantly more complex than anticipated. Their contracts are not even verified on Etherscan/Sourcify. The documentation wasn't sufficient for a straightforward USDC mainnet deposit to unified balance flow. The system's complexity involving ClearNode connections, custody contracts, and state channel management required more time to properly understand and implement than the hackathon allowed.

How it's Made

Tech Stack:

  • TypeScript with @erc7824/nitrolite SDK for Yellow Network state channels
  • Commander.js for CLI, viem for Ethereum wallet/signatures
  • Express.js for freelancer HTTP server with 402 Payment Required flow
  • WebSocket connection to Yellow's ClearNode (clearnet-sandbox.yellow.com)

What we built (testnet):

  • State channel creation and management via ClearNode
  • Wallet/session persistence in ~/.cryptomodels/
  • Incremental payment states (0.001 USDC per API call)
  • HTTP 402 payment flow with X-Payment header validation

Where we got stuck (mainnet): Yellow Network's architecture involves multiple components: Custody Contracts for deposits, ClearNode for state management, and complex message signing flows. While testnet worked with their sandbox, transitioning to mainnet USDT required understanding undocumented flows around:

  • Mainnet ClearNode endpoints and authentication
  • Proper deposit flow from Custody Contract to unified balance
  • Channel creation with real assets

Additionally, Yellow's mainnet contracts are not verified on Etherscan or Sourcify, making it difficult to understand the on-chain interactions and verify the contract logic we'd be trusting with user funds.

The SDK and documentation are oriented toward their specific use cases. Adapting it for a generic "deposit USDT → pay anyone" flow proved challenging within hackathon constraints. We cloned nitrolite repo and studied the code, but ran out of time before achieving mainnet functionality.

Lesson learned: State channel infrastructure is powerful but requires significant integration effort beyond typical DeFi protocols.

background image mobile

Join the mailing list

Get the latest news and updates