ariseid-lib
v1.0.6
Published
The Javascript library behind the AriseID blockchain-based identity protocol.
Downloads
5
Maintainers
Readme
AriseID Javascript Library
This is the javascript library for usage with the AriseID authentication protocol.
AriseID-lib creates a message on the Bitcoin blockchain and verifies its signature.
Implementing AriseID Into Your Application (For Partner Projects)
Add this line to your application's package.json dependencies:
'ariseid-lib': 'latest'
Or install it yourself as:
$ npm install ariseid-lib
Usage
This package will simply give your application the ability to create a custom message on the Bitcoin blockchain that will send to the AriseID network and verify the signature of the message through a customer's mobile device, therefore verifying the identity of the individual.
Challenge
To build a challenge, you need to initialize a Ariseid
object with a nonce
and a callback
.
var ariseid = new Ariseid({nonce:nonce, callback:callback});
nonce
is a random string associated with your user's session id.
callback
is AriseID callback URL, used to verify your customers via AriseID's network.
One example of callback could be v.ariseid.com/verify
. A callback cannot have parameters. By
default the POST call will be done using https
.
Once the Ariseid
object is initialized, you have access to the following methods :
ariseid.uri
This is the uri which will trigger the wallet when clicked (or scanned as QRcode). For instance :
ariseid://secure.arisebank.com/callback?x=987f20277c015ce7
If you added unsecure:true
when initializing the object then uri will be like :
ariseid://secure.arisebank.com/callback?x=987f20277c015ce7&u=1
To get the uri as QRcode :
ariseid.qrcode
This is actually a URL pointing to the QRcode image.
Verification
When getting the callback from the AriseID mobile application that is present with your customer, you must initialize a Ariseid
object with the received
parameters address
, uri
, signature
as well as the expected callback
:
var ariseid = new Ariseid(address:address, uri:uri, signature:signature, callback:callback);
You can after call the following methods :
ariseid.nonce
Return the nonce
, which would get you the user's session.
ariseid.uriValid()
Returns true
if the submitted URI is valid and corresponds to the correct callback
url.
ariseid.signatureValid()
If returns true
, then you can authenticate the user's session with address
(public Bitcoin
address used to sign the challenge).
Integration example
AriseID JS Boilerplate: https://github.com/arisebank/ariseid-boilerplate
Live AriseID demonstration: http://bitex.arisebank.network:8081
In the Wild
The following projects use ariseid-lib
If you are using ariseid-lib in a project, app, or module, get on the list below by getting in touch or submitting a pull request with changes to the README.
Startups & Apps
Author
Jared Rice Sr. [email protected]