bsv2 2.3.0 → 2.4.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/README.md +29 -0
- package/dist/bsv2.cjs +7 -7
- package/dist/bsv2.cjs.map +1 -1
- package/dist/bsv2.mjs +5546 -5156
- package/dist/bsv2.mjs.map +1 -1
- package/dist/bsv2.umd.js +7 -7
- package/dist/bsv2.umd.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -193,6 +193,8 @@ All symbols below are exported from the package root (`entry.js`).
|
|
|
193
193
|
| Cryptography and math | `Bn`, `Point`, `Ecdsa`, `Hash`, `Random`, `Aes`, `Aescbc`, `Cbc`, `Ecies`, `Ach` |
|
|
194
194
|
| Serialization / utilities | `Struct`, `Br`, `Bw`, `Bsm`, `VarInt`, `Base58`, `Base58Check`, `cmp`, `Constants` |
|
|
195
195
|
| Workers | `Workers`, `WorkersResult` |
|
|
196
|
+
| BRC helpers | `P2PKH`, `RPuzzle`, `PushDrop`, `AesGcm`, `SafeRecord`, `Reader`, `Writer` |
|
|
197
|
+
| Fees and sizing | `FeeModel`, `SatoshisPerKilobyte`, `varUintSize`, `transactionInputSize`, `transactionOutputSize`, `transactionSize` |
|
|
196
198
|
| Package | `deps`, `version` |
|
|
197
199
|
|
|
198
200
|
Additional modules under `lib/` (for example `Msg`, `Version`, `Merkle` and
|
|
@@ -263,6 +265,33 @@ For BRC-100 integrations use the BSV Association reference implementations in
|
|
|
263
265
|
|
|
264
266
|
See [BRC-100](https://bsv.brc.dev/wallet/0100.md) for the normative interface.
|
|
265
267
|
|
|
268
|
+
## BRC helpers
|
|
269
|
+
|
|
270
|
+
- `P2PKH`, `RPuzzle` and `PushDrop` build locking/unlocking scripts from
|
|
271
|
+
BRC-16, BRC-17 and BRC-48.
|
|
272
|
+
- `AesGcm` implements AES-256-GCM with BRC-2 framing
|
|
273
|
+
(`IV || ciphertext || tag`, with a 32-byte IV).
|
|
274
|
+
- `SatoshisPerKilobyte` computes a fee from the exact serialized size; the
|
|
275
|
+
`transactionSize` helpers can estimate it before signing.
|
|
276
|
+
- `Reader`/`Writer` are bounds-checked byte helpers with canonical varint
|
|
277
|
+
decoding; `SafeRecord` rejects prototype-polluting keys in untrusted JSON.
|
|
278
|
+
|
|
279
|
+
BEEF (BRC-62) and BUMP (BRC-74) are not yet implemented.
|
|
280
|
+
|
|
281
|
+
## Known differences from the C++ reference
|
|
282
|
+
|
|
283
|
+
- Activation is expressed with `SCRIPT_VERIFY_CHRONICLE` or a transaction
|
|
284
|
+
version above 1; the library has no block height, so policy is not tied to a
|
|
285
|
+
chain height.
|
|
286
|
+
- Pre-Genesis rules are selected explicitly with `SCRIPT_VERIFY_PREGENESIS_LIMITS`;
|
|
287
|
+
outside Chronicle some legacy policy differences (for example multiple
|
|
288
|
+
`OP_ELSE`) are permitted because older reference vectors rely on them.
|
|
289
|
+
- `Sig.toTxFormat()` serializes the hash type as one byte, as required inside
|
|
290
|
+
scripts; C++ `SigHashType` also supports a 32-bit form with a fork value.
|
|
291
|
+
- `Bip39` buffer serialization stores the mnemonic and seed but not the
|
|
292
|
+
wordlist; re-create non-English mnemonics with `Bip39Jp`/`Bip39Es` after a
|
|
293
|
+
binary round-trip.
|
|
294
|
+
|
|
266
295
|
## Security
|
|
267
296
|
|
|
268
297
|
Please report security issues privately through the repository's security
|