ArPay Protocol Documentation
# Overview
ArPay is a peer-to-fiat settlement protocol that bridges the gap between cryptocurrency holders and traditional merchants. It enables seamless conversion of on-chain USDC to local fiat currency (IDR) without requiring merchants to interact with any cryptocurrency infrastructure.
# The Problem
Commerce between digital asset holders and traditional merchants faces a fundamental mismatch:
- Merchants operate exclusively within banking systems that recognize legal tender
- Crypto holders possess value in programmable, censorship-resistant tokens
- No direct settlement exists that satisfies both parties without forcing one to adopt the other's infrastructure
Current Solutions Fall Short
❌ Centralized Exchanges
- • Require custody surrender
- • Mandatory KYC verification
- • Settlement delays (hours/days)
❌ Crypto POS Terminals
- • Merchants bear regulatory exposure
- • Requires crypto knowledge
- • Near-zero adoption
❌ Payment Plugins
- • Merchants must accept novel instruments
- • Complex integration
- • Limited merchant acceptance
# The ArPay Solution
ArPay resolves this asymmetry through protocol-level separation of concerns:
User-facing layer: Operates entirely on Solana blockchain
Merchant-facing layer: Operates entirely within existing domestic banking
Bridge: Cryptographically-verified Python daemon connects both layers
# Key Features
⚡ Lightning Fast Settlement
Complete settlement cycle from transaction signature to merchant bank credit in 3-6 seconds under nominal network conditions.
🔒 Non-Custodial & Trustless
- Users maintain self-custody via standard Solana wallets
- Merchants never touch crypto—receive only legal tender
- No intermediary can freeze or confiscate funds
🛡️ Atomic Settlement Guarantee
Formal guarantee: Either the merchant receives fiat OR the user receives a full USDC refund. No intermediate state where funds are lost.
🏦 QRIS Native Integration
Leverages Indonesia's standardized QR payment system (QRIS) with 30M+ merchant terminals nationwide.
📊 Transparent & Auditable
All on-chain operations are publicly verifiable on Solana blockchain. Open-source smart contract code.
# How It Works (Simplified)
sequenceDiagram
participant User
participant Wallet
participant Solana
participant Oracle
participant Gateway
participant Merchant
User->>Wallet: Scan QRIS code
Wallet->>User: Show USDC amount
User->>Solana: Sign & submit transaction
Solana->>Solana: Lock USDC in PDA escrow
Solana->>Oracle: Emit SettlementRequested event
Oracle->>Gateway: POST /disbursements (IDR)
Gateway->>Merchant: Transfer IDR via BI-FAST
Merchant->>Merchant: Receive fiat in bank
Oracle->>Solana: Release USDC from escrow
# Technical Highlights
| Component | Technology | Purpose |
|---|---|---|
| Smart Contract | Rust + Anchor 0.29 | Type-safe, auditable escrow logic |
| Blockchain | Solana Mainnet | Sub-second finality, 65K+ TPS |
| Frontend | Next.js 14 PWA | Mobile-first, no app install required |
| Stablecoin | USDC (SPL Token) | Price-stable, regulated, liquid |
| Oracle | Pyth Network | First-party on-chain price feeds |
| Bridge | Python 3.11 + asyncio | Event listener & fiat dispatcher |
| Payment Rail | BI-FAST | Indonesia instant transfer network |
| Payment Gateway | Xendit API | Licensed OJK processor |
# Performance Metrics
Under nominal conditions on Solana Mainnet-Beta with premium RPC:
| Stage | P50 Latency | P99 Latency |
|---|---|---|
| QR Scan → Wallet Prompt | <500ms | <1,200ms |
| Wallet Sign → Block Confirmed | 400ms | 1,200ms |
| Block Confirmed → Event Received | 80ms | 400ms |
| Event → Gateway API Response | 300ms | 900ms |
| Gateway → BI-FAST Credit | 800ms | 2,000ms |
| Total (End-to-End) | ~2.5s | ~6.0s |
# Target Market
Primary: Indonesia — 30M+ QRIS merchants, 270M+ population, high mobile penetration
Generalizable: Any market with:
- Standardized QR payment scheme
- Licensed Payment Gateway API
- Instant fiat settlement network
# Use Cases
- Cross-border remittances — Send USDC globally, receiver gets local fiat instantly
- Crypto spending — Use crypto holdings for everyday purchases without merchant onboarding
- Tourism — Visitors pay with crypto, merchants receive local currency
- Freelancer payments — Receive crypto wages, spend as fiat instantly
- Merchant adoption — Zero-risk crypto acceptance for traditional businesses
# Getting Started
👨💻 For Developers
Integrate ArPay, run the oracle, deploy smart contracts
🏪 For Merchants
Accept crypto payments without touching crypto
🏗️ Architecture
Deep dive into tri-layer protocol design
🔐 Security
Fund safety, oracle manipulation, formal guarantees
# Project Status
✅ Completed
- • Solana smart contract deployed on mainnet
- • PWA frontend with Solana Pay integration
- • Oracle bridge with WebSocket event listener
- • Xendit API integration for fiat disbursement
- • End-to-end testing on Solana devnet
🚧 In Progress
- • Mainnet beta testing with pilot merchants
- • Formal security audit of smart contract
- • Mobile app (iOS/Android native)
# Open Source
ArPay is open-source and contributions are welcome:
- Smart Contract: github.com/arpay/smart-contract
- Frontend: github.com/arpay/frontend
- Oracle Bridge: github.com/arpay/oracle-bridge
# Support & Contact
- Website: www.arpay.net
- Email: arshaka@gmail.com
- Documentation: You're reading it! 📖
- Discord: Join our community
- Twitter: @ArPayProtocol
ArPay, Indonesia 🇮🇩