npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ssv-keys

v1.2.0

Published

Tool for splitting a validator key into a predefined threshold of shares via Shamir-Secret-Sharing (SSS), and encrypt them with a set of operator keys.

Downloads

374

Readme

SSV Keys

GitHub GitHub Workflow Status GitHub package.json version

GitHub commit activity GitHub contributors GitHub last commit

GitHub package.json dynamic GitHub package.json dynamic

Discord

Important dependencies:

  • GitHub package.json dependency version (prod)
  • GitHub package.json dependency version (prod)
  • GitHub package.json dependency version (prod)
  • GitHub package.json dependency version (prod)
  • GitHub package.json dependency version (prod)

Library and CLI to work with the ETH keystore file and extract latest validator cluster snapshot to build the payload:

  1. Parse the private key using the keystore password
  2. Use the private key to get shares for operators
  3. Build the payload for the transaction

Option 1: Running an Executable (Recommended route)

If you want to run a compiled version (easier option then CLI)

  1. Go to the releases section: https://github.com/ssvlabs/ssv-keys/releases
  2. Select the latest release for the specific version of the CLI: vX.Y.Z-v1 - for the first version of the contract, vX.Y.Z-v2 - for second etc. Example: v0.0.1-v1 or v0.0.1-v2.
  3. Download the native executable for your operating system:
    • ssv-keys-lin - for Ubuntu Linux
    • ssv-keys-mac - for MacOS
    • ssv-keys.exe - for Windows
  4. Open terminal and change the directory to where you downloaded the executable. For instance, on MacOS you can:
    cd ~/Downloads
  5. (Mac and Linux) Make sure that the executable has permissions to run by running:
    chmod 777 ./ssv-keys-mac
  6. Now you can run it:
    ./ssv-keys-mac
  7. If your operating system prevents you from running the executable you can open it from the file manager (Finder in case of MacOS), right click on it, and click the Open menu. Once open click the Open or allow button when you are asked to do so. After this go back to the console and try to run it again.

Option 2: Running from the CLI

Installation

This installation requires NodeJS on your machine. You can download it here.

Once you have installed NodeJS, follow instructions:

git clone https://github.com/ssvlabs/ssv-keys.git
cd ssv-keys
npm install -g yarn
yarn install
yarn cli --help

Help

Help on available actions:

yarn cli --help

Help on a specific action:

yarn cli <action> --help

Example

To run you will use the "shares" command

Input parameters:

  • keystore (ks) = The path to either a validator keystore file or a folder that contains multiple validator keystore files. If a folder is provided, it will split in bulk all the keystore files within it according to the additional arguments provided
  • password (ps) = The keystore file encryption password, if a folder was provided the password will be used for all keystore files in the folder
  • operator-ids (oids) = Comma-separated list of operator IDs. The amount must be 3f+1 compatible
  • operator-keys (oks) = Comma-separated list of operator keys (same sequence as operator ids). The amount must be 3f+1 compatible
  • output-folder (of) = Target folder path to output the key shares file
  • owner-address (oa) = The cluster owner address (in the SSV contract)
  • owner-nonce (on) = The validator registration nonce of the account (owner address) within the SSV contract (increments after each validator registration), obtained using the ssv-scanner tool
# single file
yarn cli shares --keystore=keystore.json --password=test --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=..

# folder with multiple keystore files
yarn cli shares --keystore=./keystore-files --password=test --operator-ids=1,2,3,4 --operator-keys=LS..,LS..,LS..,LS.. --output-folder=./ --owner-address=... --owner-nonce=..

Output: Name will start with keyshares-timestamp.json

Option 3: Integration in your projects

Node Project

To run an example of a NodeJS project containing all the code snippets to build the share and transaction payload, simply follow these instructions!

cd examples/console
yarn install

To run a JavaScript example:

# example 1
yarn start:basic:js
# example 2
yarn start:complex:js

To run a TypeScript example:

yarn start:ts

Browser project (web application)

Go to the example folder and then install all the dependencies:

cd examples/react-app
yarn install

Start the web app:

yarn start

Open the developer console to see how it works in a browser environment.

Development

Run the CLI as a TypeScript executable:

yarn dev:cli ...

Run the CLI as a JavaScript compiled executable:

yarn cli ...

Lint

yarn lint

Testing

yarn test

In watch mode during development

yarn test --watchAll

Building

Build TypeScript into JavaScript

yarn build

Build for NodeJs using esbuild

yarn esbuild

Build everything

yarn build-all

License

MIT License