2026-02-17 11:12:19 -08:00
# Logos Chat
2025-07-04 22:17:31 -07:00
2026-02-23 07:56:21 -08:00
[](https://github.com/logos-messaging/logos-chat/actions/workflows/ci.yml)

A privacy focused decentralized messaging SDK, built on the Logos Stack. Logos Chat provides permission-less, censorship-resistant communication for humans and clankers.
2025-08-24 22:28:26 -07:00
## Quick Start
2026-02-23 07:56:21 -08:00
### Prerequisites
- [Nim ](https://nim-lang.org/ ) >= 2.2.4
- [Rust ](https://www.rust-lang.org/tools/install ) (for libchat cryptographic backend)
- Make
### Build
```bash
# Initialize submodules and dependencies
2025-09-26 19:09:19 -07:00
make update
2025-08-24 22:28:26 -07:00
2026-02-23 07:56:21 -08:00
# Build all targets (examples + shared library)
2025-09-26 19:09:19 -07:00
make all
2025-11-25 08:14:59 -08:00
# Run tests
make tests
2025-08-24 22:28:26 -07:00
```
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
### Quick Tasks
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
Here are common tasks to get up and running. See [`examples/` ](examples/ ) for full examples, including [`pingpong.nim` ](examples/pingpong.nim ) which demonstrates a full two-client conversation.
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
**Initialize Client**
2025-08-24 22:28:26 -07:00
2026-02-23 07:56:21 -08:00
```nim
let waku = initWakuClient(DefaultConfig())
var client = newClient(waku).get()
...
...
client.start()
```
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
**Create Introduction Bundle**
2025-10-10 11:05:58 -07:00
2026-02-23 07:56:21 -08:00
Introductions are single use key-bundles required by Senders to initiate a conversation.
Recipients must generate them before anyone can contact them.
IntroBundles contain no secrets and can be published, or transmitted over over other channels.
2025-10-10 11:05:58 -07:00
2026-02-23 07:56:21 -08:00
```nim
...
# IntroBundles are sent to other clients Out-of-Band to establish a conversation.
let intro_bundle = client.createIntroBundle()
...
```
**Create 1:1 Chat**
2025-10-10 11:05:58 -07:00
2026-02-23 07:56:21 -08:00
Once a Sender has retrieved a bundle then they can create a conversation.
All conversations must have an initial message.
```nim
...
let initial_content = @[1,2,3]
2025-10-10 11:05:58 -07:00
2026-02-23 07:56:21 -08:00
# This intro_bundle must come from another client
let convo_id = await client.newPrivateConversation( intro_bundle, initial_content )
...
```
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
**Receive Message**
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
Receiving a message is accomplished by registering a callback.
```nim
...
client.onNewMessage(proc( convo: Conversation, msg: ReceivedMessage ) {.async.} =
echo convo.id(), msg.content
2025-12-17 19:16:02 -08:00
2026-02-23 07:56:21 -08:00
)
...
```
2025-07-04 22:17:31 -07:00
2026-02-23 07:56:21 -08:00
**Send Message**
2025-07-04 22:17:31 -07:00
2026-02-23 07:56:21 -08:00
```nim
...
let content = @[1,2,3]
let convo = client.getConversation( convo_id )
await client.sendMessage( content )
...
```
2025-07-04 22:17:31 -07:00
2026-02-23 07:56:21 -08:00
## Message Flow
2025-07-04 22:17:31 -07:00
2026-02-23 07:56:21 -08:00
```mermaid
2025-07-07 16:03:16 -07:00
sequenceDiagram
2025-09-27 07:16:16 -07:00
participant S as Saro
participant R as Raya
Note over R,S: Discovery
2026-02-23 07:56:21 -08:00
R -->> S: Send intro bundle via established channel
2025-09-27 07:16:16 -07:00
Note over R,S: Initialization
2026-02-23 07:56:21 -08:00
S ->> R: PrivateV1 Invite + initial message
2025-09-27 07:16:16 -07:00
Note over R,S: Operation
2026-02-23 07:56:21 -08:00
loop Encrypted messaging
2025-09-27 07:16:16 -07:00
par
2026-02-23 07:56:21 -08:00
R ->> S: Send Message
2025-09-27 07:16:16 -07:00
and
2026-02-23 07:56:21 -08:00
S ->> R: Send Message
2025-09-27 07:16:16 -07:00
end
end
2026-02-23 07:56:21 -08:00
```
### C Bindings
2025-07-07 16:03:16 -07:00
2026-02-23 07:56:21 -08:00
A shared library with C bindings is available:
2025-07-07 16:03:16 -07:00
2026-02-23 07:56:21 -08:00
```bash
make liblogoschat
```
2025-07-07 16:03:16 -07:00
2026-02-23 07:56:21 -08:00
This produces `build/liblogoschat.{dylib,so,dll}` . See [`library/liblogoschat.h` ](library/liblogoschat.h ) and [`examples/cbindings/` ](examples/cbindings/ ) for usage.
2025-07-07 16:03:16 -07:00
## License
2026-02-23 07:56:21 -08:00
Dual-licensed under [MIT ](LICENSE-MIT ) and [Apache 2.0 ](LICENSE-APACHE ).