Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make raw keys #5

Open
croraf opened this issue Oct 26, 2017 · 1 comment
Open

How to make raw keys #5

croraf opened this issue Oct 26, 2017 · 1 comment

Comments

@croraf
Copy link

croraf commented Oct 26, 2017

I need to make pem encoded secp256k1 keys.

I do this:

var KeyEncoder = require('key-encoder'),
    keyEncoder = new KeyEncoder('secp256k1')

How I create raw keys from here?

I first have to make these raw keys from here and then encode them in Pem format with keyEncoder.encodePrivate and keyEncoder.encodePublic?

@earonesty
Copy link

In this library, a raw key is a hex string. For secp256k1, you'll see it start with hex bytes 02, 03 or 04 and be either 33 or 65 bytes (66 or 130 hex chars) long. For a description of that curve and an example of a hex point, see: https://en.bitcoin.it/wiki/Secp256k1. For a library that allows you to manipulate points, see: https://github.com/indutny/elliptic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants