Skip to content
@StreamPay-Organization

StreamPay-Organization

🌊 StreamPay

Money that flows by the second.

Real-time money streaming on Stellar — stream salaries & subscriptions that vest linearly, second by second.


Stellar Soroban Rust React Node.js
License: MIT PRs Welcome


💡 Elevator Pitch

StreamPay turns one-time payments into continuous flows. Instead of waiting for payday or a billing cycle, funds vest linearly between a start and end time so recipients can withdraw exactly what they've earned at any moment. Senders stay in control: cancel anytime to instantly reclaim the unstreamed remainder — all settled trustlessly on Stellar via a Soroban smart contract.


📚 Table of Contents


✨ Why StreamPay?

Lump-sum payroll and subscriptions are coarse, all-or-nothing, and built on trust. Streaming makes value transfer continuous, fair, and reversible.

Dimension 💸 Lump-Sum Payroll 🌊 StreamPay Streaming
Cash flow Paid once per cycle (monthly) Accrues every second — withdraw anytime
Trust model Prepay & hope, or pay-after & wait Funds vest on-chain, no counterparty risk
Flexibility Fixed amount, fixed date Any duration, any rate, partial withdrawals
Cancel anytime Hard to claw back, disputes Sender reclaims the unstreamed remainder instantly
Transparency Off-chain ledgers & invoices Every stream is auditable on Stellar
Overpayment risk Pay upfront, recipient may underdeliver Only earned funds become withdrawable

🚀 Features

Feature Description
⏱️ Per-second vesting Funds unlock continuously between start and end — no cliffs, no waiting
💧 Withdraw anytime Recipients pull accrued funds whenever they like, as often as they like
↩️ Cancel & reclaim Senders cancel a stream and instantly recover the unstreamed remainder
🔁 Subscriptions Model recurring services as long-running streams that just keep flowing
🧾 Payroll Pay teams in real time — salaries that drip instead of dropping once a month
📊 Live counters The frontend ticks the vested balance up in real time, second by second
🔐 Trustless settlement All accounting enforced by an audited Soroban contract on Stellar

🏗️ Architecture

flowchart LR
    Sender(["👤 Sender"]) -->|create_stream| FE["⚛️ StreamPay-Frontend<br/>React + Vite"]
    Recipient(["🙋 Recipient"]) -->|withdraw| FE
    FE <-->|REST + tx build| BE["🟢 StreamPay-Backend<br/>Node + Express API"]
    BE <-->|invoke / query| SC["🦀 StreamPay-Contract<br/>Soroban Stream Contract"]
    FE -.->|sign tx| Wallet["👛 Stellar Wallet"]
    Wallet -.->|submit| SC

    subgraph Stellar["🌌 Stellar Network"]
        SC -->|linear vesting over time| Vesting["📈 Vested = total · (now−start)/(end−start)"]
        Vesting -->|withdraw accrued| Recipient
        Vesting -->|cancel → reclaim remainder| Sender
    end

    classDef violet fill:#7c3aed,stroke:#5b21b6,color:#ffffff;
    class FE,BE,SC,Vesting violet;
Loading

Flow: A Sender calls create_stream (amount, recipient, start, end) → the Frontend builds the request and the Backend prepares the transaction → the Soroban contract escrows the funds and vests them linearly. The Recipient calls withdraw to pull accrued funds; the Sender calls cancel to reclaim whatever hasn't streamed yet.


⏱️ How Streaming Works

A stream is a fixed total amount that unlocks linearly from start to end. At any instant, the streamed (vested) amount is a simple ratio of elapsed time — clamped so it never goes below 0 or above total.

elapsed   = clamp(now, start, end) − start
duration  = end − start
streamed  = total * elapsed / duration          // 0 ≤ streamed ≤ total
withdrawable = streamed − already_withdrawn
remainder    = total − streamed                 // reclaimable by sender on cancel
sequenceDiagram
    autonumber
    actor S as 👤 Sender
    participant C as 🦀 Stream Contract
    actor R as 🙋 Recipient

    S->>C: create_stream(total, R, start, end)
    Note over C: Funds escrowed · vesting begins at `start`

    rect rgb(124, 58, 237)
    Note over C,R: t = 25% elapsed → 25% vested
    R->>C: withdraw()
    C-->>R: pay streamed − already_withdrawn
    end

    rect rgb(124, 58, 237)
    Note over C,R: t = 60% elapsed → 60% vested
    R->>C: withdraw()
    C-->>R: pay newly accrued amount
    end

    S->>C: cancel()
    Note over C: streamed → Recipient · remainder → Sender
    C-->>R: pay any unwithdrawn vested funds
    C-->>S: refund (total − streamed)
Loading

📈 At t = end, streamed == total and the recipient can withdraw the full amount. Before start, nothing is withdrawable.


🧩 Repositories

Repository Description Tech
🎨 StreamPay-Frontend Web app with live, per-second streaming counters and wallet connection React Vite
🔌 StreamPay-Backend REST API that builds transactions, indexes streams, and serves stream state Node.js Express
🦀 StreamPay-Contract Soroban smart contract implementing linear vesting, withdraw & cancel Rust Soroban

🛠️ Tech Stack

Frontend
React Vite TypeScript

Backend
Node.js Express

Smart Contract & Chain
Rust Soroban Stellar


⚡ Quick Start

📦 Click to expand setup instructions for all three repos

1. Smart Contract — StreamPay-Contract (Soroban / Rust)

git clone https://github.com/StreamPay/StreamPay-Contract.git
cd StreamPay-Contract

# Build the WASM and deploy to Stellar testnet
rustup target add wasm32-unknown-unknown
stellar contract build
stellar contract deploy \
  --wasm target/wasm32-unknown-unknown/release/streampay.wasm \
  --network testnet

2. Backend — StreamPay-Backend (Node + Express)

git clone https://github.com/StreamPay/StreamPay-Backend.git
cd StreamPay-Backend

npm install
cp .env.example .env      # set CONTRACT_ID, STELLAR_RPC_URL, NETWORK_PASSPHRASE
npm run dev               # API on http://localhost:3000

3. Frontend — StreamPay-Frontend (React + Vite)

git clone https://github.com/StreamPay/StreamPay-Frontend.git
cd StreamPay-Frontend

npm install
cp .env.example .env      # set VITE_API_URL=http://localhost:3000
npm run dev               # app on http://localhost:5173

🗺️ Roadmap

  • Linear vesting stream contract (create_stream, withdraw, cancel)
  • Backend API for transaction building & stream indexing
  • Frontend with live per-second counters
  • Multi-asset streams (any Stellar asset, not just XLM)
  • Pausable & top-up streams
  • Recurring subscription templates & one-click renewals
  • Batch payroll: stream to an entire team in one transaction
  • Mainnet launch & security audit
  • Mobile companion app

🤝 Contributing

Contributions are welcome and appreciated! 💜

  1. Fork the relevant repository and create a feature branch.
  2. Make your changes with clear, conventional commits.
  3. Add tests where it makes sense and ensure everything passes.
  4. Open a Pull Request describing the what and the why.

Found a bug or have an idea? Open an issue in the appropriate repo — every contribution helps StreamPay flow further.


📜 License

Released under the MIT License. You're free to use, modify, and distribute StreamPay — see the LICENSE file in each repository for details.


Built with 💜 on Stellar · Powered by Soroban

⬆️ Back to top

Popular repositories Loading

  1. StreamPay-Frontend StreamPay-Frontend Public

    JavaScript 5

  2. StreamPay-Backend StreamPay-Backend Public

    JavaScript 3

  3. StreamPay-Contracts StreamPay-Contracts Public

    Rust 13

  4. .github .github Public

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…