AlgoChat Protocol

End-to-end encrypted messaging on Algorand

Features

End-to-End Encryption

X25519 + ChaCha20-Poly1305

Forward Secrecy

Per-message ephemeral keys

Immutable Storage

Messages stored on blockchain

Decentralized

No central server required

Quantum Resistant

Optional PSK mode (v1.1)

Ratcheted Keys

Session-bounded PSK derivation

Wire Format

v1.0 — Standard Mode (0x01)

ver:1 proto:1 sender_pk:32 ephemeral_pk:32 nonce:12 enc_sender:48 ciphertext:var
Header: 126 bytes  |  Max plaintext: 882 bytes  |  Note limit: 1024 bytes

v1.1 — PSK Mode (0x02)

ver:1 proto:2 counter:4 sender_pk:32 ephemeral_pk:32 nonce:12 enc_sender:48 ciphertext:var
Header: 130 bytes  |  Max plaintext: 878 bytes  |  Hybrid: X25519 + ratcheted PSK
Header
PSK
Crypto
Payload

Cryptographic Primitives

FunctionAlgorithm
Key AgreementX25519 ECDH
EncryptionChaCha20-Poly1305
Key DerivationHKDF-SHA256

PSK Ratchet (v1.1)

Optional pre-shared key mode adds quantum resistance through hybrid key derivation.

PropertyStandard (0x01)PSK (0x02)
Key derivation X25519 ECDH X25519 + ratcheted PSK
Quantum resistance No Defense-in-depth
Max plaintext 882 bytes 878 bytes
Session size N/A 100 messages
Out-of-order delivery Yes Yes (counter window)

The ratchet derives a unique key per message from a shared PSK using deterministic session-based HKDF. An attacker must break both X25519 and know the PSK to decrypt.

Documentation

Implementations

LanguageRepositoryStatus
Swift swift-algochat Production
TypeScript ts-algochat Active
Python py-algochat Active
Rust rs-algochat Active
Kotlin kt-algochat Active
Angular algochat-web Active
View Test Status Dashboard

Transport

Messages are transmitted as the note field of Algorand payment transactions:

Version History

VersionChanges
1.0 Initial specification. Standard mode (0x01) with X25519 + ChaCha20-Poly1305.
1.1 Add ratcheting PSK mode (0x02). Hybrid X25519 + pre-shared key derivation for quantum defense-in-depth.