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

aioz-js

v1.0.15

Published

A javascript library allows to manipulate keys/wallet on browser.

Downloads

25

Readme

AIOZ Keytool

A javascript library allows to manipulate keys/wallet on browser.

Features

The code is ported from aiozd keytool, written in Javascript in order to:

  • generate new wallet
  • restore wallet from mnemonic
  • support generating ECDH key from private key JSON
  • generate shared key of ECDH

Installation

    npm install aioz-js

And use in code:

    const aioz = require('aioz-js');

Usage

Generate private/public key with a random 24-word mnemonic, encrypted with or without a passphrase:

    const key1 = aioz.newKey("12345678");   // encrypt private key with passphrase
    const key2 = aioz.newKey();   // no encryption for private key 

Recover wallet and private/public keys from 24-word mnemonic:

    const recoveredKeys = aioz.recover("pair that turn trash leave problem snap fork innocent symptom case please party stomach fly mirror panel stand possible decade soul strike poem feature");

From aioz key, create corresponding ECDH key:

    const ecdh1 = aioz.generateEcdhFromKeytool(key1.priv_key);
    const ecdh2 = aioz.generateEcdhFromKeytool(key2.priv_key);

Exchange public key to get shared key between 2 partners:

    const shared12 = ecdh1.derive(ecdh2.pub);
    const shared21 = ecdh2.derive(ecdh1.pub);
    console.log(shared12.toString(16);  // this should be the same as shared21
    console.log(shared21.toString(16);

Two partners can derive shared key using other's public key under JSON format

    const sharedKeyUsingJSON = ecdh1.deriveFromJSON("{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"A6g+QlHU9iFpJNeAEtmCOD0wTw3jfDRpiHn4ARe8MGBz\"}");