Tribler / tribler

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

Blockchain Engineering - class of 2022 - Team Digital Euro III #6785

Closed synctext closed 2 years ago

synctext commented 2 years ago

Project description: Your task is to {partly} realise a new blockchain-based digital Euro. Delft university has obtained permission to experiment with real digital Euros and live connection to the IBAN bank account system. You can build on this existing open source code. Reading: European Central Bank report on digital Euro, digital Euro master thesis at Delft, the progress report by China Central Bank who is at least five years ahead of Europe. You are free to set your own target feature to focus on, for instance, high transaction rate, offline support, ease of use, etc. Cashless society report by NL central bank

Approach: You will either extend our EuroToken implementation with new functionality, or improve existing functionality. The target feature(s) will be chosen depending on your expertise and interests. Suggestions/ideas are very much appreciated! Please make weekly updates of your progress on this ticket (e.g., with a screenshot). The expected deliverables are:

Possible project direction (subject to discussion next meeting): Bitcoin-backed EuroTokens. Currently, EuroTokens are backed by Euro in the central bank network. Your project involves extending support for Bitcoin-backed EuroToken. You will have to modify the Bitcoin mining parameters, set up a private Bitcoin network, and mine some Bitcoin. These Bitcoins can be sent to a validator and exchanged for EuroToken. Give each user 10 EuroToken when joining the app.

Cardinal issues: preserve scalability, permissionless, primary function focus.

References:

idea: tooling for enabling e-commerce. How can a webserver scan Trustchain? How can a server create Trustchain transaction? Where is the identity of the store stored? The phone is the webserver?? "shooting for the moon" task

ToDo:

synctext commented 2 years ago

brainstorm: offline Euro -assume 10k public keys with a provided 0% to 100% double spending risk (100% score when irrefutably double spend in the past) -externalise the decision to transact to user (For instance: THIS IS 100% RISK, DON'T DO IT) -offline risk focus (locally store "counterparty risk assessment database" + updates) -focus on running code +X% design of this trust DB (decide this week on time spend coding + readme writing of design) -assume passport safe strong ID

Outcome: an merged pull request on the superapp, enhancing the offline Euro, and possibly a design for the "counterparty risk assessment database".

Nils134 commented 2 years ago

Proposed timeline and research questions

Planning: 3 weeks research 2 weeks to implement 2 weeks UX/UI

Research questions: How to store and update the records of users, decentralized? Update between ratings Storage within phones

How to convey these risks to the user, intuitively?

Automatic block of users below a threshold?

How to prevent fraud with updating records?

(How would we update these records, given transactions)?

Milestones: Week 4: We set up a database (implementation) How to store and update? (research) Timestamp: Consensus Hash tree for information exchange / comparison Chunked update based on comparisons

Week 6: We set up exchange mechanism (implementation) How to prevent fraud (research) Only update others Prevent circular updates

Week 8: Automatic block of users below a threshold and convey risk (implementation) How to convey risk? (research) Color coding? Explanation? Double-spending?

Week 10: Do presentation Do readme

synctext commented 2 years ago

Offline double spending focus. Assumptions / constraints for the research part:

Warning for whopping incoming code: https://github.com/Tribler/trustchain-superapp/pulls (Euro + Android 12 fixes) Read prior work: https://scholar.google.com/scholar?q=double+spending

synctext commented 2 years ago
synctext commented 2 years ago

https://github.com/KoningR/stablecoin-exchange

synctext commented 2 years ago
Fastjur commented 2 years ago

Added a warning label to the send money fragment in eurotoken:

https://user-images.githubusercontent.com/1493561/160100362-a934b0d9-cda3-4f5e-b4ca-0b47b1f398d2.mp4

In the above video, it cycles through (by hot reloading so I don't have to rescan the code) the following situations:

The trust score is now loaded from an asset that is included in the source files, a json file, but it shows the feature.

synctext commented 2 years ago
aimarinov commented 2 years ago

Task division for the week:

Fastjur commented 2 years ago

Added a simple toggle for demo mode, which will be used to generate 50 random (fake!) public keys when there are no 50 transactions available. This is purely to demonstrate the working of sending the 50 public keys over the eva protocol.

Screenshot_1648642933

JoepdeJong commented 2 years ago

The generator is tested and implemented in https://github.com/pietertolsma/trustchain-superapp/pull/3. Demo mode is now enabled by default

@Fastjur can you look at this?

Fastjur commented 2 years ago

The generator is tested and implemented in pietertolsma/trustchain-superapp#3. Demo mode is now enabled by default

  • [x] Load demoModeEnabled from preferences.

@Fastjur can you look at this?

This has been fixed in our latest master branch at https://github.com/pietertolsma/trustchain-superapp

pietertolsma commented 2 years ago

https://user-images.githubusercontent.com/10885710/161062927-05458ef7-f769-427e-a60c-4dae396eaabb.mov

Working demo of our contribution!

Fastjur commented 2 years ago

@synctext Attached an APK file for you to test it out before tomorrow!

synctext commented 2 years ago

Discussed the radiating signs of frustration due to vagueness of assignment. The process of clarifying the assignment during the running of the course, continuous large changes, and keep changing course of the project was frustrating. Agile!

Week 8 progress: the app works now on my device :clap: This is now at the level of proof-of-concept. Its fully functional, while still needs further engineering and research. The trustscores for double spending uses simple linear additive model. ToDo: accepted pull request to wrap up course! polish, readme, spec of protocol messages

JoepdeJong commented 2 years ago

TODO:

Remark:

aimarinov commented 2 years ago

@synctext Here is the paper draft. It's formatted like a report instead of a paper, but that could be worked on.

synctext commented 2 years ago

Pull request with docs. :+1: there is no detailed docs for Eurotoken, just discovered today. Please focus on the update with your specific problem focus and your contribution. To be consistent with others please do the readme at 2 levels: short main blurb and a detailed version in more than 33 lines. Discussed arvix uploading. More informative title: double spending prevention of digital Euros using a web-of-trust. If you alter the intro and start with the words "double spending", it will flow better. Level of detail needs to build up to the point of a specification. Others can reproduce your work with merely your scientific paper. "III. Requirements", more informative would be 'III. Offline Euro requirements". More informative "IV. Protocol", like transaction protocol or "offline P2P payment protocol". Difficult choice on how to deal with trust protocol versus pointing to other docs for actual payments or repeating briefly what others build. Like: coins in our system are minted by the public keys of central bank within the Eurozone. Each coin is simply a unique coin number, denomination and signature by a entity within the eIDAS legal framework ref. As authors, could mention my name as final author and use annotation "(course supervisor)". Example here and please add --- student project ---. Please arvix upload, option for adjustment and versioning later.

aimarinov commented 2 years ago

The updated version of the paper.

aimarinov commented 2 years ago

The newest version of the paper. We reflected on most of the feedback received last week but there is still some work to be done on the protocol part.

Fastjur commented 2 years ago

Pull request opened

https://github.com/Tribler/trustchain-superapp/pull/105

Readme

https://github.com/pietertolsma/trustchain-superapp/blob/master/eurotoken/README.MD

Debug APK

https://drive.google.com/file/d/1-qag_BBYBweuw9ENgHTe0t8p8RdR2nkX/view?usp=sharing

Research paper

https://arxiv.org/abs/2204.06831

synctext commented 2 years ago

Euro readme intro: EU member states of the Eurozone are considering creating a blockchain-inspired digital Eurotoken using a P2P architecture. The superapp contains a fully functional digital cash implementation, still experimental and tested within 1 retail location for 1 morning in live production usage with real financial transactions.

devos50 commented 2 years ago

This work has been completed, closing the issue 👍