> For the complete documentation index, see [llms.txt](https://solieum.gitbook.io/solieum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solieum.gitbook.io/solieum/archive-technical-architecture.md).

# archive technical architecture

## 🚀 Solieum Layer 2: Solutions and Improvements

#### 📱 Solana Mobile Stack

Makes Solana more accessible and user-friendly for non-crypto users, helping overcome barriers to adoption through seamless mobile integration.

#### 🔑 Intuitive Key Management

Eliminates the need for seed phrases, email verifications, and passwords with innovative key management solutions.

#### 👛 User-Friendly Wallets

Wallets like Phantom offer simple layouts and security audits, making the experience more intuitive for users.

#### 🔐 Passkey Authentication

Enables users to access and transact across multiple web3 platforms via passwordless authentication through secure interfaces.

#### 💸 One-click Fiat Onramps

Simplified fiat-to-crypto conversion for easier access to the Solana ecosystem without complex exchange processes.

While Solana's technology is designed for speed and efficiency, the user experience can be improved, especially for beginners. The Solana Mobile Stack and other initiatives aim to address these challenges and make Solana more accessible and user-friendly.

Solana, like Ethereum, is exploring Layer-2 solutions called "Rollups" or "RollApps" to address scalability issues, allowing for off-chain transaction processing and bundling, which are then settled on the main Solana network, while preserving its core security.

## 💡 Understanding Rollups and RollApps

### What are Rollups/RollApps?

#### 📈 Scaling Solutions

Rollups are Layer-2 scaling solutions that process transactions off-chain, offloading the main blockchain (Layer-1) and improving scalability and speed.

#### 🗃️ Bundling Transactions

They bundle multiple transactions and process them on a Layer-2/Layer-3 network, then publish the transaction data back on the Layer-1 (Solana mainnet).

#### 🛡️ Security Inheritance

Rollups inherit security from the base Layer-1 (Solana), ensuring the network's core security remains intact while extending functionality.

#### ⚙️ Customization

DApps have the freedom to customize their rollup chain to suit specific ecosystem needs and application requirements.

#### 🌐 Solana RollApps

Solana is exploring similar solutions, with projects like Nitro, Eclipse, and Solieum building rollups for the Solana Virtual Machine (SVM).

## ✅ Benefits of Rollups/RollApps on Solana

**📈 Improved Scalability**

Off-chain processing allows for faster transaction speeds and higher throughput, addressing Solana's potential scaling limitations.

**💰 Lower Transaction Fees**

By processing transactions off-chain, Rollups can significantly reduce transaction fees on the main Solana network.

**🧩 Enhanced Customization**

DApps can tailor their rollup chains to meet specific application needs, offering flexibility and efficiency.

**🔄 Seamless User Experience**

Rollups can feel like an extension of Solana, allowing users to maintain the same wallets and addresses, and access Solana assets seamlessly.

## ⚠️ Challenges of Rollups/RollApps

**🔒 Security Considerations**

While inheriting security from the base layer, both the RollApp and Layer-1 need to be secure, potentially increasing the risk of vulnerabilities.

**🧠 Complexity**

The increased complexity of Layer-2 solutions can lead to more opportunities for bugs and vulnerabilities, requiring rigorous security audits and ongoing maintenance.

**🔗 Interoperability**

Operating between different Layer-2 networks can be challenging, requiring solutions for passing assets and data between them efficiently.

## 🖥️ Solieum Node Types

Solieum nodes are classified into two main categories that serve different functions in the network:

### 🔍 RPC Nodes (Remote Procedure Call)

* Function as gateways for blockchain data and dApp interaction
* Allow applications to transmit read and write requests to the blockchain
* Check new blocks and network changes independently
* Do not participate in consensus or block creation

### ⛓️ Validator Nodes (Consensus Nodes)

* Participate in the Proof-of-Stake (PoS) consensus process
* Guarantee the integrity of the blockchain
* Produce and suggest new blocks
* Vote on the authenticity of new blocks
* Require a 1 SOL stake to operate

## 🏗️ Solieum Layer 2 Technical Architecture

<figure><img src="https://content.gitbook.com/content/9sknVijWtYbZXNBeIcYM/blobs/gWWaFV7yL95YlHBH0bgF/image.png" alt="Solieum Layer 2 Architecture"><figcaption><p>Technical architecture of Solieum Layer 2 solution</p></figcaption></figure>

Solieum's Layer 2 technology implements a hybrid scaling approach that combines optimistic rollups with data availability sampling to achieve high throughput while maintaining security guarantees derived from Solana's Layer 1.

### Core Components

{% stepper %}
{% step %}

## Rollup Operator Network

The Rollup Operator Network is responsible for aggregating transactions, executing them off-chain, and submitting rollup blocks to Solana Layer 1.

```rust
// Simplified structure of a Solieum rollup block header
pub struct RollupBlockHeader {
    // Block identifier
    pub block_id: [u8; 32],
    // Previous block hash
    pub previous_block_hash: [u8; 32],
    // Merkle root of all transactions in the block
    pub transactions_root: [u8; 32],
    // Merkle root of the post-state after executing transactions
    pub post_state_root: [u8; 32],
    // Timestamp of block creation
    pub timestamp: u64,
    // Operator who produced this block
    pub operator_pubkey: [u8; 32],
    // Layer 1 reference block
    pub l1_reference_block: u64,
}
```

{% endstep %}

{% step %}

## State Commitment Chain

The State Commitment Chain (SCC) is a Solana program that stores the sequence of state roots from the Layer 2 chain, anchoring the Layer 2 state to Solana for security.

```rust
// Interface for the State Commitment Chain program
#[program]
pub mod state_commitment_chain {
    use super::*;

    // Submit a new state root to the chain
    pub fn submit_state_root(
        ctx: Context<SubmitStateRoot>,
        state_root: [u8; 32],
        block_number: u64,
        timestamp: u64,
    ) -> Result<()> {
        // Verify the submitter is an authorized operator
        if !ctx.accounts.operators.is_operator(&ctx.accounts.submitter.key()) {
            return err!(ErrorCode::UnauthorizedOperator);
        }

        // Record the new state root
        let state_root_account = &mut ctx.accounts.state_root;
        state_root_account.root = state_root;
        state_root_account.block_number = block_number;
        state_root_account.timestamp = timestamp;
        state_root_account.submitter = ctx.accounts.submitter.key();

        // Emit event for indexers and clients
        emit!(StateRootSubmitted {
            state_root,
            block_number,
            timestamp,
            submitter: ctx.accounts.submitter.key(),
        });

        Ok(())
    }
}
```

{% endstep %}

{% step %}

## Fraud Proof System

The Fraud Proof System allows any network participant to challenge invalid state transitions by submitting cryptographic proofs of incorrect execution.

```typescript
// Simplified fraud proof verification in TypeScript
async function verifyFraudProof(
  fraudProof: FraudProof,
  connection: Connection
): Promise {
  // Step 1: Retrieve the challenged state transition from on-chain
  const stateTransition = await getStateTransition(
    connection,
    fraudProof.blockNumber
  );

  // Step 2: Re-execute the transaction batch with the provided pre-state
  const computedPostState = await executeTransactions(
    fraudProof.transactions,
    fraudProof.preState
  );

  // Step 3: Compare the computed post-state with the claimed post-state
  return !bytesEqual(computedPostState, stateTransition.postStateRoot);
}
```

{% endstep %}

{% step %}

## Data Availability Layer

The Data Availability Layer ensures that all transaction data necessary for verifying state transitions is publicly available and cannot be withheld by operators.

```typescript
// Data Availability Sampling implementation
class DataAvailabilitySampler {
  // Sample random data chunks to verify availability
  async sampleData(
    blockHash: string,
    dataMerkleRoot: string,
    samplingRate: number
  ): Promise {
    const chunkCount = await this.getChunkCount(blockHash);
    const samplesToCheck = Math.ceil(chunkCount * samplingRate);

    // Generate random indices to sample
    const indices = this.generateRandomIndices(chunkCount, samplesToCheck);

    // Check each sampled chunk
    for (const index of indices) {
      const chunk = await this.requestChunk(blockHash, index);
      const proof = await this.requestProof(blockHash, index);

      // Verify the chunk matches the Merkle proof
      if (!this.verifyChunk(chunk, proof, dataMerkleRoot)) {
        return false;
      }
    }

    return true;
  }
}
```

{% endstep %}
{% endstepper %}

## 📊 Performance Benchmarks

| Metric                 | Solana L1      | Solieum L2      | Improvement         |
| ---------------------- | -------------- | --------------- | ------------------- |
| Transaction Throughput | 65,000 TPS     | 1,000,000+ TPS  | 15x                 |
| Transaction Cost       | \~0.000025 SOL | \~0.0000025 SOL | 10x reduction       |
| Time to Finality       | 400ms          | 200ms           | 2x faster           |
| Settlement Time        | Immediate      | \~10 minutes    | Trade-off for scale |
| Hardware Requirements  | High           | Moderate        | More accessible     |

## 🌐 Use Cases for Solieum Layer 2

#### 🎮 Gaming

High-frequency, low-value transactions for in-game actions and microtransactions with near-instant finality and minimal fees.

#### 💰 DeFi

High-volume trading, lending, and borrowing with reduced transaction costs and increased throughput for better capital efficiency.

#### 🖼️ NFT Marketplaces

Frictionless NFT trading and minting with faster transaction times and lower fees to improve the creator and collector experience.

#### 📱 Social Applications

Decentralized social platforms with micro-payments, content rewards, and high user interaction volumes.

#### 🏛️ DAO Governance

Cost-effective on-chain voting and proposal systems that enable more frequent and inclusive community governance.

#### 📊 Data Markets

Decentralized data marketplaces with high-frequency micro-transactions for accessing and providing data services.

#### 🔮 The Future of Solana Scaling

Solieum's Layer 2 solution represents a significant advancement in Solana's scaling journey, complementing the base layer's impressive performance with additional capacity and specialized optimizations for different application types. As the ecosystem continues to grow, this multi-layered approach will be essential to support millions of users and billions of transactions in a truly decentralized web3 future.
