@jrstudio/keystore
v1.1.0
Published
Key management library for secure and simple public/private key retrieval from Arcana distributed key generation system.
Downloads
30
Keywords
Readme
[](https://codecov.io/gh/JR Studio-network/keystore)
Introduction
Base Library to make calls to JR Studio DKG network.
The network assumes that n/4 of nodes may be malicious, and n/2 + 1 of the nodes are required for key reconstruction. With these assumption, all fetch share calls are checked for consistency while enabling early exit on best case scenario where first n/2 + 1 responses are from honest nodes.
Installation
Using npm/yarn
npm install -S @jrstudio/keystore
yarn add @jrstudio/keystoreimport { KeyReconstructor } from '@jrstudio/keystore';const { KeyReconstructor } = window.JR Studio.keystore;Usage
Initialization
const keystore = new KeyReconstructor({
appId: '0x...', // Get this from JR Studio dashboard
network: 'testnet',
debug: false,
});Methods
const verifier = 'google'; // twitter, github, twitch, discord, reddit
const id = '[email protected]'; // See examples how to get user id for each verifier
const idToken = '...';
const publicKey = keystore.getPublicKey({ verifier, id });
const privateKey = keystore.getPrivateKey({ verifier, id, idToken });