| Crates.io | mostro-chat |
| lib.rs | mostro-chat |
| version | 0.2.1 |
| created_at | 2025-03-18 22:37:33.568599+00 |
| updated_at | 2025-03-20 13:33:59.641898+00 |
| description | Minimalist peer-to-peer chat application written in Rust, utilizing the Nostr protocol for decentralized and secure communication |
| homepage | https://mostro.network |
| repository | https://github.com/MostroP2P/mostro-chat |
| max_upload_size | |
| id | 1597376 |
| size | 79,459 |
mostro-chat is a minimalist peer-to-peer chat application written in Rust, utilizing the Nostr protocol for decentralized and secure communication. It integrates the nostr-sdk for event handling and encryption, and features a terminal-based user interface (TUI) built with ratatui and crossterm.
N seconds (default: 600 seconds).wss://relay.mostro.network. Ensure access to this relay or use another relay.Clone the repository:
git clone https://github.com/MostroP2P/mostro-chat.git
cd mostro-chat
Run the program:
cargo run -- -s <sender_secret> -p <receiver_pubkey>
The application requires two arguments:
-s, --sender-secret <SENDER_SECRET>: Your private key (in hex or bech32 format, e.g., nsec1...).
-p, --receiver-pubkey <RECEIVER_PUBKEY>: The recipient’s public key (in hex or bech32 format, e.g., npub1...).
Example:
cargo run --release -- -s nsec1yourprivatekeyhere -p npub1recipientpubkeyhere
The following constants in the code can be modified:
Shared Key Generation: Uses ECDH with the sender’s private key and receiver’s public key to create a shared key.
Message Encryption: Messages are wrapped in a simplified NIP-59 event, encrypted with the shared key, and signed with an ephemeral key.
Event Subscription: Subscribes to events targeting the shared key’s public key via the Nostr relay.
Real-Time Updates: Decrypts and displays incoming messages in the TUI if they fall within the time window.
NIP-59 Simplification: The app uses a custom, non-standard NIP-59 implementation for gift-wrapped events.
Asynchronous Handling: Employs tokio for managing Nostr client tasks and TUI updates concurrently.
You can find more information about here
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are encouraged! Feel free to open issues or submit pull requests on GitHub.