Tribler / tribler

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

Blockchain Engineering Class of 2020: Delft-DAO - Freedom of Computing #5146

Closed synctext closed 3 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?

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).

Freedom of Computing Freely executing code forms the core of the DAO. Improvement of smart contract execution model. This team will build the enabling infrastructure of the DAO. You will create Python-based code execution using the "Dapp" approach, decentralized applications. All executed code on the Delft-DAO is compressed down to a single hash. This code can be upgraded and can never revoked in a "rage-quit" incident; it probably is even "lawyer-proof". The mandatory starting point for your code with documentation in this master thesis.

synctext commented 4 years ago

@thystler @tpapak01 @C3lio Welcome to the course! Sprint proposal divided on team of 4 students :

synctext commented 4 years ago

sprint advice:

synctext commented 4 years ago

Addition: please focus this sprint primarily on Grab 'N Run. I think it offers exactly what we need. Separately, also test and evaluate dynamic-load-apk. Use something as simple as possible. From the Grab 'N Run research paper

This additional piece of code is loaded at runtime (thus the
term “dynamic”), and it might not necessarily be present
in the application package at installation time: In fact, the
additional code could be retrieved, once again at runtime,
from a remote network endpoint.

Try to get this to work or create an issue on their repo what is broken. Future sprint options:

Thystler commented 4 years ago

@rootmonkey

rootmonkey commented 4 years ago

Sprint update:

After button press:

Screenshot 2020-03-11 at 23 26 17

Where the modified string is dynamically loaded from the method get_str of this class at runtime:

Screenshot 2020-03-11 at 23 26 34
tpapak01 commented 4 years ago

Update: We managed to get DexClassLoader to load a class from a jar file on an actual phone. The problem was that the application required runtime permissions through the actual device (at least, that's what solved a common problem we were experiencing). The "Injected" class has been built into a jar file and placed on the phone. Below we simply present its code. Since DexClassLoader eventually worked, and since Grab n' Run is based primarily on that class, we have high hopes that SecDexClassLoader will work as well. After all, the difficulty was the whole permission granting process on the actual device, and we achieved that without resorting to older versions and tools. Inject Code Result

synctext commented 4 years ago

Sprint feedback:

Wrap-up above sprint content, then demo to other groups at end of week 6 of this course?

tpapak01 commented 4 years ago

We managed to get libtorrent working on android, whether a magnet link is used, or a .torrent file. Although the state of each download holds between runs (which means a download at 15% will continue from 15% the next time), we still haven't managed to find the actual file on the phone once the download is complete. Next steps:

Libtorrent using both torrent and magnet link.zip

synctext commented 4 years ago

sprint progress:

tpapak01 commented 4 years ago

Integration with superapp (as a separate module) is complete. GUI screenshots will follow soon.

I guess one main question about the integration with the other teams is: "what are we supposed to transfer from peer to peer in the form of torrents? Is it votes? Is it executable code, and if so, for what purpose? The other teams made shared wallets, methods of money transferring and a system to vote/agree on money transferring. Where does our contribution fit in this?"
synctext commented 4 years ago

Sprint feedback. To answer above question Libtorrent is used to download Kotlin code and conduct live code injection. Offer complete end-to-end Kotlin Distributed App system.

From prior list:

synctext commented 4 years ago

Sprint progress:

tpapak01 commented 4 years ago
synctext commented 4 years ago

Sprint progress:

Thystler commented 4 years ago

magnet:?xt=urn:btih:6d651f45a01afc35572c734c73cbf8a8f82c396f&dn=20+Awesome+Nature+Ultra+HD+4K+Wallpapers+3840x2160+Px+%5BSet+64%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969

synctext commented 4 years ago

Sprint progress:

rootmonkey commented 4 years ago

This was one of the basic test where the button is made in a different apk and loaded dynamically into Test4

Screenshot 2020-04-15 at 15 49 04
synctext commented 4 years ago

@InvictusRMC from the MultiSIG wallet team has volunteered to help integration your efforts. Thus real Bitcoin bounty payout for a magnet link with useful code.

tpapak01 commented 4 years ago

Our app/module is complete. Below you can find a guide describing the main use case, from start to finish, and each step required along the process: https://github.com/tpapak01/trustchain-superapp/wiki/FOC---app Here is the apk: app-debug.zip We can test the functionality tomorrow, if you want to. A new pull request was made for the superapp. Finally, we spoke with the Democracy group, and agreed on the integration. In short, if a user wants to distribute code among the network (through our Upload button) he must first propose that code/apk and have it approved/voted for, otherwise the button blocks him from uploading his apk.

synctext commented 4 years ago

Final sprint feedback:

synctext commented 4 years ago

Top README.md documentation uploaded to Superapp dApp example code in repo and operational code injection. Testing latest release...