Tribler / tribler

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

Blockchain Engineering Class of 2020: Delft-DAO - Distributed Democracy #5145

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

Distributed Democracy Key component of a DAO is controlling the fully automated firm through a voting process. A DAO is fully autonomous and has the integrated ability to govern itself. Self-governance is difficult to realise. Anonymous owners of the DAO coordinate their action through a voting process. Collective decision making by the stakeholders is known as a hard problem. Electronic voting is known to be difficult security problem. This is a challenging part of DAO engineering. Mandatory starting point for your code is this Kotlin app

synctext commented 4 years ago

@emieldesmidt @koningr @PraveshMoelchand @erwinvanthiel Welcome to the course! Sprint proposal divided on team of 4 students :

Future sprint ideas:

rwblokzijl commented 4 years ago

Related:

emieldesmidt commented 4 years ago

The APK from last sprint: demo-voting-android-debug.zip

PraveshMoelchand commented 4 years ago

Propose button in debug screen (1) and creating a proposal (2):

Proposal has been added to chain (1), can be voted on (2), and votes can be viewed in the chain (3):

synctext commented 4 years ago

Next sprint:

synctext commented 4 years ago

related work (critical components are still MIA) https://vocdoni.io/docs/#/architecture/process-overview

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.

synctext commented 4 years ago

The team seems stuck, yet still determined

synctext commented 4 years ago

smart idea from another group: if you can always pull out your Bitcoins, you mitigated the "Voting Quorum capture" attack. If people don't like the direction a DAO is going, it trigger something like a "bank run", a large-scale exit. Does an "always-exit" mechanism solve this attack for any permissionless DAO with true democratic voting (e.g. no special voting privileges)?

emieldesmidt commented 4 years ago

Markdown documentation keeping track of how to use our voting application, design choices that have been made, and ongoing questions: hackmd link

synctext commented 4 years ago

Sprint progress:

PraveshMoelchand commented 4 years ago

UPDATE

PraveshMoelchand commented 4 years ago

We have proposed first version of API to work with the currency group (translated from Dutch):

fun startVote(voteSubject: whatever, , voters: List<whatever>)
//  Proposer calls startVote() and sends all voters a proposal 
//  block with the subject of the vote in JSON.
//  Votesubject could also contain something else, as long as it is JSON-able.
//  Voters could also be a list of peers, as long as the public keys are retrievable.

fun respondToVote(voteSubject: whatever, signature: whatever, proposalBlock: TrustChainBlock)
//  Voters call respondToVote() to vote. VoteSubject is the name of the vote. 
//  Signature is the BTC signature as string or something else JSON-able.
//  Proposalblock is the block that is being responded on.

fun countVotes(voteSubject: whatever, proposerKey: ByteArray): List<whatever>
//  VoteSubject is the name of the vote. Proposerkey it the key of proposer, used
//  to crawl the chain to find the voting responds. Return type is a list of signatures.
//  Please give us instructions of how we could verify a signature for its validity, so we
//  can incorporate this when counting votes.
synctext commented 4 years ago

Sprint progress:

emieldesmidt commented 4 years ago

Last week was for all of us rather hectic, nevertheless we have made some solid progress both in terms of coordination as well as voting.

For the integration with the other groups:

For our own voting development:

However, there were some issues that we have encountered:

We'll address these issues and our further progress during the meeting.

synctext commented 4 years ago
emieldesmidt commented 4 years ago

Due to a fair share of stress from other deadlines/exams, last week amounted to a little less than hoped. Nevertheless a fair share of work has been done. Our voting has finally moved to the super-app, see the pr. We only wanted to do so once there was sufficient unit testing as there is no way to manually test an API without writing a dedicated application for it.

@erwinvanthiel took the time to check out some of the pr's from other groups.

There were some complications with the build. (Classic case of 'works on my machine'), obstructing @KoningR and @PraveshMoelchand from continuing to work on the threshold implementation. This has been discussed with @MattSkala and is currently trying to be fixed. The issue involves gradle modules, something where we are inexperienced with.

synctext commented 4 years ago
emieldesmidt commented 4 years ago

Connected with super app, and created demo application that showcases our yes/no voting solution. As of right now it is a rudimentary state, but we expect to extend its functionality and style over the coming days.

It serves as a place where new vote proposals can be discovered, voted upon, and created.

PraveshMoelchand commented 4 years ago

Corresponding APK app-debug.zip

synctext commented 4 years ago

Sprint progress:

PraveshMoelchand commented 4 years ago

Just created a PR for the initial GUI with yes/no voting. This ticks off the dynamic voting list bullet point.

Also, our main working branch is now the forked dao branch. When creating new functionalities, we create a new branch from here and merge them back into dao once finished.

Some screenshots of the GUI can already be seen in the PR.

PraveshMoelchand commented 4 years ago

We also fixed an exclusion that wasn't working in the ktlint of the kotlin-ipv8 repo, see the PR here

emieldesmidt commented 4 years ago

Summary of this weeks sprint progress as we are nearing the end of the project:

Some screenshots indicating all that's new.

Main screen:

### Clicking on a vote were you have already proposed upon: ### Toggle to only uncasted votes mode + cast dialog: ### Initiating vote with toggle between yesno/threshold:
PraveshMoelchand commented 4 years ago

voting-23-04-2020.zip

synctext commented 4 years ago

Last sprint comment:

PraveshMoelchand commented 4 years ago

For this final sprint, we decided to make use of the GitHub issue board

PraveshMoelchand commented 4 years ago

Final pull request created: https://github.com/Tribler/trustchain-superapp/pull/23 🎉

emieldesmidt commented 4 years ago

That was a lie, https://github.com/Tribler/trustchain-superapp/pull/25

emieldesmidt commented 4 years ago

So to conclude:

We will use the app where the FOC integration proof of concept is present. Both this APK and the FOC APK can be found below!

PraveshMoelchand commented 4 years ago

APK for our final app: trustchain-voter.zip

APK for the FOC-integration proof of concept: foc-integration.zip

synctext commented 4 years ago

Fascinating final result feature; Freedom of Computing integration: https://github.com/Tribler/trustchain-superapp/blob/dao/trustchain-voter/README.md#experimental-freedom-of-computing-file-proposal