> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neynar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

Farcaster has a hybrid architecture that stores identity onchain and data offchain.

<img src="https://mintcdn.com/neynar/GtASQDFnQ57Y0zcm/farcaster/assets/architecture.png?fit=max&auto=format&n=GtASQDFnQ57Y0zcm&q=85&s=411a84bea24825757bb8183e1c298ade" alt="Architecture" width="1736" height="1180" data-path="farcaster/assets/architecture.png" />

## Onchain

Farcaster's onchain systems are implemented as [contracts on OP Mainnet](/farcaster/learn/architecture/contracts). Actions are performed onchain only when security and consistency are critical. Use of onchain actions is kept at a minimum to reduce costs and improve performance.

Only a handful of actions are performed onchain, including:

* Creating an [account](/farcaster/learn/what-is-farcaster/accounts).
* Paying rent to [store data](/farcaster/learn/what-is-farcaster/messages#storage).
* Adding account keys for [connected apps](/farcaster/learn/what-is-farcaster/apps#connected-apps).

## Offchain

Farcaster's offchain system is a peer-to-peer network of servers called [Snapchain](https://snapchain.farcaster.xyz/) which store user data. The majority of user actions are performed offchain. These include:

* Posting a new public message.
* Following another user.
* Reacting to a post.
* Updating your profile picture.

Actions are performed offchain when performance and cost are critical. Use of offchain actions is typically preferred when consistency isn't a strict requirement. Offchain systems achieve security by relying on signatures from onchain systems.
