Skip to main content

Architecture

This page explains how ZendFi’s payment infrastructure works under the hood. Understanding the architecture is optional for integration, but it helps when debugging, optimizing, or building advanced flows.

System Overview

Payment Lifecycle

Every payment moves through a well-defined state machine:

States

Transaction Flow

Here is the full lifecycle of a typical payment:

Gasless Transactions

ZendFi supports gasless payments where the customer does not need SOL for transaction fees. This removes a major friction point in crypto payments. The fee payer keypairs are separate for test and live modes:
  • Test mode: Uses a devnet fee payer
  • Live mode: Uses a mainnet fee payer with funded SOL balance

Key Management

ZendFi uses a layered key management system: All private keys are encrypted with AES-256 before storage. The master encryption key is loaded from the environment and never persisted to disk.

Resilient RPC Infrastructure

ZendFi does not rely on a single Solana RPC node. The system includes:
  • Multiple RPC endpoints with automatic failover
  • Health monitoring that continuously checks endpoint availability
  • Response caching to reduce RPC load and improve latency
  • Endpoint rotation that shifts traffic away from degraded nodes

Webhook Delivery

Webhook reliability is critical. ZendFi’s webhook engine includes:
  • Automatic retries with exponential backoff on delivery failure
  • Dead letter queue for webhooks that exhaust all retry attempts
  • HMAC-SHA256 signatures on every payload for verification
  • Deduplication by event ID to prevent double-processing
  • Correlation IDs on every request for end-to-end tracing
See the Webhook Security page for implementation details.

Background Workers

ZendFi runs several background processes that maintain system health:

Data Model

The core entities and their relationships:

Network Configuration