Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soroban Subscription Engine

The foundational payment layer for recurring transactions on Stellar.

License: MIT Rust Next.js Stellar

Soroban Subscription Engine is a decentralized recurring payment protocol built on Soroban within the Stellar ecosystem. It enables developers and businesses to implement automated, trustless subscription and payment systems using smart contracts — bringing automation, transparency, and efficiency to Web3 billing.


The Problem

Recurring payments are a core part of modern digital services — SaaS, memberships, payroll — but in Web3:

  • Payments are mostly manual and require user action every cycle
  • There is no native recurring billing standard on-chain
  • Users lack control and transparency over what they're charged
  • Developers must build custom solutions from scratch every time

This creates friction for both users and builders.


Objective

Build a reusable on-chain protocol that:

  • Automates recurring payments securely via smart contracts
  • Provides flexible, configurable subscription models
  • Reduces reliance on centralized billing systems
  • Enables developers to easily integrate subscription logic into dApps

Core Features

1. Smart Contract-Based Subscriptions

  • Time-based payment execution (daily, weekly, monthly)
  • Configurable billing cycles and amounts
  • Multi-token support (any Stellar asset)

2. Subscription Management

  • Create, update, pause, or cancel subscriptions on-chain
  • User-controlled approvals and permissions
  • Transparent, auditable on-chain records

3. Payment Automation Logic

  • Scheduled execution via off-chain relayer (cron-like triggers)
  • Grace periods and retry mechanisms
  • Fail-safe handling for insufficient balances

4. Merchant Dashboard

  • Manage subscribers and plans
  • Revenue tracking and analytics
  • Plan configuration interface

Tech Stack

Layer Technology
Smart Contracts Rust, Soroban SDK
Relayer Node.js (off-chain executor)
Frontend Next.js 14, React, Tailwind CSS
Wallet Freighter API
Network Stellar Testnet / Mainnet

Project Structure

Soroban-Subscription-Engine/
├── contracts/
│   ├── src/
│   │   ├── lib.rs              # Contract entry point
│   │   ├── subscription.rs     # Subscription logic
│   │   ├── billing.rs          # Payment execution
│   │   └── types.rs            # Shared types & errors
│   └── Cargo.toml
├── relayer/
│   ├── src/
│   │   ├── index.js            # Relayer entry point
│   │   ├── executor.js         # Payment execution logic
│   │   └── scheduler.js        # Cron-based trigger
│   └── package.json
├── frontend/
│   └── src/
│       ├── app/
│       │   ├── page.jsx        # Landing page
│       │   ├── dashboard/      # Merchant dashboard
│       │   └── subscribe/      # User subscription page
│       ├── components/
│       └── context/
│           └── WalletContext.jsx
└── README.md

Getting Started

Prerequisites

Build Contracts

cd contracts
cargo build --target wasm32-unknown-unknown --release

Run Relayer

cd relayer
npm install
cp .env.example .env
npm run start

Run Frontend

cd frontend
npm install
cp .env.example .env.local
npm run dev

How It Works

User approves subscription on-chain
          ↓
Contract stores: subscriber, merchant, amount, token, interval, next_payment
          ↓
Relayer polls contracts every N minutes
          ↓
If next_payment <= current_ledger → execute payment
          ↓
Contract transfers tokens from subscriber to merchant
          ↓
Updates next_payment = current + interval
          ↓
(if balance insufficient) → grace period → retry → cancel

Use Cases

  • SaaS subscription billing
  • Membership platforms
  • Payroll and recurring payouts
  • API usage billing
  • Content creator monetization

Target Users

  • SaaS platforms and subscription-based businesses
  • Web3 developers building dApps
  • DAOs managing recurring payments
  • Freelancers and service providers

Value Proposition

  • Fully automated, trustless recurring payments
  • Reduced operational overhead for businesses
  • Transparent and user-controlled billing
  • Composable infrastructure for other dApps

Roadmap

  • Soroban subscription smart contract
  • Off-chain relayer for payment execution
  • Merchant & user dashboard (Next.js)
  • Freighter wallet integration
  • Token streaming (real-time payments)
  • Multi-party subscriptions (split payments)
  • Cross-chain subscription support
  • SDK for easy developer integration
  • Integration with identity/reputation systems

Contributing

Pull requests are welcome. Open an issue first for major changes.


License

MIT


Related Projects

About

Soroban Subscription Engine is a decentralized recurring payment protocol built on Soroban within the Stellar ecosystem. It enables developers and businesses to implement automated, trustless subscription and payment systems using smart contracts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages