# Farcaster's Structure

By [huhyun](https://paragraph.com/@huhyun) · 2024-10-13

---

Farcaster operates using **Hubs** as key components for data transmission and storage, bridging communication between compatible blockchains like **Optimism** and **Ethereum**. Its architecture consists of three layers: **off-chain data**, **on-chain identity**, and **applications**.

### **Off-Chain Data Layer**

The off-chain system is a **peer-to-peer network of Hubs** that store user data. Most user actions are processed and stored within these Hubs, including:

*   Posting new content.
    
*   Following other users.
    
*   Reacting to posts.
    
*   Updating profile pictures.
    

### **On-Chain Identity Layer**

Farcaster’s on-chain system is deployed on the **Optimism mainnet** to ensure **security and data consistency**. On-chain actions are kept minimal to reduce costs and optimize performance, and include:

*   Creating new accounts.
    
*   Paying for data storage.
    
*   Adding account keys for connected apps.
    

### **How Farcaster Works**

Hubs function as **distributed, peer-to-peer servers** for validating and storing off-chain data. Users can set up their own Hub by installing it on a **VPS**. Each Hub synchronizes both on-chain data from Ethereum and off-chain data from other Hubs, storing a full copy of Farcaster’s data accessible via APIs.

When a **validator node** is involved, it ensures the integrity of every action within the Hub network. For example, when a user posts a message, it is signed with their account key. The message is then sent to a Hub, where validators verify it through **signature checks and property validation**. After validation, the message is stored locally, replicated across other Hubs, and synchronized with both the **Layer-2 Optimism** and **Layer-1 Ethereum** databases.

This structure ensures secure, efficient data management while maintaining **decentralized storage** and network-wide synchronization.

---

*Originally published on [huhyun](https://paragraph.com/@huhyun/farcasters-structure)*
