Skip to content

Open, programmable money rails for the internet. Building Stripe-level crypto payments and on-chain treasury infrastructure.

Notifications You must be signed in to change notification settings

oanskyy/sovereign-pay

Repository files navigation

SovereignPay

Crypto-native payments, treasury, and financial intelligence

Stripe for crypto. Revolut for on-chain capital. Palantir for money intelligence.

SovereignPay is a full-stack crypto payments platform for multi-chain treasury, wallet payments, and financial intelligence built without custody, banks, or intermediaries.

This is what modern money looks like when built natively on crypto rails.


1. Why SovereignPay

Most crypto applications treat money as speculation. SovereignPay treats crypto as working capital.

Real financial systems are built on three primitives:

Layer Purpose Traditional Analog
Payments How money moves Stripe, Adyen
Treasury How money is held Revolut, Mercury
Intelligence How money is understood Palantir, Chainalysis

Stripe, Revolut, and Palantir each dominate one of these layers in traditional finance. SovereignPay unifies all three using on-chain, self-custodied money.


2. System Architecture

The architecture follows the same pattern used by Stripe, Coinbase, and Circle: on-chain settlement, off-chain indexing, and API-driven financial products.

Wallets (MetaMask, WalletConnect) | v Next.js Frontend (Revolut-style UI) | v TypeScript SDK (Stripe-style API) | v SovereignVault.sol (Payments & Ledger) | v Blockchain (Ethereum / Base / Arbitrum) | v Indexer (rindexer / TheGraph) | v PostgreSQL (Palantir-style financial intelligence)

Every payment is:

  • Cryptographically signed
  • Settled on-chain
  • Indexed into a queryable financial database

No black boxes. No custodians. No fake balances.


3. Core Capabilities (v1)

3.1 Wallet & Treasury

  • Wallet connection via MetaMask, WalletConnect
  • Multi-chain balances:
    • Ethereum
    • Base
    • Arbitrum
  • Supported assets:
    • ETH
    • USDC
    • USDT
    • SKY (custom ERC-20)

3.2 Payments

  • Native ETH transfers
  • ERC-20 token transfers
  • Gas and total cost shown before signing
  • Transparent protocol fees

3.3 Ledger

  • All transactions indexed from on-chain events
  • Incoming and outgoing flows
  • Token, chain, timestamp, gas details
  • Immutable source of truth

3.4 Counterparty Intelligence

Your wallet becomes a financial graph:

  • Who you send to
  • Who sends to you
  • Total value transferred
  • Frequency and volume analysis

This is on-chain economic intelligence.


4. Smart Contracts

SovereignVault.sol A non-custodial, event-driven treasury contract that:

  • Accepts ETH and ERC-20 deposits
  • Executes payments with wallet signatures
  • Applies protocol fees
  • Emits structured events

Events are the system of record. Everything else is derived.


5. Indexing & Data Layer

All balances and analytics are derived from on-chain events, ensuring deterministic, replayable financial state.

All on-chain activity is indexed into PostgreSQL using:

  • rindexer or TheGraph
  • Custom event mappings

This enables:

  • Real-time transaction history
  • Multi-chain balance tracking
  • Analytics dashboards
  • Counterparty graphs

On-chain truth, off-chain intelligence.


6. Tech Stack

Layer Stack
Frontend Next.js, TypeScript, Tailwind
Wallets wagmi, viem, RainbowKit
Smart Contracts Solidity, Foundry, OpenZeppelin
Indexing rindexer / TheGraph
Database PostgreSQL
API Node.js, Prisma
Chains Ethereum, Base, Arbitrum

7. What This Demonstrates

This project showcases:

  • Wallet UX and transaction signing
  • Multi-chain treasury accounting
  • ERC-20 mechanics and gas modeling
  • Fee systems and payment rails
  • Event-driven indexing pipelines
  • Financial data modeling
  • End-to-end crypto payments architecture

These are the same problem domains solved by Stripe, Circle, Coinbase, Ramp, Brex, and Palantir but implemented using sovereign crypto infrastructure.


8. Development

# Clone and install
git clone https://github.com/oanskyy/sovereignpay
cd sovereignpay
npm install

# Environment setup
cp .env.example .env.local
# Add your RPC URLs, database connection, etc.

# Run development server
npm run dev

# Smart contracts
cd packages/contracts
forge build
forge test

# Indexer
npm run indexer:start

9. Philosophy

Money is not an app. It is infrastructure.

SovereignPay is an attempt to rebuild financial infrastructure using cryptographic truth instead of institutional trust.

License

MIT © [oasnkyy]. Built to demonstrate modern crypto payments, treasury, and data infrastructure.

About

Open, programmable money rails for the internet. Building Stripe-level crypto payments and on-chain treasury infrastructure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published