Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.18 KB

index.md

File metadata and controls

44 lines (30 loc) · 1.18 KB

KeyLib v0.0.12

Principles

keyLib provides a reliable API for JavaScript apps that need to create, import, and derive ECDSA keys.

Documentation Index

Key Management

Extra

Module Development

Examples

Create and Save a Private Key - Bitcoin

var privateKey = new keyLib.PrivateKey();

var exported = privateKey.toWIF();
// e.g. L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m
var imported = keyLib.PrivateKey.fromWIF(exported);
var hexa = privateKey.toString();
// e.g. 'b9de6e778fe92aa7edb69395556f843f1dce0448350112e14906efc2a80fa61a'

Create and Save a Private Key - other cryptocurrencies

The default behavior creates a key for the Bitcoin network. You can specify another network by providing a string argument identifying the currency.

var privateKey = new keyLib.PrivateKey();
var privateKey = new keyLib.PrivateKey('BTC');
var privateKey = new keyLib.PrivateKey('BCH');
var privateKey = new keyLib.PrivateKey('LTC');