Architecture Overview
Understand how ZynPay works: from payment creation to on-chain execution and fee splitting.
System Architecture
ZynPay is built on a decentralized architecture that ensures payments are non-custodial, transparent, and programmable.
Payment Flow
Payment Creation
Your application creates a payment object with amount, merchant address, and metadata. This happens client-side using the SDK.
User Approval
Customer connects MetaMask and approves the payment transaction. They can review the amount, merchant, and fee breakdown before confirming.
On-Chain Execution
Transaction is submitted to the blockchain. The router contract receives the payment and automatically splits it in a single atomic operation.
Confirmation & Events
Once confirmed, payment events are emitted on-chain. Your application can listen for these events to automatically unlock access or fulfill orders.
Fee Splitting Mechanism
This split happens atomically—either both transfers succeed or both fail. No partial payments, no reconciliation needed.
Security Model
- Non-custodial: ZynPay never holds funds. Payments go directly from customer to merchant.
- Smart contract verified: All fee splits are enforced by audited smart contracts on-chain.
- Transparent: All transactions are publicly verifiable on the blockchain.
- Immutable: Payment records cannot be altered once confirmed on-chain.
- User-controlled: Customers always approve transactions in their own wallet.