osCASH.me GATE für osCASH.me APP

Teil 1) Gedanken zu einem Mixin Messenger Fork

Wallet Systems für osCASH.me Integration

Die Untersuchung der verschiedenen Payment-Integrationsoptionen für die osCASH.me APP zeigt, dass eine API-basierte Integration mit BTCPay Server die optimale Lösung darstellt, während Mixin Network aufgrund der GPL-Lizenzierung und des Sicherheitsvorfalls 2023 problematisch erscheint. Die technische Architektur sollte auf selbst-gehosteten, MIT-lizenzierten Lösungen basieren.

Mixin Network zeigt kritische Einschränkungen für osCASH.me

Das Mixin Network nutzt eine innovative BFT-DAG Blockchain-Struktur mit beeindruckenden technischen Spezifikationen: über 1 Million TPS mit Sub-Sekunden-Bestätigungen und Unterstützung für 48 öffentliche Blockchains inklusive Bitcoin, Ethereum, MOB und eUSD. Die Architektur basiert auf 35 Mainnet-Nodes mit Proof-of-Stake-Konsens und bietet Zero-Fee-Transaktionen innerhalb des Netzwerks.

Die Mixin API (verfügbar unter api.mixin.one) bietet umfassende Endpoints für User Management, Asset Management und Transfers. Die Authentifizierung erfolgt über EdDSA-signierte JWT-Tokens mit Ed25519 Private Keys, wobei drei Signaturtypen unterstützt werden: Bot JWT, OAuth User JWT und PIN-Signaturen für Transfers. SDKs sind für Go, Node.js, Python, Ruby, PHP, C# und Kotlin/Java verfügbar.

Jedoch offenbaren sich kritische Probleme: Die Core-Komponenten stehen unter GNU GPL v3.0 Lizenz, was mit der MIT-Präferenz von osCASH.me inkompatibel ist. Der massive Sicherheitsvorfall im September 2023 mit einem Verlust von ~$200 Millionen durch einen Database-Breach beim Cloud-Provider wirft ernsthafte Bedenken auf. Obwohl das Netzwerk im Oktober 2023 neu gestartet wurde, bleibt das Vertrauen beschädigt.

Sentz Desktop Wallet bietet begrenztes Fork-Potenzial

Die Analyse des Sentz Desktop Wallet v1.9.2 (ehemals MobileCoin Desktop Wallet) zeigt eine Electron-basierte Architektur mit React.js Frontend, die über JSON RPC mit dem Full-Service Backend kommuniziert. Die technische Umsetzbarkeit eines Forks wird als mittlere Komplexität eingestuft.

Das Wallet nutzt eine gemischte Lizenzierung mit Apache 2.0 für Client-SDKs und GPL v3 für Server-Komponenten. Die Full-Service API bietet JSON RPC 2.0 Endpoints auf Port 9090 mit optionaler API-Key-Authentifizierung. Kritische Limitierungen umfassen das Fehlen nativer Webhook-Funktionalität und eingebauter Payment-Gateway-Features.

Für Self-Hosting werden erhebliche Infrastruktur-Anforderungen identifiziert: Docker-Deployment für Full-Service, Rust-Toolchain für lokale Builds, Intel SGX für Validator-Nodes und Fog-Services für mobile Clients. Die geschätzten monatlichen Infrastrukturkosten liegen bei $50-200 für Basic-Instanzen und $1000-5000+ für Fog-Services mit SGX-Hardware.

Signal's MobileCoin-Integration liefert wichtige Erkenntnisse

Signal's Implementation von MobileCoin-Payments (2021-2025) demonstriert sowohl Potenzial als auch Fallstricke von Messenger-Payment-Integrationen. Die Zero-Knowledge-Architektur verhinderte, dass Signal Transaktionsdaten einsehen konnte, während die Integration direkt in die App eingebettet wurde statt über externe APIs.

Die limitierte Adoption trotz 40+ Millionen Signal-Nutzern resultierte aus regulatorischen Herausforderungen, geografischen Beschränkungen (nur UK, Deutschland, Frankreich, Schweiz), extremer Preisvolatilität von MOB ($7 zu $68 und Crash) und internem Widerstand. Der Interessenkonflikt durch Moxie Marlinspikes Advisory-Rolle bei MobileCoin führte zu zusätzlicher Kritik.

Molly Messenger entwickelt aktuell eine alternative Monero (XMR) Integration mit verbesserter Privatsphäre durch RAM-Shredding und passphrase-verschlüsselte Datenbanken. Die geplante dezentralisierte Backend-Infrastruktur vermeidet Signal-Abhängigkeiten und bietet UnifiedPush-Support für privacy-freundliche Benachrichtigungen.

BTCPay Server emergiert als optimale Lösung

Die Analyse alternativer Payment-Gateways identifiziert BTCPay Server als beste Option für osCASH.me. Die vollständige MIT-Lizenzierung gewährleistet perfekte Kompatibilität, während die ausgereifte Architektur auf .NET 8.0 mit PostgreSQL/SQLite und Bitcoin Core/NBXplorer basiert.

BTCPay's Greenfield API bietet moderne RESTful-Endpoints mit Webhook-Support, Rate-Limiting und API-Key-Authentifizierung. Die Multi-Currency-Unterstützung umfasst Bitcoin (on-chain), Lightning Network und Liquid Bitcoin nativ, mit Community-Support für LTC, XMR und ETH. Die Plugin-Architektur ermöglicht Erweiterungen für zusätzliche Kryptowährungen.

Für Lightning Network Integration empfiehlt sich Core Lightning (CLN) mit MIT-Lizenz, leichtgewichtiger C-Implementation und eingebautem REST API (v23.08+). Die hochgradig erweiterbare Plugin-Architektur und BOLT-Compliance machen es zur idealen Wahl. Alternative Implementierungen wie LND (Go-basiert) oder Eclair (Scala) bieten ähnliche Funktionalität mit unterschiedlichen Trade-offs.

Empfohlene Implementierungsstrategie für osCASH.me

Die optimale Architektur kombiniert BTCPay Server als primäres Payment-Backend mit selektiver API-Integration für erweiterte Currency-Unterstützung. Diese Hybrid-Strategie maximiert Selbst-Hosting-Kontrolle bei gleichzeitiger Flexibilität.

Technische Implementierung in drei Phasen

Phase 1: Core Payment Infrastructure (2-3 Wochen) Deploy BTCPay Server mit Docker Compose auf selbst-gehostetem VPS ($50-200/Monat). Konfiguration von Bitcoin Core und Core Lightning für Instant Payments. Integration der Greenfield API in die osCASH.me Android App mit Retrofit/OkHttp. Implementierung von Webhook-Handlern für Echtzeit-Payment-Benachrichtigungen.

Phase 2: GATE Component Development (4-6 Wochen) Entwicklung einer Microservices-basierten Payment-Gateway-Architektur mit API Gateway (nginx), Payment Processor Service und Webhook Handler. Erstellung von E-Commerce-Plugins für WooCommerce, Shopify und generische Webhooks. Implementation von POS-Integration mit Terminal-Management und Offline-Transaction-Support.

Phase 3: Extended Currency Support (2-4 Wochen) Für erweiterte Multi-Currency-Anforderungen Integration von NOWPayments API (300+ Kryptowährungen) als sekundäre Option. Entwicklung eines Abstraction Layers für einheitliche Payment-Schnittstelle. Optional: Monero-Integration für maximale Privacy nach Molly-Vorbild.

Architektur-Komponenten für Android App

// Clean Architecture Payment Module
interface PaymentGateway {
    suspend fun createInvoice(amount: Money, orderId: String): Invoice
    suspend fun checkPaymentStatus(invoiceId: String): PaymentStatus
    fun observePayments(): Flow<PaymentEvent>
}

class BTCPayGateway(
    private val api: BTCPayApi,
    private val webhookManager: WebhookManager
) : PaymentGateway {
    override suspend fun createInvoice(amount: Money, orderId: String): Invoice {
        return api.createInvoice(
            storeId = STORE_ID,
            amount = amount.value,
            currency = amount.currency,
            orderId = "osCASH-$orderId"
        ).toInvoice()
    }
}

GATE Plugin-Architektur

// osCASH.me GATE Payment Processor
class OSCashGate {
    constructor(config) {
        this.btcpay = new BTCPayClient(config.btcpayUrl, config.apiKey);
        this.webhookHandler = new WebhookHandler();
    }
    
    async processPayment(order) {
        const invoice = await this.btcpay.createInvoice({
            amount: order.total,
            currency: order.currency,
            orderId: order.id,
            webhookUrl: `${this.baseUrl}/webhooks/payment`
        });
        
        return {
            paymentUrl: invoice.checkoutLink,
            invoiceId: invoice.id,
            status: 'pending'
        };
    }
}

Sicherheit und Compliance-Überlegungen

Die Implementierung folgt Zero-Knowledge-Prinzipien ähnlich Signal's Ansatz, wobei Payment-Daten Ende-zu-Ende verschlüsselt und Metadaten minimiert werden. Private Keys werden lokal mit Android Keystore/iOS Secure Enclave geschützt. Die modulare Architektur ermöglicht geografische Feature-Flags für regulatorische Compliance.

Für PCI-DSS-Compliance bei Fiat-Integration: Field-Level-Encryption für sensible Daten, Certificate Pinning für API-Kommunikation, keine Speicherung von Karteninformationen. Die MIT-Lizenz-Präferenz wird durchgehend eingehalten mit Apache 2.0 als kompatible Alternative.

Kosten-Nutzen-Analyse

BTCPay Server Self-Hosted: Einmalige Setup-Kosten von 2-4 Entwicklerwochen, laufende Infrastruktur $50-200/Monat, volle Kontrolle und keine Transaktionsgebühren außer Bitcoin Network Fees. Alternative API-Services: Minimale Setup-Zeit, 0.5-1% Transaktionsgebühren, eingeschränkte Kontrolle und Vendor-Lock-in-Risiko.

Die Investition in BTCPay Server amortisiert sich bei >$20.000 monatlichem Transaktionsvolumen durch eingesparte Gebühren. Die technische Kontrolle und Datenhoheit rechtfertigen den initialen Implementierungsaufwand.

Schlussfolgerung und nächste Schritte

BTCPay Server mit Core Lightning bietet die optimale Lösung für osCASH.me's Anforderungen: vollständige MIT-Lizenz-Kompatibilität, robuste Self-Hosting-Fähigkeiten, ausgereifte API-Integration und aktive Community-Unterstützung. Die Greenfield API ermöglicht nahtlose Mobile-Integration während Webhook-Support Echtzeit-Benachrichtigungen gewährleistet.

Mixin Network's GPL-Lizenzierung und Sicherheitshistorie disqualifizieren es trotz technischer Eleganz. Sentz Desktop Wallet's Fork-Komplexität übersteigt den Nutzen verglichen mit BTCPay's ausgereifter Lösung. Signal's Erfahrungen unterstreichen die Wichtigkeit regulatorischer Flexibilität und User Education.

Die empfohlene Hybrid-Strategie - BTCPay für Bitcoin/Lightning plus selektive API-Integration für Multi-Currency - balanciert Selbst-Hosting-Prinzipien mit praktischer Flexibilität. Die geschätzte Implementierungszeit von 8-12 Wochen bei moderaten laufenden Kosten macht dies zur wirtschaftlich und technisch sinnvollsten Lösung für osCASH.me's Payment-Gateway-Anforderungen.


Teil 2 - BTCPay Server FORKEN !!!

Roter Faden: osCASH.me Payment Integration

Phase 1: BTCPay Server Fork & Debian Package (Woche 1-3)

Repository Setup

# Fork BTCPay auf https://github.com/osCASHme/oscash-gateway
git clone https://github.com/btcpayserver/btcpayserver.git oscash-gateway
cd oscash-gateway
git remote set-url origin https://github.com/osCASHme/oscash-gateway.git
git remote add upstream https://github.com/btcpayserver/btcpayserver.git

Rebranding & Anpassungen

// BTCPayServer/osCASHGateway.cs
namespace BTCPayServer
{
    public class osCASHBranding
    {
        public const string ApplicationName = "osCASH Gateway";
        public const string DefaultApiPath = "/api/v1/oscash";
        public const string MobileAppScheme = "oscash://";
    }
}

Debian Package Struktur

oscash-gateway/
├── debian/
│   ├── control
│   ├── postinst
│   ├── oscash-gateway.service
│   └── rules
├── docker/
│   ├── docker-compose.yml
│   └── Dockerfile.debian
└── install.sh

Debian Control File

Package: oscash-gateway
Version: 1.0.0
Architecture: amd64
Maintainer: osCASH.me Team <dev@oscash.me>
Depends: docker-ce, docker-compose, nginx, postgresql-14
Description: osCASH Gateway - Self-hosted payment processor
 Fork of BTCPay Server optimized for osCASH.me ecosystem
Homepage: https://github.com/osCASHme/oscash-gateway

Installation Script

#!/bin/bash
# install.sh - One-line installer
curl -sSL https://get.oscash.me | sudo bash

# Oder manuell:
sudo add-apt-repository ppa:oscashme/stable
sudo apt update
sudo apt install oscash-gateway

Docker Compose Anpassung

# docker-compose.yml
version: "3.7"
services:
  oscash-gateway:
    image: oscashme/gateway:latest
    environment:
      - OSCASH_NETWORK=mainnet
      - OSCASH_LIGHTNING=true
      - OSCASH_MOBILECOIN=true
      - OSCASH_MONERO=true
    ports:
      - "8080:8080"
      - "9090:9090" # API Port
    volumes:
      - oscash_data:/data
      - /var/run/docker.sock:/var/run/docker.sock
  
  bitcoin:
    image: btcpayserver/bitcoin:25.0
    
  lightning:
    image: elementsproject/lightningd:v23.08
    
  postgres:
    image: postgres:14-alpine

Phase 2: Mobile App Integration (Woche 3-5)

Android App Payment Module

// app/src/main/java/im/molly/messenger/payments/OsCashPaymentManager.kt
package im.molly.messenger.payments

import kotlinx.coroutines.flow.Flow
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

class OsCashPaymentManager(
    private val context: Context,
    private val preferences: SharedPreferences
) {
    private val api: OsCashGatewayApi by lazy {
        Retrofit.Builder()
            .baseUrl(preferences.getString("oscash_gateway_url", "https://pay.oscash.me"))
            .addConverterFactory(GsonConverterFactory.create())
            .build()
            .create(OsCashGatewayApi::class.java)
    }
    
    suspend fun sendPayment(
        recipient: Recipient,
        amount: Money,
        memo: String? = null
    ): PaymentResult {
        // 1. Create invoice on gateway
        val invoice = api.createInvoice(
            CreateInvoiceRequest(
                amount = amount.toSatoshis(),
                currency = amount.currency,
                recipient = recipient.publicKey,
                memo = memo
            )
        )
        
        // 2. Display payment UI
        showPaymentBottomSheet(invoice)
        
        // 3. Process payment
        return processPayment(invoice)
    }
    
    fun observeIncomingPayments(): Flow<Payment> {
        return api.subscribeToWebhooks(deviceId)
            .map { it.toPayment() }
    }
}

Payment UI Integration

// PaymentBottomSheetFragment.kt
class PaymentBottomSheetFragment : BottomSheetDialogFragment() {
    
    override fun onCreateView(...): View {
        binding = FragmentPaymentBottomSheetBinding.inflate(inflater)
        
        // Lightning by default
        binding.paymentMethodToggle.check(R.id.lightning_button)
        
        binding.sendButton.setOnClickListener {
            viewModel.sendPayment(
                amount = binding.amountInput.text.toString().toDouble(),
                method = getSelectedMethod()
            )
        }
        
        // QR Code for receiving
        binding.receiveButton.setOnClickListener {
            generateReceiveInvoice()
        }
        
        return binding.root
    }
    
    private fun generateReceiveInvoice() {
        lifecycleScope.launch {
            val invoice = viewModel.createInvoice(
                amount = binding.amountInput.text.toString().toDouble()
            )
            binding.qrCodeView.setImageBitmap(
                QRCodeGenerator.generate(invoice.bolt11)
            )
        }
    }
}

Settings Integration

<!-- res/xml/preferences_payments.xml -->
<PreferenceScreen>
    <SwitchPreference
        android:key="oscash_payments_enabled"
        android:title="@string/oscash_payments"
        android:summary="@string/oscash_payments_summary"
        android:defaultValue="false"/>
    
    <Preference
        android:key="oscash_gateway_setup"
        android:title="@string/gateway_setup"
        android:dependency="oscash_payments_enabled">
        <intent android:action="im.molly.messenger.SETUP_GATEWAY"/>
    </Preference>
    
    <ListPreference
        android:key="default_currency"
        android:title="@string/default_currency"
        android:entries="@array/currencies"
        android:entryValues="@array/currency_values"
        android:defaultValue="BTC"
        android:dependency="oscash_payments_enabled"/>
</PreferenceScreen>

Gateway Setup Activity

// GatewaySetupActivity.kt
class GatewaySetupActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        binding.setupMethods.setOnCheckedChangeListener { _, checkedId ->
            when (checkedId) {
                R.id.self_hosted -> showSelfHostedSetup()
                R.id.oscash_cloud -> showCloudSetup()
            }
        }
    }
    
    private fun showSelfHostedSetup() {
        binding.gatewayUrlInput.visibility = View.VISIBLE
        binding.apiKeyInput.visibility = View.VISIBLE
        
        binding.testConnectionButton.setOnClickListener {
            testConnection()
        }
    }
    
    private suspend fun testConnection() {
        val url = binding.gatewayUrlInput.text.toString()
        val apiKey = binding.apiKeyInput.text.toString()
        
        try {
            val api = OsCashGatewayApi.create(url, apiKey)
            val info = api.getServerInfo()
            
            showSuccess("Connected to ${info.version}")
            saveCredentials(url, apiKey)
        } catch (e: Exception) {
            showError("Connection failed: ${e.message}")
        }
    }
}

Phase 3: osCASH.me PAY Plugin (Woche 5-7)

WooCommerce Plugin

<?php
/**
 * Plugin Name: osCASH Gateway for WooCommerce
 * Description: Accept cryptocurrency payments via osCASH Gateway
 * Version: 1.0.0
 * Author: osCASH.me Team
 */

class WC_Gateway_osCASH extends WC_Payment_Gateway {
    
    public function __construct() {
        $this->id = 'oscash_gateway';
        $this->icon = plugin_dir_url(__FILE__) . 'assets/logo.png';
        $this->has_fields = false;
        $this->method_title = __('osCASH Gateway', 'oscash');
        
        $this->init_form_fields();
        $this->init_settings();
        
        $this->title = $this->get_option('title');
        $this->gateway_url = $this->get_option('gateway_url');
        $this->api_key = $this->get_option('api_key');
        
        add_action('woocommerce_update_options_payment_gateways_' . $this->id, 
                   array($this, 'process_admin_options'));
        add_action('woocommerce_api_oscash_webhook', 
                   array($this, 'webhook_handler'));
    }
    
    public function process_payment($order_id) {
        $order = wc_get_order($order_id);
        
        // Create invoice on osCASH Gateway
        $invoice = $this->create_invoice([
            'amount' => $order->get_total(),
            'currency' => get_woocommerce_currency(),
            'orderId' => $order_id,
            'webhookUrl' => home_url('/wc-api/oscash_webhook/'),
            'redirectUrl' => $this->get_return_url($order)
        ]);
        
        // Store invoice ID
        $order->update_meta_data('_oscash_invoice_id', $invoice['id']);
        $order->save();
        
        return [
            'result' => 'success',
            'redirect' => $invoice['checkoutUrl']
        ];
    }
    
    private function create_invoice($data) {
        $response = wp_remote_post($this->gateway_url . '/api/v1/invoices', [
            'headers' => [
                'Authorization' => 'Bearer ' . $this->api_key,
                'Content-Type' => 'application/json'
            ],
            'body' => json_encode($data)
        ]);
        
        return json_decode(wp_remote_retrieve_body($response), true);
    }
}

Generic JavaScript SDK

// oscash-gateway-sdk.js
class OsCashGateway {
    constructor(config) {
        this.apiUrl = config.apiUrl || 'https://pay.oscash.me/api/v1';
        this.apiKey = config.apiKey;
        this.storeId = config.storeId;
    }
    
    async createInvoice(amount, currency = 'EUR', options = {}) {
        const response = await fetch(`${this.apiUrl}/stores/${this.storeId}/invoices`, {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${this.apiKey}`,
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                amount,
                currency,
                ...options
            })
        });
        
        return response.json();
    }
    
    async showPaymentModal(invoice) {
        const modal = document.createElement('div');
        modal.className = 'oscash-payment-modal';
        modal.innerHTML = `
            <div class="oscash-modal-content">
                <h3>Complete Payment</h3>
                <div class="oscash-qr-code">
                    <img src="${invoice.qrCodeUrl}" alt="Payment QR"/>
                </div>
                <div class="oscash-payment-methods">
                    <button onclick="window.open('${invoice.lightningUrl}')">
                        ⚡ Pay with Lightning
                    </button>
                    <button onclick="window.open('${invoice.bitcoinUrl}')">
                        ₿ Pay with Bitcoin
                    </button>
                </div>
                <div class="oscash-invoice-details">
                    <p>Amount: ${invoice.amount} ${invoice.currency}</p>
                    <p>Invoice ID: ${invoice.id}</p>
                </div>
            </div>
        `;
        document.body.appendChild(modal);
        
        // Poll for payment status
        this.pollPaymentStatus(invoice.id);
    }
    
    async pollPaymentStatus(invoiceId) {
        const interval = setInterval(async () => {
            const status = await this.getInvoiceStatus(invoiceId);
            
            if (status.paid) {
                clearInterval(interval);
                this.onPaymentSuccess(status);
            }
        }, 2000);
    }
}

POS Terminal Integration

// pos-terminal-plugin.ts
interface POSPlugin {
    name: string;
    version: string;
    process(transaction: Transaction): Promise<PaymentResult>;
}

export class OsCashPOSPlugin implements POSPlugin {
    name = 'osCASH Gateway';
    version = '1.0.0';
    
    constructor(
        private config: {
            gatewayUrl: string;
            apiKey: string;
            terminalId: string;
        }
    ) {}
    
    async process(transaction: Transaction): Promise<PaymentResult> {
        // 1. Create invoice
        const invoice = await this.createInvoice({
            amount: transaction.total,
            items: transaction.items,
            terminalId: this.config.terminalId
        });
        
        // 2. Display on customer screen
        await this.displayQRCode(invoice);
        
        // 3. Wait for payment
        const result = await this.waitForPayment(invoice.id);
        
        // 4. Print receipt
        if (result.paid) {
            await this.printReceipt(result);
        }
        
        return result;
    }
    
    private async displayQRCode(invoice: Invoice) {
        // Send to customer display
        customerDisplay.show({
            type: 'qr_code',
            data: invoice.bolt11,
            amount: invoice.amount,
            timeout: 300 // 5 minutes
        });
    }
}

Deployment & Testing Checkliste

Server Setup

# 1. Installation testen
sudo apt install oscash-gateway
sudo systemctl status oscash-gateway

# 2. SSL einrichten
sudo certbot --nginx -d pay.yourdomain.com

# 3. Monitoring
docker logs oscash-gateway -f
curl https://pay.yourdomain.com/api/v1/health

# 4. Backup einrichten
sudo oscash-gateway backup --schedule daily

Mobile App Testing

// Testfälle
@Test
fun testPaymentFlow() {
    // 1. Gateway Verbindung
    assertNotNull(paymentManager.testConnection())
    
    // 2. Invoice erstellen
    val invoice = paymentManager.createInvoice(100.0, "EUR")
    assertNotNull(invoice.id)
    
    // 3. Payment UI
    onView(withId(R.id.payment_button)).perform(click())
    onView(withId(R.id.amount_input)).perform(typeText("10"))
    onView(withId(R.id.send_button)).perform(click())
    
    // 4. Webhook empfangen
    verify(webhookHandler).onPaymentReceived(any())
}

Plugin Integration

// E2E Test für WooCommerce
describe('osCASH Gateway WooCommerce', () => {
    it('should process payment', async () => {
        // 1. Produkt in Warenkorb
        await addToCart('test-product');
        
        // 2. Checkout
        await goToCheckout();
        await selectPaymentMethod('oscash_gateway');
        
        // 3. Zahlung
        const invoiceUrl = await placeOrder();
        expect(invoiceUrl).toContain('pay.oscash.me');
        
        // 4. Status prüfen
        await simulatePayment(invoiceUrl);
        const order = await getOrder();
        expect(order.status).toBe('processing');
    });
});

Wichtige Hinweise

  1. Upstream Sync: Regelmäßig BTCPay Updates mergen
  2. Security Audits: Vor Go-Live externe Prüfung
  3. Rate Limiting: API-Zugriffe begrenzen
  4. Monitoring: Prometheus/Grafana Setup
  5. Documentation: API-Docs mit Swagger/OpenAPI
  6. Compliance: KYC/AML je nach Jurisdiction

Viel Erfolg bei der Implementierung! 🚀


Teil 3 - Ghost Server Plugin

osCASH PAY Plugin für Ghost Server (hohe Priorität)

Plugin Struktur

ghost-oscash-gateway/
├── package.json
├── index.js
├── lib/
│   ├── oscash-gateway.js
│   ├── webhook-handler.js
│   ├── payment-button.js
│   └── admin-api.js
├── assets/
│   ├── css/
│   │   └── oscash-payment.css
│   └── js/
│       └── oscash-frontend.js
├── templates/
│   ├── payment-modal.hbs
│   ├── donation-widget.hbs
│   └── membership-checkout.hbs
└── config/
    └── defaults.json

Package.json

{
  "name": "ghost-oscash-gateway",
  "version": "1.0.0",
  "description": "osCASH Gateway integration for Ghost CMS - Accept crypto payments",
  "main": "index.js",
  "engines": {
    "ghost": ">=5.0.0",
    "ghost-api": "v5"
  },
  "keywords": ["ghost", "plugin", "payment", "bitcoin", "lightning", "crypto"],
  "author": "osCASH.me Team",
  "license": "MIT",
  "dependencies": {
    "@tryghost/helpers": "^1.1.0",
    "@tryghost/errors": "^1.2.0",
    "axios": "^1.6.0",
    "express": "^4.18.0",
    "handlebars": "^4.7.0",
    "qrcode": "^1.5.0",
    "socket.io-client": "^4.5.0"
  },
  "ghost": {
    "api": "v5",
    "permissions": {
      "content": ["browse", "read", "add", "edit"],
      "members": ["browse", "read", "add", "edit"],
      "webhooks": ["add"]
    }
  }
}

Main Plugin File

// index.js
const OsCashGateway = require('./lib/oscash-gateway');
const WebhookHandler = require('./lib/webhook-handler');
const PaymentButton = require('./lib/payment-button');
const AdminAPI = require('./lib/admin-api');

module.exports = {
    name: 'ghost-oscash-gateway',
    version: '1.0.0',
    
    async activate(ghost) {
        const { api, config, logging } = ghost;
        
        // Initialize gateway
        this.gateway = new OsCashGateway({
            apiUrl: config.get('oscash:gateway_url') || process.env.OSCASH_GATEWAY_URL,
            apiKey: config.get('oscash:api_key') || process.env.OSCASH_API_KEY,
            storeId: config.get('oscash:store_id') || process.env.OSCASH_STORE_ID,
            logger: logging
        });
        
        // Register webhook endpoint
        this.webhookHandler = new WebhookHandler(this.gateway, api);
        await this.registerWebhooks(api);
        
        // Register payment button helper
        this.registerHelpers(ghost);
        
        // Setup admin API extensions
        this.setupAdminAPI(api);
        
        // Initialize WebSocket for real-time updates
        this.initializeWebSocket();
        
        logging.info('osCASH Gateway plugin activated');
    },
    
    async deactivate() {
        if (this.wsConnection) {
            this.wsConnection.disconnect();
        }
    },
    
    async registerWebhooks(api) {
        // Register webhook endpoint for payment notifications
        api.webhooks.add({
            event: 'oscash.payment.received',
            target_url: '/oscash/webhook',
            internal: true
        });
        
        // Add Express route for webhook handling
        api.site.use('/oscash/webhook', this.webhookHandler.middleware());
    },
    
    registerHelpers(ghost) {
        const { helpers } = ghost;
        
        // Payment button helper
        helpers.register('oscash_payment', this.createPaymentButton.bind(this));
        
        // Donation widget helper
        helpers.register('oscash_donate', this.createDonationWidget.bind(this));
        
        // Membership payment helper
        helpers.register('oscash_membership', this.createMembershipCheckout.bind(this));
    },
    
    createPaymentButton(options) {
        return PaymentButton.render({
            amount: options.hash.amount,
            currency: options.hash.currency || 'EUR',
            label: options.hash.label || 'Pay with osCASH',
            description: options.hash.description,
            style: options.hash.style || 'default',
            callback_url: options.hash.callback_url
        });
    },
    
    createDonationWidget(options) {
        return `
            <div class="oscash-donation-widget" 
                 data-amounts="${options.hash.amounts || '5,10,25,50'}"
                 data-currency="${options.hash.currency || 'EUR'}"
                 data-project="${options.hash.project || 'general'}">
                <div class="oscash-donation-amounts"></div>
                <button class="oscash-donate-button">Donate with Crypto</button>
            </div>
            <script src="/assets/oscash/donation-widget.js"></script>
        `;
    }
};

Gateway Integration

// lib/oscash-gateway.js
const axios = require('axios');
const QRCode = require('qrcode');
const crypto = require('crypto');

class OsCashGateway {
    constructor(config) {
        this.apiUrl = config.apiUrl;
        this.apiKey = config.apiKey;
        this.storeId = config.storeId;
        this.logger = config.logger;
        
        this.client = axios.create({
            baseURL: this.apiUrl,
            headers: {
                'Authorization': `Bearer ${this.apiKey}`,
                'Content-Type': 'application/json'
            }
        });
    }
    
    async createInvoice(data) {
        try {
            const invoice = await this.client.post(`/stores/${this.storeId}/invoices`, {
                amount: data.amount,
                currency: data.currency || 'EUR',
                orderId: data.orderId || this.generateOrderId(),
                buyerEmail: data.email,
                itemDesc: data.description,
                notificationUrl: data.webhookUrl,
                redirectUrl: data.redirectUrl,
                metadata: {
                    ghostPostId: data.postId,
                    ghostMemberId: data.memberId,
                    paymentType: data.type // 'article', 'membership', 'donation'
                }
            });
            
            // Generate QR codes for different payment methods
            invoice.data.qrCodes = {
                lightning: await QRCode.toDataURL(invoice.data.lightning),
                bitcoin: await QRCode.toDataURL(invoice.data.bitcoin),
                monero: invoice.data.monero ? await QRCode.toDataURL(invoice.data.monero) : null
            };
            
            return invoice.data;
        } catch (error) {
            this.logger.error('Failed to create invoice:', error);
            throw error;
        }
    }
    
    async getInvoice(invoiceId) {
        const response = await this.client.get(`/invoices/${invoiceId}`);
        return response.data;
    }
    
    async verifyWebhookSignature(payload, signature) {
        const hmac = crypto.createHmac('sha256', this.webhookSecret);
        hmac.update(JSON.stringify(payload));
        const expectedSignature = hmac.digest('hex');
        return crypto.timingSafeEqual(
            Buffer.from(signature),
            Buffer.from(expectedSignature)
        );
    }
    
    generateOrderId() {
        return `ghost-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
    }
}

module.exports = OsCashGateway;

Ghost Members Integration

// lib/ghost-members-integration.js
class GhostMembersIntegration {
    constructor(api, gateway) {
        this.api = api;
        this.gateway = gateway;
    }
    
    async handleMembershipPayment(member, tier) {
        // Create invoice for membership
        const invoice = await this.gateway.createInvoice({
            amount: tier.price,
            currency: tier.currency,
            type: 'membership',
            memberId: member.id,
            email: member.email,
            description: `${tier.name} Membership - ${tier.interval}`,
            webhookUrl: `${process.env.SITE_URL}/oscash/webhook/membership`,
            redirectUrl: `${process.env.SITE_URL}/membership/success`
        });
        
        // Store invoice in member metadata
        await this.api.members.edit({
            id: member.id,
            metadata: {
                oscash_invoice_id: invoice.id,
                oscash_invoice_status: 'pending',
                subscription_tier: tier.id
            }
        });
        
        return invoice;
    }
    
    async activateMembership(invoiceId) {
        // Find member by invoice
        const members = await this.api.members.browse({
            filter: `metadata.oscash_invoice_id:${invoiceId}`
        });
        
        if (members.length === 0) {
            throw new Error('Member not found for invoice');
        }
        
        const member = members[0];
        const invoice = await this.gateway.getInvoice(invoiceId);
        
        // Activate membership
        await this.api.members.edit({
            id: member.id,
            status: 'paid',
            metadata: {
                ...member.metadata,
                oscash_invoice_status: 'paid',
                payment_date: new Date().toISOString(),
                payment_amount: invoice.amount,
                payment_currency: invoice.currency
            },
            subscriptions: [{
                tier_id: member.metadata.subscription_tier,
                status: 'active',
                start_date: new Date().toISOString()
            }]
        });
        
        // Send confirmation email
        await this.sendConfirmationEmail(member, invoice);
    }
}

Payment Modal Component

// assets/js/oscash-frontend.js
class OsCashPaymentModal {
    constructor(options) {
        this.amount = options.amount;
        this.currency = options.currency;
        this.description = options.description;
        this.postId = options.postId;
        this.gateway = new OsCashGatewayClient();
    }
    
    async show() {
        // Create invoice
        const invoice = await this.gateway.createInvoice({
            amount: this.amount,
            currency: this.currency,
            description: this.description,
            postId: this.postId
        });
        
        // Create modal
        this.modal = document.createElement('div');
        this.modal.className = 'oscash-modal';
        this.modal.innerHTML = `
            <div class="oscash-modal-content">
                <span class="oscash-close">&times;</span>
                <h2>Complete Your Payment</h2>
                
                <div class="oscash-payment-tabs">
                    <button class="oscash-tab active" data-method="lightning">
                        ⚡ Lightning
                    </button>
                    <button class="oscash-tab" data-method="bitcoin">
                        ₿ Bitcoin
                    </button>
                    <button class="oscash-tab" data-method="monero">
                        🔒 Monero
                    </button>
                </div>
                
                <div class="oscash-payment-content">
                    <div id="lightning-content" class="oscash-tab-content active">
                        <img src="${invoice.qrCodes.lightning}" alt="Lightning Invoice"/>
                        <input type="text" value="${invoice.lightning}" readonly/>
                        <button class="oscash-copy-btn" data-copy="${invoice.lightning}">
                            Copy Invoice
                        </button>
                    </div>
                    
                    <div id="bitcoin-content" class="oscash-tab-content">
                        <img src="${invoice.qrCodes.bitcoin}" alt="Bitcoin Address"/>
                        <input type="text" value="${invoice.bitcoin}" readonly/>
                        <button class="oscash-copy-btn" data-copy="${invoice.bitcoin}">
                            Copy Address
                        </button>
                    </div>
                    
                    <div id="monero-content" class="oscash-tab-content">
                        ${invoice.monero ? `
                            <img src="${invoice.qrCodes.monero}" alt="Monero Address"/>
                            <input type="text" value="${invoice.monero}" readonly/>
                            <button class="oscash-copy-btn" data-copy="${invoice.monero}">
                                Copy Address
                            </button>
                        ` : '<p>Monero not available for this payment</p>'}
                    </div>
                </div>
                
                <div class="oscash-payment-info">
                    <p>Amount: <strong>${this.amount} ${this.currency}</strong></p>
                    <p>Invoice expires in: <span id="oscash-timer">15:00</span></p>
                    <div class="oscash-payment-status" id="payment-status">
                        Waiting for payment...
                    </div>
                </div>
            </div>
        `;
        
        document.body.appendChild(this.modal);
        this.attachEventListeners();
        this.startPolling(invoice.id);
        this.startTimer(15 * 60); // 15 minutes
    }
    
    startPolling(invoiceId) {
        this.pollInterval = setInterval(async () => {
            const status = await this.gateway.checkInvoiceStatus(invoiceId);
            
            if (status.paid) {
                clearInterval(this.pollInterval);
                this.onPaymentSuccess(status);
            } else if (status.expired) {
                clearInterval(this.pollInterval);
                this.onPaymentExpired();
            }
        }, 2000);
    }
    
    onPaymentSuccess(payment) {
        document.getElementById('payment-status').innerHTML = `
            <div class="oscash-success">
                ✅ Payment Received!
                <p>Transaction ID: ${payment.txId}</p>
            </div>
        `;
        
        // Unlock content or redirect
        setTimeout(() => {
            if (this.postId) {
                this.unlockContent();
            } else {
                window.location.reload();
            }
        }, 3000);
    }
    
    unlockContent() {
        // Remove paywall
        document.querySelectorAll('.oscash-paywall').forEach(el => {
            el.classList.remove('oscash-paywall');
            el.classList.add('oscash-unlocked');
        });
        
        // Store unlock in localStorage
        const unlockedPosts = JSON.parse(localStorage.getItem('oscash_unlocked') || '[]');
        unlockedPosts.push(this.postId);
        localStorage.setItem('oscash_unlocked', JSON.stringify(unlockedPosts));
        
        this.close();
    }
}

Ghost Theme Integration

<!-- post.hbs - Paywall Integration -->
{{#if @custom.oscash_enabled}}
    {{#unless @member.paid}}
        <article class="post-content">
            {{!-- Show excerpt --}}
            <div class="post-excerpt">
                {{excerpt words="50"}}
            </div>
            
            {{!-- Paywall --}}
            <div class="oscash-paywall">
                <div class="paywall-message">
                    <h3>🔒 Premium Content</h3>
                    <p>Support independent journalism with a micro-payment</p>
                    
                    {{!-- One-time payment --}}
                    {{oscash_payment 
                        amount="2.50" 
                        currency="EUR" 
                        label="Unlock Article (€2.50)" 
                        description=title
                        postId=id
                    }}
                    
                    {{!-- Or membership --}}
                    <div class="membership-option">
                        <p>Or become a member for unlimited access</p>
                        {{oscash_membership 
                            tier="monthly" 
                            price="9.99" 
                            currency="EUR"
                        }}
                    </div>
                </div>
            </div>
        </article>
    {{else}}
        {{!-- Full content for members --}}
        <article class="post-content">
            {{content}}
        </article>
    {{/unless}}
{{else}}
    {{!-- Standard content --}}
    <article class="post-content">
        {{content}}
    </article>
{{/if}}

{{!-- Donation Widget in Sidebar --}}
<aside class="sidebar">
    <div class="donation-widget">
        <h3>Support This Site</h3>
        {{oscash_donate 
            amounts="5,10,25,50,100" 
            currency="EUR"
            project="blog-support"
        }}
    </div>
</aside>

Admin Settings Panel

// lib/admin-api.js
class AdminAPI {
    static registerSettings(api) {
        api.settings.add({
            group: 'oscash',
            settings: [
                {
                    key: 'oscash_enabled',
                    type: 'boolean',
                    default: false,
                    label: 'Enable osCASH Gateway'
                },
                {
                    key: 'oscash_gateway_url',
                    type: 'string',
                    default: 'https://pay.oscash.me',
                    label: 'Gateway URL',
                    description: 'Your osCASH Gateway server URL'
                },
                {
                    key: 'oscash_api_key',
                    type: 'secret',
                    label: 'API Key',
                    description: 'Get from your osCASH Gateway dashboard'
                },
                {
                    key: 'oscash_store_id',
                    type: 'string',
                    label: 'Store ID'
                },
                {
                    key: 'oscash_payment_methods',
                    type: 'select',
                    multiple: true,
                    options: ['lightning', 'bitcoin', 'monero', 'mobilecoin'],
                    default: ['lightning', 'bitcoin'],
                    label: 'Accepted Payment Methods'
                },
                {
                    key: 'oscash_article_price',
                    type: 'number',
                    default: 2.50,
                    label: 'Default Article Price'
                },
                {
                    key: 'oscash_membership_monthly',
                    type: 'number',
                    default: 9.99,
                    label: 'Monthly Membership Price'
                }
            ]
        });
    }
}

Installation Script

#!/bin/bash
# install-ghost-plugin.sh

echo "🚀 Installing osCASH Gateway Plugin for Ghost"

# Check if Ghost is installed
if [ ! -d "content/adapters" ]; then
    echo "❌ Ghost installation not found. Please run from Ghost root directory."
    exit 1
fi

# Create plugin directory
mkdir -p content/adapters/oscash-gateway

# Clone plugin
git clone https://github.com/osCASHme/ghost-oscash-gateway.git content/adapters/oscash-gateway

# Install dependencies
cd content/adapters/oscash-gateway
npm install --production

# Copy default config
cp config/defaults.json ../../settings/oscash-gateway.json

# Set permissions
chown -R ghost:ghost ../oscash-gateway

# Restart Ghost
ghost restart

echo "✅ osCASH Gateway Plugin installed successfully!"
echo ""
echo "Next steps:"
echo "1. Go to Ghost Admin → Settings → Labs"
echo "2. Configure osCASH Gateway settings"
echo "3. Add your API key and Gateway URL"
echo "4. Enable payment methods in your theme"
echo ""
echo "Documentation: https://github.com/osCASHme/ghost-oscash-gateway/wiki"

Docker Integration für Ghost + osCASH

# docker-compose.ghost-oscash.yml
version: '3.8'

services:
  ghost:
    image: ghost:5-alpine
    environment:
      - url=https://your-blog.com
      - database__client=mysql
      - database__connection__host=mysql
      - database__connection__database=ghost
      - OSCASH_GATEWAY_URL=http://oscash-gateway:8080
      - OSCASH_API_KEY=${OSCASH_API_KEY}
    volumes:
      - ghost-content:/var/lib/ghost/content
      - ./oscash-plugin:/var/lib/ghost/content/adapters/oscash-gateway
    depends_on:
      - mysql
      - oscash-gateway
    
  oscash-gateway:
    image: oscashme/gateway:latest
    environment:
      - OSCASH_NETWORK=mainnet
      - OSCASH_LIGHTNING=true
    volumes:
      - oscash-data:/data
    
  mysql:
    image: mysql:8
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=ghost
    volumes:
      - mysql-data:/var/lib/mysql

volumes:
  ghost-content:
  oscash-data:
  mysql-data:

Testing & Deployment

Ghost Plugin Tests

// test/ghost-plugin.test.js
const { expect } = require('chai');
const sinon = require('sinon');
const Plugin = require('../index');

describe('osCASH Gateway Ghost Plugin', () => {
    let ghost, plugin;
    
    beforeEach(() => {
        ghost = {
            api: { 
                members: { browse: sinon.stub(), edit: sinon.stub() },
                settings: { add: sinon.stub() }
            },
            config: { get: sinon.stub() },
            logging: { info: sinon.stub(), error: sinon.stub() }
        };
        
        plugin = Object.create(Plugin);
    });
    
    it('should create payment button helper', async () => {
        await plugin.activate(ghost);
        
        const button = plugin.createPaymentButton({
            hash: { amount: 5, currency: 'EUR' }
        });
        
        expect(button).to.include('oscash-payment-button');
        expect(button).to.include('data-amount="5"');
    });
    
    it('should handle membership payment', async () => {
        const gateway = plugin.gateway;
        const invoice = await gateway.createInvoice({
            amount: 9.99,
            type: 'membership'
        });
        
        expect(invoice).to.have.property('id');
        expect(invoice).to.have.property('lightning');
    });
});

Namasté! 🙏 Der Ghost-Plugin ist jetzt vollständig dokumentiert und bereit für die Implementierung. Ghost's moderne Architektur macht die Integration besonders elegant.


Recherche: BTCPay Server vs SHKeeper.io

osCASH.me GATE - Zusammenfassung und Empfehlung

Nach umfassender technischer Analyse empfehle ich BTCPay Server als Basis für das osCASH.me Payment Gateway Projekt, jedoch mit einer hybriden Architektur für MobileCoin-Integration über einen separaten Microservice.

Hauptgründe für BTCPay Server

  1. Überlegene Plugin-Architektur: Trotz fehlender Sandboxing bietet BTCPay Server mit .NET 8.0 und C# eine ausgereifte, gut dokumentierte Plugin-Entwicklungsumgebung
  2. Etabliertes Ökosystem: 6,952 GitHub Stars, 170+ Contributors und bewährte Enterprise-Deployments (Namecheap: $73M+ Umsatz)
  3. Sicherheitsmaturität: Formales Bug Bounty Programm, dokumentierte CVEs und aktive Security-Community
  4. Zukunftssicherheit: MIT-Lizenz, BTCPay Server Foundation und dezentralisierte Governance garantieren Langlebigkeit

Kritische Unterschiede

Aspekt BTCPay Server SHKeeper.io
Technologie C#/.NET 8.0, ASP.NET Core Python, Flask/FastAPI
Plugin-System Embedded, gleicher Prozess API-driven, externe Module
Community 6,952 Stars, 170+ Contributors 345 Stars, <20 Contributors
Lizenz MIT (permissiv) GPL-3.0 (copyleft)
Cloud-Native Docker-fokussiert Kubernetes-first
API Greenfield API v1 + BitPay-kompatibel Einfache REST API

1. SHKeeper.io Analyse

Technische Architektur

SHKeeper basiert auf einer Python-basierten Microservices-Architektur mit separaten Blockchain-Modulen. Die Hauptstärke liegt in der Kubernetes-nativen Deployment-Strategie mit Helm Charts. Das System unterstützt 15+ Kryptowährungen über dedizierte Fullnodes.

Architektur-Schwächen:

  • Hohe Ressourcenanforderungen (BNB: 16 Cores, 64GB RAM, 3TB Storage)
  • Begrenzte Plugin-Isolation trotz API-Ansatz
  • Fehlende Webhook-Standardisierung
  • GPL-3.0 Lizenz erschwert kommerzielle Forks

API und Dokumentation

Die API (v2.1.47) bietet grundlegende CRUD-Operationen mit API-Key-Authentifizierung. Die Dokumentation ist funktional aber limitiert - keine SDKs außer cURL-Beispiele verfügbar.

2. BTCPay Server Deep Dive

Plugin Development Framework

BTCPay Server v2.0+ revolutionierte die Plugin-Architektur:

public class MobileCoinPlugin : BaseBTCPayServerPlugin
{
    public override void Execute(IServiceCollection services)
    {
        services.AddSingleton<IPaymentMethodHandler, MobileCoinPaymentHandler>();
        services.AddSingleton<IMobileCoinService, MobileCoinService>();
    }
}

Plugin-Vorteile:

  • Voller Zugriff auf BTCPay Server Core-Funktionalität
  • Entity Framework Integration für Datenbankoperationen
  • Razor Pages für nahtlose UI-Integration
  • Greenfield API Erweiterungen möglich

Plugin-Nachteile:

  • Keine Sandboxing (Sicherheitsrisiko)
  • C#-only Entwicklung
  • Server-Neustart für Updates erforderlich

Greenfield API vs Legacy API

Die moderne Greenfield API bietet:

  • OpenAPI 3.0 Spezifikation
  • Granulare Permissions (btcpay.store.cancreateinvoice)
  • WebSocket Support für Echtzeit-Updates
  • Client Libraries (C#, Python, Node.js, PHP)

3. MobileCoin (MOB/eUSD) Integration

Technische Herausforderungen

MobileCoin erfordert:

  • Intel SGX Hardware für Fog Services
  • Full-Service API (JSON RPC 2.0)
  • Keine C#/.NET SDK verfügbar
  • Kein natives Webhook-System

Empfohlene Hybrid-Architektur

# Architektur für osCASH.me
services:
  btcpay-server:
    image: btcpayserver/btcpayserver:latest
    environment:
      - BTCPAY_PLUGINDIR=/plugins
  
  mobilecoin-bridge:
    image: oscash/mobilecoin-bridge:latest
    environment:
      - MOBILECOIN_API=http://full-service:9090
      - BTCPAY_API=http://btcpay-server:49392
    volumes:
      - mobilecoin-data:/data

Der MobileCoin-Bridge-Service würde:

  1. MobileCoin Full-Service API in BTCPay-kompatible Calls übersetzen
  2. Polling für Transaktionsbestätigungen implementieren
  3. Webhooks an BTCPay Server senden
  4. eUSD/MOB Konversionen handhaben

4. Plugin-Architektur Vergleich

Modularität

BTCPay Server ermöglicht tiefe Integration aber mit Risiken:

  • Plugins teilen Prozessraum (Performance-Vorteil)
  • Direkte Datenbankzugriffe möglich
  • UI-Komponenten nahtlos integrierbar

SHKeeper.io bietet bessere Isolation:

  • API-only Integration
  • Prozess-Trennung
  • Sprach-agnostisch

Empfehlung für osCASH.me

Hybride Lösung: BTCPay Core + externe Services für kritische Komponenten

5. Fiat Gateway Integration

Integration Komplexität

Provider BTCPay Integration Aufwand KYC
NOWPayments Plugin verfügbar 2-4 Wochen Optional
PayBis Custom Plugin 6-8 Wochen Erforderlich
ChangeNOW Custom Plugin 4-6 Wochen Optional
Sentz Sehr komplex 8-12 Wochen Minimal

PayBis Integration Beispiel

public class PayBisGatewayPlugin : BaseBTCPayServerPlugin
{
    public override void Execute(IServiceCollection services)
    {
        services.AddScoped<IPayBisService>(provider =>
        {
            var config = provider.GetRequiredService<IConfiguration>();
            return new PayBisService(
                apiKey: config["PayBis:ApiKey"],
                webhookSecret: config["PayBis:WebhookSecret"]
            );
        });
    }
}

6. Technische Modernität

Performance und Skalierung

BTCPay Server (.NET 8.0):

  • Kompilierte Sprache mit überlegener Performance
  • Entity Framework Core für optimierte Datenbankzugriffe
  • Begrenzte horizontale Skalierung

SHKeeper.io (Python):

  • Interpretierte Sprache, langsamer
  • Bessere Kubernetes-Skalierung
  • Höhere operative Komplexität

API Design

BTCPay's Greenfield API ist enterprise-ready mit:

  • Vollständiger OpenAPI Dokumentation
  • Granularen Permissions
  • WebSocket Support
  • Multiple SDKs

7. Compliance & KYC Separation

Beide Plattformen unterstützen Zero-KYC by Design:

// BTCPay KYC Plugin (optional)
public class OptionalKYCPlugin : BaseBTCPayServerPlugin
{
    public override void Execute(IServiceCollection services)
    {
        services.AddAuthorization(options =>
        {
            options.AddPolicy("KYCRequired", policy =>
                policy.AddRequirements(new KYCRequirement { 
                    AmountThreshold = 1000m 
                }));
        });
    }
}

8. Deployment & Operations

Ressourcenanforderungen

Komponente BTCPay Server SHKeeper.io
Minimal 2 CPU, 4GB RAM, 25GB 4 CPU, 4GB RAM, 20GB
Production 4 CPU, 8GB RAM, 200GB 8 CPU, 8GB RAM, 100GB+
Multi-Crypto +2GB RAM pro Coin +4-16 CPU, +8-64GB RAM pro Coin

Docker Deployment (BTCPay)

export BTCPAY_HOST="pay.oscash.me"
export NBITCOIN_NETWORK="mainnet"
export BTCPAYGEN_CRYPTO1="btc"
export BTCPAYGEN_LIGHTNING="lnd"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s"
./btcpay-setup.sh

9. Security Architecture

BTCPay Server Vorteile

  • Bug Bounty Program (bis $5,000)
  • CVE Historie mit verantwortungsvoller Offenlegung
  • Hardware Wallet Integration (Trezor, Ledger)
  • Multi-Signature Support
  • PSBT für Air-gapped Signing

Sicherheitsbedenken

  • Plugin-Sandboxing fehlt in beiden Systemen
  • SHKeeper hat keine dokumentierten Security Audits
  • BTCPay's größere Attack Surface durch Komplexität

10. Community & Ecosystem

Metriken Vergleich

Metrik BTCPay Server SHKeeper.io Faktor
GitHub Stars 6,952 345 20x
Contributors 170+ <20 8.5x
Plugins/Module 15+ 5 3x
E-Commerce Integrationen 20+ 5 4x
Dokumentation Umfassend Basis -

Finale Empfehlung für osCASH.me

Architektur-Vorschlag

graph TD
    A[osCASH.me Gateway] --> B[BTCPay Server Core]
    B --> C[Bitcoin/Lightning Plugin]
    B --> D[Ethereum Plugin]
    B --> E[Monero Plugin]
    A --> F[MobileCoin Bridge Service]
    F --> G[Full-Service API]
    F --> B
    A --> H[Fiat Gateway Service]
    H --> I[PayBis API]
    H --> J[NOWPayments API]
    H --> B

Implementierungs-Roadmap

Phase 1 (Wochen 1-4):

  • BTCPay Server Deployment mit Bitcoin/Lightning
  • Ghost CMS Plugin Development
  • Android App API Integration

Phase 2 (Wochen 5-8):

  • MobileCoin Bridge Service in Rust/Go
  • eUSD Integration und Testing
  • Webhook-System Implementation

Phase 3 (Wochen 9-12):

  • Fiat Gateway Plugin (NOWPayments prioritär)
  • USDT/USDC über Ethereum Plugin
  • XMR Plugin Integration

Phase 4 (Wochen 13-16):

  • PayBis Integration für Fiat On/Off-Ramp
  • KYC Module (optional, plugin-basiert)
  • Production Deployment und Optimierung

Technologie-Stack Empfehlung

# Empfohlener Stack für osCASH.me
infrastructure:
  core: BTCPay Server v2.1.0+
  deployment: Docker Compose (initial), Kubernetes (scale)
  database: PostgreSQL 14+
  proxy: nginx with Let's Encrypt

services:
  payment_core: BTCPay Server
  mobilecoin: Custom Bridge Service (Rust)
  fiat_gateway: Custom Plugin (C#)
  monitoring: Prometheus + Grafana

plugins:
  - Bitcoin Core + Lightning (LND)
  - Ethereum (with USDT/USDC)
  - Monero
  - Custom MobileCoin Connector
  - Custom Fiat Gateway Aggregator

Kritische Erfolgsfaktoren

  1. MobileCoin Bridge: Separater Service in Rust für optimale MobileCoin SDK Nutzung
  2. Plugin Security: Implementiere zusätzliche Sicherheitsschicht für Plugin-Validierung
  3. API Gateway: Kong oder Traefik für API-Aggregation und Rate Limiting
  4. Monitoring: Comprehensive logging und alerting von Anfang an
  5. Documentation: API-first Entwicklung mit OpenAPI Spec

Langzeit-Perspektive

BTCPay Server bietet die beste Grundlage für osCASH.me weil:

  • Bewährte Enterprise-Tauglichkeit (Namecheap Case Study)
  • Aktive Entwicklung und Community Support
  • Flexible Plugin-Architektur für Custom Requirements
  • MIT Lizenz ermöglicht kommerzielle Nutzung
  • Zukunftssicher durch Foundation-Backing

SHKeeper.io wäre nur dann vorzuziehen, wenn:

  • Kubernetes-first Deployment absolute Priorität hat
  • Sehr viele verschiedene Altcoins unterstützt werden müssen
  • Das Team starke Python-Expertise hat
  • GPL-3.0 Lizenz akzeptabel ist

Anhang - Überlegungen zum Fork der Sentz Wallet

Sentz Wallet für eUSD und MOB auf der Mobilecoin Blockchain.

Die Sentz Wallet repräsentiert eine komplexe Verschmelzung von Privacy-fokussierten Kryptowährungstechnologien mit teilweiser Open Source Transparenz. Als Nachfolger der ursprünglichen Moby Wallet durch MobileCoin Foundation zeigt Sentz sowohl beeindruckende technische Innovation als auch strukturelle Herausforderungen für die Open Source Community.

Die Untersuchung zeigt, dass Sentz technisch forkbar ist mit 96 öffentlichen Repositories unter Apache 2.0 und GPL v3 Lizenzen, jedoch fehlt die Community-zentrierte Reinheit vergleichbarer Projekte wie Signal oder Molly Messenger. Die gemischte Lizenzstruktur und Corporate-Kontrolle positioniert Sentz in einer Mittelschicht der Open Source Transparenz - offener als MetaMask, aber weniger rein als nonprofit Alternativen.

Die technische Architektur verstehen

Sentz basiert auf der MobileCoin Blockchain und implementiert fortschrittliche kryptografische Protokolle für private Zahlungen. Das Herzstück bildet eine selbstverwaltete Wallet-Architektur, bei der private Schlüssel niemals das Gerät des Nutzers verlassen. Die technische Implementierung nutzt Ring Signatures nach dem MLSAG-Protokoll zur Verschleierung des Absenders, One-Time Addresses für Empfängerprivatsphäre und Ring Confidential Transactions (RingCT) mit Bulletproofs zur Betragsverbergung.

Die Integration von Intel SGX Secure Enclaves ermöglicht es, Transaktionen in verschlüsselten Ausführungsumgebungen zu validieren. Diese Defense-in-Depth Strategie bedeutet, dass selbst bei SGX-Kompromittierung die grundlegenden CryptoNote-Privatsphäreschutzmaßnahmen bestehen bleiben. Die MobileCoin Fog-Infrastruktur nutzt Oblivious RAM (ORAM) Datenstrukturen, um Zugriffsmuster bei der Kontostandsabfrage zu verschleiern - eine Innovation, die mobile Krypto-Wallets ohne vollständige Blockchain-Synchronisation ermöglicht.

Zwei Hauptwährungen werden unterstützt: $MOB als nativer Token mit festem Supply von 250 Millionen und $eUSD als Privacy-preserving Stablecoin, der durch einen Korb etablierter Stablecoins (USDT, USDC) gedeckt ist. Die eUSD-Architektur bietet 1:1 USD-Deckung mit algorithmischer Rebalancierung und Community-gesteuerter Governance.

Von Moby zu Sentz: Ein strategischer Übergang

Die Geschichte von Sentz beginnt 2017 mit der Gründung von MobileCoin Inc. durch Joshua Goldbard und Shane Glynn. Die ursprüngliche Moby Wallet (nicht "Mobby") wurde 2020 von der neu gegründeten MobileCoin Foundation entwickelt, zeitgleich mit dem Launch des MobileCoin Mainnets im Dezember 2020. Signal integrierte MOB für Peer-to-Peer-Zahlungen im April 2021, was dem Projekt erhebliche Aufmerksamkeit verschaffte.

Der vollständige Rebrand zu Sentz erfolgte 2024, wobei alle Komponenten umbenannt wurden: Moby App wurde zur Sentz App, MobileCoin Foundation zur Sentz Foundation und MobileCoin Inc. zu Sentz Global. Diese strategische Neuausrichtung zielte darauf ab, ein breiteres globales Publikum anzusprechen, besonders in Lateinamerika und Afrika. Die zugrundeliegende Blockchain-Infrastruktur und Privacy-Technologie blieb dabei unverändert.

Die Organisationsstruktur trennt klar zwischen der Sentz Foundation als Non-Profit-Organisation für Protokoll-Governance und Sentz Global als kommerziellem Unternehmen für Produktentwicklung. Sara Drakeley übernahm im September 2023 die CEO-Position, nachdem der vorherige CPO Bob Lee tragischerweise im April 2023 in San Francisco getötet wurde.

Open Source Status: Gemischte Transparenz

Die Open Source Analyse zeigt ein komplexes Bild. Mit 96 öffentlichen Repositories unter der mobilecoinofficial Organisation und weiteren 38 unter mobilecoinfoundation ist der Quellcode umfangreich verfügbar. Die Lizenzierung folgt einem gemischten Ansatz: Apache 2.0 für Client-SDKs und mobile Implementierungen, GPL v3 für einige Server-Komponenten und Wallet-Anwendungen.

Die wichtigsten Komponenten wie full-service (Backend-Wallet-Service mit 46 Stars, 21 Forks), desktop-wallet, android-sdk und MobileCoin-Swift sind aktiv entwickelt mit regelmäßigen Commits. Das Kern-Repository mobilecoin zeigt mit 1.164 Stars und 155 Forks substantielles Community-Interesse. Allerdings erfordert die Contribution ein Contributor License Agreement (CLA), was eine zusätzliche Hürde für Community-Beiträge darstellt.

Kritisch anzumerken ist das Fehlen großer Community-Forks, wie sie bei Signal (Molly, Session) existieren. Dies deutet entweder auf technische Komplexität oder mangelndes Community-Interesse an unabhängigen Implementierungen hin. Die Build-Komplexität ist moderat bis hoch, mit gut dokumentierten Prozessen aber spezifischen Anforderungen wie Intel SGX für vollständige Funktionalität.

Fork-Möglichkeiten: Technisch ja, praktisch komplex

Sentz ist rechtlich und technisch forkbar, jedoch mit erheblichen praktischen Herausforderungen. Die Apache 2.0 und GPL v3 Lizenzen erlauben Modifikationen und Redistribution. Es existieren keine offensichtlichen Patent-Restriktionen, die Forks blockieren würden. Allerdings unterscheidet sich die Situation fundamental von Signal/Molly-Forks.

Während Molly als Signal-Fork denselben Server nutzen kann und nur den Client modifiziert, würde ein Sentz-Fork ein separates Blockchain-Netzwerk erfordern oder Kompatibilitätsmodus mit dem bestehenden MobileCoin-Netzwerk benötigen. Die Intel SGX-Abhängigkeit für Consensus-Validierung stellt eine zusätzliche technische Barriere dar. Markenrechtliche Überlegungen erfordern zudem ein komplettes Rebranding bei einem Fork.

Die empfohlene Fork-Strategie würde sich auf Apache 2.0 lizenzierte Komponenten fokussieren für maximale Flexibilität, eine unabhängige Markenidentität entwickeln und entweder ein kompatibles oder völlig separates Netzwerk aufbauen. Die Tatsache, dass keine größeren Forks existieren, während Signal mehrere erfolgreiche Forks hat, spricht für die höhere Komplexität eines Sentz-Forks.

Sicherheit: Fortschrittlich aber ungeprüft

Die Sicherheitsarchitektur von Sentz implementiert state-of-the-art Kryptografie mit mehrschichtigen Schutzmaßnahmen. Die Verwendung von CryptoNote-Protokoll, Ring Confidential Transactions und Intel SGX Secure Enclaves bietet Defense-in-Depth gegen verschiedene Angriffsvektoren. Die selbstverwaltete Natur mit 24-Wort Recovery Phrase gibt Nutzern volle Kontrolle über ihre Gelder.

Besorgniserregend ist jedoch das Fehlen öffentlicher Sicherheitsaudits. Keine formalen Audit-Berichte sind verfügbar, und das Bug-Bounty-Programm ist minimal entwickelt ohne Integration in etablierte Plattformen wie HackerOne. Die Abhängigkeit von Intel SGX ist problematisch angesichts bekannter Vulnerabilities wie Foreshadow und verschiedener Side-Channel-Attacken. Historische Incidents umfassen FTX-Handelsmanipulation 2021 und Mitarbeiterbetrug 2017, jedoch keine direkten Netzwerk-Kompromittierungen.

Die Forward-Secrecy-Eigenschaften mildern SGX-Risiken teilweise, da Privacy-Schutz durch CryptoNote auch bei SGX-Kompromittierung bestehen bleibt. Dennoch stellt die durchschnittliche 2-monatige Patch-Zeit für SGX-Vulnerabilities ein Zeitfenster für potenzielle statistische Analysen dar.

Vergleich mit Open Source Alternativen

Im Spektrum der Open Source "Reinheit" positioniert sich Sentz in der Mitte. Signal und Molly-FOSS repräsentieren den Goldstandard mit nonprofit Struktur, minimalen proprietären Komponenten und aktiver Community. Molly-FOSS eliminiert sogar Google-Abhängigkeiten für vollständige Open Source Reinheit. Am anderen Ende steht MetaMask mit custom Lizenzierung seit August 2020 und Corporate-Kontrolle durch ConsenSys.

Sentz bietet bessere Transparenz als Trust Wallet (nur mobile App open source) oder aktuelles MetaMask, erreicht aber nicht die Community-zentrierte Offenheit von Signal. Die 96 öffentlichen Repositories und standard Open Source Lizenzen sind positiv, werden jedoch durch CLA-Anforderungen, Corporate-Struktur und unklare Monetarisierungsstrategie getrübt.

Die Geschäftsmodell-Transparenz ist ein kritischer Unterschied. Signal Foundation als 501(c)(3) nonprofit mit öffentlichen Finanzberichten kontrastiert stark mit Sentz's undurchsichtiger Einnahmestruktur. Die For-Profit Natur von Sentz Global unterscheidet sich fundamental von Signals spenden-basiertem Modell für 100 Millionen Nutzer Selbstversorgung.

Mobilecoin Blockchain Integration bewerten

Die technische Integration von $MOB und $eUSD zeigt sophistizierte Blockchain-Architektur. Der Federated Byzantine Agreement Konsens basierend auf Stellar Consensus Protocol ermöglicht ~5-Sekunden Blockzeiten bei minimaler Umweltbelastung. Die eUSD-Implementation mit Reserve Protocol und Multi-Stablecoin-Backing adressiert Depegging-Risiken intelligent.

Transaktionskosten von $0.0025 flat fee unabhängig vom Betrag machen Mikrotransaktionen praktikabel. Die Privacy-Features auf Blockchain-Ebene - Ring Signatures, One-Time Addresses, Bulletproofs - bieten substantiellen Schutz auch ohne SGX. Die Governance durch gewählte Governors für eUSD minting/burning zeigt Ansätze dezentraler Verwaltung, bleibt aber Foundation-kontrolliert.

Die Cross-Chain-Verfügbarkeit von eUSD auf Ethereum und MobileCoin erweitert Interoperabilität. Die Sentz Earn Funktion mit bis zu 8% jährlichen Rewards auf eUSD-Holdings, aktuell in Nigeria verfügbar, zeigt innovative DeFi-Integration in einem Privacy-fokussierten Kontext.

Schlussfolgerung: Ein hybrider Ansatz

Sentz Wallet repräsentiert einen hybriden Open Source Ansatz - technisch forkbar mit substantieller Code-Transparenz, aber ohne die Community-zentrierte Reinheit von Signal oder Molly. Die fortschrittliche Privacy-Technologie und umfangreiche Repository-Sammlung sind lobenswert, werden jedoch durch Corporate-Struktur, gemischte Lizenzierung und fehlende Sicherheitsaudits getrübt.

Für potenzielle Forks ist Sentz technisch viable aber praktisch herausfordernd. Die Blockchain-Netzwerk-Anforderungen, Intel SGX-Abhängigkeiten und fehlende Fork-Community stellen höhere Barrieren dar als bei reinen Messaging-Apps. Die Abwesenheit existierender Major Forks spricht Bände über die praktischen Schwierigkeiten.

Als "sauberes" Open Source Projekt qualifiziert sich Sentz nur teilweise. Es bietet mehr Transparenz als viele kommerzielle Wallets, erreicht aber nicht den Standard truly community-driven Projekte. Die Empfehlung für Fork-Interessierte: Fokus auf Apache 2.0 Komponenten, Aufbau eigener Netzwerk-Infrastruktur und substantielle Ressourcen-Planung für die technische Komplexität. Sentz bleibt ein faszinierendes Beispiel für die Spannung zwischen Privacy-Innovation und Open Source Idealen im Kryptowährungsraum.


● 🎯 Eingehende Analyse: osCASH.me GATE Strategie

Nach der detaillierten Recherche bei https://recode.at/molly-mixin-sentz/ ist die BTCPay Server Fork-Strategie eindeutig der bessere Weg!

Warum BTCPay Server FORKEN? 💡

Vorteile der GATE-Lösung:

  • ✅ MIT Lizenz - Perfekt für osCASH.me
  • ✅ Bewährte Architektur - .NET 8.0, PostgreSQL, Docker
  • ✅ Multi-Currency ready - Bitcoin, Lightning, erweiterbar
  • ✅ Greenfield API - Moderne REST/Webhook Integration
  • ✅ Self-hosted - Wie Nextcloud/Mailserver
  • ✅ Privacy-First - Zero-knowledge Payment Processing

osCASH.me GATE Architecture 🏗

osCASH.me App ←→ osCASH.me GATE (BTCPay Fork) ←→ Blockchain

Webhooks/APIs

Plugin System (POS/Shop)

Implementierungsstrategie:

Phase 1: BTCPay Server Fork (2-3 Wochen)

  • Fork BTCPay Server → osCASH.me GATE
  • osCASH.me Branding & Configuration
  • Docker-Setup für Self-hosting

Phase 2: Mobile Integration (1-2 Wochen)

  • osCASH.me App ↔ GATE API Integration
  • Wallet-UI für GATE Server Selection
  • QR-Code Payment Flow

Phase 3: Ecosystem (2-4 Wochen)

  • osCASH.me PAY Plugin (WooCommerce/Shopify)
  • POS Integration
  • Multi-Server Support

Swiss Clockwork Reliability 🇨🇭⏰

Server-Auswahl wie bei E-Mail:
Settings → Payment Gateway
├── Default: gate.osCASH.me
├── Custom: my-company.com/oscash-gate
└── Self-hosted: localhost:23000

Soll ich mit dem BTCPay Server Fork beginnen? Das ist definitiv der professionellere und nachhaltigere Ansatz für das osCASH.me Ecosystem! 🚀