Skip to content

KeplerJS Javascript library for interacting with Bench Network's Kepler Service.

Notifications You must be signed in to change notification settings

benchlab/KeplerJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

benOS Logo


KeplerJS

KeplerJS Javascript library for interacting with Bench Network's Kepler Service.

What Does KeplerJS Do?

KeplerJS provides a library for the following:

  • Creating / Retreiving Kepler Account ID Objects
  • Creating / Retreiving Kepler Explorer ID Objects
  • Creating / Retreiving Kepler Neutron ID Objects
  • Creating / Retreiving Kepler Website ID Objects
  • Creating / Retreiving Kepler Nova ID Objects
  • Creating / Retreiving Kepler Aero ID Objects

Quick start

Using npm to include keplerjs in your own project:

npm install --save keplerjs

You can also use yarn to include keplerjs in your own project:

yarn add keplerjs

For websites and web browser, we utilize Bower. It exports a variable KeplerJS. The example below assumes you have keplerjs.js relative to your html file.

<script src="keplerjs.js"></script>
<script>console.log(KeplerJS);</script>

Add KeplerJS To Your Application

To use KeplerJS within your next Bench-based dApp or application, follow these instructions:

  1. Install it using yarn:
yarn install keplerjs
  1. Regular Import of KeplerJS
var KeplerJS = require('keplerjs');

{IF ES6} 3. ES6 Import of KeplerJS

import KeplerJS from 'keplerjs';

Use KeplerJS Inside Your Website

  1. Install it using bower:
bower install keplerjs
  1. Include it in your webpage:
<script src="./bower_components/keplerjs/keplerjs.js"></script>
<script>console.log(KeplerJS);</script>

If you don't want to use install Bower, you can copy built JS files from the Kepler-Bower Repository.

Add KeplerJS Inside Your Website With CDNJS

  1. Add the follow code to your root HTML file using the Kepler-CDNJS-Library
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchlabs/1.0.0/keplerjs.js"></script>
<script>console.log(KeplerJS);</script>

To Develop On KeplerJS

  1. Clone via the KeplerJS GitHub Repository
git clone https://github.com/benchlab/keplerjs.git
  1. Yarn install all KeplerJS Dependencies
cd keplerjs
yarn

KeplerJS Reference

Below is information related to the usage of KeplerJS within your application.

Kepler Account UID Attributes

Attributes:
Key: uuid: Key value UUID for KeplerAccount ID Object, generated via KeplerUUID library.
account_uuid: RFC-compliant v4 Account UUID for KeplerAccount ID Object, generated via KeplerUUID library.
id: SHA256 hash of the account_uuid
wallet_addr_sec: ed25519 secret key, derived from seed, which derives from id
wallet_addr_uni: ed25519 universal key, derived from wallet_addr_sec
sec_key: ed25519 secret key, derived from wallet_addr_sec, which derives from id
uni_key: ed25519 universal key, derived from sec_key
nonce: SALSA20 hash of uni_key
hex_key: BASE64 of Account ID Object UUID Key
klob: klobs are blob data related to the KeplerAccount ID Object UUID. This could be the benOS-related node that the Account UUID was generated from. Klob-based data generated with Account UUIDs can differ, depending on the circumstances surrounding the generation of the Account UUID.
klob>uuid: Reference of the uuid
klob>account_uuid: Reference of the account_uuid
klob>time_created: Time that the KeplerAccount ID Object was created
klob>benchx_uuid: Only included and auto-generated, if generated via benOS-based device

Creating New KeplerAccount ID Object

new KeplerAccount(keplerUuid, accountUuid, accountId, walletAddrUni, walletAddrSec, uniKey, secKey, nonce, hexKey, klob)
Source: node_modules/keplerbase/src/kepleraccount.js, line 17

Parameter Type Description
keplerUuid string Key value UUID for KeplerAccount ID Object
accountUuid string RFC-compliant v4 Account UUID for KeplerAccount ID Object
accountId string SHA256 hash of the accountUuid
walletAddrSec string ed25519 secret key, derived from seed, which derives from accountId
walletAddrUni string ed25519 universal key, derived from walletAddrSec
secKey string ed25519 secret key, derived from walletAddrSec, which derives from accountId
uniKey string ed25519 universal key, derived from secKey
nonce string Salsa20 nonce to protect from replays
hexKey string BASE64 of Account ID Object UUID Key
klob array Kepler blob data related to KeplerAccount ID Object creation
klob > keplerUuid array-element Reference of the keplerUuid
klob > accountUuid array-element Reference of the accountUuid
klob > time_created array-element Time that the KeplerAccount ID Object was created
klob > benchx_uuid array-element Only included and auto-generated, if generated via benOS-based device

Example Response via console.log

uuid: 2fd305ea-912c-405b-bfed-7d98143d0d56 // Key value UUID for KeplerAccount ID Object, generated via `KeplerUUID` library.
account_uuid: e4f48839-db29-47c4-abc9-7e33dada1858 // RFC-compliant v4 Account UUID for KeplerAccount ID Object, generated via `KeplerUUID` library.
id: 3ebb0942f24e02c2f69d7d79bf4ace02645d42d247336738c0777084826aaac0 // SHA256 hash of the `account_uuid` 
wallet_addr_sec: upzjknOyoc8EzJSIk/6jyOGLIrS4mpml/hcQoMOaNDE= // ed25519 secret key, derived from seed, which derives from `id` 
wallet_addr_uni: VYBioijzebrLwDX2K8wkMRLD98iRjbatQV4guXw2iDw= // ed25519 universal key, derived from `wallet_addr_sec`
sec_key: ThO6DslXOwZucznK/E0jjUNYR3tw2sySjgW6HXjmd6wkapkxYvMLH7XCFamlYgd4K2YZ/1WA/wRD6Pb/Pc9nLg== // ed25519 secret key, derived from `wallet_addr_sec`, which derives from `id`
uni_key: JGqZMWLzCx+1whWppWIHeCtmGf9VgP8EQ+j2/z3PZy4= // ed25519 universal key, derived from `sec_key`
nonce: 0fef761a1f95b18948412e521a37ee49369d46b0025dd71cfd5d246c9744f3d1294eeab44acb0f320352f82a29dca4a2f503468098a99f4496c997fbe891846a // based on uni_key
hex_key: MmZkMzA1ZWEtOTEyYy00MDViLWJmZWQtN2Q5ODE0M2QwZDU2 // BASE64 of Account ID Object UUID Key 
klob: { 
uuid: 2fd305ea-912c-405b-bfed-7d98143d0d56, // Reference of the `uuid` 
account_uuid: 'e4f48839-db29-47c4-abc9-7e33dada1858', // Reference of the `account_uuid`
time_created: '2018-05-20T07:11:22.526Z', // Time that the KeplerAccount ID Object was created
benchx_uuid: 'b33a4dcd-7057-4618-a635-9ad476cb45c3' // Only included and auto-generated, if generated via benOS-based device
}

KeplerJS Testing

To run all tests:

gulp test

To run a specific set of tests:

gulp test:node
gulp test:browser

What Is benOS

benOS is a decentralized operating system, originally based on Linux, uses some design strategies from RedoxOS and even some design concepts from OpenStack, Ethereum and EOS. Although we utilize some of their design strategies, benOS is completely custom from a codebase perspective.

benOS has many components that make the wheels turn. Below are a list of those components:

Other benOS Network Components

Nova - Global Decentralized Hypervisor For The Bench Network
Kepler - Global Decentralized Identity Management For The Bench Network

  • KeplerJS - Javascript Library For Working With Kepler Service
  • KeplerUUID - Javascript Library For Creating Kepler UUIDs
  • Kepler-CLI - CLI For Generating Kepler ID Sets
  • KeplerBase - Base Javascript Library For The Kepler Service

Designate - Global Decentralized Naming Service For The Bench Network
Flutter - Global Decentralized Image Service For The Bench Network
Neutron - Global Network Creation & Management For The Bench Network

  • BenchCore - Core Decentralized Network Component For The Bench Network
  • BenchChain - Neutron's RootChain On The Bench Network

Aero - Global Object Storage Distributor & Manager For The Bench Network
Explorer - Global dApp Distributor, Manager and Viewer For The Bench Network
benFS - benOS FileSystem
dappJS - dApp Development Kit For The Bench Network
Mercury - benOS Graphical User Interface
Asteroid - benOS Native Programming Language
Meteor - benOS Native IDE for dApp Development

benOS Core Components

benOS-Microkernel - benOS Microkernel
benOS-Bootloader - benOS Bootloader
ParseArgs - benOS-based Argument Parsing
X - benOS Graphical User Interface

NOTE: There are other pieces under development as well, as our development team grows.

CREDITS AND ATTRIBUTES

benOS may use software from other open source libraries. For a full list of software credits and acknowledgements, please visit https://github.com/benchlab/benOS/blob/master/ATTRIBUTES.md. The original LICENSE or LICENSES for the originating software(s) and library or libraries that were used to create KeplerJS are still active, although, considering this Bench software and the softwares and/or libraries/packages it is imported into may be used to issue illegal securities, the BENCH LICENSE is activated for this purpose. This does not take away the credits, disable the originating LICENSE or in any way disown the original creation, creators, developers or organizations that originally developed many of the libraries used throughout Bench's large array of software libraries packaged together for the purposes of building a decentralized operating system (benOS)

VERSION

1.0.0

LICENSE

BENCH LICENSE
For KeplerJS

Copyright (c) 2018 Bench Computer, Inc. [email protected]

Permission to use, copy, modify, and distribute this blockchain-related software or blockchain-based software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE USAGE OF THIS BLOCKCHAIN-RELATED OR BLOCKCHAIN-BASED SOFTWARE WITH THE PURPOSE OF CREATING ICOS OR "INITIAL COIN OFFERINGS", UNREGISTERED SECURITIES SPECIFICALLY IN THE UNITED STATES OR IN OTHER COUNTRIES THAT HAVE A LEGAL FRAMEWORK FOR SECURITIES, IS PROHIBITED. BENCH FOUNDATION, LLC RESERVES THE RIGHT TO TAKE LEGAL ACTION AGAINST ANY AND ALL COMPANIES OR INDIVIDUALS WHO USE THIS BLOCKCHAIN-RELATED OR BLOCKCHAIN-BASED SOFTWARE FOR THE PURPOSE OF DISTRIBUTING CRYPTOCURRENCIES WHERE THOSE CRYPTOCURRENCIES AND THEIR METHOD OF DISTRIBUTION ARE IN DIRECT VIOLATION OF UNITED STATES SECURITIES LAWS. IF A GOVERNMENT BODY TAKES ACTION AGAINST ANY USERS, DEVELOPERS, MARKETERS, ORGANIZATIONS, FOUNDATIONS OR ANY PROFESSIONAL ENTITY WHO CHOOSES TO UTILIZE THIS SOFTWARE FOR THE DISTRIBUTION OF ILLEGAL SECURITIES, BENCH COMPUTER INC. WILL NOT BE HELD LIABLE FOR ANY ACTIONS TAKEN BY THE USERS, DEVELOPERS, MARKETERS, ORGANIZATIONS, FOUNDATIONS OR ANY PROFESSIONAL ENTITIES WHO CHOOSE TO DO SO.

UNITED STATES SECURITIES VIOLATIONS SPECIFICALLY REFER TO ANY VIOLATIONS OF SECTION 10(b) OF THE SECURITIES EXCHANGE ACT OF 1934 [15 U.S.C. § 78j(b)] AND RULE 10b-5(b) PROMULGATED THEREUNDER [17 C.F.R. § 240.10b-5(b)], AND SECTIONS 5(a), 5(c), and 17(a)(2) OF THE SECURITIES ACT OF 1933 [15 U.S.C. §§ 77e(a), 77e(c), and 77q(a)(2)]; BY MAKING USE OF ANY MEANS OR INSTRUMENTS OF TRANSPORTATION OR COMMUNICATION IN INTERSTATE COMMERCE OR OF THE MAILS TO SELL THROUGH THE USE OR MEDIUM OF ANY WRITTEN CONTRACT, OFFERING DOCUMENT, PROSPECTUS, WHITEPAPER, OR OTHERWISE, ANY SECURITY AS TO WHICH NO REGISTRATION STATEMENT WAS IN EFFECT. OR FOR THE PURPOSE OF SALE OR DELIVERY AFTER SALE, CARRYING OR CAUSING TO BE CARRIED THROUGH THE MAILS OR IN INTERSTATE COMMERCE, BY MEANS OR INSTRUMENTS OF TRANSPORTATION OR COMMUNICATION IN INTERSTATE COMMERCE OR OF THE MAILS TO OFFER TO SELL OR OFFER TO BUY THROUGH THE USE OR MEDIUM OF ANY WRITTEN CONTRACT, OFFERING DOCUMENT, PROSPECTUS, WHITEPAPER, OR OTHERWISE, SECURITIES AS TO WHICH NO REGISTRATION STATEMENT HAS BEEN FILED.

OUTSIDE OF THESE LEGAL REQUIREMENTS, THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Releases

No releases published

Packages

No packages published