Skip to main content

Architecture & Internals

This section details the internal design of the Backend, intended for developers who need to extend the functionality or understand the data flow.

Tech Stack​


Modular Design​

The application follows a Domain-Driven Design (DDD) approach via NestJS Modules:

ModuleDescription
TransactionModuleCore Logic. Handles the creation, storage, signature collection, and submission of Multi-sig transactions.
EventModuleListens to Smart Contract events emitted on the Hedera Network and syncs them to the local DB.
ProxyModuleForwards read-only requests to Mirror Nodes, adding a layer of caching or security (optional).
NetworkModuleManages the connection context (Testnet/Mainnet) and Client initialization.

Multi-Signature Flow​

The backend coordinates the asynchronous collection of signatures for multisig transactions.

Transactions not executed within 3 minutes of their startDate are automatically marked as EXPIRED. This is a Hedera network constraint — transactions have a maximum validity window of 3 minutes.


Database Schema​

The persistence layer uses a relational model to track the state of operations.

Key Entities​

  1. Transaction: Stores the raw bytes (transactionMessage) of the Hedera Transaction.
  2. Signature: Stores the cryptographic signature, public key, and relation to the Tx.

Event Listener System​

The backend includes a polling mechanism to catch events:

  1. FactoryObserver: Watches for new Stablecoins deployed.
  2. TokenObserver: Watches for CashIn, Burn, and Transfer events.