rchain / rchain-api

Obsoleted in favor of https://github.com/rchain-community/rchain-api. Use at your own risk.
Other
8 stars 4 forks source link

Key management / signing #1

Closed JoshOrndorff closed 6 years ago

JoshOrndorff commented 6 years ago

From RChain-API created by crypto-coder : JoshOrndorff/RChain-API#26

Making a general suggestions that we include a convenience feature in the NPM package for managing aliased pub-priv keypairs in a file, that can be loaded and used to sign transactions. Functions would include things like:

Create new KeyPair: myNode.createKeyPair( alias, add_to_keystore=true ); Get Public Key by Alias: myNode.getPublicKey( alias ); Sign a transaction: myNode.signTransaction( alias, DeployData );

The current API provides the ability to dynamically generate a keypair and sign text.

const seed = randomBytes(32); const pair1 = keyPair(seed);

console.log('public key:', pair1.publicKey()); console.log('signature:', pair1.signTextHex('hello world'));

We can use this internally, but if we want to reuse these generated keys, we will need a way to persist, and retrieve them later. Since this NPM package will be used for backend applications, there are some situations where reused keys will need to either be passed into the NPM package, or managed internally by the NPM package.

Do we have a preference?

JoshOrndorff commented 6 years ago

Failed attempt to copy the issue from the old repo.