Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Any fork of tdesktop to support Secure Chats? Considering crowdfunding. #16835

Closed
marcovelon opened this issue Aug 18, 2021 · 20 comments
Labels

Comments

@marcovelon
Copy link

marcovelon commented Aug 18, 2021

First of all, this is not a dublicate of #871 as I am not asking the tdesktop team to implement Secret Chats, because we already know that it's never going to happen.

Basically, I would like to know if some of the 3.5k forks of this repo has implemented Secret Chats support yet. I don't really know how to check all ~3500 forks for the presence of this feature, but if someone know one please mention it.

In case there is none I would like to donate ~5000 USD in Bitcoin to the volunteers who are able to implement it. I am thinking of starting a crowdfunding project soon, but first would like to check if people subscribed to this repo can suggest anything.

UPDATE:

This issue has been moved to a separate fork in order to avoid Gitcoin bot flood here. The code bounty has been funded with 2.2 ETH

Github issue: github.com/marcovelon/tdesktop/issues/2

Gitcoin code bounty campaign: https://gitcoin.co/issue/marcovelon/tdesktop/2/100026398

@23rd
Copy link
Collaborator

23rd commented Aug 19, 2021

it's never going to happen.

I think it will.
Not so soon, but I believe there is a chance that this feature will appear next year.

@john-preston
Copy link
Member

@marcovelon I think no fork implemented it, the task is too intrusive to the existing codebase. I believe the easiest way to get (working correctly) secret chats in tdesktop is to migrate it to TDLib, as it was done with Unigram in the past, and then implement the UI part. But such migration is a huge task, I'd say 20%-30% of the application code has to be rewritten + the UI part is not small as well (although, much smaller).

@Eric-01
Copy link

Eric-01 commented Aug 19, 2021

Add QML to that and the percentages would increase even more :(

@john-preston
Copy link
Member

@Eric-01 But why would you add QML to that? What has rewriting the app on QML has to do with this issue? 🙈

@lukejohnsonrp
Copy link

I honestly don't agree this task is that complex as being described by john-preston.

Let's go through facts:

  • secure chats specification and realization is open source
  • Those clients have secure chats implemented and fully functional:
    Telegram-FOSS
    Nekogram X
    Unigram
    telegram-purple ( <- non-TDLib and C ! )
    cutegram
  • TDLib is open source and cross-platform and it contains the necessary modules needed for secret chats

So based on how many implementations we already have for different platforms written in different languages, how is it so hard to reimplement the code into tdesktop (even that it's not based on TDLib)? Any experienced C++ coder that is able to read and understand other languages (like Java or QML) can do this alone in a full time in about 1 month. Both, with or without TDLib support.

However, if you're serious about considering this donation amount, go on and start the crowdfunding and I believe there will be at least one interested person who will be able to do this.

Still, even for a lower financial interest than you suggested it's a feature that must be implemented soon or later. I am not a fan of Telegram myself because a multi millionaire company is promoting false security on their own site (aka advocating ridiculous reasons to not implement secure chats on desktop), but based on how many people I know use it including myself, I would be still able to contribute to this extremely important issue without requesting any financial support.

@Eric-01
Copy link

Eric-01 commented Aug 19, 2021

John-preston, what does rewriting Telegram Desktop in QML have to do with this "issue"? I'm just telling the author of this "issue" that support for secret chats is not the only huge task, there are others (e.g. rewrite in QML that some people were asking for from time to time). And all of them may or may not be worth the efforts.

@john-preston
Copy link
Member

@Eric-01 Yeah, just my percentage was about that specific issue :)

I'm not sure rewrite to QML is a good idea even if it could be done. I don't really think that QML on Windows is stable enough.

@john-preston
Copy link
Member

@lukejohnsonrp Maybe you just don't understand the task well enough.

You provide a strange list of apps to illustrate your point.

  • Telegram-FOSS is a fork of Telegram for Android (of course it has secret chats, the same the official Android app has)
  • Nekogram X is a fork of Telegram-FOSS (see above)
  • Unigram implemented secret chats by migrating its codebase to TDLib (took the author several months), exactly what I'm talking about here
  • cutegram was a GUI for telegram-cli (https://github.com/vysheng/tg), a C implementation which was written by Vitaly Valtman, this was one of the first Telegram API implementations from the Telegram team.
  • telegram-purple is based on a library that was extracted from telegram-cli (https://github.com/vysheng/tgl) by Vitaly Valtman as well, so it is the same, as cutegram/

So here we see four secret chat implementations (iOS, Android, telegram-cli, TDLib), all those implementations:

  • are from the core Telegram developers
  • are provided as a full separate Telegram API implementation, not just secret chats, but the whole MTProto implementation, API implementation on top of it, local messages database implementation on top of it, secret chats implementation on top of it
  • don't allow simply extracting the secret chats part of the implementation, because it is deeply coupled with everything else

All of the Telegram apps with secret chats support that you were able to show as examples use one of those four as their full MTProto / Telegram API / Local messages database / Secret chats implementation, none of them does anything of it by itself, none of them have their own custom secret chats implementation (or the rest of the Telegram API implementation, or the MTProto implementation), they all use existing solutions as a whole.

Telegram Desktop has a huge codebase that provides custom MTProto implementation and almost full custom Telegram API implementation both in a rather intrusive way. Based on the mentioned above I can only repeat myself:

I believe the easiest way to get (working correctly) secret chats in tdesktop is to migrate it to TDLib, as it was done with Unigram in the past, and then implement the UI part. But such migration is a huge task, I'd say 20%-30% of the application code has to be rewritten + the UI part is not small as well (although, much smaller).

@lukejohnsonrp
Copy link

@john-preston actually I understand the task and there was no point of repeating the obvious thing again, which is also absolutely not only possible solution.

You are saying that the easiest way to implement secret chats is to migrate to TDLib, which is indeed a good option, but unfortunately it would require rewriting other parts according to exactly what you pointed out, which is indeed very time-consuming.

I just wanted to bring attention to the fact that the easiest way you suggest is not the only way to implement secret chats in tdesktop, thus the harder solution may be less time-consuming than migrating to TDLib.

We could indeed extract the secret chats part of the implementation, irrelevantly to how deeply coupled it is with other modules. According to https://core.telegram.org/api/end-to-end and https://core.telegram.org/schema/end-to-end there is nothing impossible even if it needs to be reimplemented from the scratch and any programmer who has solid experience with writing basic client/server implementations with asymmetric encryption would be able to do this.

Is it too complex to implement it without migrating to TDLib? Not really, because we have a fully open source client implementation which we can base on. There is also no need to reverse engineer anything, MTProto is open source, thus even these factors reduce complexity of this task exponentially.

@john-preston
Copy link
Member

@lukejohnsonrp Ok, I won't argue with the fact that it is possible to implement them. Of course it is possible. IMHO if it will be done, it'll be done using tdlib.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.1018 BTC (4998.18 USD @ $49098.02/BTC) attached to it.

@marcovelon
Copy link
Author

I've created a code bounty via Gitcoin platform. This is the only platform I found that works with cryptocurrency, because BountySource has crypto payments integration broken since 2020 (#1547 #1469) and IssueHunt.io don't support cryptocurrency.

I think both suggested ways of implementation suggested by john-preston and lukejohnsonrp are feasible, but I also agree that trying to integrate Secret Chats directly into tdesktop by rewriting some parts of existing implementations would take less time and effort than porting the whole project to TDLib, unless someone is ready to do it for this code bounty.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 265 years, 3 months from now.
Please review their action plans below:

1) hanabi62513 has applied to start work (Funders only: approve worker | reject worker).

わからない教えて

スワップ流動性プールなど言葉の意味まったくわかりません困ってます教えてください

Learn more on the Gitcoin Issue Details page.

@kirsan31
Copy link
Contributor

I wonder, purely technical, can only secret chat be realized through TDLib without migrating to it whole app?

@ilya-fedin
Copy link
Contributor

@kirsan31 read #16835 (comment)

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 265 years, 3 months from now.
Please review their action plans below:

1) lordzeall has applied to start work (Funders only: approve worker | reject worker).

I will answer it as best as I can

Learn more on the Gitcoin Issue Details page.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.1018 BTC (5032.78 USD @ $50327.81/BTC) attached to this issue has been cancelled by the bounty submitter

@marcovelon
Copy link
Author

The issue has been moved to my fork of this repo in order to avoid @gitcoinbot flood in this thread. Apparently there are some bots or trolls present on Gitcoin that apply to campaigns so I have to reject them, thus the separate issue and a new campaign has been created so I can moderate it.

Github issue: marcovelon#2

Gitcoin code bounty campaign: https://gitcoin.co/issue/marcovelon/tdesktop/2/100026398

@Aokromes
Copy link
Collaborator

closed as answered.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants