<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sam Sepiol</title>
    <description>The latest articles on DEV Community by sam Sepiol (@sam_sepiol_b877bcc20da75b).</description>
    <link>https://dev.to/sam_sepiol_b877bcc20da75b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4101806%2F5e1bc075-8133-444f-8e76-eddfb4a1bb9e.png</url>
      <title>DEV Community: sam Sepiol</title>
      <link>https://dev.to/sam_sepiol_b877bcc20da75b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sam_sepiol_b877bcc20da75b"/>
    <language>en</language>
    <item>
      <title>GoyGram — one Python runtime for both Telegram Bot API and MTProto, with a Rust core and OpSec-first sessions</title>
      <dc:creator>sam Sepiol</dc:creator>
      <pubDate>Sun, 30 Aug 2026 20:12:15 +0000</pubDate>
      <link>https://dev.to/sam_sepiol_b877bcc20da75b/goygram-one-python-runtime-for-both-telegram-bot-api-and-mtproto-with-a-rust-core-and-48na</link>
      <guid>https://dev.to/sam_sepiol_b877bcc20da75b/goygram-one-python-runtime-for-both-telegram-bot-api-and-mtproto-with-a-rust-core-and-48na</guid>
      <description>&lt;p&gt;GoyGram is a Telegram framework for Python. It runs both of Telegram's protocols — Bot API and MTProto — in a single asyncio runtime, and moves crypto and TL serialization into a compiled Rust extension.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dual-transport problem
&lt;/h2&gt;

&lt;p&gt;aiogram and python-telegram-bot are Bot API only. telethon and pyrogram are MTProto only. GoyGram runs both in one process, one loop, one dispatcher — the transport is picked per operation, and one handler serves both protocols.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Rust core
&lt;/h2&gt;

&lt;p&gt;AES-256-IGE and AES-256-GCM run in Rust (LTO, opt-level=3). Benchmarks on one VPS, Python 3.11:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cold import: 87 ms (aiogram 3.1 s, pyrogram 477 ms, telethon 298 ms)&lt;/li&gt;
&lt;li&gt;RSS after import: 12 MB (aiogram 152 MB)&lt;/li&gt;
&lt;li&gt;AES-256-IGE: 113 MB/s (telethon default 12 MB/s)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Zero-overhead dynamic dispatch
&lt;/h2&gt;

&lt;p&gt;Methods resolve from the TL schema at load time — no hundreds of generated model files. Raw fields are read lazily.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpSec-first sessions
&lt;/h2&gt;

&lt;p&gt;Sessions live in an AES-256-GCM vault keyed to machine-id, keys are zeroized from memory on logout, and login is terminal-only (QR / phone / 2FA) — no token ever touches a browser or desktop client.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rest
&lt;/h2&gt;

&lt;p&gt;Multi-session, filters, FSM state machines, transport routing, and an event pipeline.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/GoyGram/GoyGram" rel="noopener noreferrer"&gt;https://github.com/GoyGram/GoyGram&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://goygram.github.io" rel="noopener noreferrer"&gt;https://goygram.github.io&lt;/a&gt;&lt;br&gt;
License: AGPL-3.0&lt;/p&gt;

</description>
      <category>api</category>
      <category>performance</category>
      <category>python</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
