Key Distributer SDK
The
SSV Key Distributor SDK
is a JS/TS library that enables developers to integrate the distribution of validator keys to KeyShares to their applications.// Yarn
yarn add https://github.com/bloxapp/ssv-keys.git
// NPM
npm install https://github.com/bloxapp/ssv-keys.git
import { ISharesKeyPairs, SSVKeys } from 'ssv-keys';
const keystore = require('./test.keystore.json');
const operators = require('./operators.json');
const operatorIds = require('./operatorIds.json');
const keystorePassword = 'testtest';
Returns a validator key from an existing Keystore file.
const ssvKeys = new SSVKeys();
const privateKey = await ssvKeys.getPrivateKeyFromKeystoreData(keystore, keystorePassword);
Returns KeyShares (SharesPublicKey & SharesEncrypted) from a validator key and set of operator keys.
const threshold: ISharesKeyPairs = await ssvKeys.createThreshold(privateKey, operatorIds);
const shares = await ssvKeys.encryptShares(operators, threshold.shares);
const payload = await ssvKeys.buildPayload(
threshold.validatorPublicKey,
operatorIds,
shares,
123456789,
);
console.log(payload);
Last modified 2mo ago