Code Monkey home page Code Monkey logo

universalloginsdk's Introduction

CircleCI

Ethereum UniversalLoginSDK

UniversalLogin is a design pattern for storing funds and connecting to Ethereum applications, aiming to simplify new users on-boarding.

This repository is a monorepo including sdk, relayer, smart contracts and example. Each public sub-package is independently published to NPM.

Disclaimer

This is a work in progress. Expect breaking changes. The code has not been audited and therefore can not be considered secure.

Technical concepts

Technically Universal Login utilizes four major concepts:

  • Personal multi-sig wallet - a smart contract used to store personal funds. A user gets his wallet created in a bearly noticeable manner. The user then gets engaged incrementally to add authorization factors and recovery options.
  • Meta-transactions - that give user ability to interact with his wallet from multiple devices easily, without a need to store ether on each of those devices. Meta-transactions, also allow paying for execution with tokens.
  • ENS names - naming your wallet with easy-to-remember human-readable name
  • Universal login - ability to use the wallet as authorization layer to numerous web applications dapps

Structure

Packages maintained with this monorepo are listed below.

  • Contracts - all contracts used in this project
  • Relayer - allows to interact with blockchain
  • SDK - easy way to communicate with relayer by http protocol
  • Example - example app, which shows how to use SDK

Internal dependencies

The diagram below shows the internal dependencies among the Universal Login subsystems and the relevant external dependencies.

Diagrams

The external interfaces present in the Universal Login system are identified by the lollipop use symbol:

  • <<IF-6>> RELAYER HTTP JSON IF: this interface defines an off-chain remote API for ERC #1077 and #1078
  • <<IF-9>> ETH JSON-RPC IF: this interface is the Ethereum JSON-RPC API for the on-chain execution

The internal interfaces defined within the Universal Login system are identified by the arrow use symbol. The main ones are:

  • <<IF-2>> UL SDK IF: the JS applications using Universal Login shall be based on this library interface to conveniently attach to the Relayer subsystem and route their meta transactions
  • <<IF-4>> ERC1077 SIG IF: this interface is a message hash and signature JS facility API for ERC #1077
  • <<IF-5>> ERC1077 IF / ERC1078 IF: this interface is made up of ERC #1077 and #1078 smart contracts ABI

Quick start

Hacking

To start hacking around go to tutorial. To just see example in action follow the next section.

Quick example start

Before running example, you have PostgreSQL installed, up and running. You might want to check database configuration in file universal-login-example/src/relayer/knexfile.js and make sure your database is configured correctly.

To install dependencies and build projects run following commands from the main project directory:

yarn && yarn build

To run example:

cd universal-login-example
yarn dev:start [hostAddress]

with hostAddress being your machine address where the Universal Login service will be accessible via HTTP (default is localhost, only local browser will work).

manual option

Contributing

Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct and contribution policy.

Before you issue pull request:

  • Make sure all tests and linters pass.
  • Make sure you have test coverage for any new features.

Running linting/tests

You can run lint via:

yarn lint

You can run tests:

yarn test

You can ran full clean:

yarn clean

And you can emulate full CI process by:

yarn clean
yarn
yarn ci

License

Universal Login SDK is released under the MIT License.

universalloginsdk's People

Contributors

justynabroniszewska avatar marekkirejczyk avatar kyrrui avatar alexvansande avatar alexchorman avatar giulio2002 avatar vanjan avatar yaram avatar

Watchers

James Cloos avatar Liberalite avatar

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.