Skip to content

Commit 1cfa7bd

Browse files
committed
Update README and RELEASE-NOTES.
1 parent 277834a commit 1cfa7bd

File tree

2 files changed

+30
-50
lines changed

2 files changed

+30
-50
lines changed

Diff for: README.md

+14-50
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LightWallet is a HD wallet that can store your private keys encrypted in the bro
88

99
LightWallet is primarily intended to be a signing provider for the [Hooked Web3 provider](https://github.com/ConsenSys/hooked-web3-provider) through the `keystore` module. This allows you to have full control over your private keys while still connecting to a remote node to relay signed transactions. Moreover, the `txutils` functions can be used to construct transactions when offline, for use in e.g. air-gapped coldwallet implementations.
1010

11-
The default BIP32 HD derivation path is `m/0'/0'/0'/i`.
11+
The default BIP32 HD derivation path has been `m/0'/0'/0'/i`, but any HD path can be chosen.
1212

1313
## Security
1414

@@ -102,43 +102,25 @@ ks.passwordProvider = function (callback) {
102102

103103
These are the interface functions for the keystore object. The keystore object holds a 12-word seed according to [BIP39][] spec. From this seed you can generate addresses and private keys, and use the private keys to sign transactions.
104104

105-
Note: Addresses and RLP encoded data are in the form of hex-strings. Hex-strings do not start with `0x`.
105+
Note: Addresses and RLP encoded data are in the form of hex-strings. Hex-strings start with `0x`.
106106

107107
### `keystore.createVault(options, callback)`
108108

109-
The current recommended keystore construction method. Has popular defaults, handles salting internally, and is the easiest interface to use.
109+
This is the interface to create a new lightwallet keystore.
110110

111111
#### Options
112112

113113
* password: (mandatory) A string used to encrypt the vault when serialized.
114-
* seedPhrase: (optional) A twelve-word mnemonic used to generate all accounts.
114+
* seedPhrase: (mandatory) A twelve-word mnemonic used to generate all accounts.
115115
* salt: (optional) The user may supply the salt used to encrypt & decrypt the vault, otherwise a random salt will be generated.
116-
* hdPathString: (optional) The user may provide a `BIP39` compliant HD Path String. The default is `m/0'/0'/0'`.
116+
* hdPathString (mandatory): The user must provide a `BIP39` compliant HD Path String. Previously the default has been `m/0'/0'/0'`, another popular one is the BIP44 path string `m/44'/60'/0'/0`.
117117

118118
### `keystore.keyFromPassword(password, callback)`
119119

120120
This instance method uses any internally-configured salt to return the appropriate `pwDerivedKey`.
121121

122122
Takes the user's password as input and generates a symmetric key of type `Uint8Array` that is used to encrypt/decrypt the keystore.
123123

124-
### `keystore.deriveKeyFromPassword(password, callback)` (deprecated)
125-
126-
Deprecated class method that uses a fixed salt to derive a `pwDerivedKey` from a password.
127-
128-
Takes the user's password as input and generates a symmetric key of type `Uint8Array` that is used to encrypt/decrypt the keystore.
129-
130-
### `keystore(seed, pwDerivedKey [,hdPathString])` (deprecated)
131-
132-
Constructor of the keystore object. The seed `seed` is encrypted with `pwDerivedKey` and stored encrypted in the keystore.
133-
134-
This method has been deprecated because it relies on a hard-coded salt, but still exists for backwards-compatibility.
135-
136-
#### Inputs
137-
138-
* words: string defining a 12-word seed according to [BIP39][]
139-
* pwDerivedKey: symmetric key to encrypt the seed (Uint8Array)
140-
* hdPathString: optional alternate HD derivation path to use
141-
142124
### `keystore.isDerivedKeyCorrect(pwDerivedKey)`
143125

144126
Returns `true` if the derived key can decrypt the seed, and returns `false` otherwise.
@@ -151,18 +133,7 @@ Generates a string consisting of a random 12-word seed and returns it. If the op
151133

152134
Checks if `seed` is a valid 12-word seed according to the [BIP39][] specification.
153135

154-
### `keystore.addHdDerivationPath(hdPathString, pwDerivedKey, info)`
155-
156-
Adds the HD derivation path `hdPathString` to the keystore. The `info` structure denotes the curve and purpose for the keys in that path. Supported structures are
157-
158-
* `{curve: 'secp256k1', purpose: 'sign'}`
159-
* `{curve: 'curve25519', purpose: 'asymEncrypt'}`
160-
161-
### `keystore.setDefaultHdDerivationPath(hdPathString)`
162-
163-
Set the default HD Derivation path. This path will be used if the `hdPathString` is omitted from other functions. This is also the path that's used if the keystore is used with the Hooked Web3 Provider.
164-
165-
### `keystore.generateNewAddress(pwDerivedKey, [num,] [hdPathString])`
136+
### `keystore.generateNewAddress(pwDerivedKey, [num])`
166137

167138
Allows the vault to generate additional internal address/private key pairs.
168139

@@ -196,17 +167,6 @@ Given the derived key, decrypts and returns the private key corresponding to `ad
196167

197168
Takes a serialized keystore in an old format and a password. The callback takes the upgraded serialized keystore as its second argument.
198169

199-
200-
### `keystore.generateNewEncryptionKeys(pwDerivedKey [, num, hdPathString])`
201-
202-
Generate `num` new encryption keys at the path `hdPathString`. Only
203-
defined when the purpose of the HD path is `asymEncrypt`.
204-
205-
### `keystore.getPubKeys([hdPathString])`
206-
207-
Return the pubkeys at `hdPathString`, or at the default HD path. Only
208-
defined when the purpose of the HD path is `asymEncrypt`.
209-
210170
## `signing` Function definitions
211171

212172
### `signing.signTx(keystore, pwDerivedKey, rawTx, signingAddress, hdPathString)`
@@ -257,7 +217,7 @@ Signs a sha3 message hash with the private key corresponding to `signingAddress`
257217

258218
Signed hash as signature object with v, r and s values.
259219

260-
### `concatSig(signature)`
220+
### `signing.concatSig(signature)`
261221

262222
Concatenates signature object to return signature as hex-string in the same format as `eth_sign` does.
263223

@@ -269,14 +229,14 @@ Concatenates signature object to return signature as hex-string in the same form
269229

270230
Concatenated signature object as hex-string.
271231

272-
### `recoverAddress(rawMsg, v, r, s)`
232+
### `signing.recoverAddress(rawMsg, v, r, s)`
273233

274234
Recovers the signing address from the message `rawMsg` and the signature `v, r, s`.
275235

276236

277237
## `encryption` Function definitions
278238

279-
### `encryption.multiEncryptString(keystore, pwDerivedKey, msg, myPubKey, theirPubKeyArray [, hdPathString])`
239+
### `encryption.multiEncryptString(keystore, pwDerivedKey, msg, myAddress, theirPubKeyArray)`
280240

281241
**NOTE:** The format of encrypted messages has not been finalized and may change at any time, so only use this for ephemeral messages that do not need to be stored encrypted for a long time.
282242

@@ -301,12 +261,16 @@ Encrypts the string `msg` with a randomly generated symmetric key, then encrypts
301261

302262
Note that no padding is applied to `msg`, so it's possible to deduce the length of the string `msg` from the ciphertext. If you don't want this information to be known, please apply padding to `msg` before calling this function.
303263

304-
### `encryption.multiDecryptString(keystore, pwDerivedKey, encMsg, theirPubKey, myPubKey [, hdPathString])`
264+
### `encryption.multiDecryptString(keystore, pwDerivedKey, encMsg, theirPubKey, myAddress)`
305265

306266
Decrypt a message `encMsg` created with the function
307267
`multiEncryptString()`. If successful, returns the original message
308268
string. If not successful, returns `false`.
309269

270+
### `encryption.addressToPublicEncKey(keystore, pwDerivedKey, address)`
271+
272+
Gets the public encryption key corresponding to the private key of `address` in the `keystore`.
273+
310274
## `txutils` Function definitions
311275

312276
These are the interface functions for the `txutils` module. These functions will create RLP encoded raw unsigned transactions which can be signed using the `keystore.signTx()` command.

Diff for: RELEASE-NOTES.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Release Notes #
22

3+
## Version 3.0.0 - 2017-11-01 ##
4+
5+
* Major cleanup - not backwards compatible!
6+
7+
* Remove legacy constructor - now only `createVault` is supported. Also `createVault` now require seed and hd path as inputs.
8+
9+
* Remove `deriveKeyFromPassword` function in favor of `keyFromPassword` function.
10+
11+
* Remove special handling of encryption keys in the keystore. You can still use keystore keys to encrypt, but they no longer use pubkeys to index. To get the pubkey corresponding to an address, please use the function `encryption.addressToPublicEncKey`.
12+
13+
* Make the keystore and interfaces simpler by only allowing one `hdPathString`. If you need to derive from more HD paths you need to create more keystores.
14+
15+
* Add `0x` prefix for all addresses and transaction hex data.
16+
17+
* Remove unneeded `bitcore-lib` package dependency. Thanks to [Srirangan](https://github.com/Srirangan).
18+
319
## Version 2.5.4 - 2017-03-16 ##
420

521
* Upgrade bitcore-lib and explicitly increase version of bitcore-mnemonic. By [roderik](https://github.com/roderik).

0 commit comments

Comments
 (0)