Skip to content

cosmasken/kaspa402

Repository files navigation

Kaspa402 - Kaspathon Entry

Pay-Per-Request APIs Powered by Kaspa's Millisecond Blockchain

License Kaspa Kaspathon

🚀 What This Is

Turn Kaspa into the payment layer of the internet. Autonomous agents discover services, negotiate payments, and execute transactions using HTTP 402 Payment Required and Kaspa's instant confirmations.

Perfect for Kaspathon tracks:

  • Payments & Commerce: HTTP 402 payment protocol with instant settlement
  • Real-Time Data: IoT-style data feeds with per-request pricing

⚡ Quick Demo

Watch autonomous agents execute real-time payments:

asciicast

🛠️ Quick Start

git clone https://github.com/cosmasken/kaspa402
cd kaspa402
pnpm install
pnpm build

# Navigate to demo
cd examples/marketplace-demo

# Start all services
./scripts/start-all.sh

# Run the autonomous payment demo
# (First-time users: the demo will detect insufficient funds and show funding instructions)
pnpm start

🎬 Service Management

Start all services (registry + 4 specialized agents):

asciicast

Check service status:

asciicast

Stop all services:

asciicast

🏗️ Architecture

Client → API (402) → Kaspa Payment → Kaspa Network → Verifier → API Response

Key Components:

  • Agent Client: Auto-handles 402 responses with Kaspa payments
  • Service Registry: Decentralized service discovery
  • Payment Verifier: Cryptographic proof of payment
  • Multiple Pricing Models: Fixed, usage-based, outcome-based, tiered

🎯 Kaspathon Features

  • Millisecond Payments: Leverages Kaspa's instant block times
  • Autonomous Agents: No human intervention required
  • Service Composition: Chain multiple paid services
  • Real-time Settlement: No waiting for confirmations
  • Open Source: MIT licensed, ready to fork and extend

📦 Packages

Package Purpose
@kaspa-agent-pay/core Kaspa integration & utilities
@kaspa-agent-pay/agent-client Smart HTTP client with auto-payments
@kaspa-agent-pay/service-agent Paid service implementation
@kaspa-agent-pay/service-registry Service discovery

🏆 Why Kaspa?

Unlike other blockchains with multi-minute confirmations, Kaspa enables:

  • True real-time payments between services
  • Instant settlement without waiting
  • Practical microtransactions with minimal fees
  • Trustless verification with PoW security

Perfect for the real-time PoW blockchain that Kaspathon celebrates.

📚 Documentation

📄 License

MIT - Build, fork, and extend freely for Kaspathon and beyond!

About

A starter kit that lets developers monetize APIs instantly with Kaspa using HTTP 402 Payment Required.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors