smartledger-bsv 3.1.1 → 3.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +123 -1
  2. package/README.md +233 -277
  3. package/bsv.bundle.js +39 -0
  4. package/bsv.min.js +8 -8
  5. package/docs/ADVANCED_COVENANT_DEVELOPMENT.md +533 -0
  6. package/docs/COVENANT_DEVELOPMENT_RESOLVED.md +169 -0
  7. package/docs/CUSTOM_SCRIPT_DEVELOPMENT.md +320 -0
  8. package/docs/README.md +201 -0
  9. package/docs/block.md +46 -0
  10. package/docs/ecies.md +102 -0
  11. package/docs/index.md +104 -0
  12. package/docs/nchain.md +958 -0
  13. package/docs/networks.md +55 -0
  14. package/docs/preimage.md +126 -0
  15. package/docs/script.md +139 -0
  16. package/docs/transaction.md +174 -0
  17. package/docs/unspentoutput.md +32 -0
  18. package/examples/README.md +200 -0
  19. package/examples/basic/transaction-creation.js +534 -0
  20. package/examples/basic/transaction_signature_api_gap.js +178 -0
  21. package/examples/covenants/advanced_covenant_demo.js +219 -0
  22. package/examples/covenants/covenant_interface_demo.js +270 -0
  23. package/examples/covenants/covenant_manual_signature_resolved.js +212 -0
  24. package/examples/covenants/covenant_signature_template.js +117 -0
  25. package/examples/covenants2/covenant_bidirectional_example.js +262 -0
  26. package/examples/covenants2/covenant_utils_demo.js +120 -0
  27. package/examples/covenants2/preimage_covenant_utils.js +287 -0
  28. package/examples/covenants2/production_integration.js +256 -0
  29. package/examples/data/covenant_utxos.json +28 -0
  30. package/examples/data/utxos.json +26 -0
  31. package/examples/preimage/README.md +178 -0
  32. package/examples/preimage/extract_preimage_bidirectional.js +421 -0
  33. package/examples/preimage/generate_sample_preimage.js +208 -0
  34. package/examples/preimage/generate_sighash_examples.js +152 -0
  35. package/examples/preimage/parse_preimage.js +117 -0
  36. package/examples/preimage/test_preimage_extractor.js +53 -0
  37. package/examples/preimage/test_varint_extraction.js +95 -0
  38. package/examples/scripts/custom_script_helper_example.js +273 -0
  39. package/examples/scripts/custom_script_signature_test.js +344 -0
  40. package/examples/scripts/script_interpreter.js +193 -0
  41. package/examples/smart_contract/complete_workflow_demo.js +343 -0
  42. package/examples/smart_contract/covenant_builder_demo.js +176 -0
  43. package/examples/smart_contract/script_testing_integration.js +198 -0
  44. package/index.js +3 -0
  45. package/lib/covenant-interface.js +713 -0
  46. package/lib/opcode.js +14 -7
  47. package/lib/smart_contract/API_REFERENCE.md +862 -0
  48. package/lib/smart_contract/DOCUMENTATION_SUMMARY.md +201 -0
  49. package/lib/smart_contract/EXAMPLES.md +751 -0
  50. package/lib/smart_contract/QUICK_START.md +549 -0
  51. package/lib/smart_contract/README.md +395 -0
  52. package/lib/smart_contract/builder.js +452 -0
  53. package/lib/smart_contract/covenant.js +336 -0
  54. package/lib/smart_contract/covenant_builder.js +512 -0
  55. package/lib/smart_contract/index.js +350 -0
  56. package/lib/smart_contract/opcode_list.js +30 -0
  57. package/lib/smart_contract/opcode_map.js +1174 -0
  58. package/lib/smart_contract/opcodes.md +1173 -0
  59. package/lib/smart_contract/preimage.js +903 -0
  60. package/lib/smart_contract/script_interpreter.js +236 -0
  61. package/lib/smart_contract/script_tester.js +487 -0
  62. package/lib/smart_contract/script_utils.js +621 -0
  63. package/lib/smart_contract/sighash.js +310 -0
  64. package/lib/smart_contract/smartledger-opcode_review.md +70 -0
  65. package/lib/smart_contract/stack_examiner.js +129 -0
  66. package/lib/smart_contract/test_integration.js +269 -0
  67. package/lib/smart_contract/utxo_generator.js +367 -0
  68. package/package.json +43 -10
  69. package/utilities/blockchain-state.json +20478 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "smartledger-bsv",
3
- "version": "3.1.1",
4
- "description": "Security-hardened Bitcoin SV library with custom script framework - Complete drop-in replacement for bsv@1.5.6 with zero vulnerabilities",
3
+ "version": "3.2.1",
4
+ "description": "Advanced Bitcoin SV library with JavaScript-to-Bitcoin Script framework - Complete BSV API + BIP143 preimage parsing + 121 opcode mapping + covenant builder + nChain PUSHTX techniques + custom script development + integrated debugging tools",
5
5
  "author": "SmartLedger Technology <hello@smartledger.technology> (https://smartledger.technology)",
6
6
  "homepage": "https://github.com/codenlighten/smartledger-bsv#readme",
7
7
  "bugs": {
@@ -12,14 +12,25 @@
12
12
  "lint": "standard",
13
13
  "test": "standard && mocha",
14
14
  "test:signatures": "node validation_test.js",
15
+ "test:js2script": "node lib/smart_contract/opcode_map.js && node lib/smart_contract/covenant_builder.js",
16
+ "test:opcodes": "node lib/smart_contract/opcode_list.js",
17
+ "test:covenants": "node examples/covenants/advanced_covenant_demo.js",
18
+ "test:scripts": "node examples/scripts/custom_script_signature_test.js",
19
+ "test:basic": "node examples/basic/transaction-creation.js",
20
+ "test:all": "npm test && npm run test:covenants && npm run test:scripts",
15
21
  "coverage": "nyc --reporter=text npm run test",
16
- "build-bsv": "webpack index.js --config webpack.config.js",
17
- "build-ecies": "webpack ecies/index.js --config webpack.subproject.config.js --output-library bsvEcies -o bsv-ecies.min.js",
18
- "build-message": "webpack message/index.js --config webpack.subproject.config.js --output-library bsvMessage -o bsv-message.min.js",
19
- "build-mnemonic": "webpack mnemonic/index.js --config webpack.subproject.config.js --output-library bsvMnemonic -o bsv-mnemonic.min.js",
20
- "build-bundle": "webpack bundle-entry.js --config webpack.bundle.config.js",
22
+ "build-bsv": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack index.js --config webpack.config.js",
23
+ "build-ecies": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack ecies/index.js --config webpack.subproject.config.js --output-library bsvEcies -o bsv-ecies.min.js",
24
+ "build-message": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack message/index.js --config webpack.subproject.config.js --output-library bsvMessage -o bsv-message.min.js",
25
+ "build-mnemonic": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack mnemonic/index.js --config webpack.subproject.config.js --output-library bsvMnemonic -o bsv-mnemonic.min.js",
26
+ "build-bundle": "NODE_OPTIONS=\"--openssl-legacy-provider\" webpack bundle-entry.js --config webpack.bundle.config.js",
21
27
  "build": "npm run build-bsv && npm run build-ecies && npm run build-message && npm run build-mnemonic",
22
28
  "build-all": "npm run build && npm run build-bundle",
29
+ "demo": "npm run test:covenants",
30
+ "demo:basic": "npm run test:basic",
31
+ "demo:scripts": "npm run test:scripts",
32
+ "demo:preimage": "echo '🧠 BIP-143 Preimage Extractor Demo' && node examples/preimage/extract_preimage_bidirectional.js",
33
+ "preimage:extract": "node examples/preimage/extract_preimage_bidirectional.js",
23
34
  "prepublishOnly": "NODE_OPTIONS=\"--openssl-legacy-provider\" npm run build"
24
35
  },
25
36
  "unpkg": "bsv.min.js",
@@ -33,11 +44,14 @@
33
44
  "message/",
34
45
  "mnemonic/",
35
46
  "bsv.min.js",
47
+ "bsv.bundle.js",
36
48
  "bsv-ecies.min.js",
37
- "bsv-message.min.js",
49
+ "bsv-message.min.js",
38
50
  "bsv-mnemonic.min.js",
39
51
  "bsv.d.ts",
40
52
  "validation_test.js",
53
+ "docs/",
54
+ "examples/",
41
55
  "LICENSE",
42
56
  "README.md",
43
57
  "SECURITY.md",
@@ -55,7 +69,27 @@
55
69
  "hardened",
56
70
  "vulnerability-free",
57
71
  "drop-in-replacement",
72
+ "covenant",
73
+ "covenants",
74
+ "pushtx",
75
+ "pels",
76
+ "bip143",
77
+ "preimage",
78
+ "nchain",
79
+ "custom-scripts",
80
+ "multisig",
81
+ "timelock",
82
+ "conditional-scripts",
58
83
  "utxo-management",
84
+ "ultra-low-fees",
85
+ "javascript-to-script",
86
+ "opcode-mapping",
87
+ "covenant-builder",
88
+ "script-simulation",
89
+ "bitcoin-script",
90
+ "asm-generation",
91
+ "advanced-features",
92
+ "script-development",
59
93
  "blockchain-simulator",
60
94
  "miner-simulator",
61
95
  "testing-tools",
@@ -67,8 +101,7 @@
67
101
  "bip32",
68
102
  "bip37",
69
103
  "bip69",
70
- "bip70",
71
- "multisig"
104
+ "bip70"
72
105
  ],
73
106
  "repository": {
74
107
  "type": "git",