From 818d9cb3311bba0beea10b939216cb16fa93da10 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 23 Jan 2015 20:14:52 -0500 Subject: [PATCH] Docs: Include information about saving a PrivateKey --- docs/index.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 6f41d23c9..006313e04 100644 --- a/docs/index.md +++ b/docs/index.md @@ -45,17 +45,20 @@ Some functionality is implemented as a module that can be installed seperately: # Examples -## Create a Private Key +## Create and Save a Private Key ```javascript -var privKey = new bitcore.PrivateKey(); +var privateKey = new bitcore.PrivateKey(); + +var exported = privateKey.toWIF(); +// e.g. L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2m +var imported = bitcore.PrivateKey.fromWIF(exported); ``` ## Create an Address ```javascript -var privKey = new bitcore.PrivateKey(); -var address = privKey.toAddress(); +var address = privateKey.toAddress(); ``` ## Create a Multisig Address