Move Routes (Blockchain)

Documentation for Move blockchain routes within the unified backend, handling Movement testnet interactions using the Aptos SDK and Privy.

Created: 12/17/2025

The Move Routes are part of the unified backend service (apps/ai/routes/move). This module serves as an intermediary between the application and the Movement testnet, providing blockchain interaction capabilities within the consolidated backend architecture.

Core Technologies

This service utilizes several key libraries to perform its duties:

  • @aptos-labs/ts-sdk: The official TypeScript SDK for interacting with the Aptos blockchain (which powers the Move testnet).
  • Privy: Used for secure transaction signing and user authentication flows.
  • Viem: Included for specific Ethereum-compatible operations if required.
  • Express: The web server framework handling API requests.

Functionality

The backend exposes endpoints that allow the client application to:

  1. Query Chain Data: Retrieve account resources, module information, or transaction history from the Move testnet without exposing the client directly to all node details.
  2. Submit Transactions: While signing often happens on the client or via a secure wallet provider, the backend can facilitate transaction submission or gas fee estimation.
  3. Manage State: Maintain any off-chain state related to on-chain activities.

Configuration and Security

As part of the unified backend, Move routes benefit from shared authentication and security measures:

  • Privy Authentication: All Move route endpoints require valid Privy access tokens in the Authorization header
  • Performance Tracking: Built-in timing middleware automatically tracks and logs the performance of all blockchain operations
  • Shared Environment: Configuration is managed through the unified backend's .env file (apps/ai/.env)
  • Database Integration: Move operations can be correlated with user data through the shared database

The unified backend provides a secure, monitored environment for all blockchain interactions.

Running Locally

The Move routes are part of the unified backend. To start the backend locally:

# From project root - starts all services including Move routes
pnpm dev

# Or start the unified backend specifically
pnpm start:ai

The unified backend runs on port 3005 by default, with Move routes accessible at /api/move/*. The backend includes built-in performance tracking middleware that logs timing information for all blockchain operations.