# Tyr: True P2P Email on top of Yggdrasil Network


**English | Русский**


---


## What is Tyr?


Tyr enables true peer-to-peer email on Android devices using the Yggdrasil network, which provides free IPv6 addressing and strong encryption without relying on centralized infrastructure. Traditional email systems depend on multiple servers, exposing metadata to surveillance, censorship, or failure. Tyr eliminates this by running a local SMTP/IMAP server directly on the device, connected via Yggdrasil’s P2P mesh. It integrates with DeltaChat and ArcaneChat for seamless messaging, requiring no centralized mail servers, additional encryption layers, or port forwarding.


---


## Features


- **Full DeltaChat/ArcaneChat Integration**: Seamless setup with decentralized messengers.

- **Local SMTP/IMAP Server**: Runs a complete mail server on the device.

- **Cryptographic Identity**: Generates Ed25519 keys; mail address is a 64-character hex string followed by `@yggmail`.

- **Yggdrasil Network**: Connects via configurable peers; inherently censorship-resistant.

- **Auto-Start on Boot**: Ensures availability for incoming messages.

- **Encrypted Backup & Restore**: Password-protected configuration and key export.

- **Battery Optimized**: Uses timed wake locks for power efficiency.


---


## How It Works


Tyr embeds the **Yggmail** mail server (written in Go) as a library and runs it as a foreground service. It exposes standard SMTP (`127.0.0.1:1025`) and IMAP (`127.0.0.1:1143`) ports locally. Any compatible email client can connect, but DeltaChat or ArcaneChat are recommended.


**Диаграма потоку (опис):**


```

graph LR

    A[DeltaChat/ArcaneChat] -->|SMTP/IMAP| B[Tyr Service]

    B -->|Yggmail Protocol| C[Yggdrasil Network]

    C -->|P2P Encrypted| D[Recipient's Tyr]

    D -->|SMTP/IMAP| E[Recipient's Chat App]

```


The Yggdrasil network handles NAT traversal and encrypts all P2P traffic. Each Tyr instance generates a unique Ed25519 key; the mail address is derived from the public key: `<64-hex-characters>@yggmail`.


---


## Quick Start


### Setting up DeltaChat/ArcaneChat


#### Option 1: Automatic Setup (Recommended)


1. Install Tyr and complete onboarding (set password, configure peers).

2. Start the Yggmail service.

3. Install [DeltaChat](https://delta.chat/) or [ArcaneChat](https://github.com/ArcaneChat/android).

4. Tap **"Setup DeltaChat/ArcaneChat"** in Tyr.

5. Tyr opens the chat app with pre-configured settings.

6. Complete setup and start messaging.


#### Option 2: Manual Setup


1. Complete Tyr onboarding and start the service.

2. Copy your mail address (e.g., `abc123...@yggmail`) from Tyr’s main screen.

3. In DeltaChat/ArcaneChat, create a new profile.

4. Select **"Use a different server"**.

5. Enter your Yggmail address and Tyr password.

6. Confirm setup.


> **Note**: Tyr must remain running for messaging. Enable auto-start in settings.


---


## Security Features


- **Password Encryption**: Uses Android Keystore with AES-256-GCM.

- **Automatic Keystore Recovery**: Handles Keystore issues on devices like Samsung.

- **Network Encryption**: Yggdrasil encrypts all P2P communications.

- **Local-Only Access**: SMTP/IMAP ports bound to `localhost`.

- **Cryptographic Identity**: Ed25519 keys prevent spoofing.

- **Encrypted Backups**: Configuration and keys stored with password protection.


---


## Building from Source


### Prerequisites


- Android Studio (latest)

- JDK 17

- Android SDK (API 23–36)

- Go 1.21+ and `gomobile` (for rebuilding `yggmail.aar`)


### Build Commands


```bash

git clone https://github.com/JB-SelfCompany/Tyr.git

cd Tyr

./gradlew assembleDebug

./gradlew installDebug

```


APKs are output to `app/build/outputs/apk/debug/` or `release/`.


### Rebuilding yggmail.aar (Optional)


```bash

cd ../yggmail/mobile

```


- **Windows**: Run `build-android.bat`

- **Unix**:

  ```bash

  gomobile bind -target=android -androidapi 23 -javapkg=com.jbselfcompany.tyr -ldflags="-checklinkname=0" -o yggmail.aar .

  ```


Copy the generated `yggmail.aar` to `Tyr/app/libs/`.


---


## Technical Details


| Component       | Details                                  |

|----------------|------------------------------------------|

| **Language**   | Kotlin 2.2.20                            |

| **Min SDK**    | 23 (Android 6.0)                         |

| **Target SDK** | 33 (Android 13)                          |

| **Compile SDK**| 36                                       |

| **Architecture**| Layered (UI → Service → Data)            |

| **Mail Server**| Yggmail (Go library via gomobile)        |

| **Network**    | Yggdrasil overlay mesh                   |

| **Localization**| English, Russian                         |

| **Native Lib** | `yggmail.aar` in `app/libs/`             |


**Related Projects**:

- **Yggmail**: Mail transfer agent powering Tyr.

- **Mimir**: P2P messenger on Yggdrasil (sister project).

- **Yggdrasil Network**: Mesh infrastructure.

- **DeltaChat**: Recommended email-based messenger.

- **ArcaneChat**: Alternative messenger.


---


## License


Tyr is open source. The Yggmail library is licensed under **Mozilla Public License v2.0**.


See [LICENSE](/JB-SelfCompany/Tyr/blob/main/LICENSE).


---


## Why P2P Email Matters


- **Censorship Circumvention**: Connect via public Yggdrasil nodes, host your own, or build private networks.

- **Privacy by Design**: No metadata collection, server logs, or third-party surveillance.

- **Decentralization**: No single point of failure or corporate control.


**Made with love for the decentralized web.**


---


**Repository**: [https://github.com/JB-SelfCompany/Tyr](https://github.com/JB-SelfCompany/Tyr)  

**Last Update**: Nov 28, 2025  

**Languages**: Not specified in content.


---


*Цей документ адаптовано для розмітки Google Docs. Рекомендації для форматування:*

- Використовуйте заголовки (Heading 1 для основного заголовка, Heading 2 для секцій, Heading 3 для підсекцій).

- Списки: Bullet points для features та numbered для кроків.

- Таблиця: Вставте як таблицю в Docs.

- Код: Використовуйте monospace шрифт (Courier New) для блоків коду.

- Діаграма: Вставте як ASCII-арт або створіть просту діаграму в Docs за допомогою Insert > Drawing.

- Гіперпосилання: Зробіть клікабельними.

Коментарі

Популярні дописи з цього блогу

Мадуро увезли. Путин считает шаги

Добавили новый Reticulum-узел в карту сервисов Yggdrasil.