Tribler / tribler

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

Blockchain Engineering 2023 - Upvote Token #7305

Open InvictusRMC opened 1 year ago

InvictusRMC commented 1 year ago

Upvoting token. Each user can give away an infinite amount of ❤️ tokens. Content creators are rewarded with ❤️ tokens, boosting their visibility. Content gathering lots of ❤️ will get more attention and go viral. Content creators can see in real-time who is giving them a ❤️ token. The ❤️ token economy design and implementation is your responsibility. Part of your demonstration will be a wipe-based UX implementation which favours viral content. Fraud and manipulation of your token economy such as the Sybil attack can be ignored. Bonus background reading: The like economy: Social buttons and the data-intensive web.

InvictusRMC commented 1 year ago

Some difficulties compiling, fix ASAP!

GitHub handles to add:

LeonKempen commented 1 year ago

@InvictusRMC Last week we have created a fork of the project and added our own submodule. Each one of us managed to compile the application and run the new submodule.

For this sprint we have added the following features:

Currently we have not tested sending tokens with two physical devices yet. However, sending (and receiving) the token did work when one of us used an emulator and someone else joined as a peer.

InvictusRMC commented 1 year ago

Great progress!

Next sprint:

NektariosEvangelou commented 1 year ago

For the second sprint we came up with the following token design and we wanted to check if we are heading in the right direction. We asked @InvictusRMC to provide some insight on the following:

Token data structure:

a. Balance of upvote tokens in the wallets of sender and receiver.

I. The balance of a peer in DeToks is composed of the number of (upvotes received minus number of upvotes given). II. Peers which have posted videos will additionally have a dictionary where the keys are video ids and the values are number of upvotes that video has received from other peers (an idea we had to make recommending viral videos easier).

b. Timestamp GMT (to act as a nonce and prevent replay attacks). c. Identifier of the video which the sender wants to upvote (to be used later to decide which video should go viral). d. Public keys of the sender’s wallet and and the receiver’s wallet’s public key. e. Signature of the sender (the other peers in the network verifies this signature using the sender’s public key).

On the personal trustchains we would like to store:

a. Hashes of previous block which this token would have as a predecessor. b. Sequence number of the block.

In the database we would like to store:

a. Balances of known peers. b. Transactions on the Trustchain network. c. Possibly in the TrustStore, we would set the balance of a peer as the score, as a peer with a lot of upvote tokens contributes significantly to the value of DeToks.

Reply from @InvictusRMC: "My thoughts: I believe you are actually talking about your transactions. Please take notice that these are different things. The transaction is the act of transferring some data, which is the token itself. By using the balance, you might run into concurrency issues. For instance, what happens when the balance is updated during the process of sending the transaction? I like your idea of your balance decreasing when giving away upvotes. It makes upvoting a resource that must be used wisely. It does, however, leave me wondering about incentives. Why would you ever upvote content if this would lead to a decrease in your net worth? These are all things to take into consideration."

NektariosEvangelou commented 1 year ago

@InvictusRMC, for this sprint we have discussed the following things and/or added the following features:

All group members read up on TrustChain. As seen in the previous comment, we have also thought about our token design. We will discuss it further with you in our upcoming meeting. We managed to integrate a start of the TrustChain logic into our community, however, the validation part is not yet done. We managed to add a generic sqldelight database to our upvote community.

Questions:

How can we hook up a block validator to the TrustChain? Both the EuroToken and the Music modules seem to do it differently, but we cannot seem to get either to work.

InvictusRMC commented 1 year ago

See work of other group on simple token:

https://github.com/Tribler/tribler/issues/7311

LeonKempen commented 1 year ago

@InvictusRMC Hereby our update for sprint 3.

This sprint we worked on finishing the token design and trustchain implementation. We made the following decisions regarding this:

For the Trustchain implementation:

For the Token design:

All changes are currently on the master branch. I have created a PR to the trustchain repository but it does not seem to create an APK yet. We look forward to your feedback this afternoon!

As pointers to next sprint we want to do:

InvictusRMC commented 1 year ago

Great design ideas!

Next steps:

--> Great content checkin by https://github.com/ChrisSBras/trustchain-superapp/issues/1#issuecomment-1465608449 hacking https://github.com/Tribler/trustchain-superapp/commit/bd8f42daf66ff7b5e1075b031b4e36c167375ff4

LeonKempen commented 1 year ago

@InvictusRMC Hereby the update for this week:

We have implemented 4 ways of recommending videos:

Regarding the torrent:

  1. let a user seed a torrent/mp4 that (s)he posted
  2. a user that double clicks on a video, will start to seed that video/torrent as well

What we did for these 2 stories was:

The obstacle encountered was: the function call sessionManager.fetchMagnet(magnet, 10) returns null instead of the byte data needed to decode into a torrentInfo object which can be used to download the mp4 video As a result we currently cannot download the mp4 corresponding to a torrent's magnet link which is being seeded

InvictusRMC commented 1 year ago

Great work!

Next sprint

Deliverables

LeonKempen commented 1 year ago

@InvictusRMC Hereby the update for this week:

Torrent seeding & Incentives for content providers:

InvictusRMC commented 1 year ago

Prioritization

Meetings

NektariosEvangelou commented 1 year ago

@InvictusRMC Hereby the update for this week.

Benchmarking:

Previous merge to main:

README:

NektariosEvangelou commented 1 year ago

@InvictusRMC Hereby the final (small) update for this week.

Application:

Benchmarking:

Unit tests:

Examination:

TODO:

InvictusRMC commented 1 year ago

You have a solid report, guys! Great work.

Minor points:

LeonKempen commented 1 year ago

@InvictusRMC Thank you for the review!

We have incorporated the feedback in the report and made some small adjustments and extentions. Currently we are in the process of adding a code coverage badge to the repository. The tests that we have written cover ~18% of the lines in the main package (including the UI code).

The build that you approved passed and produced an APK which can be found here: APK

InvictusRMC commented 1 year ago

Hi guys, great work! Can you also post your slides here?

LeonKempen commented 1 year ago

@InvictusRMC Thank you for your time and the guidance during the course! Below I have attached the slides we had used during the presentation.

DeToks - Upvote Token.pptx