@smartledger/bsv 8.2.0 → 8.3.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 +84 -0
- package/README.md +38 -38
- package/bsv-ecies.min.js +1 -1
- package/bsv-gdaf.min.js +62 -62
- package/bsv-ltp.min.js +48 -48
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +62 -62
- package/bsv.min.js +62 -62
- package/docs/AUDIT_SCOPE.md +8 -8
- package/docs/BRC220_ENCODING_AMENDMENT.md +100 -0
- package/docs/BRC220_PLAN.md +224 -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/index.js +5 -0
- package/index.mjs +1 -0
- package/lib/gdaf/attestation-signer.js +2 -38
- package/lib/notaryhash/certificate.js +282 -0
- package/lib/notaryhash/encoding.js +150 -0
- package/lib/notaryhash/index.js +334 -0
- package/lib/notaryhash/merkle.js +209 -0
- package/lib/notaryhash/script.js +261 -0
- package/lib/notaryhash/suites.js +156 -0
- package/lib/util/jcs.js +75 -0
- package/package.json +7 -5
- package/test/notaryhash/certificate.js +249 -0
- package/test/notaryhash/encoding.js +186 -0
- package/test/notaryhash/merkle.js +181 -0
- package/test/notaryhash/script.js +270 -0
- package/test/notaryhash/verify.js +339 -0
- package/version.js +1 -1
package/docs/AUDIT_SCOPE.md
CHANGED
|
@@ -5,7 +5,7 @@ cryptographic core, and carries the enquiry text to send to vendors. It exists s
|
|
|
5
5
|
every vendor prices the *same* thing, and so that the reasoning behind the scope
|
|
6
6
|
boundary survives past the engagement that prompted it.
|
|
7
7
|
|
|
8
|
-
Measured against **v8.
|
|
8
|
+
Measured against **v8.3.0**, 2026-08-16. Re-measure before sending if the version has
|
|
9
9
|
moved (`docs/AUDIT_SCOPE.md` is not covered by a drift gate).
|
|
10
10
|
|
|
11
11
|
## 1. The question we are asking
|
|
@@ -58,16 +58,16 @@ is not.
|
|
|
58
58
|
| Component | Status | Reason |
|
|
59
59
|
| --- | --- | --- |
|
|
60
60
|
| `@noble/curves`, `@noble/hashes`, `@noble/ciphers` | Already audited | The primitives come from the Noble libraries, which **Cure53 has audited and published on**. We do not implement curve or hash arithmetic ourselves. State this explicitly to vendors — otherwise they price work we do not need. |
|
|
61
|
-
| `lib/smart_contract/`, `lib/ltp/`, `lib/gdaf/`, `lib/ordinals/`, `lib/block/`, plus 9 further directories and 6 top-level files | Excluded | Application layer,
|
|
61
|
+
| `lib/smart_contract/`, `lib/ltp/`, `lib/gdaf/`, `lib/ordinals/`, `lib/block/`, plus 9 further directories and 6 top-level files | Excluded | Application layer, 24,447 lines — 18,600 in the five named modules and 5,847 in the remainder. Written in-house and covered by adversarial tests. Worth a separate engagement; including it here would blur the question in §1. |
|
|
62
62
|
|
|
63
|
-
Totals reconcile against `lib/`, which is
|
|
63
|
+
Totals reconcile against `lib/`, which is 38,322 lines across 130 files:
|
|
64
64
|
|
|
65
65
|
```
|
|
66
66
|
tier 1 12,268
|
|
67
67
|
tier 2 1,607
|
|
68
|
-
excluded
|
|
68
|
+
excluded 24,447
|
|
69
69
|
------
|
|
70
|
-
total
|
|
70
|
+
total 38,322
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Core + optional = 13,875.
|
|
@@ -94,7 +94,7 @@ Each of these should *reduce* the quote — they remove discovery work.
|
|
|
94
94
|
- **`npm run conformance`** — 452 cases across 13 suites, freezing observable behaviour
|
|
95
95
|
so any change surfaces as a diff. A second, independently written implementation
|
|
96
96
|
(`smartledger-bsv-core`, the TypeScript port) agrees on all 452.
|
|
97
|
-
- **4,
|
|
97
|
+
- **4,626 passing tests**, plus a reproducible-bundle gate, a require-cycle gate, and a
|
|
98
98
|
type-drift gate that parses the published types against the runtime.
|
|
99
99
|
- **`SECURITY.md`** — a published advisory (GHSA-gw63-x79h-mhjc) and a changelog of
|
|
100
100
|
security fixes with the reasoning for each.
|
|
@@ -143,7 +143,7 @@ Scope, and we would like these priced separately:
|
|
|
143
143
|
JavaScript (CommonJS), Node >= 20.19. The code is public.
|
|
144
144
|
|
|
145
145
|
Explicitly out of scope: elliptic-curve and hash primitives, which are supplied
|
|
146
|
-
by the Noble libraries and already audited; and our
|
|
146
|
+
by the Noble libraries and already audited; and our 24,447-line application
|
|
147
147
|
layer (credentials, tokens, ordinals), which we would treat as a separate
|
|
148
148
|
engagement.
|
|
149
149
|
|
|
@@ -171,7 +171,7 @@ SmartLedger Technology
|
|
|
171
171
|
Every figure in this document, including the excluded total, must come out of this
|
|
172
172
|
script. **Derive the excluded count as the complement — never by subtracting tier 1
|
|
173
173
|
alone.** The first draft did exactly that, double-counted tier 2, and published parts
|
|
174
|
-
summing to 37,430 against a
|
|
174
|
+
summing to 37,430 against a 38,322 whole; §7 could not catch it because it reproduced
|
|
175
175
|
every figure except the wrong one.
|
|
176
176
|
|
|
177
177
|
```sh
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Proposed BRC-220 amendment: define the `encoding` field
|
|
2
|
+
|
|
3
|
+
`encoding` is listed among the certificate's required fields, but its values are never
|
|
4
|
+
enumerated. This proposes the definition, with the reasoning that led to it.
|
|
5
|
+
|
|
6
|
+
Prepared 2026-08-16 while implementing BRC-220 in `@smartledger/bsv`. The gap surfaced
|
|
7
|
+
because an implementation cannot emit a required field whose values are undefined.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Proposed text
|
|
12
|
+
|
|
13
|
+
Insert into **§Certificate**, after the sentence listing the required fields.
|
|
14
|
+
|
|
15
|
+
> #### `encoding`
|
|
16
|
+
>
|
|
17
|
+
> `encoding` names the byte representation of `publicKey` and `signature` as they appear
|
|
18
|
+
> in the certificate and in the canonical proof bytes.
|
|
19
|
+
>
|
|
20
|
+
> Implementations **MUST** support `"raw"` and **SHOULD** emit it:
|
|
21
|
+
>
|
|
22
|
+
> - **`"raw"`** — the scheme's native fixed-length byte string.
|
|
23
|
+
> - For `ECDSA-secp256k1`, a signature is exactly **64 bytes**: `r ‖ s`, each a 32-byte
|
|
24
|
+
> big-endian unsigned integer, zero-padded on the left. A public key is the 33-byte
|
|
25
|
+
> compressed SEC1 form.
|
|
26
|
+
> - For `ML-DSA-*` and `SLH-DSA-*`, the signature and public key are the byte strings the
|
|
27
|
+
> scheme itself defines (FIPS 204, FIPS 205). No further framing is applied.
|
|
28
|
+
> - **`"der"`** — ECDSA signatures in ASN.1 DER, as produced by Bitcoin tooling.
|
|
29
|
+
> Accepted for compatibility with existing Bitcoin-native signers; **SHOULD NOT** be
|
|
30
|
+
> emitted by new implementations, for the reason given below. Undefined for post-quantum
|
|
31
|
+
> algorithms, which have no DER form.
|
|
32
|
+
>
|
|
33
|
+
> For `ECDSA-secp256k1`, `s` **MUST** be in the lower half of the curve order
|
|
34
|
+
> (`s ≤ n/2`). A signature with a high `s` **MUST** be rejected rather than normalised on
|
|
35
|
+
> receipt: normalising changes the signature bytes, and the signature bytes are inside
|
|
36
|
+
> `proofHash`.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Why `"raw"` rather than DER
|
|
41
|
+
|
|
42
|
+
### 1. DER is not canonical, and `proofHash` covers the signature bytes
|
|
43
|
+
|
|
44
|
+
The canonical proof bytes include `lp(signature)`, so the signature's exact byte
|
|
45
|
+
representation determines `proofHash`. DER does not have one representation per signature.
|
|
46
|
+
Measured over 200 signatures from a single key with `@smartledger/bsv`:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
DER lengths: { "69": 1, "70": 108, "71": 91 }
|
|
50
|
+
raw lengths: { "64": 200 }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The variance is ordinary leading-zero handling in the two INTEGERs, and it is entirely
|
|
54
|
+
legal DER. But it means the same signing act can yield different `proofHash` values
|
|
55
|
+
depending on which library encoded it — and a certificate re-encoded in transit no longer
|
|
56
|
+
matches its own integrity root.
|
|
57
|
+
|
|
58
|
+
That is the property §Motivation names first: *"any implementation in any language
|
|
59
|
+
reproduces identical bytes"*, and the reason the spec already rejects `JSON.stringify`.
|
|
60
|
+
A non-canonical signature encoding reintroduces exactly the problem the binary encoding was
|
|
61
|
+
chosen to avoid.
|
|
62
|
+
|
|
63
|
+
### 2. Every other algorithm in the spec is already raw
|
|
64
|
+
|
|
65
|
+
ML-DSA-65 signatures are 3,309 bytes; SLH-DSA-SHA2-128s are 7,856. Both are fixed-length
|
|
66
|
+
byte strings with no DER form. With ECDSA on DER and the post-quantum schemes on raw,
|
|
67
|
+
every verifier needs per-algorithm branching on `encoding`. With ECDSA on raw, all sixteen
|
|
68
|
+
algorithm identifiers share one representation and the branch disappears.
|
|
69
|
+
|
|
70
|
+
### 3. It matches what the signature actually is
|
|
71
|
+
|
|
72
|
+
§Algorithms specifies that the signer signs the 32-byte `payloadHash` **directly**. This is
|
|
73
|
+
a detached signature over a digest, not a Bitcoin script signature — the case ES256K
|
|
74
|
+
(RFC 7515) and WebCrypto both address, and both use `r ‖ s`, not DER.
|
|
75
|
+
|
|
76
|
+
### 4. Low-S is a separate malleability, and raw does not fix it
|
|
77
|
+
|
|
78
|
+
For any ECDSA signature, `s` and `n − s` both verify. They are different bytes, so they
|
|
79
|
+
produce different `proofHash` values. Without a normative rule, two valid certificates
|
|
80
|
+
exist for one signing act — an ambiguity a notarization protocol should not carry.
|
|
81
|
+
|
|
82
|
+
Requiring low-S at signing, and **rejecting** rather than normalising on receipt, keeps
|
|
83
|
+
`proofHash` a function of the certificate as issued.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Note on `toCompact`
|
|
88
|
+
|
|
89
|
+
Some Bitcoin libraries expose a 65-byte "compact" signature. That is not this format: it
|
|
90
|
+
carries a leading recovery byte for public-key recovery. `"raw"` is the bare 64 bytes,
|
|
91
|
+
with no recovery byte, because the public key is already a certificate field.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Impact on existing certificates
|
|
96
|
+
|
|
97
|
+
None, if no certificate has yet been issued with `encoding: "der"`. If any have, they
|
|
98
|
+
remain valid — `"der"` stays an accepted value, and the SPV envelope and `proofHash`
|
|
99
|
+
semantics are untouched. This amendment defines a field that was previously unspecified;
|
|
100
|
+
it does not change any field that was.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# BRC-220 (NotaryHash) — implementation plan
|
|
2
|
+
|
|
3
|
+
Plan for implementing [BRC-220](https://github.com/bitcoin-sv/BRCs/blob/master/apps/0220.md),
|
|
4
|
+
*NotaryHash: Privacy-Preserving Signed-Hash Notarization with SPV-Verifiable Certificates*,
|
|
5
|
+
in `@smartledger/bsv`.
|
|
6
|
+
|
|
7
|
+
Drafted against the spec on 2026-08-16, at v8.2.0. Nothing here is implemented yet.
|
|
8
|
+
|
|
9
|
+
## 1. Why this library
|
|
10
|
+
|
|
11
|
+
BRC-220 is a notarization protocol, not a signature scheme. It needs a signer, an
|
|
12
|
+
`OP_FALSE OP_RETURN` output, a canonical JSON certificate, an SPV proof, and a Merkle
|
|
13
|
+
tree. Four of those five already exist here:
|
|
14
|
+
|
|
15
|
+
| BRC-220 needs | Already present |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| RFC 8785 canonical certificate | `AttestationSigner._canonicalizeJCS` (8.2.0) |
|
|
18
|
+
| SPV inclusion proof, TSC format | `lib/spv/merkleproof.js`, `lib/spv/headerchain.js` |
|
|
19
|
+
| Independent block headers, never the provider's word | `verifyHeaderChain`, already the documented stance |
|
|
20
|
+
| `OP_FALSE OP_RETURN` safe data output | `lib/transaction`, `lib/custom-script-helper.js` |
|
|
21
|
+
| Length-prefixed binary | `lib/encoding/bufferwriter.js` |
|
|
22
|
+
| ECDSA-secp256k1 signing | `lib/crypto/ecdsa.js` |
|
|
23
|
+
|
|
24
|
+
The JCS work landed in 8.2.0 for an unrelated reason — GDAF signatures had to be
|
|
25
|
+
verifiable by other implementations — and BRC-220 requires exactly that encoding for its
|
|
26
|
+
certificates. That is the single strongest argument that this belongs here rather than in
|
|
27
|
+
a separate package.
|
|
28
|
+
|
|
29
|
+
## 2. Post-quantum stays OUT of the dependency tree
|
|
30
|
+
|
|
31
|
+
The spec names ML-DSA (3 parameter sets) and SLH-DSA (12), but `ECDSA-secp256k1` is a
|
|
32
|
+
first-class algorithm alongside them. A conformant implementation can support ECDSA only.
|
|
33
|
+
|
|
34
|
+
`@noble/post-quantum` should NOT become a dependency of this library:
|
|
35
|
+
|
|
36
|
+
- **It is the one unaudited Noble package.** Its README states plainly: *"The library has
|
|
37
|
+
not been independently audited yet"* — a self-audit at 0.6.1 only. `@noble/curves`,
|
|
38
|
+
`@noble/hashes` and `@noble/ciphers` carry a published Cure53 audit, which is why
|
|
39
|
+
`docs/AUDIT_SCOPE.md` can tell a vendor not to price the primitive layer. Adding an
|
|
40
|
+
unaudited implementation trades that away and has to be disclosed.
|
|
41
|
+
- It is **0.x**, so the API is not stable.
|
|
42
|
+
- It does **not claim constant-time execution**, which its README calls out as mattering
|
|
43
|
+
most when an attacker can measure signing.
|
|
44
|
+
- 669 KB unpacked, against bundles this project cut 20% in 8.0.0.
|
|
45
|
+
|
|
46
|
+
**Instead: a suite registry.** `algorithm` is a string in both the certificate and the
|
|
47
|
+
on-chain record, so it maps naturally onto a lookup:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
NotaryHash.registerSuite('ML-DSA-65', {
|
|
51
|
+
verify: function (payloadHash, signature, publicKey) { /* … */ },
|
|
52
|
+
sign: function (payloadHash, privateKey) { /* … */ }
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`ECDSA-secp256k1` is registered by default and needs nothing new. Everything else is
|
|
57
|
+
supplied by the caller — most obviously from **`@smartledger/keys`**, which already wraps
|
|
58
|
+
`@noble/post-quantum` for ML-DSA-44/65/87. That keeps one PQ dependency in the ecosystem
|
|
59
|
+
rather than two, and callers who do not need it pay nothing in bundle size or audit
|
|
60
|
+
surface.
|
|
61
|
+
|
|
62
|
+
Note `@smartledger/keys@2.0.0` is currently 8 months stale and behind on all three of its
|
|
63
|
+
crypto dependencies, including a full major on `@noble/hashes` (1.8.0 against 2.3.0).
|
|
64
|
+
Refreshing it is a prerequisite for recommending it as the PQ path, and is separate work.
|
|
65
|
+
|
|
66
|
+
## 3. The trap: three different Merkle trees
|
|
67
|
+
|
|
68
|
+
BRC-220 batch mode uses **RFC 6962** trees. This library already contains two Merkle
|
|
69
|
+
implementations, and **neither is RFC 6962**:
|
|
70
|
+
|
|
71
|
+
| Tree | Leaf | Internal | Odd node |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| Bitcoin (`lib/spv/merkleproof.js`) | txid | `sha256d(L‖R)` | rightmost **duplicated** |
|
|
74
|
+
| `lib/gdaf/zk-prover.js` | salted field hash | `sha256(L‖R)` | duplicated |
|
|
75
|
+
| **RFC 6962 (BRC-220 needs)** | `sha256(0x00‖d)` | `sha256(0x01‖L‖R)` | **never duplicated** |
|
|
76
|
+
|
|
77
|
+
Domain separation and the no-duplication rule are what make RFC 6962 resistant to the
|
|
78
|
+
second-preimage attack Bitcoin's tree is famously vulnerable to. Reusing either existing
|
|
79
|
+
implementation would be silently wrong: it would produce a root that no other BRC-220
|
|
80
|
+
implementation computes, and the failure would only appear when someone else verified a
|
|
81
|
+
batch certificate.
|
|
82
|
+
|
|
83
|
+
RFC 6962 splits at the **largest power of two less than the leaf count**, not the middle.
|
|
84
|
+
That must be tested against published RFC 6962 vectors, not against our own output.
|
|
85
|
+
|
|
86
|
+
## 4. Module layout
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
lib/notaryhash/
|
|
90
|
+
index.js NotaryHash.create / verify / registerSuite
|
|
91
|
+
encoding.js lp(), canonical bytes, proofHash
|
|
92
|
+
script.js OP_FALSE OP_RETURN builder + parser, all three modes
|
|
93
|
+
certificate.js build, JCS-canonicalize, validate shape
|
|
94
|
+
merkle.js RFC 6962 — NOT the Bitcoin or zk-prover trees
|
|
95
|
+
suites.js registry; ECDSA-secp256k1 registered by default
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Exposed as `bsv.NotaryHash`, with a `notaryhash-entry.js` and its own bundle, matching how
|
|
99
|
+
`gdaf`, `ltp` and `didweb` are already packaged.
|
|
100
|
+
|
|
101
|
+
## 5. What gets built, in order
|
|
102
|
+
|
|
103
|
+
**Phase 1 — encoding and proofHash.** `lp(x) = u32be(len(x)) || x`, and the canonical byte
|
|
104
|
+
string:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
lp("NotaryHash/1.0") || u8(version) || lp(algorithm) || lp(hashAlgorithm) ||
|
|
108
|
+
lp(payloadHash) || lp(publicKey) || lp(signature) || u64be(createdAtUnix)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The protocol prefix, version and timestamp are in `proofHash` but never on chain — so the
|
|
112
|
+
on-chain record alone cannot reconstruct it, and a verifier needs the certificate. Worth a
|
|
113
|
+
test that states this, because it looks like an omission otherwise.
|
|
114
|
+
|
|
115
|
+
**Phase 2 — the OP_RETURN record**, all three modes, builder and parser, round-tripping.
|
|
116
|
+
Full mode carries the key and signature; hybrid carries `sha256` of each, which is what
|
|
117
|
+
makes PQ signatures affordable on chain; batch carries only a 32-byte root and a `u32be`
|
|
118
|
+
leaf count.
|
|
119
|
+
|
|
120
|
+
**Phase 3 — certificate**, built on the existing `_canonicalizeJCS`. The SPV envelope is
|
|
121
|
+
additive and must not change `proofHash` — a test should add an envelope to a finished
|
|
122
|
+
certificate and assert the hash is unchanged.
|
|
123
|
+
|
|
124
|
+
**Phase 4 — verification**, the three checks the spec requires, each returning a strict
|
|
125
|
+
boolean and failing closed:
|
|
126
|
+
|
|
127
|
+
1. signature verifies over `payloadHash` under the registered suite — offline;
|
|
128
|
+
2. `proofHash` recomputes from canonical bytes and matches — offline;
|
|
129
|
+
3. anchor confirmed, SPV preferred: `txid = reverse(sha256d(rawTx))`, the `OP_RETURN`
|
|
130
|
+
fields match the certificate, and the TSC Merkle proof folds to a root matching a
|
|
131
|
+
block header **obtained independently**.
|
|
132
|
+
|
|
133
|
+
**Phase 5 — batch mode** and RFC 6962, last because it is the piece most likely to be got
|
|
134
|
+
wrong and benefits from everything else being settled.
|
|
135
|
+
|
|
136
|
+
## 6. Testing stance
|
|
137
|
+
|
|
138
|
+
Given what the last two reviews found in `zk-prover.js` — a range proof that verified
|
|
139
|
+
nothing and a selective-disclosure scheme that leaked every withheld field, under 4,469
|
|
140
|
+
passing tests — this module starts with adversarial tests rather than acquiring them
|
|
141
|
+
later:
|
|
142
|
+
|
|
143
|
+
- Every `verify` returns a **strict boolean** or throws. Never a truthy result object.
|
|
144
|
+
This is the defect class that has recurred most in this codebase.
|
|
145
|
+
- Each of the three validity checks has a test that **defeats it in isolation**: a valid
|
|
146
|
+
signature with a tampered `proofHash`; a correct `proofHash` with a forged signature; a
|
|
147
|
+
well-formed certificate anchored to a transaction that is not in the block it claims.
|
|
148
|
+
- An unregistered `algorithm` must **fail**, not fall through to a default suite.
|
|
149
|
+
- RFC 6962 vectors from the RFC, not from our own implementation, and a test that a
|
|
150
|
+
Bitcoin-style tree over the same leaves produces a *different* root — that failure is
|
|
151
|
+
the one that would otherwise ship silently.
|
|
152
|
+
- Round-trip the on-chain record for all three modes, and assert hybrid's pushes are
|
|
153
|
+
32 bytes where full's are variable.
|
|
154
|
+
|
|
155
|
+
## 7. Questions, settled against the full text
|
|
156
|
+
|
|
157
|
+
The spec is 8,514 bytes. These were resolved by reading all of it rather than querying it
|
|
158
|
+
piecemeal — which is also how the first of them turned out to be an artifact of my own
|
|
159
|
+
summarising rather than anything in the document.
|
|
160
|
+
|
|
161
|
+
- **Push 0 is `"NOTARYHASH"`, 10 ASCII bytes** (`4e4f5441525948415348`). The spec states no
|
|
162
|
+
byte count for it anywhere; the "9 bytes" this section previously flagged came from a
|
|
163
|
+
summarisation step, not the normative text. Verified by fetching the raw file and
|
|
164
|
+
grepping it directly.
|
|
165
|
+
- **`hashAlgorithm` is SHA-256** for every algorithm the spec lists — the Algorithms table
|
|
166
|
+
gives one hash for all three families. It is not stated to be closed, so the field stays
|
|
167
|
+
a string rather than an enum, but SHA-256 is the only conformant value in v1.
|
|
168
|
+
- **The signer signs the 32-byte `payloadHash` directly** (§Algorithms): "post-quantum
|
|
169
|
+
schemes apply their own internal hashing". So ECDSA signs the digest as-is, with no
|
|
170
|
+
second hash. Getting this wrong produces signatures nothing else verifies.
|
|
171
|
+
- **Batch certificates carry BOTH `anchor` and `merkle`** — the spec says a batched
|
|
172
|
+
certificate "additionally carries" the inclusion proof.
|
|
173
|
+
- **The service is a role, not a requirement.** §What a certificate proves: "any party
|
|
174
|
+
holding a valid (hash, signature, publicKey) triple may re-anchor it; the attestation
|
|
175
|
+
remains valid". A self-notarizing caller producing its own certificate is conformant.
|
|
176
|
+
- **`createdAt` is advisory for trust but load-bearing for the hash.** §Verification calls
|
|
177
|
+
it "an advisory client field only" — meaning proof-of-existence time comes from the
|
|
178
|
+
block, not from this field. It is still inside the canonical bytes as `createdAtUnix`,
|
|
179
|
+
so it cannot be altered after issuance.
|
|
180
|
+
|
|
181
|
+
Decided, and proposed back to the spec:
|
|
182
|
+
|
|
183
|
+
- **`encoding` is `"raw"`.** The field is required by the spec but its values were never
|
|
184
|
+
enumerated, so this library defines them and proposes the definition upstream — see
|
|
185
|
+
`docs/BRC220_ENCODING_AMENDMENT.md`.
|
|
186
|
+
|
|
187
|
+
For `ECDSA-secp256k1` that is 64 bytes, `r ‖ s`, each a 32-byte big-endian integer, with
|
|
188
|
+
a 33-byte compressed public key. NOT DER, and not the 65-byte `toCompact` form, which
|
|
189
|
+
carries a recovery byte the certificate does not need because it already has the key.
|
|
190
|
+
|
|
191
|
+
The deciding argument is that `proofHash` covers `lp(signature)`, and **DER is not
|
|
192
|
+
canonical**. Measured over 200 signatures from one key: DER came out at 69, 70 and 71
|
|
193
|
+
bytes depending on leading-zero handling, all of it legal. Raw was 64 bytes every time.
|
|
194
|
+
The same signing act producing different `proofHash` values is precisely the failure the
|
|
195
|
+
binary encoding exists to prevent — it is why the spec already refuses `JSON.stringify`.
|
|
196
|
+
|
|
197
|
+
Two supporting reasons: ML-DSA and SLH-DSA have no DER form, so raw makes `encoding`
|
|
198
|
+
uniform across all sixteen algorithm identifiers instead of forcing per-algorithm
|
|
199
|
+
branching in every verifier; and the signature is detached over a digest rather than a
|
|
200
|
+
Bitcoin script signature, which is the ES256K/WebCrypto case, and both use `r ‖ s`.
|
|
201
|
+
|
|
202
|
+
**Low-S is required and must be rejected, not normalised.** `s` and `n − s` both verify
|
|
203
|
+
and hash differently, so without the rule two valid certificates exist for one signing
|
|
204
|
+
act. Normalising on receipt would change the signature bytes, which are inside
|
|
205
|
+
`proofHash`. This library already emits low-S and has `Signature.toCanonical()`.
|
|
206
|
+
|
|
207
|
+
### The reference implementation
|
|
208
|
+
|
|
209
|
+
§Implementations describes a reference service, client SDK and standalone verifier, with
|
|
210
|
+
**published test vectors**: a complete certificate-with-SPV-envelope golden vector,
|
|
211
|
+
`txidFromRawTx` against the Bitcoin genesis coinbase, and the Merkle fold against the real
|
|
212
|
+
block-170 two-transaction proof.
|
|
213
|
+
|
|
214
|
+
Those vectors are worth more than anything in §6, and should be wired in as gates before
|
|
215
|
+
Phase 2 goes far. This module's characteristic failure is being self-consistent and wrong
|
|
216
|
+
— every local test green, no other implementation agreeing — and a golden vector from a
|
|
217
|
+
second implementation is the only thing that actually rules it out. Our own tests cannot.
|
|
218
|
+
|
|
219
|
+
## 8. Not in scope
|
|
220
|
+
|
|
221
|
+
- Post-quantum suites themselves — supplied by the caller, see §2.
|
|
222
|
+
- The notary *service*. This library builds and verifies records and certificates; it does
|
|
223
|
+
not run the submission endpoint the spec describes.
|
|
224
|
+
- Broadcasting. Existing transaction plumbing covers it.
|
|
@@ -55,19 +55,19 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
55
55
|
- **Purpose**: Threshold cryptography for secure secret distribution
|
|
56
56
|
- **Use Cases**: Backup keys, multi-party security, key recovery
|
|
57
57
|
- **Features**: Split secrets into N shares, require M to reconstruct
|
|
58
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@8.
|
|
58
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@8.3.0/bsv-shamir.min.js`
|
|
59
59
|
|
|
60
60
|
#### **🌐 Global Digital Attestation Framework - GDAF (1184KB)**
|
|
61
61
|
- **Purpose**: W3C Verifiable Credentials and decentralized identity
|
|
62
62
|
- **Use Cases**: Identity verification, attestations, zero-knowledge proofs
|
|
63
63
|
- **Features**: DID creation, credential issuance, selective disclosure
|
|
64
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@8.
|
|
64
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js`
|
|
65
65
|
|
|
66
66
|
#### **⚖️ Legal Token Protocol - LTP (1184KB)**
|
|
67
67
|
- **Purpose**: Legal compliance framework for tokenized assets
|
|
68
68
|
- **Use Cases**: Property rights, obligations, compliant tokenization
|
|
69
69
|
- **Features**: Legal primitives, compliance checking, attestation anchoring
|
|
70
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@8.
|
|
70
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js`
|
|
71
71
|
|
|
72
72
|
### **2. Incorrect File Sizes in Documentation**
|
|
73
73
|
|
|
@@ -81,18 +81,18 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
81
81
|
|
|
82
82
|
| Module | Size | Use Case | CDN Link |
|
|
83
83
|
|--------|------|----------|----------|
|
|
84
|
-
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.
|
|
85
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.
|
|
86
|
-
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@8.
|
|
87
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.
|
|
88
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.
|
|
89
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.
|
|
90
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.
|
|
91
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.
|
|
92
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.
|
|
93
|
-
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@8.
|
|
94
|
-
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@8.
|
|
95
|
-
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@8.
|
|
84
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js` |
|
|
85
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js` |
|
|
86
|
+
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@8.3.0/bsv-smartcontract.min.js` |
|
|
87
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.3.0/bsv-covenant.min.js` |
|
|
88
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.3.0/bsv-script-helper.min.js` |
|
|
89
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.3.0/bsv-security.min.js` |
|
|
90
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.3.0/bsv-ecies.min.js` |
|
|
91
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.3.0/bsv-message.min.js` |
|
|
92
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.3.0/bsv-mnemonic.min.js` |
|
|
93
|
+
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-shamir.min.js` |
|
|
94
|
+
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js` |
|
|
95
|
+
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js` |
|
|
96
96
|
|
|
97
97
|
## 🎯 **Updated Usage Examples**
|
|
98
98
|
|
|
@@ -100,22 +100,22 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
100
100
|
|
|
101
101
|
#### **1. Basic Development (~963KB)**
|
|
102
102
|
```html
|
|
103
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
104
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
104
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-script-helper.min.js"></script>
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
#### **2. Smart Contract Development (~2.7MB — each bundle re-embeds core BSV)**
|
|
108
108
|
```html
|
|
109
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
110
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
111
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
109
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
110
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-covenant.min.js"></script>
|
|
111
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-smartcontract.min.js"></script>
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
#### **3. 🆕 Legal & Compliance Development (~3.2MB — each bundle re-embeds core BSV)**
|
|
115
115
|
```html
|
|
116
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
117
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
118
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
116
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
117
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js"></script>
|
|
118
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js"></script>
|
|
119
119
|
<script>
|
|
120
120
|
// Legal Token Protocol
|
|
121
121
|
const legalToken = bsv.createLegalToken({
|
|
@@ -132,9 +132,9 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
132
132
|
|
|
133
133
|
#### **4. 🆕 Security & Cryptography (~1.4MB)**
|
|
134
134
|
```html
|
|
135
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
137
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
135
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-security.min.js"></script>
|
|
137
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-shamir.min.js"></script>
|
|
138
138
|
<script>
|
|
139
139
|
// Shamir Secret Sharing
|
|
140
140
|
const shares = bsv.splitSecret('my_secret_key', 5, 3); // 5 shares, 3 needed
|
|
@@ -146,7 +146,7 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
146
146
|
|
|
147
147
|
#### **5. Everything Bundle (937KB)**
|
|
148
148
|
```html
|
|
149
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
149
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js"></script>
|
|
150
150
|
<script>
|
|
151
151
|
// Everything available immediately
|
|
152
152
|
const shares = bsv.splitSecret('secret', 5, 3);
|
|
@@ -722,7 +722,7 @@ interface UTXO {
|
|
|
722
722
|
<html>
|
|
723
723
|
<head>
|
|
724
724
|
<title>UTXO Manager Demo</title>
|
|
725
|
-
<script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@8.
|
|
725
|
+
<script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
726
726
|
</head>
|
|
727
727
|
<body>
|
|
728
728
|
<script>
|
|
@@ -48,7 +48,7 @@ const tx: Transaction = new Transaction();
|
|
|
48
48
|
#### **Core Library Only (937KB)**
|
|
49
49
|
For basic Bitcoin SV operations:
|
|
50
50
|
```html
|
|
51
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
51
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
52
52
|
<script>
|
|
53
53
|
const privateKey = new bsv.PrivateKey();
|
|
54
54
|
const address = privateKey.toAddress();
|
|
@@ -58,7 +58,7 @@ For basic Bitcoin SV operations:
|
|
|
58
58
|
#### **Complete Bundle (937KB)**
|
|
59
59
|
Everything in one file:
|
|
60
60
|
```html
|
|
61
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
61
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js"></script>
|
|
62
62
|
<script>
|
|
63
63
|
// All features available immediately
|
|
64
64
|
const shares = bsv.splitSecret('secret', 5, 3);
|
|
@@ -71,9 +71,9 @@ Everything in one file:
|
|
|
71
71
|
|
|
72
72
|
#### **Smart Contract Development (~2.7MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
73
73
|
```html
|
|
74
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
75
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
76
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
74
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
75
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-covenant.min.js"></script>
|
|
76
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-smartcontract.min.js"></script>
|
|
77
77
|
<script>
|
|
78
78
|
const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
79
79
|
.extractField('amount').push(50000).greaterThanOrEqual().build();
|
|
@@ -82,9 +82,9 @@ Everything in one file:
|
|
|
82
82
|
|
|
83
83
|
#### **Legal & Identity Development (~3.2MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
84
84
|
```html
|
|
85
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
86
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
87
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
85
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
86
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js"></script>
|
|
87
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js"></script>
|
|
88
88
|
<script>
|
|
89
89
|
// Legal Token Protocol
|
|
90
90
|
const propertyToken = bsv.createPropertyToken({
|
|
@@ -98,9 +98,9 @@ Everything in one file:
|
|
|
98
98
|
|
|
99
99
|
#### **Security & Cryptography (~1.4MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
100
100
|
```html
|
|
101
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
102
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
103
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
101
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
102
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-security.min.js"></script>
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-shamir.min.js"></script>
|
|
104
104
|
<script>
|
|
105
105
|
// Threshold Cryptography
|
|
106
106
|
const shares = bsv.splitSecret('my_secret_key', 5, 3);
|
|
@@ -114,18 +114,18 @@ Everything in one file:
|
|
|
114
114
|
|
|
115
115
|
| Module | Size | Purpose | CDN Link |
|
|
116
116
|
|--------|------|---------|----------|
|
|
117
|
-
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.
|
|
118
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.
|
|
119
|
-
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@8.
|
|
120
|
-
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@8.
|
|
121
|
-
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@8.
|
|
122
|
-
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@8.
|
|
123
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.
|
|
124
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.
|
|
125
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.
|
|
126
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.
|
|
127
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.
|
|
128
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.
|
|
117
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js` |
|
|
118
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js` |
|
|
119
|
+
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@8.3.0/bsv-smartcontract.min.js` |
|
|
120
|
+
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js` |
|
|
121
|
+
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js` |
|
|
122
|
+
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@8.3.0/bsv-shamir.min.js` |
|
|
123
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@8.3.0/bsv-security.min.js` |
|
|
124
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@8.3.0/bsv-mnemonic.min.js` |
|
|
125
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@8.3.0/bsv-ecies.min.js` |
|
|
126
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@8.3.0/bsv-covenant.min.js` |
|
|
127
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@8.3.0/bsv-script-helper.min.js` |
|
|
128
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@8.3.0/bsv-message.min.js` |
|
|
129
129
|
|
|
130
130
|
## ⚙️ **Development Environment Setup**
|
|
131
131
|
|
|
@@ -14,10 +14,10 @@ npm install @smartledger/bsv
|
|
|
14
14
|
### Browser CDN (Instant)
|
|
15
15
|
```html
|
|
16
16
|
<!-- Core library (937KB) -->
|
|
17
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
17
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
18
18
|
|
|
19
19
|
<!-- Everything included (937KB) -->
|
|
20
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
20
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 💰 **Your First Transaction (60 seconds)**
|
|
@@ -127,19 +127,19 @@ SmartLedger-BSV offers 12 different loading options - use only what you need:
|
|
|
127
127
|
|
|
128
128
|
```html
|
|
129
129
|
<!-- Core BSV only (937KB) -->
|
|
130
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
130
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.min.js"></script>
|
|
131
131
|
|
|
132
132
|
<!-- Smart contracts (937KB) -->
|
|
133
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
133
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-smartcontract.min.js"></script>
|
|
134
134
|
|
|
135
135
|
<!-- Legal tokens (1.16MB) -->
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-ltp.min.js"></script>
|
|
137
137
|
|
|
138
138
|
<!-- Digital identity (1.16MB) -->
|
|
139
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
139
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv-gdaf.min.js"></script>
|
|
140
140
|
|
|
141
141
|
<!-- Everything (937KB) -->
|
|
142
|
-
<script src="https://unpkg.com/@smartledger/bsv@8.
|
|
142
|
+
<script src="https://unpkg.com/@smartledger/bsv@8.3.0/bsv.bundle.js"></script>
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
## ⚡ **Key Advantages**
|