@smartledger/bsv 8.3.0 → 8.3.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 +42 -0
- package/README.md +349 -207
- package/bsv-gdaf.min.js +1 -1
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +2 -2
- package/bsv.min.js +2 -2
- package/docs/BRC220_BATCH_LEAF_AMENDMENT.md +119 -0
- package/docs/BRC220_PLAN.md +9 -0
- 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/lib/notaryhash/index.js +20 -0
- package/lib/notaryhash/merkle.js +8 -0
- package/lib/notaryhash/suites.js +17 -1
- package/package.json +3 -2
- package/test/notaryhash/batch_leaf.js +140 -0
- package/test/notaryhash/interop.js +112 -0
- package/test/notaryhash/verify.js +5 -2
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.3.1] - 2026-08-20
|
|
11
|
+
|
|
12
|
+
### Fixed — BRC-220 signature verification was not interoperable
|
|
13
|
+
|
|
14
|
+
`lib/notaryhash/suites.js` set `endian: 'little'` before verifying, which made
|
|
15
|
+
ECDSA reverse the 32-byte `payloadHash` before reducing it to a scalar. That is
|
|
16
|
+
Bitcoin's message-signing convention, not this protocol's.
|
|
17
|
+
|
|
18
|
+
The effect was on the **verify** side. A signature produced the way BRC-220
|
|
19
|
+
describes — over the `payloadHash` directly — was **rejected**, and the only
|
|
20
|
+
signatures accepted were ones made with bsv's own byte-reversed convention. In
|
|
21
|
+
practice 8.3.0 could not verify a certificate from any other implementation.
|
|
22
|
+
|
|
23
|
+
Signing was never affected: `ECDSA.sign(payloadHash, key)` already produced a
|
|
24
|
+
conformant signature. Only the verifier disagreed with it.
|
|
25
|
+
|
|
26
|
+
**If you issued certificates with 8.3.0**, they are fine — the signatures in them
|
|
27
|
+
are whatever your signer produced. If you signed via `ECDSA` with
|
|
28
|
+
`endian: 'little'` to satisfy the old verifier, those signatures are
|
|
29
|
+
non-conformant and must be re-issued; 8.3.1 rejects them, deliberately, because
|
|
30
|
+
accepting both conventions would mean two valid signatures exist for one signing
|
|
31
|
+
act and both are inside `proofHash`.
|
|
32
|
+
|
|
33
|
+
### Why the tests did not catch it
|
|
34
|
+
|
|
35
|
+
Every NotaryHash test signed through `lib/crypto/ecdsa.js` and verified through a
|
|
36
|
+
suite that used the same file, so the module and its tests were self-consistent
|
|
37
|
+
and wrong together — the failure shape `test/notaryhash/encoding.js` warns about
|
|
38
|
+
in its own header comment.
|
|
39
|
+
|
|
40
|
+
`test/notaryhash/interop.js` is new and verifies against `@noble/curves`, which
|
|
41
|
+
shares no verification code with ours. Reverting the one-line fix fails 9 tests.
|
|
42
|
+
It also records the trap that made this slow to diagnose: noble v2 **prehashes by
|
|
43
|
+
default**, so `secp256k1.sign(digest, key)` signs `sha256(digest)` and looks
|
|
44
|
+
self-consistent while disagreeing with everyone; every call in that file passes
|
|
45
|
+
`{ prehash: false }`.
|
|
46
|
+
|
|
47
|
+
### Documentation
|
|
48
|
+
|
|
49
|
+
- The README's NotaryHash example now shows the signing step explicitly, and says
|
|
50
|
+
why no `endian` option belongs there.
|
|
51
|
+
|
|
10
52
|
## [8.3.0] - 2026-08-16
|
|
11
53
|
|
|
12
54
|
### BRC-220 (NotaryHash)
|