project-rainstorm / rainstorm

The easiest way to own your cloud. Your data. Your cloud. Rainstorm.
Other
10 stars 5 forks source link

[AUTH] Implement Premium License Keys #12

Closed nullcount closed 4 years ago

nullcount commented 4 years ago

We want to allow access to premium features. Similar to the microservice for generating backup access tokens (see #11), there should be another service to generate and validate premium license keys.

My initial thoughts are to leverage ethereum addresses for this purpose. The central server maintains an Ether wallet. Using the xpub, we can generate unlimited unique addresses. This is a one-way function. The owner of a premium license has a unique ether address which they input in their node to unlock premium features.

I want to use ether addresses because I can imagine a future where the device users own does not even house their data, but rather it is a storj node and their data is hosted entirely on the tardigrade public cloud. In this model, each node will earn a share of STORJ tokens deposited to the ether address which is their premium key.

In this way we can easily calculate the earning from a particular node and use those earnings to allocate space for that node on the public cloud. This model allows users with good internet to potentially earn their data/storage usage rather than pay for it.

Even if we don't take it that far, using eth addresses should be easy and simple enough for this purpose.

WillHHippo commented 4 years ago

When you get a chance, let's break this down. This should be it's own project.

nullcount commented 4 years ago

The main Premium features are:

Backups and VPN will have recurring costs. I don't think its sustainable to charge a 1-time fee for a license and provide unlimited access. Perhaps keys expire after a year or it's a month-to-month subscription.

I think a yearly license is easier to do, so for that we'll need an authentication server API that:

Not sure if we can strictly enforce automatic updates to premium users only. Since any user can auto update with command line, they can just as easily write a script to update automatically for them or edit the code to enable the 1-cick update in the GUI.

It would be easy to bypass, but for normal users, a simple backend check if the license is valid before rendering the update button would work. So the API should also:

nullcount commented 4 years ago

This server can also host our drop-cloud.com (or whatever) webpage. The marketing site where they learn about the product and download the image.

nullcount commented 4 years ago

Generating addresses is pretty easy. We can create an Ether wallet then export the xpub to use on the auth server. Using the xpub, we can generate unlimited addresses: https://ethereum.stackexchange.com/questions/61969/how-to-generate-address-from-xpub-in-js

The addresses will be the license keys. This way, the private key can be stored in cold storage to protect funds. The xpub will be stored on the server and needs to be protected since anyone with the xpub can generate license keys. Each premium node can use their license an address to send us money. This gives us options for creative funding models in the future AND gives us a pretty solid key generation scheme today.

nullcount commented 4 years ago

Moving this to the auth repo. Closing.