# Hierarchical Structure

### The Scaling Challenge <a href="#the-scaling-challenge" id="the-scaling-challenge"></a>

Traditional blockchains face an impossible choice: stay small and secure, or grow large and vulnerable. Qai’s hierarchical structure breaks this limitation.**The Innovation:** Imagine a tree where every branch processes transactions independently, but the trunk ensures all branches stay secure. That’s Qai’s hierarchical structure - multiple blockchain “branches” working in parallel while sharing the security of the entire “tree.”

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#how-it-works)How It Works <a href="#how-it-works" id="how-it-works"></a>

**Three Levels of Organization:**

1. **Prime Chain** (The Trunk): Coordinates the entire network
2. **Region Chains** (Main Branches): Organize geographical areas
3. **Zone Chains** (Leaves): Process your actual transactions

**The Key Breakthrough:**

* **Traditional sharding**: Splits security (dangerous)
* **Qai’s approach**: Splits only workload (safe)

Each zone processes transactions independently while maintaining the full security of the entire network through [merged mining](https://docs.qu.ai/learn/advanced-introduction/merged-mining/overview).

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#why-this-matters)Why This Matters <a href="#why-this-matters" id="why-this-matters"></a>

**For Users:**

* **50,000+ TPS**: Process more transactions than Visa
* **Sub-penny fees**: Sustainable even at massive scale
* **5-second blocks**: Near-instant transaction confirmation
* **Global scale**: Ready for billions of users

**For the Network:**

* **Unlimited growth**: Add new zones as demand increases
* **Maintained security**: Every zone has full network protection
* **Optimized performance**: Miners self-organize for best efficiency

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#the-security-innovation)The Security Innovation <a href="#the-security-innovation" id="the-security-innovation"></a>

**Traditional Sharding Problem:** When blockchains split into shards, each shard typically gets only a fraction of the security. A network with 10 shards might give each shard only 10% of total security - making them vulnerable to attacks.**Qai’s Solution:** Through [merged mining](https://docs.qu.ai/learn/advanced-introduction/merged-mining/overview), every transaction in every zone receives 100% of the network’s security. This maintains the full hash-based security guarantees while allowing unlimited parallel processing.

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#self-optimizing-performance)Self-Optimizing Performance <a href="#self-optimizing-performance" id="self-optimizing-performance"></a>

**The Latency Problem:** [Network latency](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/latency) - the time it takes for data to travel between nodes - is the primary bottleneck in blockchain performance.**Qai’s Unique Solution:** Miners naturally organize themselves for optimal performance because:

1. **Higher latency = Lower profits** (more uncle blocks)
2. **Miners choose their zone** based on best connection
3. **Result**: Geographic self-organization without central planning

**The Math Behind the Improvement:**&#x54;his relationship is described by t = p*n*log\_m(n) where:

* **t** = time to propagation
* **p** = ping time between nodes
* **n** = number of nodes in the network
* **m** = average number of connected peers

**Real-World Example:**

* **Bitcoin**: 8 hops × 100ms ping = 800ms total propagation time
* **Qai zones**: 3 hops × 10ms ping = 30ms total propagation time
* **Improvement**: 25x faster data propagation

This self-organizing system creates naturally optimized regional networks without any central coordination.

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#parallel-processing-power)Parallel Processing Power <a href="#parallel-processing-power" id="parallel-processing-power"></a>

Think of Qai as a [multi-core processor for blockchains](https://docs.qu.ai/learn/advanced-introduction/multithreaded-execution). Each zone chain operates like an independent CPU core, processing transactions in parallel while staying perfectly synchronized.**How Chains Work Together:**

* **Independent operation**: Each zone produces blocks on its own schedule
* **Perfect coordination**: [Hash linked references](https://docs.qu.ai/learn/advanced-introduction/merged-mining/coincident-blocks) keep all chains in sync
* **Atomic operations**: Cross-chain transactions either complete fully or not at all

**The Three-Tier Architecture:**

| Chain Type | Level in Hierarchy | % of Network Hashrate | Block Time† |
| ---------- | ------------------ | --------------------- | ----------- |
| Prime      | 1 (top)            | 100%                  | \~20s       |
| Region     | 2 (middle)         | \~33%                 | \~10s       |
| Zone       | 3 (bottom)         | \~11%                 | \~5s        |

† *Block production in Qai Network is a stochastic process, meaning that real-world block times will have minor variance. These times are calculated for a 2×2 network configuration (2 regions, 2 zones per region, 4 total zones).*

#### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#starting-simple%3A-single-shard-launch)Starting Simple: Single Shard Launch <a href="#starting-simple-3a-single-shard-launch" id="starting-simple-3a-single-shard-launch"></a>

**Why Start with One?** Qai Network launches with a single zone chain because adding unnecessary shards would:

* **Reduce aggregate security**: Splitting hashrate when not needed
* **Increase settlement times**: More complexity without benefit
* **Waste resources**: Running infrastructure for unused capacity

**Automatic Expansion Trigger:** When sustained demand causes the uncle rate to exceed 20% for an extended period, the network automatically expands by adding new shards. This ensures optimal security and performance at every stage of growth.

#### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#prime-chain%3A-the-global-coordinator)Prime Chain: The Global Coordinator <a href="#prime-chain-3a-the-global-coordinator" id="prime-chain-3a-the-global-coordinator"></a>

**Purpose**: Acts as the network’s backbone, ensuring all regions stay synchronized (when multiple exist)

* **Security**: Mined by 100% of network hashrate for maximum security
* **Function**: Pure coordination - no transactions or accounts
* **Role**: Becomes active when network expands beyond single shard

#### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#region-chains%3A-geographic-organization)Region Chains: Geographic Organization <a href="#region-chains-3a-geographic-organization" id="region-chains-3a-geographic-organization"></a>

**Purpose**: Organize zones within geographical areas for optimal performance (activated during expansion)

* **Security**: Each region gets \~1/N of total hashrate (where N = number of regions)
* **Function**: Coordinate zone chains within their region
* **Activation**: Created when network demand triggers expansion

#### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#zone-chains%3A-where-transactions-happen)Zone Chains: Where Transactions Happen <a href="#zone-chains-3a-where-transactions-happen" id="zone-chains-3a-where-transactions-happen"></a>

**Purpose**: The actual workhorses - processing all user transactions

* **Speed**: 5-second average block times for near-instant confirmations
* **Function**: The only chains that store accounts and process transactions
* **Initial state**: Network launches with one zone chain
* **Expansion**: Additional zones added based on demand

Each zone operates as an independent execution thread. As the network grows, this creates a truly [multithreaded blockchain environment](https://docs.qu.ai/learn/advanced-introduction/multithreaded-execution).

### [​](https://docs.qu.ai/learn/advanced-introduction/hierarchical-structure/hierarchical-structure#cross-chain-communication)Cross-Chain Communication <a href="#cross-chain-communication" id="cross-chain-communication"></a>

**The Innovation:** Through [coincident blocks](https://docs.qu.ai/learn/advanced-introduction/merged-mining/coincident-blocks), Quai creates natural bridges between all chains in the network. These hash linked references enable trustless cross-chain transactions without any additional infrastructure.**How It Works:**

* **Automatic creation**: Merged mining naturally produces these connections
* **Zero overhead**: No extra work required from miners
* **Trustless transfers**: Move assets between chains without intermediaries
* **Atomic operations**: Cross-chain transactions complete fully or not at all

This represents the first truly decentralized bridge between hash-based blockchains, enabling seamless interoperability across the entire network.
