Introduction
opentele2 is the Telegram client identity toolkit. A Telegram client is more than an auth
key: it is the storage it keeps on disk, the session format of its library, the API id and device
it announces in initConnection, the versions it claims, the transport it speaks and, for web
clients, the browser it runs in. opentele2 reads, writes, converts and checks all of it, on one
Rust core that Python, Node and Rust share.
What it covers
Read and write Telegram Desktop 7.3.1 folders: passcodes, several accounts, the MTP config.
Telethon strings and .session + .json pairs, mtcute v3 strings, grammers 0.11 SessionData.
Eight official clients with weighted device catalogs; one unique id, one device, in every language.
Validation of the fields a client sends, tz_offset, msg_id offsets, layer and seven consistency checks.
HTTP headers and full browser fingerprints from Bayesian networks, reproducible by seed.
AES-256-IGE and -CTR, SHA, HMAC, PBKDF2 and PQ factorisation for Telethon, mtcute and grammers.
Live client versions, QR login with 2FA and session admin (list, print and terminate sessions) complete the set; see Client versions, the guides and the reference.
The packages
| Package | Registry | Runtime | Works over |
|---|---|---|---|
opentele2 | PyPI | Python 3.8+, abi3 wheels | Telethon 1.45 |
opentele2 | npm | Node 18+, subpaths opentele2/mtcute and opentele2/telethon | mtcute (@mtcute/node 0.32+) |
opentele2-core | crates.io | Rust | — |
opentele2-browser | crates.io | Rust | — |
opentele2-versions | crates.io | Rust, blocking HTTP | — |
opentele2-grammers | crates.io | Rust | grammers 0.11 |
opentele2-coreowns every format and rule: tdata, sessions, device catalogs, API profiles,initConnectionchecks, the consistency expectations and the MTProto client crypto. It is pure: no async, no network, no FFI and nounsafecode.opentele2-browsergenerates browser headers and fingerprints. It is Apache-2.0; everything else is MIT.opentele2-versionsfetches the current official client versions and stable Chrome and Firefox.opentele2-grammersturns tdata accounts into grammers sessions and API profiles into grammers connection params; itsclientfeature adds QR login, session admin and the consistency checks.
How the pieces fit
The Python wheel (PyO3) and the Node addon (napi-rs) are thin layers over the same core. Each one converts values, calls the core and adapts the result to its client library: Telethon in Python, mtcute in Node, grammers in Rust. Name tables, texts, error codes and session JSON shaping all come from the core, so the three ecosystems give the same answers, and the Rust, Python and Node test suites check them against the same golden vectors.
Targets: Telegram Desktop 7.3.1 tdata and Telethon 1.45, schema layer 230.
A tdata folder, a session string or a .session file is a logged-in account. Anyone who holds
one can act as you. Never share them, never commit them, and keep them out of logs.
Where to go next
Requirements and install commands for pip, npm and cargo, with the optional features.
Load a tdata folder and get a Telethon, mtcute or grammers session from it.
How opentele2 models tdata, sessions, profiles, fingerprints, crypto and versions.
Task-by-task recipes: conversions, QR login with 2FA, session admin and versions.