At last year's Ocean Hackathon, I won third place for my chrome extension that allowed users to capture their browsing history and sell it on the ocean marketplace. I then discovered that a company called Swash had "borrowed" my idea to create a Data Union business on Streamr. Swash captures the browsing histories from thousand of users then stream it live and sell it on the Streamr marketplace to data scientists. The users then receive a fraction of the price as payment for providing their data. As Swash already implemented my idea, I looked around to find what else could a random person like me stream live for revenues. I stoped searching when reaching my Fitbit tracker on my wrist!
What it does
This project is a Data Union for merging and crowdsourcing thousands of users’ Fitbit data and shares profits with them. Fitbit data includes daily activities, steps, consumed calories, heart-rate, etc. To start earning, users simply connect their Fitbit account to the platform then receive profits directly into their wallet.
How I built it
The frontend is a simple interface that allows users to go through the Fitbit Oauth 2 authorization process and send their access token and wallet payment address to the server. The server then stores that data in memory along with all the other users. The server has a cron job that runs every 10 minutes to fetch activities, steps, food intakes, gps locations etc. from Fitbit. The data is then aggregated with other users' data and streamed to the Streamr Data Union where it can be sold for 10 DATA coins per day. Users are then payed everyday a fraction of that price to their wallet.
Challenges I ran into
As the price of Ether has been very volatile over the past few days, when I tried to deploy the Data Union on streamr.network/ the deployment price of the smart contract was $1,600! I therefore was not able to afford a mainnet deployment and had to use the Localhost dev environment provider by Streamr. Unfortunately the experience has been very painful as it took me days to make it work... One of the main issue I had was how to connect Metamask to the local ganache instance created by streamr as there is little to no documentation about it. By default, Streamr want to connect to Chain ID 8995 with is nowhere to be found. I had to try many experiments before understanding that I had to connect Metamask to localhost:8545 then change the default chain ID to 8995. Then I couldn't deploy the smart contract because I didn't have any fund on that specific network created by streamr which I couldn't get any mnemonic from like with a on a normal ganache instance. After hours of going through documentation and github repos I found a faucet repo that contained a file with a private key. This account had 999999 ETH on the local ganache session and I was finally able to deploy the Data Union. From there, everything else went smoothly.
Accomplishments that I'm proud of
I have many times considered quitting this project with all the issues I had with Streamr Docker Dev environment but I am proud that I kept going and solved all the issues one after the other.
What I learned
I learned a lot about Streamr and Data Unions.
What's next for Fitbit Data Union
Deploying the data union to the mainnet would be the first next step and also deploying the app on FitnessDataUnion.com which I have just purchased. Also I didn't have enough time to automate payments to users but that is just regular erc20 token transfer which is easy enough. Finally, after some time and and a few hundreds of user data, it would be great to export everything in one file and put it on sale on the Ocean Marketplace (this is an ocean hackathon after all ^^)