Tribler / tribler

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

Blockchain Engineering Class of 2020: Delft-DAO - Create your own currency #5143

Closed synctext closed 2 years ago

synctext commented 4 years ago

Delft-DAO

What is a DAO? Within the coming decade the future of jobs, employment and the nature of the firm will change profoundly. Automation, AI, and robots will replace many of today's jobs. A new type of company is a company without any employees, without any machines or physical infrastructure. A Decentralized Autonomous Organizations, DAO, only exists in software. It goes beyond smart contracts, it is a complete company inside software. DAO development is still in the experimental stage.

Within this course you can create your very own autonomous organisation, the Delft-DAO. Learn to engineer a decentralised autonomous organisation, use the existing tools, and understand the security risks. The aim is to alter the nature of the firm in the Internet age, see the Nobel prize winning theory. Production cost become essentially cost-free. An organisation which exists purely in cyberspace. The Delft-DAO is designed to be the first sustainable DAO. How can we empower leaderless organizations? How can it earn money from manipulating bits?

Advisor: J.A. Pouwelse, TUDelft blockchain lab founder (weekly meetings on Wednesdays)

Several teams from the class will create running code (requirements for a passing grade..) for one of the following functionalities. Four teams together create the building blocks of the complete Delft-DAO (time consuming integration step is outside our scope).

Create your own currency First step of building a DAO is creating money. This enables the Delft-DAO micro-economy. Mark Zuckerberg is creating his own currency for a few billion users, called "Facebook Libra". For this assignment you will also create your own currency in 10 weeks, almost from scratch! Obviously security and usability is somewhat limited. You will investigate methods for minting and transfer of tokens. You will designate yourself as "trusted nodes", able to generate cash. Mandatory starting point for your code is this Kotlin app

synctext commented 4 years ago

@mvanmeerten @martijnbosma @dymbe @tijmen104 Welcome to the course! Sprint proposal divided on team of 5 students :

mvanmeerten commented 4 years ago

:D

rwblokzijl commented 4 years ago

Related:

synctext commented 4 years ago

Lesson learned, not easy to solve; need 3 QR scans to transfer funds to strangers. Next sprint:

tijmengit commented 4 years ago

For creating QR-code transactions:

MattSkala commented 4 years ago

For integrating work of all teams with the existing codebase, we have decided to take the super app approach. To separate IPv8 library from the app, we have moved demo-android app from kotlin-ipv8 to trustchain-superapp repository. Please create a module for your app and add a link to the dashboard according to the provided tutorial. When you feel ready (in the upcoming weeks), you can create a pull request with your contribution.

dymbe commented 4 years ago

Screenshot:

From https://github.com/mvanmeerten/kotlin-ipv8/tree/blockSending

synctext commented 4 years ago
dymbe commented 4 years ago

Our app is in the superapp. Can be found here: https://github.com/dymbe/trustchain-superapp/ Would you want us to do pull requests to the main repository @MattSkala?

dymbe commented 4 years ago

The app can now count how much you have of our currency, and a validator is added to make sure that the sender actually has enough money when sending. This check is disabled for offline transactions, because you need the senders entire chain to calculate how much currency it has. For the moment we have solved the minting problem by making every self-signed block print money. This is of course just a temporary solution to make development easier. Issue Verify transaction and Mint currency

tijmengit commented 4 years ago

Update:

awrgold commented 4 years ago

Pseudorandom dataset of 100k trades, with trade price and amounts is done. Mean price: 0.64 (DymbeDollars) Mean position size: 39 (position sizes are integers) image image

synctext commented 4 years ago

Sprint progress:

dymbe commented 4 years ago

@synctext Just to be sure, you don't want us to use the currency we created, but rather Bitcoin and Euro? The last meetings we were told we should use our own currency when trading, and our project is called "Create Your own Currency" after all. This is all good of course but we though at least you should know that most of our efforts so far have gone towards creating our own currency, and we hope you can take this into account.

synctext commented 4 years ago

sprint progress:

ToDo list:

awrgold commented 4 years ago

image

Our classifier is now able to predict whether or not to execute a trade depending on the value of the bid/ask order. Prediction class 0 is "do nothing", class 1 is "buy", class 2 is "sell".

tijmengit commented 4 years ago

Further update on the progress:

Todo's done: -"however, there is no workload or traffic there!" -"create your own test bid/ask workload (Python or Kotlin)" -" no trustchain block creation, simple message broadcasting only to few dozen peers (will not scale, inefficient)" -" create bid/ask in the market community manually in GUI (helpful for testing)"

tijmengit commented 4 years ago
Screenshot 2020-04-01 at 09 48 25

We can send and display bid and asks messages!

devos50 commented 4 years ago

Wow, that really cool progress guys! This is a critical step towards a decentralised market on a mobile phone đź‘Ť

Maybe you could improve the presentation a bit, and show asks on the left side, and bids on the right side, sorted on price (not sure if this is the focus of your project, just a suggestion)?

synctext commented 4 years ago
synctext commented 4 years ago

Future work, after this course (notes)

tijmengit commented 4 years ago

Trader The AI is able to decide and execute trades upon receiving bids/asks broadcasted in the community.

synctext commented 4 years ago

solid! Can you hard link the .APK? 4 PRs are in pipeline, so there will be some re-basing for (late) teams.

synctext commented 4 years ago

Sprint progress:

mvanmeerten commented 4 years ago

@synctext You can try to install this apk. It works on @dymbe his device.

app-release.zip

synctext commented 4 years ago

works! Please make an animated .GIF for the final documentation. Seeing the live trades come in, small GUI glitch when it starts to overflow from the screen. Better to put the latest accepted/rejected trade to the top of the screen I guess, users needs to scroll down for browsing old history. Keeps the screen interesting. Can you do a :information_source: icon for additional info on the internal trading bot state? Simply some high-precision numbers that constantly change.. Please rename "trader" in the GUI to "AI trading bot".

tijmengit commented 4 years ago

So to wrap up, in the past weeks we started by building an app to send money offline. We were able to send entire proposal and agreement blocks by using QR codes, but verification was difficult. Therefore we discussed to use the QR codes in a fire -and-forget way, and implemented that. We proceeded by creating another app, to integrate a ML-trading algorithm inside the super app.

Future recommendations:

tijmengit commented 4 years ago
mvanmeerten commented 4 years ago

app-release.zip

works! Please make an animated .GIF for the final documentation. Seeing the live trades come in, small GUI glitch when it starts to overflow from the screen. Better to put the latest accepted/rejected trade to the top of the screen I guess, users needs to scroll down for browsing old history. Keeps the screen interesting. Can you do a icon for additional info on the internal trading bot state? Simply some high-precision numbers that constantly change.. Please rename "trader" in the GUI to "AI trading bot".

Most of the requested fixes are implemented, only the information icon is still missing

synctext commented 4 years ago

Sprint progress:

synctext commented 4 years ago

Final apk Github actions: local version: app.zip