Giter VIP home page Giter VIP logo

filecoin-verifier's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filecoin-verifier's Issues

Refactor how we display pop-up messages to give full context

Currently we show the following for a transaction:
image

This can be confusing for users because:

  • It may not be clear what the associated t0 is for a t1 account (because we're finding it behind the scenes)
  • It may not be clear that the user has to go to the ledger to approve the action

I propose that to fix this we add a section that explictly states what they should see on their ledger (and prompt the user to check the ledger to confirm the transaction) to move forward. Something like:

  • Your transaction is to send: 1 TiB of Data Cap to t080 (the associated address for t1x...) from t1n... . Please confirm on your ledger this is correct to complete the transaction.

Analyze where to get info to show in frontend app

Analyze the information displayed on the different screens of the design.
Discern what is the info we can get from the current API (for instance to get the Remain Datacap we can get the list of verifiers and sum their datacaps), and think about how we could get the rest of the info.
Probably we can get some of this info directly from the state tree, but for some we will need additional mechanisms, like block explorer integration or store off chain data in a db

Refactor table for onboarding.

image

We should change this flow so (to start) we only have this table view for clients.

To make this usable, I think we shoudl add a "Use Case" column (between verifier and geography).
I think we should also take out the "email / github" columns - and instead embed this in the form. Perhaps we could have the last question say "choose how you'dl like to contact this verifier", and you can get a radial select - "Email", "Public Github Issue"... etc

Document the architecture about the automated datacap allocation for clients

NOTE: This design is complemented by: #26

How applications can on-board their users in Filecoin?

Introduction

The current Filecoin Registry application allows to the verifier to allocate some of their datacap to clients. This is okay from a functional point of view because there is a mechanism to distribute the datacap from the verifiers to the associated clients to that verifier.

Also there are applications like Slate wanting to provide storage capabilities to their users using Filecoin as substrate. To support that capabilities, all the new Slate users should be able to receive automatically a datacap allocation from the verifier associated with that application (Textile in this case).

The current manual flow supported in the Filecoin registry application is totally functional but is not optimal for supporting automatic datacap allocation.

The objective of this document is to describe the technical solution allowing to allocate datacap in an automatic way to clients/users of these Filecoin applications.

Architecture

Here we distinguiss different actors:

  • The VERIFIER (Textile for example)
  • The CLIENT running an APP (Slate for example)
  • The USERS of the APP (Slate users able to sign up in the website)

To support the level of automation required, there will be a micro-service (aka SERVICE) with the following characteristics:

  • An instance of this micro-service must be executed for each VERIFIER (like Textile) requiring to automate the datacap allocation for the APP USERS (like Slate users)
  • When a new USER is registered in the APP (like Slate or similar) using the APP sign-up process, this APP will send a datacap requests for the USER just registered to the SERVICE run by the VERIFIER
  • The SERVICE will authenticate the datacap request coming from the APP via pre-shared token (aka PSK). The PSK identifies to a specific CLIENT (Slate in this case)
  • The APPs will have a pre-allocation of datacap in the VERIFIER for all their potential USERS
  • The SERVICE will expose a REST interface in the following endpoint POST /verifier/client/datacap. The PSK will be sent in the HTTP Authorization header. This endpoint will request the following JSON payload as input:
    {
      "clientAddress": "t01032",
      "applicationId": "LIKE_SLATE_ID",
      "userId": "INTERNAL_USER_ID",
      "datetimeRequested": "2020-02-08T08:13:49Z"
    }
    
  • The SERVICE will authenticate the user via PSK
  • The SERVICE will authorize the user request checking in the internal configuration if there is the existing allocation and mapping between the PSK and the client address and the client total datap pre-allocation
  • In the internal configuration of the SERVICE this should have the key material related with the VERIFIER and allowing to interact with the Filecoin network via lotus node. Also the configuration will include a default datacap allocation for clients (1gb?). Each VERIFIER running the SERVICE depending on their needs can modify this configuration to allocate more or less datacap to new APP USERS.
  • The SERVICE checks the existing allocation of the CLIENT (in this case Slate) to validate if there is datacap available to share. If that's the case the service allocate the datacap for the user.
  • If everything goes right the SERVICE will return a response like this:
    HTTP 201
    {
      "clientAddress": "t01032",
      "applicationId": "LIKE_SLATE_ID",
      "userId": "INTERNAL_USER_ID",
      "datetimeApproved": "2020-02-08T08:13:49Z",
      "transactionId": "0x1234567890abcdeefgh1234567890abcdeefgh",
      "datacapAllocated": "1000000000000"
    }
    
  • If the request can't be processed the SERVICE will return a response like this:
HTTP 401 or 500
{
  "clientAddress": "t01032",
  "applicationId": "INTERNAL_APPLICATION_ID",
  "message": "The verifier can't distribute more datacap at this time"
}
  • As owner of the SERVICE, I can attestate the datacap requests writing the output of the previous method and writing into IPFS or similar
  • The technologies suggested for this service are Node.js and Express for the micro-service implementation
  • It's recommended to have the SERVICE as much isolated possible from a networking point of view

image

Show off chain metadata in frontend

According with the designs, the frontend should show more friendly information about the verifiers and the clients (names, alias, logos, urls, โ€ฆ) To accomplish this goal it should exists an off chain mechanism, like a db, to persist this kind of info, and be able to merge on the screen the on chain info with the related off chain info.

Probably the responsibility of filling or persisting this info is out of the scope of the frontend app

Ledger shows odd information in the transaction confirmation

Not sure if this is a bug, or can be resolved elsewhere - but when confirming the message in my ledger I noticed it never actually mentions the data cap.

The Value field seems to only refer to FIL, not to potential data cap - and theres nothin gin the Method or Params that indicates what amount of data cap I'm actually trying to send/

Modify Add verifier form to add metadata

Related with #39

When a Root Key Holder propose a new Verifier it should provide some metadata that will be stored

The formulary to propose a new verifier needs to include this fields:

  • Name/Organization
  • Location
  • email
  • Check of available for private request
  • Check of available for github assignations
  • Address
  • Datacap

When the root key holder push the "Propose Verifier" button, the app will send the message to the lotus node with the address and the datacap, and it will store the metadata

App should check to see if the latest version of Filecoin Ledger app is installed

As we recently discovered not having:

  1. The latest version of ledger
  2. Not having expert mode enabled

Will cause the ledger flow to not work. Is there a way of querying and surfacing these issues to a user in app?

At the least I think we can add that to the confirmation screen for the message (for the expert mode enabled) - but definitely should try and flag the ledger version thing if we can. A user won't be aware they're out of date (as I was unaware :( )

When choosing an address as a "Verifier", show the data cap associated with the address (if it exists)

As a verifier, I will want to action the decisions I've negotiated off chain, by allocating data cap. In the current flow, I do this by choosing an address and allocating data cap to the client in question.

However, without knowing the data cap associated with an address I will have to cycle through many addresses in order to find one that still has cap remaining. Furthermore, as I spend data cap, I won't know how much I have available to me (in total) across all my addresses.

image

Proposal here would be to add a second column that:

  1. Has a value, if a data cap is associated with the address
  2. Has a NaN if no data cap associated with it

Confirm if t1 addresses can also spend data cap

Whispers have said that in the most recent versions of lotus only t0 addresses can get a data cap.

If so, we need to ensure that we make that visible for users to verifiers such that they can request new data cap from verifiers.

Mainnet infrastructure deployment

It is necessary to deploy some components to support the mainnet deployment. This include:

  • Filecoin Registry backend (oauth bridge)
  • Filecoin Github bot

To accomplish this would be necessary:

  • Create AWS accounts from the root account provided by the Filecoin infrastructure team
  • Dockerize the backend service
  • Dockerize the github bot
  • Deploy the backend service in AWS
  • Deploy the bot service in AWS

Unable to properly spend data cap in app

Reproduction steps:

  1. As a root key holder, I can confirm that my address t01066 has 3GB of data cap to allocate as a verifier
  2. As a verifier, I attempt to allocate 2GB of data cap to t01046 (personal wallet)
  3. I get a message successful (and a message id that disappears)
  4. After waiting for a few minutes and refreshing t01046's allocated data cap has not incremented
  5. After checking t01046, I can see that t01066's data cap has not decremented.
    image

Define Request Datacap flow on github

Define how the request datacap flow could be implemented using github issues, and how it can be linked to the actions needed to be executed on the verifiers tool app

Issue allocating data cap

image

Unclear the exact root cause (using a Nano X).

  1. Log into app (1st address, t1y... has 9999+ YiB of data cap)
  2. Copy second address (2nd address, t1x... has no data cap)
  3. Attempt to verify my second address with 1TiB of data cap.
  4. See screenshot

Add error codes for bad transactions in allocating data cap

As noted here: #6

Because a bad transaction failed without sending an error back to the app, it was unclear that the transaction did not go through. We should implement proper error handling / UI displaying of those error messages in order to make it more obvious when there is an issue.

Infrastructure improvements

After having the bot & backend running in AWS, there are a few improvements to apply:

  • The backend should run behind a load balancer and use https
  • The backend should use environment variables for configuring the github credentials
  • The bot should use environment variables for configuring the github verifiers
  • The backend should have a proper health check
  • The github bot should have a proper health check

Allow clients to contact verifiers privately to request datacap

Currently the flows designed to request datacap force clients to open new issues on GitHub that would be visible to all Filecoin community

For some kind of clients this flow could be not convenience in order to keep privacy, so it's necessary to provide an alternative that allows clients to contact a verifier privately.

On the landing page for clients onboarding the frontend app will show a tab where the users can consult a list of verifiers available to private datacap requests

The information shown will be Name/Organization, Location, datacap remained, email address

In this screen, a text will explain to the users they can contact a verifier of their choice via email, providing some information: name/organization, address, datacap, ...

The verifier will receive the email from the client, check the information provided, asking for further info if needed.

If the verifier is ok with the info provided, it will manually verify the client using the application.

Also the verifier must write back to the client to inform about the decision. If the verifier rejects the request, the client should be informed about the reason of the rejection.

The verifier is responsible to keep and custody these emails with the clients for accountability reasons. Filecoin could request this emails to audit.

Modify backend service to specify root path

to allow to deploy different instances of the service under the same load balancer would be useful to allow to specify the root path of the service in the configuration.

also, the email service could optional depending on the config

Implement an Email Sender in backend Service

The backend service must exposes and endpoint that allows to send emails using a Provider set in the configuration.
This functionality is needed to allow users to request datacap contacting a verifier directly

Definition of root key holders governance

Definition of how the multisig governance is going to work.

  • How many addresses of the multisig need to confirm?
  • What is the process for adding a new rootkey?

As a result of this analysis we should have:

  • Answers to the main governance questions
  • Having a document describing that governance process

Configure new Github Repo for datacap request testing

Ih this moment, we are using one github repo for the datacap requests, https://github.com/keyko-io/filecoin-clients-onboarding, so different networks are using this repo, mixing test issues with actual issues in the mainnet.

It would be necessary to create a new repo, filecoin-clients-onboarding-test, that replicates all the configuration and functionality to be used for testing purposes.

For this, we will need:

  • Create the new repo
  • Set the proper permissions
  • Clone the content of the onboarding repo, including the issue template
  • Deploy a new instance of the bot ( https://github.com/keyko-io/filecoin-onboarding-bot ). Maybe it will necessary to modify the bot to allow to deploy different instances in aws
  • Set OAuth for frontend

Incoming brand Filecoin Pro and Verifier

Per feedback from JB, we're rebranding the name of the Verification process as well as the name of the "verifier role".

The latter is pretty much confirmed -> verifiers will be known as notaries on the network (verifier -> notary).

The former, is still being finalized.

We should update across the app to make sure we're consistent with this update!

Github initial application integration

Github - Frontend integrations

  • Setup a repository for registering the datacap on-boarding requests
  • Setup a new Github Oauth application
  • Setup a Github group working as authorization for verifiers
  • Setup a Github issue template for registering datacap resquests
  • Implement in the frontend the Github login
  • Fetch all the open issues from the project
  • Show in a basic table the issue content + labels + nickname of the github user who opened the request
  • If the user clicks the "Grant" button, remove any "state:XXX" label and add the "state:Granted" label. Close the github issue
  • If the user clicks the "More Info" button, remove any "state:XXX" label and add the "state:Further info needed" label. Add a comment with some text

When choosing an address, allow users to copy out the t1 addresses

When iterating through your list of addresses, you need to be able to copy out the t1 address in order to send Filecoin to that address to generate a t0 address.

This is at least required when getting addresses set up, as they must be on chain to request a data cap (Verifiers will need this to get data cap from root key holders)

Analyze the different apps/frameworks that acts on behalf of their clients

Analyze the needs of frameworks like Textile, Slate, etc, that distributes datacap among their clients, devs, apps, whatever.
The main point to overcome, bot not the only one, is the limitation of the current implementation of the verifreg actor to renew the datacap of an already verified client.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.