@smartledger/bsv 4.1.0 → 4.2.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 +68 -0
- package/README.md +217 -205
- package/bsv-covenant.min.js +8 -8
- package/bsv-gdaf.min.js +9 -9
- package/bsv-ltp.min.js +9 -9
- package/bsv-smartcontract.min.js +9 -9
- package/bsv.bundle.js +9 -9
- package/bsv.min.js +8 -8
- package/docs/COVENANT_DEVELOPMENT_RESOLVED.md +2 -2
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +25 -25
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/lib/smart_contract/covenant_helpers.js +118 -0
- package/lib/smart_contract/index.js +30 -1
- package/lib/smart_contract/locks.js +101 -0
- package/lib/smart_contract/pels.js +62 -0
- package/lib/smart_contract/pushtx.js +138 -0
- package/lib/smart_contract/token.js +95 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,74 @@ 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
|
+
## [4.2.1] - 2026-06-07
|
|
9
|
+
|
|
10
|
+
### Docs
|
|
11
|
+
|
|
12
|
+
- **Substantial README rewrite for the v4.x line.** The README still
|
|
13
|
+
headlined v3.4.x (4 minors and a major stale), showed the *old*
|
|
14
|
+
`lib/covenant-interface` API in the covenant examples instead of the
|
|
15
|
+
v4.2.0 `bsv.SmartContract.PushTx`/`PELS`/`Token`/`Locks`/`verifyScript`
|
|
16
|
+
surface, had a wrong CDN-Bundles size table (off by up to 7× on
|
|
17
|
+
`bsv-mnemonic`), duplicate "Complete Documentation" sections, a
|
|
18
|
+
"planned 3.5.0" security note that was overtaken by 4.0.0, and a
|
|
19
|
+
footer stamp claiming "v3.3.4 • 9 Loading Options". Replaced the
|
|
20
|
+
headline with the v4.2.0 covenant section, rewrote PUSHTX/PELS
|
|
21
|
+
examples to use the new API, added Ownership Tokens + end-to-end
|
|
22
|
+
verification snippets, merged the two Documentation sections (7
|
|
23
|
+
broken file paths fixed, 4 dead links removed), replaced the
|
|
24
|
+
inaccurate CDN sub-table with a pointer to the canonical
|
|
25
|
+
loading-options table, updated Security to point at the v4.0.0 GDAF
|
|
26
|
+
fix, and stamped the footer at v4.2.1.
|
|
27
|
+
|
|
28
|
+
### Semver
|
|
29
|
+
|
|
30
|
+
Patch — README only. No source changes; no `lib/`, `bin/`, `bsv.d.ts`,
|
|
31
|
+
or test diffs. Out-of-band republish: `@smartledger/bsv@4.2.0` was
|
|
32
|
+
published from a separate session with the OLD README, then
|
|
33
|
+
unpublished after the rewrite. npm's anti-republish policy refuses to
|
|
34
|
+
reuse the 4.2.0 version number; 4.2.1 is the canonical version with
|
|
35
|
+
the corrected README content. `smartledger-bsv@4.2.0` (unscoped) was
|
|
36
|
+
published with the new README; for parity, the unscoped is also
|
|
37
|
+
republished at 4.2.1.
|
|
38
|
+
|
|
39
|
+
## [4.2.0] - 2026-06-07
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **First-class, interpreter-verified covenants under `bsv.SmartContract`.**
|
|
44
|
+
A complete, tested stack of custom locking scripts that verify end-to-end
|
|
45
|
+
through `Script.Interpreter` (positive and negative cases), building on the
|
|
46
|
+
post-Genesis limits from 4.1.0:
|
|
47
|
+
- **`SmartContract.PushTx`** — a *correct* OP_PUSH_TX (nChain WP1605). The
|
|
48
|
+
locking script generates an ECDSA signature in-script from the pushed
|
|
49
|
+
preimage (`a=k=1`, `r=Gx`, `s=(e+Gx) mod n`, pubkey `02||Gx`) and verifies
|
|
50
|
+
it with `OP_CHECKSIG`, proving the preimage is this very transaction. Uses a
|
|
51
|
+
fixed-length DER template with an `nLockTime` grind (`PushTx.grind`). Exposes
|
|
52
|
+
`authenticator()`, `valueCovenant()`, `hashOutputs()`, `extractHashOutputs()`.
|
|
53
|
+
- **`SmartContract.PELS` / `perpetualCovenant(fee)`** — a Perpetually Enforcing
|
|
54
|
+
Locking Script: every spend must recreate the same script (value − fee).
|
|
55
|
+
Reads its own script from the authenticated preimage's `scriptCode`, so there
|
|
56
|
+
is no self-hash circularity.
|
|
57
|
+
- **`SmartContract.Token` / `ownershipToken(fee, ownerHash)`** — a stateful
|
|
58
|
+
ownership token (NFT) carrying its owner as on-chain state; transfer requires
|
|
59
|
+
the owner's secret and rewrites the state, perpetuating the token code.
|
|
60
|
+
- **`SmartContract.Locks`** — hash-lock, P2PKH, CLTV time-lock, m-of-n
|
|
61
|
+
multisig, and HTLC primitives.
|
|
62
|
+
- **`SmartContract.CovenantHelpers`** + convenience methods
|
|
63
|
+
`enableGenesis()`, `verifyScript()`, `valueCovenant()` — a consensus-flag
|
|
64
|
+
`verify()` harness, raw BIP-143 preimage access, signing, and fund/spend
|
|
65
|
+
scaffolding.
|
|
66
|
+
- New mocha suite `test/smart_contract/covenants.js` (11 specs / 24 assertions),
|
|
67
|
+
all green; full suite 4178 → 4189 passing.
|
|
68
|
+
|
|
69
|
+
### Notes
|
|
70
|
+
|
|
71
|
+
- These covenants require post-Genesis limits: call `SmartContract.enableGenesis()`
|
|
72
|
+
(a.k.a `Interpreter.useGenesisLimits()`) before verifying. Research-grade and
|
|
73
|
+
interpreter-verified — review before mainnet value (the OP_PUSH_TX key is the
|
|
74
|
+
intentionally public `a=k=1`; low-S malleability is left unenforced).
|
|
75
|
+
|
|
8
76
|
## [4.1.0] - 2026-06-07
|
|
9
77
|
|
|
10
78
|
### Added
|