@smartledger/bsv 5.4.0 → 5.4.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 CHANGED
@@ -5,6 +5,40 @@ All notable changes to SmartLedger-BSV will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.4.1] - 2026-06-25
9
+
10
+ Patch release. Repairs Legal Token Protocol (LTP) right-token creation,
11
+ signing, transfer, obligation and verification, which all threw on use.
12
+
13
+ ### Fixed
14
+
15
+ - **LTP right-token signing was completely broken.** `lib/ltp/right.js`
16
+ defined `_signToken` twice; the duplicate object-literal key shadowed the
17
+ working signer and referenced an undefined `hash`, so every
18
+ `prepareRightToken` / transfer / reissue / obligation signing failed with
19
+ "hash is not defined". The detached-JWS builder is now `_createJWS(hash,
20
+ signature)`.
21
+ - **`LTP#createRightToken` called non-existent entrypoints** (`LTPRight.create`
22
+ and `LTPProof.createSignature`). Added a build-only `RightToken.create(...)`
23
+ (reused by `prepareRightToken`) and signing now goes through the repaired
24
+ `RightToken._signToken`.
25
+ - **`LTP#verifyToken`, `transferRight`, `createObligation`,
26
+ `createSelectiveDisclosure` and `createLegalValidityProof` all threw** — each
27
+ called a non-existent `LTPProof`/`LTPRight` method (the same `prepare*` vs
28
+ `create*` naming mismatch). They now call the real `prepare*` entrypoints.
29
+ - **Added `RightToken.verifyToken(token, publicKey)`** — a real public-key
30
+ ECDSA verifier for tokens signed by `_signToken` (recomputes the canonical
31
+ hash, confirms `tokenHash` integrity, then verifies the signature embedded in
32
+ the detached JWS). `LTP#verifyToken` routes through it, so the pre-transfer
33
+ ownership check is now a genuine signature check.
34
+
35
+ ### Tests
36
+
37
+ - Adds `test/ltp/right.js` covering right-token creation, signing,
38
+ verification (valid / wrong-key / tampered), transfer (incl. non-transferable
39
+ rejection), obligation creation, selective disclosure and legal-validity
40
+ proofs. Full suite: 4256 passing.
41
+
8
42
  ## [5.4.0] - 2026-06-15
9
43
 
10
44
  ### Changed