Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.86k stars 450 forks source link

Generic value transfer primitive - master thesis #6029

Closed synctext closed 3 months ago

synctext commented 3 years ago

Problem description: architecture and deployment of trustworthy offline value transfer

The financial system is the heart of capitalism. In the online world we now have the Bitcoin open protocol for crypto tokens. No regulated alternative exists with sufficient consumer protection, stability, and state-based value guarantee. Central Bank Digital Currencies are being discussed by the European Central Bank, a digital Euro. You will build upon the Delft University experimental deployment of a digital Euro, turning it into a generic value transfer primitive. Source code

Requirements: The value transfer primitive is required to be a cash replacement :euro: . Value transfers do not require any intermediary. The requirements are to support low-value transactions, offline-first (Internet is optional), and compliance with existing laws. Value transfers may be fully automated in a machine-to-machine economy. A simple scenario is that a Tesla car could use this value transfer to buy or sell battery charge automatically.

This work is ideology driven. This works supports Delft University research towards a reformed financial sector that is more efficient, more effective in serving the wider economy and more resistant to bad behaviour of all kinds, Background reading on bearer instruments and central bank digital currency.

Digital identity is required to open a bank account. Unlimited anonymous money is not compliant with money laundering and anti-terror legislation. The problems with digital identity are unsolved. You will build upon the recent work by Rowdy who deployed a self-sovereign digital identity, eWallet, QR-code scanner, and zero-knowledge proof system. The UK minister of digital infrastructure announced their digital identity and digital trust framework also the Dutch vision on digital identity by our secretary-of-state (in Dutch only). (see also)

This master thesis is part of an incremental effort ongoing for 22 years at Delft University. We are trying to make the Internet more open, free, and fair. We are building open protocols for money, trust, code and data. A generic value transfer primitive is the cornerstone of any online economy. You will be the first to create one that works and scales. image

synctext commented 3 years ago

Rough timeline (tentative)

synctext commented 3 years ago

Update on 30 March 2021. Many students are contributing to Superapp: 1) Machine Learning, 2) multi-sig Bitcoin, 3) liquidity pool Euro-Bitcoin 4) liquidity pool Bitcoin-Ethereum

Brainstorming on concrete directions:

ToDo first sprint: get the superapp going from the sources. Start a Euro gateway. Understand the decentral social network: peerchat.

synctext commented 3 years ago

2nd Brainstorming on concrete directions:

Some related developments: Multi-sig server for Superapp: taproot.tribler.org

digital offline Euro... "The analysis confirms, by and large, our initial findings: what the public and professionals want the most from such a digital currency is privacy (43%), followed by security (18%), the ability to pay across the euro area (11%), no additional costs (9%) and offline usability (8%).", https://www.ecb.europa.eu/press/pr/date/2021/html/ecb.pr210414~ca3013c852.en.html

China and the race for the future of money. "China started with several urban pilots of the digital RMB—known formally as digital currency electronic payments (DCEP)—and is studying moves to broaden the trial to additional areas. DCEP is a fully digital version of the RMB, downloaded using authorised apps (digital wallets). The currency may incorporate secure technologies such as blockchain, as well as near-field communication (NFC) capabilities that allow offline money transfers when two wallets (typically mobile devices) touch.", https://www.pwc.com/gx/en/issues/reinventing-the-future/take-on-tomorrow/china-future-money.html also https://www.coindesk.com/goldman-sachs-digital-yuan-report

“States risk ceding control over many areas of finance and the economy to the private companies that dominate the digital space. Leading technology companies will entrench their monopoly positions, drawing on financial resources and superior engineering capacities. The monopoly on data held by third parties will continue to pose increasing risks of manipulation and criminal use of personal information. Privacy and the ethical use of data are key topics to be addressed by law enforcement, legislators and policy makers.” https://www.europol.europa.eu/activities-services/main-reports/european-union-serious-and-organised-crime-threat-assessment

synctext commented 3 years ago

To discuss: file transfer progress bar. (https://github.com/Tribler/tribler/issues/6023#issuecomment-828205116)

jwbambacht commented 3 years ago

First version problem description.

ProblemDescription.pdf

synctext commented 3 years ago
jwbambacht commented 3 years ago

Example App Sketch

AppOverviewNew AppOverviewNew-2

rwblokzijl commented 3 years ago

I can help getting the EuroToken code to work. Do you have any way i can reach you?

jwbambacht commented 3 years ago

Updated version of problem description and a start on state of the art.

ProblemDescription_02-06-2021.pdf

synctext commented 3 years ago

Feel free to make it stronger, if you feel that way. You can keep it in this more "boring"/rational manner. Activism is OK at a university.

Within Tribler team we are interested to the point of obsession with monopolies: I. the financial system with the free money creation monopoly; II. global media and news organisation with structural bias, state-censorship, and fake news. III. Platform power with Google, Facebook, and Amazon with anti-competitive behaviour, winner-takes-all dynamics where competitive pressure has failed.

Opening line of problem description could be: _the current financial system and digital economy is structurally unfair to citizens. Governments have failed to protect "consumer welfare". Citizens and economic actors have no alternative to banking services, Big Tech and their anti-competitive practices [1; 2]. This thesis contributes to a reformed financial/tech sector that is more efficient (I.), more effective in serving the wider economy (II.) and more resistant to bad behaviour of all kinds (III.)._

Our first motivating example of market failure is the WhatsApp messaging platforms. [etc etc] Whatsapp failing terms-of-service. Competitor based on openness Signal has barriers to market entry, no network effect, compete against closed protocol. Whatsapp has stickyness, like Hotel California, you can install, but never leave. Unfortunately citizens are powerless in this uncompetitive market. Governments need to actively support Adversarial Interoperability. This thesis indirectly contributes to such efforts.

Cardinal financial primitive (idea for thesis core): arbitrary amount of Euros, arbitrary sized binary blob, and proof-of-existence (hash(Tx)) of this transaction on your personal Trustchain. Generic function to move both valuable information (euro=0), monetary value (blob=0), or financial transaction enriched with information (nothing=0). Generic in the sense that its a multi-currency transfer primitive (Bitcoin,Euro, Ethereum or Tether scam coins).

Comments Figure 2: Public key encryption and decryption. No tutorial inside thesis, just replace all those sections with a single [REF]. Please use the term wallet when talking about this.

ToDo: update Chapter 2, replace readable normal people speak with scientific sounding terms and more compressed formulation, Android hardware procured, coding steps. For instant pleasant experience; testnet for Euros, faucet with 10 Euros upon install, every user can instantly play with all features, plus existing Bitcoin testnet faucet.

Current thesis scoping: Reliable enough for money, flawless inter-SSI communication, contract signatures, citizen identities, legal entity representation (optional), legally-binding business signatures (optional2), and generic value transfer primitive.

Month Description
March start - Problem description: architecture and deployment of trustworthy offline value transfer
June bootstrapped - compile code, run own hardware, 11-page thesis draft
Sep feature freeze of value transfer in Superapp, start focus on reliability
Dec Reliability testing infrastructure complete, documented reliability fixes, and scientific results ready (idea)
Jan Thesis DONE

Everything comes together in your impressive design: identity personas, authority interactions, chat messages, and financial transactions.

jwbambacht commented 3 years ago

Questions for this iteration:

Screenshots of current iteration of app. Real running code, awaiting PR.

See more screenshots. Click to expand!
synctext commented 3 years ago

The thesis work is progressing nicely. Running code is looking great! We need to balance thesis direction:

  1. value transfer primitive
  2. Technical debt and refactoring (current focus: boost architecture cleanness, GUI, polish UX) Related work "Refactoring, Bug Fixing, and New Development Effect on Technical Debt: An Industrial Case Study"
  3. Reliability testing infrastructure
  4. identify faults in Trustchain and IPv8, 99% reliability. Enhancing algorithms towards 99.999% reliability. (
jwbambacht commented 3 years ago

The current iteration of the app. Identity and contacts/chats implemented for the biggest part. Attestations loaded from the database can be viewed as well. Adding/verifying attestations is on the to-do list. The exchange part must be implemented completely.

Have been struggling to get docker-android going. A lot of errors and problems come up during the process. There is also a lack of documentation on how to set it up properly. I'll spend more time in the coming weeks. It was hard to spend more than a couple of hours at once due to frustration.
synctext commented 3 years ago
synctext commented 3 years ago

Note, about the ID wallet. Please consider adding TUDelft+logo as an issuer of diplomas. We can easily issue course credits in a live trail. 1 Oct 2021 the European Commission is collecting prototypes from many EU teams, their focus is cross-border diploma validity, see page 27: https://northsearegion.eu/media/16680/ebsi-explained-by-daniel-du-seuil.pdf

jwbambacht commented 3 years ago

The current iteration of the app. Added the exchange section, but is still a bit rough and sometimes not displaying the correct information. Options to transfer money by QR-code or directly to contact and request added. Contacts changed slightly, including ability to remove contacts and conversations. Identity now includes complementary attributes like address, email, .etc. These attributes can at a later point be shared within a chat or through QR-code. They are however not 'legal' attributes of an identity.

synctext commented 3 years ago

Feedback :

Month Description
Sep feature freeze of Superapp
Oct First field test
Dec Final iteration
Jan Thesis DONE
jwbambacht commented 3 years ago

Attached is a zip file containing a (signed) apk that can be installed as a separate trustchain application (link)

jwbambacht commented 3 years ago

Big update to the app. Many new features are implemented, including interface changes and optimizations. See the (not exhaustive) list of updates below and a gif of screenshots:

An updated (signed) apk can be downloaded in a zip file here. The application will be installed as a separate trustchain application.

synctext commented 3 years ago

Amazing progress this summer! We now have the following inside the superapp:

Planned next weeks steps: Pull Request 2 September at the latest, unit testing https://github.com/Tribler/trustchain-superapp/actions prepare usability study ???Thesis scope: consolidation, integration, and refactoring of years of isolated prototypes into a single deployment-ready economic stack???

jwbambacht commented 3 years ago

Pull request is merged!

jwbambacht commented 3 years ago

New signed alternative apk of current version of the app. The merged version also contained an error when trying to send money. (apk)

Most of the time is spent trying to fix the errors for the pull request. Since I had no proper experience within an organization and forking this process took more time than wanted. Changes made to app in apk above:

synctext commented 3 years ago

Open question:

jwbambacht commented 3 years ago

New version attached. (apk)

Todo:

synctext commented 3 years ago

Prior student work from 2018. NFC scan of passport https://github.com/Tribler/tribler/issues/2918#issuecomment-299701239 Also Retrieved signed data 3 with pop-up of BSN from datagroup 1 of passport Crypto library for passport EC curves (ECDSA Brainpool support) https://github.com/weidai11/cryptopp

Code link: https://github.com/digital-voting-pass/polling-station-app/blob/master/app/src/main/java/com/digitalvotingpass/passportconnection/PassportConActivity.java#L151 @drew2a you have a link to the code which in Python does the reliable binary transfer around IPv8? Answer: https://github.com/Tribler/tribler/blob/main/src/tribler-core/tribler_core/modules/remote_query_community/eva_protocol.py Reminder: transferring money (and photos) should work reliably. Critical for a public launch (Tweakers?). Future sprint: problem description V1?
jwbambacht commented 3 years ago

digital voting pass

jwbambacht commented 3 years ago

New version of the app (apk)

This version includes the onboarding of a passport. An identity is set to be verified when both the camera and NFC chip are used to import the identity. All details are gathered from the biometric chip, so the possibility of forging is very small. When NFC is not supported on the device the details are scanned by the camera only. Since someone can forge this themselves, the identity is set to not verified. Verified users cannot change any identity details afterwards. Unverified users can only change their given names and surname since this is unchecked during the scan and can contain mistakes. The other details are directly gathered from the camera and are validated using the check digits on the document. A future update will include the verification status and name of identity within a sent message so the receiver is sure that he is talking to a real identity.

synctext commented 3 years ago

Next Sprint. Make your app production-ready? Robust data transfer primitive, transfer progress bar for uploading, downloading, and error handling. Translate Python into Kotlin: https://github.com/Tribler/tribler/blob/main/src/tribler-core/tribler_core/modules/remote_query_community/eva_protocol.py

Storyline still valid I believe, "from SSI to DAO", https://github.com/Tribler/tribler/issues/6029#issuecomment-875355470 10-page IEEE 2-Column format of thesis (writing sprint?).

jwbambacht commented 3 years ago

New apk to use tomorrow https://bit.ly/3vEohA9

This version includes identity importing, automatic transfer of identity name, verification status, and profile image by chat. By tapping the name of the contact in the action bar a dialog opens displaying relevant information of the contact.

jwbambacht commented 3 years ago

New version apk (apk)

In this version, the following features are added:

Still todo: proper friend request, some fixes to the notification system, show when identity information changed.

synctext commented 3 years ago

Thesis work nearing completion :clap: :tada: Final feature the file transfer (250MByte example). Writing. Take 5 working days for the user evaluation chapter. This thesis is the first exploratory study into the societal infrastructure for identity, trust, money, and data. Cornerstone of any online economy. You will be the first to create one that works and scales. Creating societal infrastructure which is decentralised and anti-fragile is seen as essential due to our learnings from Covid crisis.

Brainstorm... Recruit 4 people from ministries and financial regulators. Measure task completion time for:

jwbambacht commented 3 years ago

Since the last meeting have been enjoying a (well deserved) holiday and focused on writing the journal article. Had some difficulties getting started in the beginning, but finally managed to get going. It is still a work in progress and there's probably too much text in the introduction, but I will look at what to do with that at a later point in time.

Article_22_11_2021.pdf

Did not do much on the app this sprint. I've however come up with a name: ConfIDapp. A mix of: Confido (trust in Latin), ID, Dapp: Decentralized Application.

synctext commented 3 years ago

Review of https://github.com/Tribler/tribler/files/7584365/Article_22_11_2021.pdf

synctext commented 3 years ago

What is the cardinal related work? Metamask seems to come close, quite mature app and combines several paradigms (ID,wallet,DeFi,exchanges,embedded browser,dApps, etc). Architecture on Github details: https://github.com/MetaMask/metamask-mobile/blob/949368384751c1379efc83e6a1a1a7070900c4b0/architecture.svg

jwbambacht commented 2 years ago

Updated version of the app (zip).

No progress has been made with the paper since implementing the EVA protocol took quite some time. For the next sprint, I'm planning to spend about half of the time to the paper.

synctext commented 2 years ago

Web3 complete reading list (ongoing editing with new discovered stuff)

jwbambacht commented 2 years ago

New version of app that has an updated EVA protocol for a massive increase in transfer speed.

https://filebin.net/kijjf087lr6u43j2

jwbambacht commented 2 years ago

New sprint, new apk https://filebin.net/8320ndukryz5zu3w, updated article Article_4_1_2022.pdf, and poster for next week Poster - Web3 Identity v1.pdf.

synctext commented 2 years ago
jwbambacht commented 2 years ago

New update to the article. Article_21_01_22.pdf

synctext commented 2 years ago

:+1: Getting ready for defence soon :+1:

jwbambacht commented 2 years ago

digid costs

jwbambacht commented 2 years ago

Thesis in the correct format. Thesis_3_2_22.pdf

synctext commented 2 years ago

Solid progress! Getting ready to pick a defence date. Quick scan only:

jwbambacht commented 2 years ago

Final draft of the thesis Thesis_7_2_22.pdf

synctext commented 2 years ago
synctext commented 2 years ago

File of 10MB, normalised to 5 MByte Also, to verify the independence of the file size of the transfer, the experiment is executed for a file size of 5MB and 10MB (and normalized to 5MB for comparison).

Please only use 250MByte files everywhere. And note in the text that you tested other files sizes, and confirm that this parameter has no influence. No need to show lots of uninteresting figures, right?

Fig. 13: Evaluation of the performance of a transfer of 250MB The exact reason for this is unknown, but it is expected to be some limitation in IPv8.

This is very poor performance. 90% or something is lost. These GHz devices and their 4G and/or Wifi5 transfers can do more. Fix, explain or document please.

jwbambacht commented 2 years ago

Updated draft Thesis_17_02_22.pdf

EVA kotlin tests

synctext commented 2 years ago

Solid tuning! Getting ready for defence.

The maximum parameter settings are big blocks (B=1200) and big window (W=128), expressed in KByte: 1200 x 128 / 1024 = 150 KByte of unacknowledged data as the fundamental limit to data transfer performance. So with certain latency we have an exact speed limit. No packet loss experiment, no latency emulator. Note what is [done on](https://github.com/Tribler/tribler/pull/6491) the EVA Python [implementation](https://github.com/drew2a/tribler/blob/800a3800b6f06d4dc0be1b30ab86ff55c19936f9/src/tribler-core/tribler_core/components/ipv8/eva_protocol.py): Lots of [EVA protocol test code is written](https://github.com/Tribler/kotlin-ipv8/blob/master/ipv8/src/test/java/nl/tudelft/ipv8/messaging/eva/TransferTest.kt)! Code coverage 70%, but achievement is not claimed within your thesis Citations of [Creative Commons link](https://en.wikipedia.org/wiki/Tim_Berners-Lee#/media/File:Sir_Tim_Berners-Lee_(cropped).jpg) for copyrighted Tim Berners-Lee photo Please do an arXiv.org upload! Is Android CI still working https://github.com/Tribler/kotlin-ipv8/actions/workflows/android.yml
jwbambacht commented 2 years ago

Defence_Presentation v1.pdf Thesis_JW_Bambacht_24_02_22.pdf Paper_24_02_22.pdf