DanielPollithy / flashwifi

Wifiota - share WiFi p2p in exchange for iota on android
https://tobywoerthle.github.io/flashWiFiSite/
9 stars 1 forks source link
android flash-channel hotspot iota j2v8 wifi-direct wifi-p2p

flashwifi

Share remaining data from your android phone as a hotspot and get paid in iota.

WiFiota Promotional Website

Installation

Required permissions explanation:

Requirements

Minimum Required Android Code Name/Version/API Level: Marshmallow / 6.0 / API level 23

How does it work?

Iota setup

The app creates a seed for a user and stores it with a password in SharedEncryptedPreferences. There are withdraw and deposit views, which can be used to interact with the seed (send and receive funds). The balance of the wallet can be viewed and is cached.

A private testnode is used by default but a mainnet (live) node can be set.

When using the testnet, 2000i can be generated and automatically sent to the wallet for testing purposes. See Settings > Add 2000i testnet.

Discovery

This uses WiFi P2P. The consumer selects a peer manually (-> in the future there will be automatic service discovery). Two devices then open a wifi direct group and start the Negotiation Protocol

Negotiation Protocol

The devices communicate with each other: how much data they want to share or consume and whether they can agree upon a price and duration.

ToDo: Add full protocol

Billing Protocol

The hotspot is created and the device providing the hotspot starts a new ServerSocket. Once the consumer is connected to the hotspot, they try to connect to the gateway and start the Billing Protocol.

(ToDo: add full protocol)

Payment

Every minute a bill is exchanged which contains information about used megabytes and duration(s). A IOTA FLASH CHANNEL is established between the two (-> in the future more than two parties will be supported). Every minute can be associated with a token transfer in the channel.

End

Every bill can contain a "closeAfterwards" flag, which ends the whole process with a short exchange of data for the consumer. The hotspot still has to attach the flash channel to the tangle.

Good to know

The WiFi P2P roles in a WiFi group are not fixed. Therefore, each time, either the future hotspot or consumer can act as server or client.

We wrapped the iota.flash.js with additional javascript bridges and connected them to the Jota - iota java lib. The javascript code for the flash channel is executed within J2V8.

Next big steps

Total: 17d