> For the complete documentation index, see [llms.txt](https://docs.1layer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1layer.io/readme/architechture.md).

# Smart Contract System

This page contains the high-level architecture of 1LAYER protocol.

<figure><img src="https://1938749682-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs1LS2dIjuXAQlecAuEJm%2Fuploads%2FMb5bu14jluMGfrXYfUdK%2F34.png?alt=media&amp;token=6350011b-0584-4741-b6df-8e13862ce56d" alt=""><figcaption></figcaption></figure>

Overall Structure: The architecture is divided into two main parts: the "Offchain" at the top and the "Onchain" represented by 2 networks on the bottom.

Offchain:

* Frontend: The user interface of the system.
* Data Provider Service: Provides information about the system to the front end.
* Messaging Service: Handles cross-chain messages and passes them from network 1 to network 2.
* Swap Executor: Executes swap when a message is delivered.

*Messaging Service & Swap Executor can be 1 single service. However, the logic must be separated to allow further migration to a more complex cross-chain messaging protocol.*

Admin Panel: Sets up and monitors the system.

Onchain:

* Executor: Handles the execution of swaps.
* Gateway: Serves as an entry point for cross-chain messaging.
* OneLayer Gateway: A specific gateway for the 1LAYER system.
* Vault (Stablecoin): A secure storage for stablecoins.
* Swap Protocol (**thirdparty**): Handles the actual swap operations.
