A Goodbye Post, a Friend, and Our Own Telegram Library
I used PyroTGFork for a long time. The original Pyrogram was no longer maintained, and PyroTGFork kept up with Telegram’s API changes. I depended on it for my projects and had no plans to maintain a library myself.
After the June 12, 2026 update to Layer 227, the repo went quiet. At first, I assumed the maintainer was taking a break. Then, on June 28, the owner posted this:
Sorry, folks, but there won’t be any more updates for high level methods… I am really tired of all this. Goodbye. 🥲
I honestly panicked. Telegram was releasing so many features I wanted to try, and the library I depended on wouldn’t be adding high-level methods for them anymore. I needed to find another fork, and I wasn’t sure which one to trust.
I understood why the owner wanted to stop. Maintaining a library for free takes a lot out of someone. I was grateful for their work, even though I really wished the updates could continue.
Looking through the forks
I checked several forks for recent updates and the features I needed. While looking through them, I noticed they were still using the same version of TgCrypto.
TgCrypto is the C extension Pyrogram uses to speed up encryption for Telegram’s MTProto protocol. That work can affect file transfer speeds, so improving it seemed worth looking into.
Dan, who created Pyrogram and TgCrypto, had stepped away. The forks I looked at were still using the TgCrypto release from November 12, 2022. Almost four years later, they were adding Telegram features on top of the same crypto implementation.
Almost four years felt like a long time. I wanted to see whether we could make it faster.
“Bruh, we should do something about this TgCrypto”
That’s what I said to Sd. He’s my friend, but I also think of him as a big brother and a teacher.
His answer was: “Let’s start.”
I was surprised by how excited he was. I hadn’t explained much, and he was already ready to work on it with me. I loved that about his response. I went to him with this thing that was bothering me, and he took it seriously straight away.
Sd did some research and came back with the idea of rewriting TgCrypto in Rust. We could use PyO3 to expose it as a Python module, so people could use it without having to write Rust themselves.
His early crypto tests showed a speedup of 12 to 15 times over TgCrypto. I hadn’t expected anything close to that. For me, that was the most exciting result of the project.
We made it into WarpCrypto, a Rust replacement for TgCrypto that people could use in their existing projects. The 12 to 15 times figure is for those crypto tests; actual bot and file transfer speeds also depend on other parts of the setup.
We ended up maintaining a fork anyway
Once WarpCrypto was working, I wanted to make our own Pyrogram fork too. I still needed support for Telegram’s newer features, and I wanted us to be able to work on those directly. We called it wzgram.
We started with the original Pyrogram codebase and worked through Telegram’s API changes. We’ve now shipped 37 releases, with support for Gifts, Stories, Topics, and Business Accounts among other features. We’ve kept Pyrogram’s familiar API so people can switch without having to learn a different way to write their bots.
Seeing wzgram at the top
At the time of writing, wzgram is first on libspeed, the Telegram library transfer benchmark by Roj, who also develops MTKruto.
The benchmark downloads and re-uploads a 2 GB file through Telegram’s DC1 using GitHub-hosted runners in the US. These are the listed results:
| # | Library | Download | Upload |
|---|---|---|---|
| 1 | wzgram | 19.5 MB/s | 20.3 MB/s |
| 2 | MTKruto | 17.6 MB/s | 17.3 MB/s |
| 3 | mtcute | 17.7 MB/s | 17.0 MB/s |
| 4 | PyrogramMod | 16.7 MB/s | 17.1 MB/s |
| 5 | TDLib | 17.1 MB/s | 16.8 MB/s |
I didn’t expect to see wzgram above TDLib, Telegram’s own C++ library. I’m really proud of that, especially because this benchmark comes from someone who develops another Telegram library. The result is specific to this setup, and speeds will vary with the account, network, and machine.
We also reached uploads above 120 MB/s in our own test using a Telegram Premium account through a session string. That used a different setup from libspeed, so the two numbers aren’t directly comparable.
Thank you, Sd
If you use Pyrogram, give wzgram a try. WarpCrypto is available separately if you only want to replace TgCrypto.
And Sd, thank you. I was so worried about what I was going to use after PyroTGFork, and now we have two projects together that I’m proud of. I didn’t expect any of this when I brought up TgCrypto with you. I’m grateful you were that excited to help, and for everything you’ve taught me. 🙏