# Peer-to-Peer

Peer-to-Peer communication is an optional communication mode in Sealed. It allows two devices to exchange messages directly, without placing the encrypted message on the blockchain delivery layer. This mode is designed for specific situations where users want a more direct communication path. The default Sealed messaging flow uses Algorand smart contracts for delivery, but Peer-to-Peer gives users another option when both sides are online and willing to communicate directly.

### What Peer-to-Peer means in Sealed

In Sealed, Peer-to-Peer means that two devices connect directly to exchange information between themselves. Instead of sending the encrypted message through the Sealed smart contract, the sender’s device communicates with the recipient’s device. For the user, this can feel similar to a direct secure chat session. The message is still protected by encryption, but the delivery path is different. The blockchain is not used as the message transport layer for that specific exchange.

### Why Peer-to-Peer exists

Peer-to-Peer exists because some users may want to avoid placing sensitive communication on-chain, even in encrypted form. Sealed uses modern Post Quantum encryption, including ML-KEM, but some users may still be concerned about long-term risks such as “save now, decrypt later”, where encrypted data is stored today in the hope that future technology may be able to decrypt it. Peer-to-Peer gives users a way to exchange information directly between devices, so the message does not need to be written into the blockchain delivery flow. This does not replace the default Sealed messaging model. It adds another mode for situations where direct communication is preferred.

### Online availability requirement

The main limitation of Peer-to-Peer communication is that both devices usually need to be online at the same time. In the default blockchain-based messaging flow, the sender can send a message even if the recipient is offline, because the recipient’s app can detect it later. In Peer-to-Peer mode, direct exchange requires both sides to be reachable during the communication session. This makes Peer-to-Peer less convenient for everyday messaging, especially when users are in different time zones, have unstable connections, or do not keep the app open. It is useful for direct sessions, but it is not as flexible as asynchronous delivery through the Sealed smart contract.

### IP address exposure

Peer-to-Peer communication has a different privacy trade-off. Because devices communicate directly, each side may expose network-level information to the other side, including the IP address of the device or network being used. This is important for users to understand. Peer-to-Peer can reduce the amount of encrypted data placed on-chain, but it can increase exposure between the two communicating devices. For this reason, Peer-to-Peer is best used with trusted contacts or trusted devices, where both sides understand the trade-off.

### When to use Peer-to-Peer

Peer-to-Peer should be treated as a special communication mode rather than the default experience. It can be useful when both users are online, when the conversation is highly sensitive, or when they want to avoid using the blockchain delivery layer for a specific exchange. For regular messaging, Sealed’s smart contract-based delivery is usually more practical because it supports asynchronous communication and does not require both users to be online at the same moment.

### Peer-to-Peer architecture summary

Peer-to-Peer in Sealed allows two devices to exchange encrypted information directly. It avoids placing the encrypted message in the blockchain delivery flow, but it requires both devices to be online and may expose IP addresses between participants. This makes Peer-to-Peer a powerful optional mode for specific use cases, not a replacement for the default Sealed messaging architecture.


---

# Agent Instructions: 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.sealed.channel/architecture/peer-to-peer.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.
