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

secp256k1-pem

v0.0.2

Published

Secp256k1 to PEM format

Downloads

4

Readme

Secp256k1 to PEM format

A simple library for converting EVM wallet keys to PEM format. The goal of this project is to convert the ECDSA (EC K256 - secp256k1) private keys into a PAM format that YubiHSM can import. The library works with private keys, extended keys, seeds, and mnemonic phrases.

Install:

  • npm -i secp256k1-pem.

Import into your project:

  • Typescript: import { Secp256k1PEM } from 'secp256k1-pem';
  • JavaScript: const { Secp256k1PEM } = require('secp256k1-pem');

Use:

  • Private Key: Secp256k1PEM.fromPrivateKey(PRIVATE_KEY).getPAM()
    • Sample Input: 0xff22437ccbedfffafa93a9f1da2e8c19c1711052799acf3b58ae5bebb5c6bd7b
  • BIP32 Root Key: Secp256k1PEM.fromExtendedKey(EXTENDED_KEY).getPAM()
    • Sample Input: xprv9s21ZrQH143K416LEFgxfdhXevstXQ4vxnjV9vuXuC7NWnDZshZN9qUEext3SMBUcfd8w7H9Jrjk7Vi3eqgNbFy5tyMmzETqKqxJUB2Sr9R
  • BIP39 Seed: Secp256k1PEM.fromSeed(SEED_HEX).getPAM()
    • Sample Input: 1d3604de517910bc57e3801fdb61b81580cd8bfd33dc437ddc83fd474eb8696638f56de46bbba77e72e492c4d8a0d2ad1e3fb69173a0b2b117233b4d69e49243
  • BIP39 Mnemonic: Secp256k1PEM.fromMnemonic(MNEMONIC_ENGLISH).getPAM()
    • Sample Input: deputy annual debris outer baby prefer mammal scene insect obtain parrot length zero detail average nation address depart stem tuition fork rocket topple kidney

Notes

The function getPAM accepts an optional attribute path. This does not work with fromPrivateKey since it is a single account. For all other types, you can specify path as full path string or account index integer. The default deviration path is m/44'/60'/0'/0/0 to conform with the standard BIP32 Derivation Path.

Examples:

  • Account Index: .getPAM(1) == ("m/44'/60'/0'/0/" + 1)
  • Full Path: .getPAM("m/44'/60'/0'/0/1")