@smartledger/bsv 9.0.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +164 -0
- package/README.md +152 -1041
- package/STABILITY.md +134 -0
- package/bsv-gdaf.min.js +53 -48
- package/bsv-ltp.min.js +23 -18
- package/bsv-smartcontract.min.js +18 -18
- package/bsv.bundle.js +53 -48
- package/bsv.min.js +53 -48
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/docs/proposals/10.0.0-package-split.md +131 -0
- package/index.js +5 -0
- package/lib/block/merkleblock.js +53 -9
- package/lib/hdprivatekey.js +15 -0
- package/lib/script/interpreter.js +109 -1
- package/lib/smart_contract/builder.js +14 -0
- package/lib/util/deprecate.js +159 -0
- package/package.json +19 -82
- package/version.js +1 -1
- package/.mocharc.json +0 -5
- package/test/address.js +0 -629
- package/test/block/block.js +0 -239
- package/test/block/blockheader.js +0 -270
- package/test/block/merkleblock.js +0 -207
- package/test/build/bundle_crypto_shim.js +0 -104
- package/test/build/bundle_externals.js +0 -125
- package/test/build/bundle_smoke.js +0 -55
- package/test/build/esbuild_main.js +0 -65
- package/test/build/esm_wrapper.js +0 -97
- package/test/build/exports_resolution.js +0 -84
- package/test/build/version_sync.js +0 -14
- package/test/cli/smoke.js +0 -261
- package/test/consensus/base58-vectors.js +0 -120
- package/test/consensus/sv-script-vectors.js +0 -81
- package/test/consensus/sv-sighash-vectors.js +0 -51
- package/test/consensus/sv-tx-vectors.js +0 -48
- package/test/credentials-test.js +0 -332
- package/test/crypto/backend_selection.js +0 -126
- package/test/crypto/bn.js +0 -168
- package/test/crypto/ecdsa.js +0 -426
- package/test/crypto/elliptic-fixed.js +0 -61
- package/test/crypto/hash.browser.js +0 -121
- package/test/crypto/hash.js +0 -122
- package/test/crypto/point.js +0 -193
- package/test/crypto/random.js +0 -105
- package/test/crypto/security.js +0 -176
- package/test/crypto/shamir.js +0 -177
- package/test/crypto/shamir_rngcap.js +0 -29
- package/test/crypto/signature.js +0 -399
- package/test/data/bip69.json +0 -215
- package/test/data/bitcoin-sv/README.md +0 -170
- package/test/data/bitcoin-sv/base58_encode_decode.json +0 -14
- package/test/data/bitcoin-sv/base58_keys_invalid.json +0 -152
- package/test/data/bitcoin-sv/base58_keys_valid.json +0 -452
- package/test/data/bitcoin-sv/script_tests.json +0 -2591
- package/test/data/bitcoin-sv/sighash.json +0 -1003
- package/test/data/bitcoin-sv/tx_invalid.json +0 -285
- package/test/data/bitcoin-sv/tx_valid.json +0 -367
- package/test/data/bitcoind/base58_keys_invalid.json +0 -152
- package/test/data/bitcoind/base58_keys_valid.json +0 -452
- package/test/data/bitcoind/blocks.json +0 -27
- package/test/data/bitcoind/script_tests.json +0 -2244
- package/test/data/bitcoind/sig_canonical.json +0 -7
- package/test/data/bitcoind/sig_noncanonical.json +0 -22
- package/test/data/bitcoind/tx_invalid.json +0 -177
- package/test/data/bitcoind/tx_valid.json +0 -224
- package/test/data/blk86756-testnet.dat +0 -0
- package/test/data/blk86756-testnet.js +0 -12
- package/test/data/blk86756-testnet.json +0 -684
- package/test/data/brc220-batch-vector.json +0 -129
- package/test/data/ecdsa.json +0 -230
- package/test/data/merkleblocks.js +0 -486
- package/test/data/messages.json +0 -22
- package/test/data/sighash.json +0 -1004
- package/test/data/tx_creation.json +0 -85
- package/test/didweb/relationships.js +0 -144
- package/test/ecies/bitcore-ecies.js +0 -178
- package/test/ecies/electrum-ecies.js +0 -206
- package/test/encoding/base58.js +0 -131
- package/test/encoding/base58check.js +0 -145
- package/test/encoding/bufferreader.js +0 -328
- package/test/encoding/bufferwriter.js +0 -160
- package/test/encoding/varint.js +0 -104
- package/test/gdaf/anchor_no_key_leak.js +0 -146
- package/test/gdaf/anchor_spv.js +0 -163
- package/test/gdaf/canonicalization.js +0 -106
- package/test/gdaf/canonicalize.js +0 -140
- package/test/gdaf/zk_prover.js +0 -204
- package/test/hdkeys.js +0 -365
- package/test/hdprivatekey.js +0 -339
- package/test/hdpublickey.js +0 -293
- package/test/index.js +0 -16
- package/test/ltp/ids.js +0 -74
- package/test/ltp/right.js +0 -198
- package/test/ltp/verify_failclosed.js +0 -134
- package/test/message/message.js +0 -190
- package/test/mnemonic/data/fixtures.json +0 -300
- package/test/mnemonic/mnemonic.js +0 -277
- package/test/mnemonic/mocha.opts +0 -1
- package/test/mnemonic/pbkdf2.test.js +0 -43
- package/test/networks.js +0 -207
- package/test/notaryhash/batch_leaf.js +0 -140
- package/test/notaryhash/batch_vector.js +0 -282
- package/test/notaryhash/certificate.js +0 -249
- package/test/notaryhash/encoding.js +0 -186
- package/test/notaryhash/interop.js +0 -112
- package/test/notaryhash/merkle.js +0 -181
- package/test/notaryhash/script.js +0 -270
- package/test/notaryhash/verify.js +0 -342
- package/test/opcode.js +0 -186
- package/test/ordinals/bsv20.js +0 -337
- package/test/ordinals/inscription.js +0 -329
- package/test/ordinals/ordlock.js +0 -567
- package/test/privatekey.js +0 -540
- package/test/publickey.js +0 -411
- package/test/regressions.js +0 -215
- package/test/script/chronicle.js +0 -543
- package/test/script/defaults.js +0 -160
- package/test/script/genesis_limits.js +0 -203
- package/test/script/interpreter.js +0 -776
- package/test/script/script.js +0 -1259
- package/test/script/string_ops.js +0 -88
- package/test/security/fail_closed_contracts.js +0 -104
- package/test/security/threat_model_coverage.js +0 -31
- package/test/smart_contract/covenants.js +0 -207
- package/test/smart_contract/dsl_debugger.js +0 -92
- package/test/smart_contract/extract_field.js +0 -61
- package/test/smart_contract/nonenforcing_guard.js +0 -44
- package/test/smart_contract/ordinal_transfer.js +0 -71
- package/test/smart_contract/preimage.js +0 -98
- package/test/smart_contract/sighash_marketplace.js +0 -98
- package/test/smart_contract/token_generalized.js +0 -175
- package/test/spv/headerchain.js +0 -86
- package/test/spv/merkleproof.js +0 -133
- package/test/statuslist/failclosed.js +0 -78
- package/test/transaction/deserialize.js +0 -33
- package/test/transaction/input/input.js +0 -92
- package/test/transaction/input/multisig.js +0 -174
- package/test/transaction/input/multisigscripthash.js +0 -111
- package/test/transaction/input/publickey.js +0 -68
- package/test/transaction/input/publickeyhash.js +0 -59
- package/test/transaction/output.js +0 -185
- package/test/transaction/sighash.js +0 -91
- package/test/transaction/signature.js +0 -127
- package/test/transaction/transaction.js +0 -1299
- package/test/transaction/unspentoutput.js +0 -97
- package/test/types/dts_drift.js +0 -124
- package/test/types/surface_honesty.js +0 -102
- package/test/util/id.js +0 -72
- package/test/util/js.js +0 -76
- package/test/util/preconditions.js +0 -79
- package/test/vcjwt/interop.js +0 -126
package/STABILITY.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Stability policy
|
|
2
|
+
|
|
3
|
+
## The commitment
|
|
4
|
+
|
|
5
|
+
**`@smartledger/bsv` 9.x will not break your code until at least 2027-09-01.**
|
|
6
|
+
|
|
7
|
+
Until that date this package ships patch and minor releases only. No 10.0.0.
|
|
8
|
+
|
|
9
|
+
## Why this document exists
|
|
10
|
+
|
|
11
|
+
Between 2026-05-31 and 2026-08-21 — 82 days — this library published six major
|
|
12
|
+
versions:
|
|
13
|
+
|
|
14
|
+
| version | date |
|
|
15
|
+
|---|---|
|
|
16
|
+
| 4.0.0 | 2026-05-31 |
|
|
17
|
+
| 5.0.0 | 2026-06-14 |
|
|
18
|
+
| 6.0.0 | 2026-07-12 |
|
|
19
|
+
| 7.0.0 | 2026-07-16 |
|
|
20
|
+
| 8.0.0 | 2026-08-13 |
|
|
21
|
+
| 9.0.0 | 2026-08-21 |
|
|
22
|
+
|
|
23
|
+
83 releases in 307 days, about one every four days.
|
|
24
|
+
|
|
25
|
+
A major version is a promise that the consumer's code breaks. Made six times a
|
|
26
|
+
quarter, that promise is one no team can plan around, and no amount of
|
|
27
|
+
correctness in the releases compensates for it. Cryptography libraries are
|
|
28
|
+
infrastructure; infrastructure that moves this fast is not infrastructure.
|
|
29
|
+
|
|
30
|
+
The releases were not gratuitous. Most encoded a real finding — Genesis reverted
|
|
31
|
+
`OP_CLTV`/`OP_CSV` to NOPs, so the CLTV locks guaranteed nothing and were removed
|
|
32
|
+
in 9.0.0; covenant verification was applying pre-Genesis limits and was corrected
|
|
33
|
+
in 8.4.0. Those calls were right. **The diagnosis was never the problem. The
|
|
34
|
+
delivery was.** An API found to be wrong was changed to `throw` in the same
|
|
35
|
+
release that found it, which converts every correctness fix into a breaking
|
|
36
|
+
change.
|
|
37
|
+
|
|
38
|
+
## How correctness ships now
|
|
39
|
+
|
|
40
|
+
Deprecating is a non-breaking act. It belongs in a minor.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
minor Mark it. Callers see a one-line warning naming the replacement and the
|
|
44
|
+
version that will remove it. Their code keeps working.
|
|
45
|
+
|
|
46
|
+
major Remove it, on a schedule that has been in consumers' logs for at
|
|
47
|
+
least one full minor cycle.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`lib/util/deprecate.js` implements this. It warns once per API per process,
|
|
51
|
+
records every notice for tooling, is silenced with
|
|
52
|
+
`BSV_NO_DEPRECATION_WARNINGS=1`, and **never throws** — a deprecation that throws
|
|
53
|
+
is a breaking change wearing a warning's name.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
var deprecate = require('./lib/util/deprecate')
|
|
57
|
+
|
|
58
|
+
Klass.prototype.old = deprecate.fn(Klass.prototype.old, {
|
|
59
|
+
what: 'Klass#old',
|
|
60
|
+
since: '9.1.0',
|
|
61
|
+
removeIn: '10.0.0',
|
|
62
|
+
use: 'Klass#replacement',
|
|
63
|
+
why: 'it does not constrain the spend'
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The effect is that correctness fixes ship continuously while breakage batches
|
|
68
|
+
into one planned major, and by the time that major lands the migration path has
|
|
69
|
+
already been printing in the consumer's terminal for months.
|
|
70
|
+
|
|
71
|
+
### The one exception
|
|
72
|
+
|
|
73
|
+
An API that can **lose funds** may be made to throw inside a minor. A covenant
|
|
74
|
+
that silently enforces nothing is not a compatibility question. When this
|
|
75
|
+
happens the release notes say so at the top, and the error message names the
|
|
76
|
+
replacement and an explicit opt-out for callers who know what they are doing —
|
|
77
|
+
as `SmartContract.Builder` does with `{ allowNonEnforcing: true }`.
|
|
78
|
+
|
|
79
|
+
This exception is deliberately narrow. "Wrong" is not "dangerous." Only loss of
|
|
80
|
+
funds qualifies.
|
|
81
|
+
|
|
82
|
+
### The two settings, worked
|
|
83
|
+
|
|
84
|
+
Both of these were APIs that threw with no warning period. They were resolved
|
|
85
|
+
differently, and the difference is the whole policy:
|
|
86
|
+
|
|
87
|
+
**`MerkleBlock#filterdTxsHash` now warns and delegates.** The name is a
|
|
88
|
+
misspelling of `filteredTxsHash` — missing an `e`. There is exactly one thing it
|
|
89
|
+
can mean, so making the typo fix a breaking change bought nothing. Restored in
|
|
90
|
+
9.1.0, removed in 10.0.0.
|
|
91
|
+
|
|
92
|
+
**`HDPrivateKey#derive` still throws.** Its two replacements return *different
|
|
93
|
+
keys*: `deriveChild` is BIP32-compliant, `deriveNonCompliantChild` reproduces the
|
|
94
|
+
old unpadded behaviour. Measured over 1600 derivations they disagree about **0.5%
|
|
95
|
+
of the time** — only when an intermediate private key serialises to under 32
|
|
96
|
+
bytes.
|
|
97
|
+
|
|
98
|
+
That rarity is the argument for throwing, not against it. A caller who switched
|
|
99
|
+
to a guessed default would pass every test they wrote and then derive
|
|
100
|
+
unrecoverable addresses for roughly one wallet in two hundred. A default that is
|
|
101
|
+
wrong half a percent of the time is more dangerous than one that is wrong always,
|
|
102
|
+
because nothing catches it. So the caller chooses, and the error names both
|
|
103
|
+
options.
|
|
104
|
+
|
|
105
|
+
The test for both lives in `test/deprecated_apis.js`.
|
|
106
|
+
|
|
107
|
+
## What is covered
|
|
108
|
+
|
|
109
|
+
Everything reachable from the documented public API: the top-level exports, the
|
|
110
|
+
`exports` subpaths in `package.json`, and the types in `bsv.d.ts`.
|
|
111
|
+
|
|
112
|
+
Not covered, and changeable in a minor:
|
|
113
|
+
|
|
114
|
+
- anything prefixed `_`
|
|
115
|
+
- `lib/**` paths reached by deep-requiring past the declared `exports`
|
|
116
|
+
- exact wording of error *messages* (the `errstr` **codes** are covered)
|
|
117
|
+
- the contents of `archive/`
|
|
118
|
+
|
|
119
|
+
## Consensus tracking
|
|
120
|
+
|
|
121
|
+
One thing overrides this policy: if BSV mainnet consensus changes, this library
|
|
122
|
+
follows it, in a minor, without waiting for a major. A library that stayed
|
|
123
|
+
compatible with a rule the network no longer enforces would be worse than
|
|
124
|
+
useless — it would be confidently wrong in the direction that costs money.
|
|
125
|
+
|
|
126
|
+
Consensus behavior is pinned by 452 conformance cases (`npm run conformance`)
|
|
127
|
+
generated against the reference implementation. Those vectors, not this
|
|
128
|
+
library's own opinion, define what "correct" means here.
|
|
129
|
+
|
|
130
|
+
## After 2027-09-01
|
|
131
|
+
|
|
132
|
+
If a 10.0.0 becomes necessary, it will be announced at least one minor in
|
|
133
|
+
advance, every removal in it will have been warning since 9.x, and a migration
|
|
134
|
+
guide will ship with the beta rather than after the release.
|