Skip to content

Idansss/MarblePay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MarblePay - Crypto Payment Processor for Nigeria

"Stripe for Crypto" - A regulated crypto payments processor designed for Nigerian merchants and compliance

🎯 What We're Building

MarblePay is a fully regulated crypto payment gateway that enables merchants to:

  • βœ… Accept crypto at checkout (USDC, USDT, and more)
  • βœ… Auto-convert to stablecoins or fiat (NGN)
  • βœ… Settle instantly to merchant wallets or bank accounts
  • βœ… Full compliance with SEC Nigeria, CBN, and FATF Travel Rule
  • βœ… Developer-first APIs, webhooks, and plugins

πŸ—οΈ Core Product Features

1. Merchant Onboarding & Compliance

  • KYB + KYC flow with document capture, liveness checks, sanctions screening
  • Compliance stack: Smile Identity, Dojah, VerifyMe (Nigeria-focused)
  • SEC registration under Virtual Assets framework
  • CBN VASP bank accounts (designated accounts per CBN guidelines)
  • AML program aligned to FATF standards + Travel Rule
  • NDPA 2023 compliance (Nigeria Data Protection Act)

2. Checkout Experience

Payment Methods

  • Start with USDC (Ethereum, Base) and USDT where compliant
  • Multichain support: Ethereum L1, Base L2, Solana
  • Note: No BUSD (Paxos halted), no MoonPay (paused Nigeria)

Flow

  1. Price quote + lock: NGN/USD quote β†’ exact coin amount + network fees + expiry
  2. QR + unique address: One address per session, detect under/over/late payments
  3. Confirmations: Configurable per chain (pending β†’ confirmed β†’ expired)
  4. Refunds: Secure return with address re-verification

3. Developer Platform

# REST APIs
POST /v1/checkout/sessions
POST /v1/refunds
POST /v1/payouts
GET  /v1/transactions/:id
  • Webhooks with HMAC-SHA256 signatures (Stripe-style)
  • Test mode with sandbox API keys
  • SDKs: JavaScript, Python, PHP
  • Plugins: Shopify, WooCommerce, Next.js

4. Custody & Wallets

  • Hot wallet: MPC or HSM-backed signing (Fireblocks, BitGo)
  • Cold storage policy for treasury reserves
  • Address book: Risk scores, allow/deny lists, velocity limits
  • Auto-blacklist from sanctions lists (Chainalysis, TRM Labs)

5. Rates, Conversion & Treasury

  • Quote engine: On-chain gas APIs + liquidity quotes + spread + fees
  • Liquidity sources: CEX accounts, OTC desks, L2 DEX swaps
  • Daily PnL tracking and exposure limits

6. Settlements & Fiat Off-Ramp

Crypto Settlement

  • Same chain/asset or convert to USDC
  • Settle to merchant wallet directly

Fiat Settlement (NGN)

  • Partners: Yellow Card B2B rails, Transak off-ramp
  • Regulated through licensed VASPs only

7. Risk, Fraud & Travel Rule

  • Pre-screening: Source/destination addresses, cluster analysis, sanctions
  • Travel Rule compliance: Transmit originator/beneficiary data per FATF Rec. 16
  • Tools: Chainalysis KYT, TRM Travel Rule APIs

8. Dashboards & Reporting

Merchant Dashboard

  • Payouts, balances, disputes, refunds
  • Conversion history, fee invoices, export reports

Internal Console

  • Case management, SAR/STR workflow
  • Manual review queue, Travel Rule alerts

Ledger

  • Double-entry accounting for assets, fees, FX PnL
  • Bank reconciliation, audit exports

πŸ› οΈ Technology Stack

Frontend

  • Next.js 14+ (App Router)
  • TypeScript
  • TailwindCSS + Shadcn UI
  • React Query for data fetching

Backend

  • Node.js with NestJS (or Go for high-performance services)
  • TypeScript end-to-end
  • PostgreSQL (primary OLTP database)
  • Redis (queues, rate limiting, caching)
  • Kafka (event streaming - V2)

Blockchain Infrastructure

  • RPC Providers: Infura, Alchemy, QuickNode
  • Chains: Ethereum, Base, Solana
  • Libraries: ethers.js, web3.js, @solana/web3.js

Custody & Security

  • MPC Wallets: Fireblocks SDK or BitGo API
  • KMS: AWS KMS / GCP Secret Manager
  • HSM: For production key signing

Compliance & Risk

  • KYC/KYB: Smile Identity, Dojah, VerifyMe APIs
  • Blockchain Analytics: Chainalysis KYT, TRM Labs
  • Travel Rule: TRM Travel Rule API

Observability

  • Logs: Winston + Elasticsearch
  • Metrics: Prometheus + Grafana
  • Tracing: OpenTelemetry
  • Errors: Sentry

DevOps

  • Containers: Docker + Kubernetes
  • CI/CD: GitHub Actions
  • Cloud: AWS / GCP
  • CDN: Cloudflare

πŸ“‹ MVP β†’ V1 β†’ V2 Roadmap

MVP (6-8 weeks)

Focus: Prove the core payment flow works

  • Hosted checkout for USDC on Base + Ethereum
  • Quote lock with expiry (1-2 confirmations)
  • Underpay/overpay recovery
  • Webhooks with HMAC signature, event log
  • Test mode for developers
  • Merchant dashboard lite (view payments, export)
  • Payouts in USDC only
  • Basic chain screening (TRM or Chainalysis)

Deliverable: Merchants can accept USDC and get paid out in USDC


V1 (12-16 weeks)

Focus: Production-ready with fiat off-ramp

  • Add USDT support
  • Add Solana network
  • NGN settlements via Yellow Card or Transak
  • Refunds system (address re-verification)
  • Partial captures & cancellations
  • Multi-sig treasury wallet
  • FX spread controls
  • WooCommerce plugin
  • JavaScript drop-in widget
  • Enhanced fraud detection

Deliverable: Merchants can accept crypto and settle to NGN bank accounts


V2 (20-28 weeks)

Focus: Scale, compliance automation, advanced features

  • Travel Rule automation (originator/beneficiary data routing)
  • Compliance case-management workflows
  • Multi-entity accounts (sub-merchants)
  • Revenue share & marketplace model
  • Invoices API
  • Subscriptions with pre-funded vaults
  • Advanced ML risk scoring (velocity, behavioral signals)
  • Shopify plugin
  • Mobile SDKs (React Native)
  • Expanded asset support (BTC, ETH)

Deliverable: Enterprise-ready platform with full automation


πŸ“œ Regulatory & Compliance Checklist

SEC Nigeria πŸ‡³πŸ‡¬

  • Register under Virtual Assets framework
  • Track 2024/2025 ARIP guidance for transitioning firms
  • Maintain updated AML policies

CBN (Central Bank of Nigeria)

  • Open designated VASP bank accounts (requires SEC licence)
  • Prepare onboarding docs: AML policies, directors' BVNs, etc.
  • Ensure banks cannot trade crypto (can only service you)

FATF Travel Rule

  • Implement originator/beneficiary data exchange
  • Set thresholds for Travel Rule triggers
  • Partner with TRM or Chainalysis for compliance

NDPA 2023 (Nigeria Data Protection Act)

  • Appoint Data Protection Officer (DPO)
  • Publish privacy policy
  • Map data processing activities
  • Implement DPIAs (Data Protection Impact Assessments)

AML/CFT Program

  • Sanctions screening (OFAC, UN, EU lists)
  • Transaction monitoring & alerts
  • SAR/STR filing procedures
  • Customer due diligence (CDD) & Enhanced DD (EDD)

πŸ’° Pricing Model

Simple & Transparent

  • 1.0% - 1.5% transaction fee
  • + Network fees (passed through transparently)
  • Volume discounts for high-volume merchants
  • Settlement currency discounts (settle in crypto = lower fee)
  • Cap for large tickets (e.g., max ₦50,000 fee)

🚫 What to Avoid

  1. ❌ BUSD - Paxos halted minting, Binance ended support
  2. ❌ MoonPay - Paused Nigeria service in 2024
  3. ❌ Single off-ramp dependency - Always have 2+ partners
  4. ❌ Retrofitting compliance - Build Travel Rule & NDPA from day one
  5. ❌ Ignoring network changes - USDC no longer on Tron by Circle

πŸ‘₯ Team Structure

Phase 1 (MVP)

  • 1x Fullstack Engineer (Next.js + NestJS)
  • 1x Blockchain Engineer (Web3, custody, RPC)
  • 1x Compliance Lead / MLRO (part-time or advisor)
  • 1x Designer (UI/UX for checkout + dashboard)

Phase 2 (V1+)

  • Head of Engineering
  • Security Lead
  • DevOps Engineer
  • Support Team
  • Legal / Compliance Officer (full-time)

πŸš€ Quick Start Guide

Step 1: Set Up Development Environment

# Clone and initialize
npm install

# Set up environment variables
cp .env.example .env

# Start development servers
npm run dev:api       # Backend API
npm run dev:web       # Frontend dashboard
npm run dev:checkout  # Checkout widget

Step 2: Configure Blockchain Connections

  • Get API keys: Infura, Alchemy, or QuickNode
  • Set up testnet wallets (Sepolia, Base Goerli, Solana Devnet)

Step 3: Integrate Compliance Stack

  • Smile Identity API key (KYC)
  • TRM Labs or Chainalysis (screening)

Step 4: Test Payment Flow

  • Create merchant account
  • Generate checkout session
  • Make test payment
  • Receive webhook
  • Process settlement

πŸ“š Key Documentation


πŸ“ž Important Links

Regulatory

Service Providers


πŸ“„ License

Proprietary - MarblePay Β© 2025


Built with πŸ‡³πŸ‡¬ for the future of payments in Africa

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors