0.3.3 • Published 4 years ago

cashid v0.3.3

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Javascript implementation of CashID by Jonathan Silverblood

Quick Pitch

This is a convenient way to login and sign up to websites using Bitcoin Cash as your "identity".

Description

CashID is an open protocol that allows secure authentication based on the public key cryptography infrastructure that is currently present in the Bitcoin Cash ecosystem. Each user can prove to a service provider that they control a specific Bitcoin Cash address by signing a challenge request, as well as provide optional metadata.

Installation

grab from NPM

  npm i cashid

Usage

import CashID from 'cashid'; // or const CashID = require('cashid');

const cashid = new CashID();

// or if using your own server
// const cashid = new CashID(domain, path);
// domain = something.com  (no http prefix)
// path = /api/auth  (endpoint that will receive POST json data)

const uri = cashid.createRequest(action, data, metadata);

// action is an optional string, ie: 'login'
// data is an optional string, ie: 'newsletter' or '123-123-123'
// metadata is an optional object, ie:
//  {
//      required: {
//        identity: ['name', 'family'],
//        position: ['country'],
//        contact: ['email']
//      },
//      optional: {
//        identity: ['age', 'gender'],
//        position: ['city']
//      }
//  }

return uri;

// uri will look like

// cashid:example.com/api/auth?a=register&d=newsletter&r=i12p1c1&o=i45p3&x=142341090

with the uri, you can generate a QR code for the user to scan, or see a client side badger-wallet implementation

The identity manager would read the cashid uri, and send a JSON POST request to the endpoint.

You would validate the object on the server side and return true as the response if valid.

Available Methods

cashid.validateRequest(responseObject)

cashid.parseCashIDRequest(requestURI)

cashid.createRequest(action, data, metadata)

Resources

CashID spec

CashID demo

0.3.3

4 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.51

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago