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

# Messaging layer 🔥

The Messaging Layer is an event-driven communication system that provides efficient and reliable support for distributed device management and payment interactions. Leveraging a decentralized messaging protocol (Nostr) and blockchain technology (Solana) enables real-time device state synchronization, payment validation, and system scalability.

It functions as an event bus built on a federated P2P network architecture, providing:

* Efficient communication between decentralized components through relay nodes that optimize network performance and reduce latency
* Comprehensive event sourcing and logging mechanisms that record all component operations and potential malicious behavior in an immutable format
* Enhanced transparency through sequential messaging and state reconstruction capabilities, reducing slashing risks through verifiable audit trails
* Resolution of connectivity challenges in P2P and HTTP RPC systems through:
  * Dynamic topology adjustment for latency optimization
  * Automated device discovery and hierarchical indexing
  * Caching and route optimization at relay nodes
  * Support for both automated discovery and manual specification for critical interactions

***

To set up your first DePHY app, we highly recommend following our tutorials:

{% content-ref url="/pages/lVSM4alqVzdebKwURwD2" %}
[Tutorials 🔥](/tutorials/build-a-hello-world-rust.md)
{% endcontent-ref %}
