> For the complete documentation index, see [llms.txt](https://docs.nearby.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nearby.finance/protocol-layers/nearby-mesh-communication-layer.md).

# Nearby Mesh (Communication Layer)

Nearby Mesh is the local communication layer of Nearby Protocol.

It enables devices within the same physical environment to discover each other, exchange encrypted messages and coordinate through peer-to-peer mesh networks, even when internet connectivity is limited, congested or unavailable.

Instead of routing all communication through centralized servers, Nearby Mesh allows communication to emerge directly from nearby devices.

***

### Overview

Most digital communication systems depend on centralized infrastructure.

Messages usually travel through mobile networks, internet providers, cloud servers and application backends before reaching another user.

This model works well under normal conditions, but it becomes fragile when:

* Internet access is unavailable
* Mobile networks are congested
* Infrastructure is damaged
* Centralized services are restricted
* Users are located in remote or unstable environments

Nearby Mesh introduces a local-first communication model where nearby devices can communicate directly or relay messages through other nearby participants.

This creates a resilient communication layer designed for real-world coordination.

***

### What Nearby Mesh Enables

Nearby Mesh allows users and applications to create temporary or persistent local networks based on physical proximity.

With Nearby Mesh, users can:

* Discover nearby peers without relying on centralized discovery servers
* Join local communities based on real-world location
* Send encrypted messages through peer-to-peer relay paths
* Coordinate during events, emergencies or network outages
* Maintain communication when traditional infrastructure becomes unreliable
* Combine local communication with Proof of Location and OfflinePay

Nearby Mesh is not designed to replace the internet.

It is designed to keep communication possible when internet access is weak, unavailable or insufficient.

***

### Core Concept

Traditional communication follows a centralized path:

```
Device → Server → Device
```

Nearby Mesh uses a distributed local path:

```
Device ⇄ Device ⇄ Device ⇄ Device
```

Each participating device can act as both a user and a relay node.

Messages can move across nearby devices until they reach the intended participant or local group.

As more devices join the network, the mesh becomes denser, more resilient and more capable of routing information locally.

***

### Network Formation

Nearby Mesh networks form dynamically around physical context.

A network may be created around:

* A venue
* A conference
* A festival
* A stadium
* A university campus
* A neighborhood
* An emergency response zone
* A temporary local community

When users enter the same physical area, their devices can discover nearby peers and participate in the local mesh network.

Each network can be scoped to a specific context, meaning communication remains relevant to the location, event or group where it was created.

***

### Communication Model

Nearby Mesh uses a peer-to-peer relay model.

At a high level, the flow works like this:

1. A device discovers nearby peers.
2. The user joins a local mesh network.
3. Messages are encrypted on-device.
4. Nearby peers relay message packets across the local network.
5. Duplicate or expired packets are filtered.
6. Messages reach participants through available local paths.

This allows communication to continue even when no direct internet connection is available.

***

### Supported Transport Layers

Nearby Mesh can use multiple local transport methods depending on device capabilities and environment conditions.

Supported transport options may include:

* Bluetooth Low Energy
* WiFi Direct
* Local network discovery
* Device-to-device pairing
* Mesh relay propagation
* Optional internet bridging when available

The system is designed to degrade gracefully.

If one communication path becomes unavailable, the network can attempt to use alternative local paths.

***

### Privacy-Preserving Design

Nearby Mesh is designed around minimal data exposure.

Users do not need to reveal a permanent identity to participate in local communication networks.

Key privacy properties include:

* Local-first peer discovery
* Encrypted message propagation
* Optional anonymous participation
* Ephemeral network sessions
* Minimal routing metadata where possible
* Optional access control through Proof of Location

Nearby Mesh prioritizes privacy and resilience while acknowledging the practical limitations of open mesh environments.

Like all mesh systems, some metadata may exist at the network level, especially in adversarial or highly monitored environments.

***

### Integration with Proof of Location

Nearby Mesh becomes more powerful when combined with Proof of Location.

Proof of Location can be used to verify that a user is physically present within a specific area before allowing access to a local network.

This enables:

* Event-gated chat rooms
* Venue-based communities
* Region-specific coordination
* Location-based access control
* Proof-of-presence group participation

Users can prove they are nearby without revealing their exact coordinates.

This creates local communication networks that are both verifiable and privacy-preserving.

***

### Integration with OfflinePay

Nearby Mesh can also act as a transport layer for OfflinePay.

When internet access is unavailable, Nearby Mesh can help users propagate payment data, transaction notes and witness attestations through local peer-to-peer communication.

This enables:

* Offline commerce at events
* Local peer-to-peer payments
* Transaction relay through nearby devices
* Payment coordination during outages
* Offline settlement preparation before on-chain reconciliation

Together, Nearby Mesh and OfflinePay create a communication and payment layer that can continue operating across disconnected environments.

***

### Use Cases

#### Events and Festivals

Large events often suffer from network congestion.

Nearby Mesh allows attendees, vendors organizers and local communities to communicate through local peer-to-peer networks even when mobile data becomes unreliable.

#### Emergency Coordination

During disasters or infrastructure failures, traditional communication systems may become unavailable.

Nearby Mesh enables local coordination between nearby devices, helping communities exchange information even without internet access.

#### Remote Communities

In areas with limited infrastructure, Nearby Mesh can provide a baseline communication layer for local coordination.

This allows users to interact without depending entirely on mobile towers or fixed internet providers.

#### Local Communities

Nearby Mesh can power neighborhood groups, campus networks, local alerts or temporary communities based on shared physical presence.

#### Offline Commerce

When integrated with OfflinePay, Nearby Mesh can support payment coordination and transaction relay in environments where online payment systems cannot operate reliably.

***

### Network Participants

Nearby Mesh is supported by different types of participants.

| Participant        | Role                                                                       |
| ------------------ | -------------------------------------------------------------------------- |
| **Users**          | Join local networks, send messages and coordinate with nearby participants |
| **Relay Devices**  | Forward encrypted message packets across the mesh                          |
| **Node Operators** | Provide stronger local infrastructure and network availability             |
| **Witnesses**      | Optionally observe local events, transactions or proof generation          |
| **Developers**     | Build applications using Nearby Mesh as a local communication layer        |

***

### Design Principles

Nearby Mesh is built around five core principles:

#### Local First

Communication should be possible even without access to global infrastructure.

#### Privacy by Default

Users should be able to participate without exposing unnecessary identity or location data.

#### Resilient by Design

The network should continue functioning under partial connectivity, congestion or infrastructure disruption.

#### Context-Aware

Networks should form around real-world places, events and communities.

#### Composable

Nearby Mesh should work independently or together with Proof of Location and OfflinePay.

***

### Limitations

Nearby Mesh improves communication resilience, but it does not eliminate every limitation of decentralized local networking.

Known limitations include:

* Message delivery may depend on local network density
* Long-distance communication may require relay paths or internet bridging
* Metadata leakage may exist in certain adversarial environments
* Performance can vary based on device hardware and transport availability
* Fully offline networks require enough nearby participants to remain effective

These trade-offs are intentional.

Nearby Mesh is designed for continuity, not perfect global availability.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nearby.finance/protocol-layers/nearby-mesh-communication-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
