smartledger-bsv 4.1.0 → 4.2.0
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 +37 -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,43 @@ 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.0] - 2026-06-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **First-class, interpreter-verified covenants under `bsv.SmartContract`.**
|
|
13
|
+
A complete, tested stack of custom locking scripts that verify end-to-end
|
|
14
|
+
through `Script.Interpreter` (positive and negative cases), building on the
|
|
15
|
+
post-Genesis limits from 4.1.0:
|
|
16
|
+
- **`SmartContract.PushTx`** — a *correct* OP_PUSH_TX (nChain WP1605). The
|
|
17
|
+
locking script generates an ECDSA signature in-script from the pushed
|
|
18
|
+
preimage (`a=k=1`, `r=Gx`, `s=(e+Gx) mod n`, pubkey `02||Gx`) and verifies
|
|
19
|
+
it with `OP_CHECKSIG`, proving the preimage is this very transaction. Uses a
|
|
20
|
+
fixed-length DER template with an `nLockTime` grind (`PushTx.grind`). Exposes
|
|
21
|
+
`authenticator()`, `valueCovenant()`, `hashOutputs()`, `extractHashOutputs()`.
|
|
22
|
+
- **`SmartContract.PELS` / `perpetualCovenant(fee)`** — a Perpetually Enforcing
|
|
23
|
+
Locking Script: every spend must recreate the same script (value − fee).
|
|
24
|
+
Reads its own script from the authenticated preimage's `scriptCode`, so there
|
|
25
|
+
is no self-hash circularity.
|
|
26
|
+
- **`SmartContract.Token` / `ownershipToken(fee, ownerHash)`** — a stateful
|
|
27
|
+
ownership token (NFT) carrying its owner as on-chain state; transfer requires
|
|
28
|
+
the owner's secret and rewrites the state, perpetuating the token code.
|
|
29
|
+
- **`SmartContract.Locks`** — hash-lock, P2PKH, CLTV time-lock, m-of-n
|
|
30
|
+
multisig, and HTLC primitives.
|
|
31
|
+
- **`SmartContract.CovenantHelpers`** + convenience methods
|
|
32
|
+
`enableGenesis()`, `verifyScript()`, `valueCovenant()` — a consensus-flag
|
|
33
|
+
`verify()` harness, raw BIP-143 preimage access, signing, and fund/spend
|
|
34
|
+
scaffolding.
|
|
35
|
+
- New mocha suite `test/smart_contract/covenants.js` (11 specs / 24 assertions),
|
|
36
|
+
all green; full suite 4178 → 4189 passing.
|
|
37
|
+
|
|
38
|
+
### Notes
|
|
39
|
+
|
|
40
|
+
- These covenants require post-Genesis limits: call `SmartContract.enableGenesis()`
|
|
41
|
+
(a.k.a `Interpreter.useGenesisLimits()`) before verifying. Research-grade and
|
|
42
|
+
interpreter-verified — review before mainnet value (the OP_PUSH_TX key is the
|
|
43
|
+
intentionally public `a=k=1`; low-S malleability is left unenforced).
|
|
44
|
+
|
|
8
45
|
## [4.1.0] - 2026-06-07
|
|
9
46
|
|
|
10
47
|
### Added
|