Giter Site home page Giter Site logo

iotgod / pegasus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from allemanfredi/pegasus

0.0 1.0 0.0 3.47 MB

Pegasus is a chrome extension that implements a wallet for the IOTA cryptocurrency. In addition, Pegasus injects the iotajs library allowing developers to interact with IOTA ecosystem without paying attention on how to keep the seed safe.

License: GNU Lesser General Public License v3.0

JavaScript 93.02% HTML 0.60% CSS 6.38%

pegasus's Introduction

PEGASUS

Pegasus is a chrome extension that implements a wallet for the IOTA cryptocurrency. In addition, Pegasus injects the iotajs library allowing developers to interact with IOTA Tangle without paying attention on how to keep the seed safe.

 


 

⚡ Installing

git clone https://github.com/allemanfredi/PEGASUS.git
cd PEGASUS
yarn init
yarn build

 


  After having built the application, it needs to be loaded on chrome.

❗ How to install Chrome extensions manually

  • Go to chrome://extensions/ and check the box for Developer mode in the top right.
  • Click the Load unpacked extension button and select the build folder for your extension to install it.

 


 

🌱 How the seed is stored?

The seed is saved in the local storage of the browser, encrypted (through aes256) with the login password that a user chooses during the wallet initialization phase. To make it more difficult to find out, the password must meet the following requirements:

  • Must contains at least 8 characters
  • Must contains at least 1 uppercase character
  • Must contains at least 1 lowercase character
  • Must contains at least 1 symbol
  • Must contains at least 1 digit

Of this password only its hash is saved in the local storage.

During the login phase, a user will have to enter a password, which will be compared with the hash specified above. if the two hashes match (the password is correct), the wallet loads the seed from the local storage (encrypted), decrypts it with the password just inserted and keeps it in memory together with the plain text of the password. If the wallet shows a period of inactivity of at least 15 minutes, delete the value of the variables relating to seed and password. In this way, the seed decryption key is not saved anywhere except in the mind of the user or in the RAM for only a limited period of time.

A user also has the ability to export the seed, in order to do so, first he will have to enter the login password which will always be compared with the hash (of the password) saved in the local storage. In this way, if a user loses the access password (or if he forgets it), if he has exported the seed he will be able to restore the wallet

 


 

💉 iota-js injection

if (window.iota) {
    //grant permission
    const permission = await window.iota.connect()

    //if user enabled
    if (permission.connected) {
        const bundle = await window.iota.core.prepareTransfers(transfers)
        console.log(bundle)
    } 
}

Injection Result

window.iota
{
    bundle: ...
    bundleValidator: ...
    checksum: ...
    connect: ...
    converter: ...
    core: ...
    extractJson: ...
    getCurrentAccount: ...
    getCurrentProvider: ...
    mam: ...
    transaction: ...
    unitConverter: ...
    validators ...
}

The functions subscribe and listen within mam.client.js are not available (through injection) yet.

 


 

🔨 Work In Progress

  • pegasus-ledger-trampoline: Since it is not possible to access Ledger Nano S from a Google Chrome extension, i implemented a workaround: injecting an iframe to the background page of the extension, (which is hosted thanks to gh-pages here). In order to work correctly, the iframe must run under https (since U2F requires SSL). [30%]

pegasus's People

Contributors

allemanfredi avatar

Watchers

James Cloos 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.