Skip to main content

Overview

captaind is the server implementation of the Ark protocol on Bitcoin, built by Second. It enables fast, low-cost, self-custodial Bitcoin payments by coordinating off-chain transactions between clients while maintaining the ability to exit funds on-chain at any time. The server orchestrates rounds - periodic events where multiple users can submit payment requests that get batched into shared Bitcoin transactions. This creates Virtual UTXOs (VTXOs) that users control off-chain.

Key Features

Round-Based Coordination

captaind coordinates payment rounds at configurable intervals (default: 10 seconds). During each round:
  • Users submit payment requests with their input VTXOs
  • Server constructs a shared VTXO tree
  • Users cosign the tree
  • Server broadcasts the funding transaction on-chain

Lightning Integration

Seamless Lightning Network integration allowing users to:
  • Send Lightning payments from off-chain Ark balances
  • Receive Lightning payments into VTXOs
  • Use CLN (Core Lightning) nodes as payment backends

Self-Custodial Security

Even though captaind coordinates transactions, users maintain full control:
  • Unilateral exit: Users can always exit on-chain without server cooperation
  • Non-custodial: Server cannot spend user funds
  • Watchman: Automated forfeit claiming protects server from malicious exits

VTXO Pool Management

Optional VTXO pool provides instant liquidity:
  • Pre-issued VTXOs available for immediate use
  • Configurable denomination targets
  • Automatic replenishment based on demand

Architecture Components

Core Services

  • Round Coordinator: Manages payment round lifecycle
  • RPC Server: Handles client connections via gRPC
  • Database: PostgreSQL for persistent state
  • Sync Manager: Tracks Bitcoin blockchain state
  • TX Index: Monitors transaction confirmations

Optional Services

  • Watchman: Claims forfeited VTXOs (can run as separate watchmand process)
  • CLN Integration: Lightning payment routing
  • VTXO Pool: Liquidity management
  • Integration Manager: API for third-party services

Why Run Your Own Server?

For Service Providers

Full Control: Operate your own Ark service with custom fee schedules, round intervals, and policies. Liquidity Management: Manage your own VTXO pool and Lightning node integration. Custom Integrations: Build bespoke payment flows for your application.

For Testing & Development

Protocol Development: Test Ark protocol changes and optimizations. Client Testing: Develop and test Ark wallet implementations. Research: Experiment with different round configurations and economic models.

For Privacy & Sovereignty

No Third-Party Dependency: Don’t rely on external Ark service providers. Data Privacy: Keep all payment metadata on your own infrastructure. Network Resilience: Contribute to a more decentralized Ark ecosystem.

System Requirements

Minimum Requirements

  • CPU: 2+ cores
  • RAM: 4GB minimum, 8GB+ recommended
  • Storage: 50GB+ SSD (database and Bitcoin Core)
  • Network: Stable internet connection with low latency

Software Dependencies

  • Bitcoin Core: v24.0+ with txindex enabled
  • PostgreSQL: v13+
  • Rust: v1.74+ (for building from source)

Optional Dependencies

  • Core Lightning: For Lightning Network integration
  • OpenTelemetry Collector: For monitoring and observability

Production Considerations

Experimental Software: Bark is experimental. Do not use with real Bitcoin or in production environments. Funds can be lost.

Before Running in Production

  1. Understand the Risks: Review known issues and limitations
  2. Test Thoroughly: Run on testnet/signet extensively
  3. Monitor Continuously: Set up alerting for critical issues
  4. Backup Strategy: Regular database and wallet backups
  5. Security Hardening: Firewall, key management, access controls

Operational Requirements

  • High Availability: Downtime affects user ability to refresh VTXOs
  • Liquidity Management: Maintain sufficient Bitcoin for rounds and Lightning routing
  • Fee Management: Configure competitive fee schedules
  • Version Compatibility: Coordinate upgrades with client software

Next Steps

Setup

Install and configure captaind

Configuration

Customize server settings

Architecture

Understand system design

Monitoring

Set up observability

Build docs developers (and LLMs) love