January 30, 2025
xOPS Team
12 min read

Val Town Deep Dive: Building the Functions.WTF Way

A comprehensive analysis of Val Town's architecture and how we're implementing similar functionality in the xOPS ecosystem with switchboard.wtf services and flowstack.wtf flows.

architectureserverlessp2pcomparison

What is Val Town?

Val Town is a browser-based, collaborative platform where you can write, deploy, run, and manage small bits of JavaScript/TypeScript code ("vals") in the cloud. It's designed to reduce the friction of deployment, setup, and maintenance by managing much of the infrastructure automatically.

Core Features & Capabilities

HTTP APIs & Web Handlers

Vals can respond to HTTP requests (GET, POST, etc.) with execution time constraints depending on your plan.

Cron & Scheduled Jobs

Schedule vals to run on intervals or cron expressions, with minimum 15-minute intervals on free plans.

Data Persistence

SQLite for structured data and blob storage for arbitrary files, with recommendations for external storage for large files.

Collaboration & Versioning

Projects group multiple vals with versioning, branches, and remixing capabilities for team collaboration.

The Functions.WTF Approach

While Val Town provides an excellent centralized solution, we're building something fundamentally different: a decentralized, peer-to-peer compute network that leverages the xOPS infrastructure with specialized services for different use cases.

Our Architecture Stack

1

xOPS Core Network

The foundational P2P compute network using Hyperswarm for peer discovery and Hypercore for verifiable execution logs. This provides the decentralized infrastructure that Val Town's centralized approach cannot match.

2

switchboard.wtf Services

Specialized microservices for common patterns: HTTP endpoints, cron jobs, webhook handlers, and API integrations. These services run on the xOPS network but provide higher-level abstractions.

3

flowstack.wtf Flows

Visual workflow builder for complex multi-step processes, data transformations, and conditional logic. Think of it as Val Town's project system but with visual flow design and distributed execution.

Feature Comparison: Val Town vs Functions.WTF

FeatureVal TownFunctions.WTF
ArchitectureCentralized cloud platformDecentralized P2P network
Execution ModelServerless functions on Val Town's infrastructureDistributed execution across peer nodes
VerificationPlatform-managed loggingCryptographic attestations on Hypercore
PricingFreemium with usage limitsCredit-based P2P economy
CollaborationProjects, branches, remixingOpen source, forkable functions
AI AssistantTownie (Claude 4 Sonnet)Integrated AI code generation

Implementation Roadmap

Phase 1: Core Infrastructure ✅

We've completed the foundational xOPS network with P2P communication, secure execution sandbox, and cryptographic verification.

  • Hyperswarm P2P networking
  • VM2-based secure execution
  • Ed25519 cryptographic signatures
  • Credit-based economic system

Phase 2: switchboard.wtf Services 🚧

Building specialized services that provide Val Town-like abstractions while running on the decentralized network.

  • HTTP endpoint service
  • Cron job scheduler
  • Webhook handler service
  • Email integration service
  • Database service (SQLite + blob storage)

Phase 3: flowstack.wtf Flows 🔮

Visual workflow builder for complex multi-step processes and conditional logic execution.

  • Visual flow designer
  • Conditional branching
  • Data transformation nodes
  • Integration with switchboard services
  • Real-time execution monitoring

Why This Matters

Val Town Limitations

  • • Centralized control and single point of failure
  • • Vendor lock-in with proprietary platform
  • • Limited by platform's resource constraints
  • • No cryptographic verification of execution
  • • Pricing model favors platform over developers

Functions.WTF Advantages

  • • Truly decentralized with no single point of failure
  • • Open source and forkable functions
  • • Cryptographic verification of all executions
  • • Fair P2P economic model
  • • Global network of compute nodes

Ready to Build the Future?

Join us in building the next generation of serverless computing. Start with our current functions.wtf platform and be part of the decentralized future.