npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ethereum-login

v0.0.4

Published

A simple front end and back end for web3 oauth

Downloads

4

Readme

ethereum-login

Foreward

Typically, websites and apps use email addresses as digital identifiers in apps. These are paired with passwords or with OAuth to validate ownership. This creates many headaches including password management (bad for users and for developers, great for hackers) and including reliance on third party servers.

However, it is now easy to ditch emails and passwords and instead provide a more elegant, safer, and simpler option. Many more online users are creating Ethereum accounts every day. These accounts can 'securely sign' in order to prove their identity using a web3.js function called personal_sign. This can be used as the basis for an authentication system for websites; one that doesn't even need to talk to the blockchain or to an API but can rely simply on mathematics (similar to SSL key authentication but managed by metamask).

Intro

Allow users to authenticate themselves to your websites and apps without relying on passwords and without relying a centralized corporation such as Google, Twitter or Facebook. Instead, users can use an Ethereum account that they control.

Those users will need to use a plugin such as Metamask or a browser such as Mist in order to authenticate themselves in this way. Any web3 enabled browser will work. There are many advantages including:

  • No need to locally store user passwords, only sessions
  • No need to include 'reset password' functions
  • No need to store API keys for Oauth services
  • No reliance on an external corporation whose API could go down at any time, grinding your app to a halt

Codepen for buttons: https://codepen.io/admazzola/pen/LOgpOV

Sample implementation: (client side only) http://starflask.com/ethereum-login/index.html

Fundamentals

This methodology uses a button to call the web3 'personal sign' function. This sends a challenge to the browser (metamask/mist) and a popup will appear for the user which they can choose to Accept/Sign. Their response can be checked against your challenge in order to validate that the user controls the private key for their given public address. This validated public address can be used as a persistent identity for that user across your application.

Why use Ethereum for Authentication

  1. Passwords are a major security flaw of the modern web. Most website developers do not implement password storage properly i.e. do not salt or encrypt passwords which leaves treasure troves of plaintext passwords for hackers.
  2. By using central authorities for OAuth, you and your users and freely sacrificing all privacy and usage rights to that authority. This is a decentralized solution so the user remains in control of their own data (which sites they have logged in to.)
  3. This does not require running an Ethereum node on your server, but you can. This only uses offline ECDSA mathematics to validate that the client controls the private key to a given public address. The private key is never revealed by the client and should never be revealed under any circumstance.

Based off of this: https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527

This is compatible with metamask 3.12.0

(This project is not directly affiliated with the ethereum foundation, it is open source.)

Note: This has not undergone security analysis yet. The web3 protocol is also still under development.