Introducing TUNA

TUNA, short for Tunnel Using NKN for any Application`, is a platform built on top of NKN that allows everyone to turn any network based application into service and monetizes based on usage. A few concrete examples:

  • You have an under-utilized computer, sitting at your home or on the cloud. You can install a proxy server on the computer as well as tuna, and provide proxy service through tuna. People who need a proxy can then find your service through tuna, use your computer as proxy server, and then pay you based on the bandwidth usage.
  • You have a game pc sitting at your home and you don’t play games 24x7. You can install moonlight server on the pc as well as tuna, and provide realtime game streaming service through tuna. Someone nearby can find your game streaming service through tuna, play games on your awesome pc remotely, and pay you based on time or bandwidth usage.
  • Your laptop are behind the router, but you want someone to temporarily access a web server hosted on your laptop to checkout your latest progress on the web app real quick. You can use tuna to find a computer with public accessible IP address to tunnel the traffic for you, and the rest of the world can access your local web server using that public IP address.

Above are just a few examples, and there are a lot more things that can be done with tuna. Actually, any network based application, as long as it’s using TCP or UDP to communicate, can be tunneled through tuna. It’s really limitless.

From tech’s perspective, tuna, at its core, has 3 components:

  1. Service discovery and negotiation using NKN’s pub/sub
  2. Generic tunnel connecting tuna entry and tuna exit
  3. Off-chain payment channel using NKN’s NanoPay

From user’s perspective, tuna consists of 2 modes: entry and exit. Typically if you want to find a service to use, you just need tuna entry; if you want to provide a service, you just need tuna exit. There is, however, a reverse mode where you can use tuna exit to expose or hide your service by asking a tuna entry to be your reverse proxy.

When tuna entry starts, it will get services specified in config, and automatically find tuna exits providing those services using NKN’s pub/sub function. Then it will select and connect to eligible tuna exits based on both IP geolocation and price. After that, you can use the services you choose in config as if they are running on localhost. For example, to use https proxy over tuna, you just need to put 127.0.0.1:[port] as your https proxy address and you are good to go.

Currently tuna is still in the development stage and it’s lack of GUI for now. You would need to use command line in order to try it out. But in the future we should be able to see easy to use GUI application built on top of tuna for everyone.