StreamPay is a real-time payment streaming protocol built on the Stellar network that enables continuous, programmable payments between parties.
Unlike traditional payments that occur as discrete transactions, StreamPay allows funds to flow continuously over time, enabling new economic models such as pay-per-second services, real-time infrastructure billing, and autonomous service payments.
The protocol enables businesses and developers to build applications where payments are metered by usage and settled continuously.
Most payment systems today rely on discrete transactions.
Examples:
- monthly SaaS billing
- hourly service payments
- prepaid API usage
- subscription plans
However, many modern services operate on continuous resource consumption.
| Service Type | Billing Need |
|---|---|
| AI compute usage | pay per compute second |
| SaaS tools | pay per active usage |
| IoT bandwidth | pay per data usage |
| Cloud infrastructure | pay per CPU / storage second |
Current systems rely on periodic billing cycles, which creates inefficiencies.
| Problem | Impact |
|---|---|
| Delayed settlements | providers assume payment risk |
| Prepaid balances | inefficient capital usage |
| Complex billing systems | operational overhead |
| Lack of micro-payment infrastructure | limits new business models |
StreamPay introduces a continuous payment streaming protocol built on Stellar.
Instead of sending individual payments, funds are streamed continuously from the payer to the recipient.
Payments flow based on time and usage.
Example stream: $0.002 per second
Flow: User Wallet → API Provider
The protocol periodically settles accumulated value on-chain.
Payments flow continuously based on time.
Services can charge users based on resource consumption.
Developers can program payment conditions and limits.
StreamPay aggregates micro-payments before settling on-chain.
Streams stop automatically when usage ends or balance runs out.
StreamPay uses the Stellar network because it is optimized for payments.
| Feature | Benefit |
|---|---|
| Extremely low fees | enables micro-payments |
| Fast settlement | near-instant confirmations |
| Stablecoin ecosystem | predictable pricing |
| Global accessibility | cross-border usage |
Stellar provides the infrastructure required for high-frequency payment systems.
flowchart LR
User[User Wallet]
API[Service API]
StreamController[Stream Controller]
Metering[Usage Metering Engine]
Settlement[Settlement Engine]
Stellar[Stellar Network]
Provider[Service Provider]
User --> StreamController
StreamController --> API
API --> Metering
Metering --> Settlement
Settlement --> Stellar
Stellar --> Provider
flowchart TB
Client[User Application]
Frontend[StreamPay Dashboard]
API[API Gateway]
StreamService[Stream Management Service]
MeteringService[Usage Metering Engine]
BillingService[Billing Aggregator]
SettlementService[Settlement Engine]
Database[(PostgreSQL)]
Cache[(Redis)]
StellarNode[Stellar Horizon Node]
Client --> Frontend
Frontend --> API
API --> StreamService
API --> MeteringService
API --> BillingService
API --> SettlementService
StreamService --> Database
BillingService --> Database
SettlementService --> StellarNode
sequenceDiagram
participant User
participant StreamController
participant Metering
participant Settlement
participant Stellar
participant Provider
User->>StreamController: Start Payment Stream
StreamController->>Metering: Track Usage
Metering->>Settlement: Calculate Streamed Value
Settlement->>Stellar: Execute Settlement
Stellar->>Provider: Transfer Payment
flowchart LR
Start[Start Stream]
Active[Active Stream]
Meter[Usage Metering]
Settlement[Periodic Settlement]
End[Stop Stream]
Start --> Active
Active --> Meter
Meter --> Settlement
Settlement --> Active
Active --> End
erDiagram
USER {
string id
string wallet
}
SERVICE {
string id
string provider
float rate_per_second
}
STREAM {
string id
string user_id
string service_id
float rate
string status
}
SETTLEMENT {
string id
string stream_id
float amount
}
USER ||--o{ STREAM : initiates
SERVICE ||--o{ STREAM : consumes
STREAM ||--o{ SETTLEMENT : generates
Each payment stream contains the following parameters.
| Field | Description |
|---|---|
| Stream ID | Unique identifier |
| Payer Wallet | Source of funds |
| Recipient Wallet | Service provider |
| Rate | Payment per second |
| Start Time | Stream start |
| End Time | Stream stop |
| Balance | Remaining funds |
Smart contracts manage streaming payment logic.
Example functions:
create_stream(payer, recipient, rate)start_stream(stream_id)stop_stream(stream_id)settle_stream(stream_id)
Contracts ensure funds are distributed according to the streaming rate.
Frontend: Next.js, React, TailwindCSS, Stellar wallet integration
Backend: Golang, Node.js, REST APIs, gRPC microservices
Blockchain: Stellar Network, Soroban smart contracts, Stellar SDK, Horizon API
Infrastructure: Docker, Kubernetes, PostgreSQL, Redis, AWS / GCP
Usage Metering: event streaming, real-time usage tracking, billing aggregation engine
StreamPay includes several security protections.
| Layer | Protection |
|---|---|
| Escrow balances | ensures provider payment |
| Rate validation | prevents malicious streams |
| Usage verification | protects billing integrity |
| Transaction monitoring | detects anomalies |
StreamPay generates revenue through infrastructure services.
| Revenue Stream | Fee |
|---|---|
| Stream settlement fee | 0.2–0.5% |
| Developer SDK | subscription |
| Enterprise infrastructure | licensing |
| Usage analytics | premium services |
Phase 1: payment streaming contracts, developer APIs, usage metering
Phase 2: streaming payment channels, real-time analytics, service marketplace
Phase 3: AI economy integrations, IoT streaming payments, cross-chain payment streams
StreamPay enables real-time economic interactions between digital services.
Benefits include: fair usage-based pricing, continuous settlement, reduced payment friction, support for autonomous systems.
The protocol could become a core financial infrastructure for the machine economy.
- streampay-frontend – Next.js dashboard and Stellar wallet integration
- streampay-backend – Express API, metering, and settlement services
- streampay-contracts – Soroban smart contracts for payment streams
License: MIT