Tribler / tribler

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

Build your own storagecoin - Group11 #3239

Closed PauluzzNL closed 6 years ago

PauluzzNL commented 6 years ago

Project H: Build your own Storagecoin

You will make your own storagecoin within this project. Filecoin is the largest ICO in the history of cybercurrency, see our analysis. A total of $257 million is given to a project without any running code. The big idea of your project and Filecoin is to turn any storage device into a cash generation machine. Key target is expanding an existing system with mobility of mined storage coins. Your code will allow send credits to another Android wallet. First task is to understand the Trustchain fabric by TUDelft, our 12 years of ledger prototyping and Android implementation. See project A for starting point with coding. Second task is to enable Android-to-Android transfer of coins. Finally, implement private key importing within your Android code and exporting using QR codes from the Tribler credit mining system.

@devbridie @PauluzzNL @mitchellolsthoorn @roelofsol @DavidGSB

RoelofSol commented 6 years ago

Our first milestone is:

Extend Tribler with the feature to generate a QR code from a key pair ( pybip38 ) This QR code can be picked up by a mobile phone using a version of the TrustChain Android app . The Android app can transfer credits to a second phone without using wifi. ( bluetooth/NFC/QR-codes/audio)

Our first week objective:

Have local builds of Tribler and Android and get acquainted with their code base.

RoelofSol commented 6 years ago

Meeting - Friday - 24 Nov We heard that there are problems with the available Android app. We hope to get a POC QR exchange between PC and Android working.

Tasks:

RoelofSol commented 6 years ago

QR generation examples screenshot from 2017-11-28 13-39-17 screenshot from 2017-11-28 13-39-58

RoelofSol commented 6 years ago

Meeting with Pouwelse - Tuesday - 28 Nov

We discussed the progress so far, and came to the conclusion that we should start communicating with the other group and TA that is working on the Android App.

mitchellolsthoorn commented 6 years ago

Progress on key export in Tribler, code can be found in PR #3267 : screenshot from 2017-12-02 14-33-22 screenshot from 2017-12-02 14-34-19 screenshot from 2017-12-02 14-34-52 screenshot from 2017-12-02 14-35-20

The individual buttons export the three different key pairs present in the session state of Tribler.

RoelofSol commented 6 years ago

The goal will be changed to wallet management, and no transactions

Tribler uses libsodium to generate dual key format keys. The problem is that the crypto libraries in Android (bouncycastle) does not support these dual format keys.

Possible TODO:

devos50 commented 6 years ago

We already compiled libsodium for Android.

To use it, you should add the following code to your build.gradle:

sodium {
                binaries.withType(SharedLibraryBinary) {
                    sharedLibraryFile = file("src/main/jniLibs/armeabi-v7a/libsodium.so")
                }
            }

Note that it's only compiled for armv7 so it cannot be loaded on Intel-based devices. Also, you probably have to write some glue code (bindings) using JNI (or SWIG) to invoke methods in the libsodium.so file.

libsodium.so.zip

UPDATE: https://github.com/joshjdevl/libsodium-jni seems exactly what you want here 👍

RoelofSol commented 6 years ago

Meeting - Dec 5

We changed our Goal. We will transfer money from a PC to an Android

TODO

synctext commented 6 years ago

Sprint goal: empty a PC wallet to a fresh Android Trustchain wallet with protection against man-in-the-middle attacks. Assume PC shows it's public IPv4:port and is connectable.

RoelofSol commented 6 years ago

Options

  1. Generate Identity on PC, transfer money on pc ( spin up second dispensery) and Move it to the android.
  2. Move PC identity to Android and generate new Identity
  3. Create a transfer from PC to Android
RoelofSol commented 6 years ago

We are focusing on option 1. ( We are using the chain as a tool and are not ensuring the security/consistency of a specific usecase. ) The tickets are :

PauluzzNL commented 6 years ago

Current Progress:

Solved roadblocks:

PauluzzNL commented 6 years ago

Progress for upcoming weeks:

synctext commented 6 years ago

Status:

RoelofSol commented 6 years ago

Dec 19 Done :

TODO : Integration test Tribler -> Android

synctext commented 6 years ago

Progress:

RoelofSol commented 6 years ago

We are now tracking progress on https://github.com/orgs/blockchain-storage/projects/1

PauluzzNL commented 6 years ago

After importing the current QR code the block is currently directly inserted into the chain and the private key is overridden. Currently the 'chain' becomes 'corrupted' because of this, because the genesis block is missing (for now). So the history of previous blocks is now incorrect, as they were from a different keypair.

The better approach and first next goal is to actually transfer the transaction from the 'temporary block/identity' to the already existing wallet on the phone.

aftertransfer

devbridie commented 6 years ago

For transactions that have associated coin data, an Activity has been created displaying the transaction data.

photo_2018-01-08_22-19-14

PauluzzNL commented 6 years ago

Current concept:

New Approach:

chainconcept

synctext commented 6 years ago

Remarks and progress :

synctext commented 6 years ago

Final documentation is contribution to: http://trustchain-android.readthedocs.io/

PauluzzNL commented 6 years ago

Short overview of the block structure used for the throwaway transfer identity.

photo_2018-01-11_13-42-52

mitchellolsthoorn commented 6 years ago

Schematic overview of offline transaction with throw-away identity photo_2018-01-11_14-17-29

We do not send all information of the zeroth block of the C node, because it will make the QR to big too display on a mobile phone.

Data sent:

mitchellolsthoorn commented 6 years ago

Beta version of the documentation: https://drive.google.com/open?id=1bQvnE0p48Zd2m9tBiCfNTQtZnYXVR4yS

This will be uploaded to the read the docs of the android app and put into the issue

mitchellolsthoorn commented 6 years ago

To be done/improved

The current PR's are #3358 https://github.com/wkmeijer/CS4160-trustchain-android/pull/54

synctext commented 6 years ago

wish list :

Final grading doc; PR to read-the-docs which should not exceed 5 pages including introduction with proper references, problem statement, high level description of the system, and reason for certain critical choices made in the design.

PauluzzNL commented 6 years ago

QR code to test the android functionality.

testqrcode

mitchellolsthoorn commented 6 years ago

Ideas for the pictures for the Stanford talk:

devbridie commented 6 years ago

https://github.com/blockchain-storage/app/releases/tag/funds-preprealpha

mitchellolsthoorn commented 6 years ago

Screenshot of new partial emptying support on Tribler, new confirmation screens and changed wording screenshot from 2018-01-17 22-51-19 screenshot from 2018-01-17 22-51-25 screenshot from 2018-01-17 22-51-44 screenshot from 2018-01-17 22-52-30 screenshot from 2018-01-17 22-52-59 screenshot from 2018-01-17 22-53-12 screenshot from 2018-01-17 23-01-04

mitchellolsthoorn commented 6 years ago

Presentation image: screenshot from 2018-01-17 23-10-22

synctext commented 6 years ago

Stauts

RoelofSol commented 6 years ago

photo5996821823771224954 photo5996821823771224952

mitchellolsthoorn commented 6 years ago

Discovered problem during last sprint:

RoelofSol commented 6 years ago

Prettier usage gif

out-smaller

PauluzzNL commented 6 years ago

Here is our process report which also includes the technical information. We'll have one final pull request with documentation changes to the android master.

synctext commented 6 years ago

Quick comments used for final grading: