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

ref!: switch to Uint8Array #56

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5daf409
chore: make Prettier
Jan 26, 2023
e145a52
chore: make README.md, tests, and CHANGELOG Prettier
Jan 26, 2023
c21b8b2
chore: add lint config
Jan 26, 2023
7df4a14
ref!: IIFE wrap, indent, and use HDKEY as export shim
Jan 26, 2023
365b915
ref!: nest HDKey under HDKEY, new HDKey(...) => HDKEY.create(...)
Jan 26, 2023
cd4fcc9
ref!: move HDKey.prototype, this => hdkey
Jan 26, 2023
945e409
ref: restore HDKEY to HDKey
Jan 26, 2023
35c44d1
ref!: defineProperty(privateKey, ...) => privateKey, setPrivateKey
Jan 26, 2023
f9ae62f
ref!: defineProperty(publicKey, ...) => publicKey, setPublicKey
Jan 26, 2023
eb0662f
ref!: _identfier, identifier, defineProperty(pubKeyHash, ...) => iden…
Jan 26, 2023
a3f1780
ref!: move fingerprint to getFingerprint (it's just a slice, and only…
Jan 26, 2023
b85240b
ref!: (private|public)ExtendedKey => get(Private|Public)ExtendedKey
Jan 26, 2023
02ae1a7
chore(lint): always use curlies around if, etc
Jan 26, 2023
a387441
ref!: make privateKey more private (won't log in console)
Jan 26, 2023
14caabb
ref: remove 'assert' node lock-in
Jan 26, 2023
1cac79c
ref: remove safe-buffer in favor of Node's now-safer Buffer
Jan 26, 2023
75c42a6
fix(test): update all tests with new APIs
Jan 26, 2023
986587d
security: update mocha and lazy install dev deps
Feb 3, 2023
92dccc8
chore: remove node v10 because mocha no longer supports it
Feb 3, 2023
7472aad
chore: add types and minor changes for type checking
Jan 26, 2023
2d19b28
ref: var => let (for upcoming `forEach` => async `for` changes)
Jan 26, 2023
c19206d
ref: replace forEach() with for() {} as prep for async
Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, latest]
node-version: [12.x, 14.x, 16.x, 18.x, latest]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
23 changes: 23 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"browser": true,
"node": true,
"esversion": 11,
"curly": true,
"sub": true,

"bitwise": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"immed": true,
"latedef": "nofunc",
"nonbsp": true,
"nonew": true,
"plusplus": true,
"undef": true,
"unused": "vars",
"strict": true,
"maxdepth": 4,
"maxstatements": 100,
"maxcomplexity": 20
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs
node_modules
package.json
package-lock.json
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"tabWidth": 2,
"singleQuote": false,
"bracketSpacing": true,
"proseWrap": "always",
"semi": true,
"trailingComma": "all"
}
189 changes: 125 additions & 64 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,113 +1,174 @@
2.1.0 / 2023-01-18
------------------
## 2.1.0 / 2023-01-18

- Add `skipVerification` option to `HDKey.fromExtendedKey()` to allow skipping verification logic for performance ([#53](https://github.com/cryptocoinjs/hdkey/pull/53))
- Use `ripemd160` package; as Node v18+ `crypto.createHash()` does not support ripemd160 ([#51](https://github.com/cryptocoinjs/hdkey/pull/51))
- Fix `.sign()` method in some environments with polyfilled `Buffer` implementations ([#50](https://github.com/cryptocoinjs/hdkey/pull/50))
- Performance improvements ([#52](https://github.com/cryptocoinjs/hdkey/pull/52))
- Add `skipVerification` option to `HDKey.fromExtendedKey()` to allow skipping
verification logic for performance
([#53](https://github.com/cryptocoinjs/hdkey/pull/53))
- Use `ripemd160` package; as Node v18+ `crypto.createHash()` does not support
ripemd160 ([#51](https://github.com/cryptocoinjs/hdkey/pull/51))
- Fix `.sign()` method in some environments with polyfilled `Buffer`
implementations ([#50](https://github.com/cryptocoinjs/hdkey/pull/50))
- Performance improvements
([#52](https://github.com/cryptocoinjs/hdkey/pull/52))

2.0.1 / 2020-05-30
------------------
2.0.1 / 2020-05-30

- Bugfix: prevent mutating buffers passed in ([#39](https://github.com/cryptocoinjs/hdkey/pull/39))
---

2.0.0 / 2020-05-29
------------------
- Bugfix: prevent mutating buffers passed in
([#39](https://github.com/cryptocoinjs/hdkey/pull/39))

- **BREAKING:** Require Node.js v10+ ([#38](https://github.com/cryptocoinjs/hdkey/pull/38))
- Upgrade `secp256k1` dependency; to use N-API ([#32](https://github.com/cryptocoinjs/hdkey/pull/32))
2.0.0 / 2020-05-29

1.1.2 / 2020-04-16
------------------
---

- Fix extremely rare types bug ([#33](https://github.com/cryptocoinjs/hdkey/pull/33))
- Use `bs58check` dependency instead of `coinstring` ([#30](https://github.com/cryptocoinjs/hdkey/pull/30))
- Don't publish test files ([#27](https://github.com/cryptocoinjs/hdkey/issues/27), [#34](https://github.com/cryptocoinjs/hdkey/pull/34))
- **BREAKING:** Require Node.js v10+
([#38](https://github.com/cryptocoinjs/hdkey/pull/38))
- Upgrade `secp256k1` dependency; to use N-API
([#32](https://github.com/cryptocoinjs/hdkey/pull/32))

1.1.1 / 2019-02-09
------------------
1.1.2 / 2020-04-16

- Fix Electron v4 support. No changes to external API. ([#26](https://github.com/cryptocoinjs/hdkey/pull/26))
---

1.1.0 / 2018-08-14
------------------
- Fix extremely rare types bug
([#33](https://github.com/cryptocoinjs/hdkey/pull/33))
- Use `bs58check` dependency instead of `coinstring`
([#30](https://github.com/cryptocoinjs/hdkey/pull/30))
- Don't publish test files
([#27](https://github.com/cryptocoinjs/hdkey/issues/27),
[#34](https://github.com/cryptocoinjs/hdkey/pull/34))

- Add `wipePrivateData()` method ([#22](https://github.com/cryptocoinjs/hdkey/pull/22))
- Add missing LICENSE file ([#21](https://github.com/cryptocoinjs/hdkey/pull/21))
1.1.1 / 2019-02-09

1.0.0 / 2018-05-24
------------------
---

- Fix Electron v4 support. No changes to external API.
([#26](https://github.com/cryptocoinjs/hdkey/pull/26))

1.1.0 / 2018-08-14

---

- Add `wipePrivateData()` method
([#22](https://github.com/cryptocoinjs/hdkey/pull/22))
- Add missing LICENSE file
([#21](https://github.com/cryptocoinjs/hdkey/pull/21))

1.0.0 / 2018-05-24

---

- drop support for all Node.js versions 4 and earlier
- fix `derive()` path validation ([#20](https://github.com/cryptocoinjs/hdkey/pull/20))
- fix `derive()` path validation
([#20](https://github.com/cryptocoinjs/hdkey/pull/20))

0.8.0 / 2018-02-06

---

0.8.0 / 2018-02-06
------------------
- add `sign()` and `verify()`
- upgrade to `safe-buffer`

0.7.1 / 2016-05-26
------------------
- fix bug when `privateKey` is `null`, `privateExtendedKey` should not throw, and return `null` [#7][#7]
0.7.1 / 2016-05-26

---

- fix bug when `privateKey` is `null`, `privateExtendedKey` should not throw,
and return `null` [#7][#7]

0.7.0 / 2016-03-22

---

0.7.0 / 2016-03-22
------------------
- upgrade from `ecurve` to `secp256k1`. [#5][#5]

0.6.0 / 2015-07-02
------------------
- **breaking** (same day though, haha). Changed `publicExtendedKey`/`privateExtendedKey` in `JSON` methods to `xpub`/`xpriv`
0.6.0 / 2015-07-02

---

- **breaking** (same day though, haha). Changed
`publicExtendedKey`/`privateExtendedKey` in `JSON` methods to `xpub`/`xpriv`
- export `HARDENED_OFFSET`

0.5.0 / 2015-07-02
------------------
0.5.0 / 2015-07-02

---

- JavaScript Standard Style
- fix rare condition for BIP32 consistency: [#1][#1]
- added `toJSON()/fromJSON()`

0.4.0 / 2014-09-24
------------------
- dropped `sha512` dependency and upgraded to crypto-browserify that supports sha512
0.4.0 / 2014-09-24

---

- dropped `sha512` dependency and upgraded to crypto-browserify that supports
sha512

0.3.1 / 2014-07-11

---

0.3.1 / 2014-07-11
------------------
- removed superfluous code `this._privateKeyBigInteger`

0.3.0 / 2014-06-29
------------------
- bugfix: if private key was less than 32 bytes, pad out to 32 bytes with leading zeros (this happens in derive)
- changed behavior of `privateExtendedKey()` and `publicExtendedKey()` to return base 58 encoded `string` instead of `Buffer`
- changed behavior of `fromExtendedKey()` from accepting a type of `Buffer` bytes to base58 `string`
0.3.0 / 2014-06-29

---

- bugfix: if private key was less than 32 bytes, pad out to 32 bytes with
leading zeros (this happens in derive)
- changed behavior of `privateExtendedKey()` and `publicExtendedKey()` to return
base 58 encoded `string` instead of `Buffer`
- changed behavior of `fromExtendedKey()` from accepting a type of `Buffer`
bytes to base58 `string`

0.2.0 / 2014-06-25

---

0.2.0 / 2014-06-25
------------------
- upgraded `"ecurve": "^0.8.0"` to `"ecurve": "^1.0.0"`
- added functionality to derive public to public child keys

0.1.0 / 2014-06-16
------------------
0.1.0 / 2014-06-16

---

- removed semicolons per http://cryptocoinjs.com/about/contributing/#semicolons
- removed `ECKey` dep
- added `ecurve` dep
- removed `terst` dev dep for `assert`
- added method `fromMasterSeed(seedBuffer, [versions])`
- changed constructor from `new HDKey(masterSeed, [versions])` to `new HDKey([versions])`
- changed constructor from `new HDKey(masterSeed, [versions])` to
`new HDKey([versions])`
- added properties: `privateKey` and `publicKey`
- removed method `getIdentifier()`, added property `identifier`
- removed method `getFingerprint()`, added property `fingerprint`
- renamed `private` to `privateExtendedKey`
- renamed `public` to `publicExtendedKey`
- added method `fromExtendedKey()`

0.0.1 / 2014-05-29
------------------
0.0.1 / 2014-05-29

---

- initial release

<!-- generated using jprichardson/issue-links -->
[#7]: https://github.com/cryptocoinjs/hdkey/issues/7 "privateExtendedKey error handling"
[#6]: https://github.com/cryptocoinjs/hdkey/pull/6 "hdkey: use bippath for BIP32 path parsing and validation"
[#5]: https://github.com/cryptocoinjs/hdkey/pull/5 "hdkey: use the secp256k1 package for crypto"
[#4]: https://github.com/cryptocoinjs/hdkey/issues/4 "Is this library still maintained?"
[#3]: https://github.com/cryptocoinjs/hdkey/pull/3 "Update hdkey.js"
[#2]: https://github.com/cryptocoinjs/hdkey/pull/2 "Update hdkey.js"
[#1]: https://github.com/cryptocoinjs/hdkey/issues/1 "rare condition needed for bip consistency"

[#7]:
https://github.com/cryptocoinjs/hdkey/issues/7
"privateExtendedKey error handling"
[#6]:
https://github.com/cryptocoinjs/hdkey/pull/6
"hdkey: use bippath for BIP32 path parsing and validation"
[#5]:
https://github.com/cryptocoinjs/hdkey/pull/5
"hdkey: use the secp256k1 package for crypto"
[#4]:
https://github.com/cryptocoinjs/hdkey/issues/4
"Is this library still maintained?"
[#3]: https://github.com/cryptocoinjs/hdkey/pull/3 "Update hdkey.js"
[#2]: https://github.com/cryptocoinjs/hdkey/pull/2 "Update hdkey.js"
[#1]:
https://github.com/cryptocoinjs/hdkey/issues/1
"rare condition needed for bip consistency"
Loading