GithubHelp home page GithubHelp logo

eoscostarica / lifebank Goto Github PK

View Code? Open in Web Editor NEW
15.0 8.0 16.0 15.44 MB

An incentive-based EOSIO blockchain solution for blood donations :heart:

Home Page: https://lifebank.io

License: MIT License

C++ 4.71% Dockerfile 0.28% JavaScript 90.66% Makefile 1.20% HTML 0.26% PLpgSQL 0.48% Shell 2.36% CSS 0.04%
eosio-blockchain blood-donation blockchain-technology

lifebank's People

Contributors

adriexnet avatar angelocg97 avatar code-factor avatar codefactor-io[bot] avatar dloynaz avatar edgar097 avatar edgarithm avatar jeanvegad avatar justincast avatar kecoco16 avatar kriskoin avatar kuronosec avatar ldrojas avatar leisterfrancisco avatar mohammadufo avatar rubenabix avatar stavares843 avatar steph222 avatar tetogomez avatar xavier506 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lifebank's Issues

Setup WebApp

Use the webapp-boilerplate to create a new React Web Application for frontend.

What happens after tokens are in sponsors accounts ?

In order to keep token scarcity and keep lifebanks from staying at top urgency level at all times

  • Lifebanks can have a max supply of tokens issued, so they can run out of tokens issued, however they can recover tokens from sponsors

-sponsors can send the tokens they get from doners to the lifebank with the highest blood urgency.

for example: if there is a can area with a disaster then sponsors can send their tokens to that clinic to help with relief

If a life bank has a surplus of tokens they can send tokens to another lifebank that needs it more

KEOSD Server Wallet

Keosd runs on the backend server to server as a signature provider for users

users can access their wallet passwords using a 4 digit PIN

Wallet table permission
image

Icons for Map

We need two icons for displaying locations on a map.

  • LifeBank (Donation Center) Icon in SVG
  • Sponsor (Small Business) Icon in SVG

Right to be Forgotten

provide users with a way to erase all of their records (similar to revoke)

they should be able to do this prom their profiles

@xavier506 is this on the database?

Login

As an user I want to login using my account name and secret provided in the signup process

user profile

As a logged in user I should see a page after I log in with a summary of my account (including token balances) and the actions I can perform

Attributes

  • accountname
  • community name
  • fullname
  • token balance
  • informed consent status
  • toggle consent
  • tx history?

Create Logo

Create a project logo and icons for the app

Implement refresh token

Tokens should be automatically refreshed if a user is active so that thetr session dosen't expire.

Community Smart Contract

These are the community smart contract actions :

Create a community (blood bank)

A community represents one or more blood banks in a given region.

A community has :

  • token symbol name
  • country

A community must have at least one clinic, upon creating a community you must then register a clinic.

Clinics Verify Blood Donation (mint and transfer tokens)

Clinic Account must verify that action of donating blood was completed , once a donor donates blood he/she will receive a token

donor account type receives token from clinic account type and may ONLY transfer token to sponsor account types.

Token Flow:

Clinic -> User -> Sponsor -> Savings

A clinic has :

  • clinic name
  • clinic description
  • clinic location
  • clinic phone number
  • clinic schedule
  • immunity test?
  • blood urgency level

The community is composed of the clinic the donors , and the small business that sponsor the community.

Note: maybe clinics can then add new clinics within the same community?

Sign Up

Users sign up on the register page.

The register page creates a blockchain account and should help handle key management, all users need to remember is a an account name and 4 digit PIN

Register as a donor (individual person)

donors must have:

  • name
  • accountname
  • Informed Consent

Clinic will manage all personal data and no personal data is stored on blockchain.

Register as a sponsor (small business)

  • sponsor name
  • covid impact
  • description of benefit
  • sponsor website
  • telephone
  • type
  • schedule

Inspired by the bespiral community contract
https://github.com/cambiatus/contracts/tree/master/bespiral.community

Captcha for registrations

In order to prevent massive amounts of signups from non-human blood donors we should have a captcha on signup

New account creator

As a donor or sponsor I should be able to register an account in the blockchain which I can access with a PIN number

Attributes for Sponsor and donor accounts are different

Backend service generate key pairs for new account, should create account on the blockchain , store keys in wallet and wallet password and pin in the postgres database.

Account Geo-location Table

Create a Database table to persist location data for easy query from frontend component

Tenemos que hacer una tabla que tenga:
name
latitude
longitude
type -> ENUM(SPONSOR | LIFE_BANK)

Eligibility criteria

Once the potential donor user (PDU) visits the community donation center (CDC), they will need to complete the eligibility criteria for the specific donation. This will be handled as usual in person at the CDC before a blood donation. The donation center will also be able to post pre-requisites on their profile page so the potential donor can decide if they meet the criteria before visiting.

Simplify donor account names

account names are being generated from a prefix + random letters

for example donor + random string made up from a-z, 1-5

In order to save ram and avoid asking users for theirfull names why not ask them for a 5 letter handle or username

so as a user I could choose my user "name" to be bobby and then the account would be donorbobby

This gives donor users a prefix and a suffix that they choose so that name along with their secret is all they need to remember in order to log in

We could shorten it to `don` para que suene a lo tico ... `doncostarica`  ๐Ÿฅ‡ 

informed consent modal

  • Informed Consent Smart Contact
  • Each user must accept terms of service
  • Users must also have a way of revoking their consent.
  • Ricardian Clauses must be included

LifeBank Tx reference number to memo

As a Clinic I want add a note to my token transfer so I can add a reference number to relate to my system and make sure that it's related to a real donation. Thus making the process more secure.

Account recovery

If users choose to leave an email address they can then recover their accountname or password.

Users can also choose e to log in with either email or account name once an email is set

LifeBank emphasises user experience over security If a user wants to recover their own private key they can also choose to do so. And interact with the smart contracts some other way.

Email address is not stored on the blockchain , only on our internal database (users should know this)

image

  • Code desing to email
  • Generate and encripted tempSecret
  • Update tempSecret
  • Create actions and querrys to change password
  • Validate current password and change to new password
  • Coding design recovery password page
  • Send and coding design email to change password when is ok
  • add validations to fields

Account Recycling

If a user signs up and dosent use their account to donate blood in a time frame (say 1 month) then the account name can be assigned a new set of private keys and new users can use that account in order to avoid spending resources on accounts that are not being used

  • Technical stuff
  • UX stuff
  • Content stuff

Informed Consent

Medical procedures are inherently risky users must be informed and consent to the service

Users must also have a way of revoking their consent.

Each user must accept terms of service

once a users account is created and PIN is generated the user must sign a transaction declaring informed consent to use the app.

Informed consent table must have :

  • data owner - doner account name
  • data viewer - clinic account name
  • hash - contract hash (helps to update version of contract agreed to)
  • ricardian clauses

LifeBank dashboard

Life banks should have a dashboard with their token balances, they should be able to set their blood demand levels etc

revoke informed consent

As I user I should be able to toggle consent from my profile page.

As a user I should also have a way of erasing all my data and recovering the RAM only if a user has donated at least once.

Users can also request for their private keys once they have donated (via email? or on screen?) and revoke consent so that lifebank no longer holds their private keys

Produce Video

Create a 3 min video as a deliverable for the hackathon project

Format Ricardian contracts

image

  • Remove duplicate titles

  • Add icons

  • Add ABI hash so it is visible for users

  • Add clear explanation of what a Ricardian contract is

  • add link to contract ABI in block explorer

Frontend Wallet integration

Users can choose to use the native eosio wallet provided by lifebank or they can optionally use the wallet of their choice

Register Page

Users sign up on the register page.

The register page creates a blockchain account and should help handle key management, all users need to remember is a an account name and secret

Register as a donor (individual person)

  • name
  • accountname
  • Informed Consent
  • secret

Clinic will manage all personal data and no personal data is stored on blockchain.

Register as a sponsor (small business)

  • sponsor name
  • covid impact
  • description of benefit
  • sponsor website
  • telephone
  • type
  • schedule

Register as a sponsor

Users sign up on the register page.

The register page creates a blockchain account and should help handle key management, all users need to remember is a an account name and secret

Register as a sponsor (small business)

  • sponsor name
  • secret/password
  • covid impact
  • description of benefit
  • sponsor website
  • telephone
  • type
  • schedule
  • latitude and logitude

Ricardian Contracts

Write ricardian clauses for the consent2life along with lifebankcode and lifebankcoin

These contract clauses must be shown to users when they accept

Blood Demand Level

Slider component for LifeBanks to set the Blood Demand Level

Green 1 - token is issued to each doner
Yellow 2 - tokens issued to each doner
Red 3 - tokens issued to each doner

receipt modal

Once a token is transfers users should see a recipt . This receipt is made up of a blockchain transaction.

This would be a great component for our eoscr-components storybook , as we can use it to display transaction results for any EOSIO TX.

Token Smart Contract

These are the following token contract actions:

Create a new currency

When a community is create a new EOSIO Token is configured.

  • max supply
  • expiration

Mint new compatible tokens

  • Tokes must only be issued by clinics
  • Tokens can only be issued for the same user once every 3 months.

Blood Demand Level

  • Green 1 token is issued to each doner
  • Yellow 2 tokens issued to each doner
  • Red 3 tokens issued to each doner

Max yearly supply of tokens per clinic to avoid abuse of bloood demand level.

(should be a constant somewhere in the code)

Transfer compatible tokens between users.

  • clinics can only transfer to doners

  • doners can only transfer to sponsors

  • sponsors retain tokens as savings , savings may be useful in a future version of the app.

    ACTION transfer(eosio::name from, eosio::name to, eosio::asset quantity, std::string memo);

Optional:

Set expiry options to a given token

ACTION setexpiry(eosio::symbol currency, std::uint32_t expiration_period, eosio::asset renovation_amount);

Inspired by the Cambiatus token contract: https://github.com/cambiatus/contracts/tree/master/bespiral.token

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.