Skip to main content

System Architecture

NOCY Protocol consists of multiple interconnected services that work together to provide a comprehensive DeFi experience on Midnight.

High-Level Overview

Service Components

Get NOCY API

The token purchase service handles:

ComponentPurpose
Order ServiceCreates and manages purchase orders
Payment MonitorWatches for incoming ADA payments
Token DistributorSends NOCY tokens to buyers
Price OracleProvides current token pricing

Base URL: https://api.get.nocy.io

Explorer API

The blockchain explorer service provides:

ComponentPurpose
REST APIQuery blocks, transactions, contracts
SSE StreamsReal-time data subscriptions
Search ServiceUnified search across all entities
Cache LayerHigh-performance data caching

Base URL: https://api.explorer.nocy.io

Midnight Integration

NOCY services integrate with Midnight through:

Data Flow

Token Purchase Flow

  1. User requests current price from Get NOCY API
  2. User creates an order with desired NOCY amount
  3. User sends ADA to the payment address
  4. Payment monitor detects the transaction
  5. Token distributor sends NOCY to user's address
  6. Order status updated to COMPLETED

Explorer Data Flow

  1. Midnight node produces new blocks
  2. Indexer processes and indexes block data
  3. Explorer API caches frequently accessed data
  4. Clients query via REST or subscribe via SSE

Security Architecture

API Security

  • Rate Limiting - Prevents abuse and ensures fair usage
  • Input Validation - All inputs sanitized and validated
  • CORS - Configured for authorized origins

Privacy Features

  • Viewing Keys - Session-based access to private data
  • Selective Disclosure - Users control what's visible
  • Zero-Knowledge Proofs - Privacy without sacrificing verification

Deployment Architecture

Next Steps