Skip to content

Commit 84bc2ea

Browse files
committed
Remove bip32, (User must bring their own)
1 parent b1ff3ce commit 84bc2ea

File tree

7 files changed

+45
-33
lines changed

7 files changed

+45
-33
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,18 @@ You can find a [Web UI](https://bitcoincore.tech/apps/bitcoinjs-ui/index.html) t
3535
## Installation
3636
``` bash
3737
npm install bitcoinjs-lib
38+
# optionally, install a key derivation library as well
39+
npm install ecpair bip32
40+
# ecpair is the ECPair class for single keys
41+
# bip32 is for generating HD keys
3842
```
3943

40-
Typically we support the [Node Maintenance LTS version](https://github.com/nodejs/Release).
41-
If in doubt, see the [.travis.yml](.travis.yml) for what versions are used by our continuous integration tests.
44+
Previous versions of the library included classes for key management (ECPair, HDNode(->"bip32")) but now these have been separated into different libraries. This lowers the bundle size significantly if you don't need to perform any crypto functions (converting private to public keys and deriving HD keys).
45+
46+
Typically we support the [Node Maintenance LTS version](https://github.com/nodejs/Release). TypeScript target will be set
47+
to the ECMAScript version in which all features are fully supported by current Active Node LTS.
48+
However, depending on adoption among other environments (browsers etc.) we may keep the target back a year or two.
49+
If in doubt, see the [main_ci.yml](.github/workflows/main_ci.yml) for what versions are used by our continuous integration tests.
4250

4351
**WARNING**: We presently don't provide any tooling to verify that the release on `npm` matches GitHub. As such, you should verify anything downloaded by `npm` against your own verified copy.
4452

package-lock.json

Lines changed: 29 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"dependencies": {
5252
"bech32": "^2.0.0",
5353
"bip174": "^2.0.1",
54-
"bip32": "^2.0.4",
5554
"bs58check": "^2.1.2",
5655
"create-hash": "^1.1.0",
5756
"typeforce": "^1.11.3",
@@ -67,6 +66,7 @@
6766
"@types/proxyquire": "^1.3.28",
6867
"@types/randombytes": "^2.0.0",
6968
"@types/wif": "^2.0.2",
69+
"bip32": "^2.0.6",
7070
"bip39": "^3.0.2",
7171
"bip65": "^1.0.1",
7272
"bip68": "^1.0.3",

src/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import * as bip32 from 'bip32';
21
import * as address from './address';
32
import * as crypto from './crypto';
43
import * as networks from './networks';
54
import * as payments from './payments';
65
import * as script from './script';
7-
export { address, bip32, crypto, networks, payments, script };
6+
export { address, crypto, networks, payments, script };
87
export { Block } from './block';
98
export { Psbt, PsbtTxInput, PsbtTxOutput, Signer, SignerAsync, HDSigner, HDSignerAsync, } from './psbt';
109
export { OPS as opcodes } from './ops';
1110
export { Transaction } from './transaction';
12-
export { BIP32Interface } from 'bip32';
1311
export { Network } from './networks';
1412
export { Payment, PaymentCreator, PaymentOpts, Stack, StackElement, } from './payments';
1513
export { Input as TxInput, Output as TxOutput } from './transaction';

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22
Object.defineProperty(exports, '__esModule', { value: true });
3-
exports.Transaction = exports.opcodes = exports.Psbt = exports.Block = exports.script = exports.payments = exports.networks = exports.crypto = exports.bip32 = exports.address = void 0;
4-
const bip32 = require('bip32');
5-
exports.bip32 = bip32;
3+
exports.Transaction = exports.opcodes = exports.Psbt = exports.Block = exports.script = exports.payments = exports.networks = exports.crypto = exports.address = void 0;
64
const address = require('./address');
75
exports.address = address;
86
const crypto = require('./crypto');

test/psbt.spec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import * as assert from 'assert';
2+
import * as bip32 from 'bip32';
23
import * as crypto from 'crypto';
34
import { ECPair } from 'ecpair';
45
import { describe, it } from 'mocha';
56

6-
import {
7-
bip32,
8-
networks as NETWORKS,
9-
payments,
10-
Psbt,
11-
Signer,
12-
SignerAsync,
13-
} from '..';
7+
import { networks as NETWORKS, payments, Psbt, Signer, SignerAsync } from '..';
148

159
import * as preFixtures from './fixtures/psbt.json';
1610

ts_src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import * as bip32 from 'bip32';
21
import * as address from './address';
32
import * as crypto from './crypto';
43
import * as networks from './networks';
54
import * as payments from './payments';
65
import * as script from './script';
76

8-
export { address, bip32, crypto, networks, payments, script };
7+
export { address, crypto, networks, payments, script };
98

109
export { Block } from './block';
1110
export {
@@ -20,7 +19,6 @@ export {
2019
export { OPS as opcodes } from './ops';
2120
export { Transaction } from './transaction';
2221

23-
export { BIP32Interface } from 'bip32';
2422
export { Network } from './networks';
2523
export {
2624
Payment,

0 commit comments

Comments
 (0)