# nymChat - Python Messenger

**URL:** <https://forum.nym.com/t/nymchat-python-messenger/832>\
**Category:** Phase 2: Reporting\
**Tags:** status-completed, build-with-nym\
**Created:** [November 16, 2024, 10:02am UTC](https://forum.nym.com/t/nymchat-python-messenger/832 "2024-11-16T10:02:57Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![code-zm](https://forum.nym.com/letter_avatar_proxy/v4/letter/c/46a35a/32.png) [@code-zm](https://forum.nym.com/u/code-zm)\
**Post date:** [March 4, 2025, 4:40pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/22 "2025-03-04T16:40:20Z")

</div>

#### Update #5 03/04/25

* * *

Python-Rust FFI for mixnet operations is fully integrated! Now you don’t need to install the nym-client binary and it should be fully cross platform! (haven’t tested on MacOS yet)

All you need is Python 3.11+ and Rust!

[https://github.com/code-zm/nymCHAT/tree/main/async\_ffi](https://github.com/code-zm/nymCHAT/tree/main/async_ffi)

* * *

> [@max-nym](#):
>
> Ok right, so its ‘secret’ from the **main directory** as the secret chat has its **own** directory instance, right? With the directory acting as another remote server similar to the SURB relayer?

Not quite. There is no directory involved in secret chats. When you run the app, you initialize a nym-client which is used for all mixnet operations during that session. When starting a secret chat, client’s exchange nym addresses which allows them to route messages directly p2p instead of through the server.

**Normal Chats:**  
Outer JSON

```py
{
    "message": "<the JSON string below>",
    "recipient": SERVER_ADDRESS,
}

```

Encapsulated JSON string

```json
{
  "action": "send",
  "content": {
    "sender": "alice",
    "recipient": "bob",
    "body": {
      "iv": "example_iv",
      "ciphertext": "encrypted_data",
      "tag": "example_tag"
    },
    "encrypted": true
  },
  "signature": "abc123signature"
}

```

**Secret Chats:**  
Outer JSON

```py
{
    "message": "<the JSON string below>",
    "recipient": RECIPIENT_ADDRESS,
}

```

Encapsulated JSON string

```json
{
  "action": "secretChat",
  "content": {
    "sender": "alice",
    "body": {
      "iv": "example_iv",
      "ciphertext": "encrypted_data",
      "tag": "example_tag"
    },
    "encrypted": true
  },
  "signature": "abc123signature"
}

```

**Group Chats: (not yet implemented)**  
Outer JSON

```py
{
    "message": "<the JSON string below>",
    "recipient": GROUP_ADDRESS,
}

```

Encapsulated JSON string

```json
{
  "action": "send",
  "content": {
    "epoch": 3,
    "sender": "alice",
    "ciphertext": "base64-ciphertext",
    "nonce": "base64-nonce",
    "tag": "base64-tag"
  },
  "signature": "abc123signature"
}

```

* * *

> [@max-nym](#):
>
> we’re currently starting to look at something like a Nym Libp2p protocol for standardising p2p traffic formats via the Mixnet, but I really like this approach as well.

Keep me updated! Would love to work with the team on this!

---

<div class="post-metadata">

**Author:** ![code-zm](https://forum.nym.com/letter_avatar_proxy/v4/letter/c/46a35a/32.png) [@code-zm](https://forum.nym.com/u/code-zm)\
**Post date:** [March 18, 2025, 4:08pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/23 "2025-03-18T16:08:10Z")

</div>

Lots of updates to the nymCHAT repo!

- Added nymDirectory code (server dir)
- Dockerfile’s
- Documentation

> **[GitHub - code-zm/nymCHAT: Python Messaging Client for secure communication...](https://github.com/code-zm/nymCHAT/)**
>
> Python Messaging Client for secure communication through the Nym Mixnet.

---

<div class="post-metadata">

**Author:** ![max-nym](https://forum.nym.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@max-nym](https://forum.nym.com/u/max-nym)\
**Post date:** [April 8, 2025, 1:27pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/24 "2025-04-08T13:27:42Z")

</div>

Going through [nymCHAT/docs/Build.md at rust · code-zm/nymCHAT · GitHub](https://github.com/code-zm/nymCHAT/blob/rust/docs/Build.md) and the docs are a little confusing - I’m not seeing the `server/` dir anywhere that are referenced in the documentation

---

<div class="post-metadata">

**Author:** ![code-zm](https://forum.nym.com/letter_avatar_proxy/v4/letter/c/46a35a/32.png) [@code-zm](https://forum.nym.com/u/code-zm)\
**Post date:** [April 9, 2025, 2:11pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/25 "2025-04-09T14:11:03Z")

</div>

The `rust` branch is incomplete, still working on the rewrite from python → rust. ETA ~1-2 Weeks!

Currently, the only thing in that branch is the TUI prototype:

 ![tui](https://forum.nym.com/uploads/default/original/2X/5/5e3910daf664c0fbdea3b8d755d705353e82b4ad.png)

---

<div class="post-metadata">

**Author:** ![hans1337](https://forum.nym.com/letter_avatar_proxy/v4/letter/h/f05b48/32.png) [@hans1337](https://forum.nym.com/u/hans1337)\
**Post date:** [April 15, 2025, 7:53pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/26 "2025-04-15T19:53:09Z")

</div>

Funny, I had no idea there even was a branch called `rust` .

After checking out the `diff` it’s obvious why it didn’t work for you.

Just checkout main, @max-nym , right @code-zm ?

---

<div class="post-metadata">

**Author:** ![code-zm](https://forum.nym.com/letter_avatar_proxy/v4/letter/c/46a35a/32.png) [@code-zm](https://forum.nym.com/u/code-zm)\
**Post date:** [April 22, 2025, 10:41pm UTC](https://forum.nym.com/t/nymchat-python-messenger/832/27 "2025-04-22T22:41:26Z")

</div>

Rust TUI client is working! Will be adding to it sparingly as I finish up this semester. New Season proposal ETA \< 3 weeks!

Anonymous poll regarding the name of the app:

_Poll ([view on site](https://forum.nym.com/t/nymchat-python-messenger/832/27))_

 ![nymstr](https://forum.nym.com/uploads/default/original/2X/d/dc92eec94f29c6f20150d309d4389905a5287169.png)

> **[nymCHAT/client/tui at rust · code-zm/nymCHAT](https://github.com/code-zm/nymCHAT/tree/rust/client/tui)**
>
> Mixnet Messaging App. Contribute to code-zm/nymCHAT development by creating an account on GitHub.

[Previous page](https://forum.nym.com/t/nymchat-python-messenger/832.md?page=1)
