smartledger-bsv 3.4.0 → 3.4.5

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 (119) hide show
  1. package/CHANGELOG.md +446 -0
  2. package/README.md +112 -84
  3. package/SECURITY.md +88 -0
  4. package/bin/cli.js +13 -8
  5. package/bsv-anchor.min.js +12 -0
  6. package/bsv-covenant.min.js +8 -8
  7. package/bsv-didweb.min.js +12 -0
  8. package/bsv-gdaf.min.js +9 -9
  9. package/bsv-ltp.min.js +9 -9
  10. package/bsv-mnemonic.min.js +2 -2
  11. package/bsv-shamir.min.js +3 -3
  12. package/bsv-smartcontract.min.js +5 -5
  13. package/bsv-statuslist.min.js +18 -0
  14. package/bsv-vcjwt.min.js +12 -0
  15. package/bsv.bundle.js +9 -9
  16. package/bsv.d.ts +486 -9
  17. package/bsv.min.js +5 -5
  18. package/build/webpack.anchor.config.js +9 -13
  19. package/build/webpack.didweb.config.js +10 -14
  20. package/build/webpack.statuslist.config.js +9 -14
  21. package/build/webpack.vcjwt.config.js +9 -13
  22. package/docs/COVENANT_DEVELOPMENT_RESOLVED.md +2 -2
  23. package/docs/MODULE_REFERENCE_COMPLETE.md +61 -58
  24. package/docs/advanced/LEGAL_TOKEN_PROTOCOL.md +3 -3
  25. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  26. package/docs/getting-started/INSTALLATION.md +30 -30
  27. package/docs/getting-started/QUICK_START.md +18 -18
  28. package/docs/migration/FROM_BSV_1_5_6.md +16 -10
  29. package/gdaf-entry.js +1 -2
  30. package/index.js +44 -13
  31. package/lib/browser-utxo-manager-es5.js +11 -4
  32. package/lib/browser-utxo-manager.js +15 -8
  33. package/lib/ltp/claim.js +1 -0
  34. package/lib/ltp/obligation.js +1 -0
  35. package/lib/ltp/registry.js +2 -0
  36. package/lib/ltp/right.js +1 -0
  37. package/lib/script/script.js +19 -0
  38. package/lib/smart_contract/covenant.js +10 -1
  39. package/lib/smartutxo.js +20 -12
  40. package/lib/transaction/input/publickeyhash.js +6 -1
  41. package/lib/transaction/transaction.js +13 -2
  42. package/lib/util/_.js +7 -1
  43. package/ltp-entry.js +1 -2
  44. package/package.json +11 -13
  45. package/utilities/blockchain-state.js +32 -23
  46. package/demos/README.md +0 -188
  47. package/demos/architecture_demo.js +0 -247
  48. package/demos/browser-test.html +0 -1208
  49. package/demos/bsv_wallet_demo.js +0 -242
  50. package/demos/complete_ltp_demo.js +0 -511
  51. package/demos/debug_tools_demo.js +0 -87
  52. package/demos/demo_features.js +0 -123
  53. package/demos/easy_interface_demo.js +0 -109
  54. package/demos/ecies_demo.js +0 -182
  55. package/demos/gdaf_core_test.js +0 -131
  56. package/demos/gdaf_demo.js +0 -237
  57. package/demos/ltp_demo.js +0 -361
  58. package/demos/ltp_primitives_demo.js +0 -403
  59. package/demos/message_demo.js +0 -209
  60. package/demos/preimage_separation_demo.js +0 -383
  61. package/demos/script_helper_demo.js +0 -289
  62. package/demos/security_demo.js +0 -287
  63. package/demos/shamir_demo.js +0 -121
  64. package/demos/simple_demo.js +0 -204
  65. package/demos/simple_p2pkh_demo.js +0 -169
  66. package/demos/simple_utxo_preimage_demo.js +0 -196
  67. package/demos/smart_contract_demo.html +0 -1347
  68. package/demos/smart_contract_demo.js +0 -910
  69. package/demos/utxo_generator_demo.js +0 -244
  70. package/demos/validation_pipeline_demo.js +0 -155
  71. package/demos/web3keys.html +0 -740
  72. package/examples/README.md +0 -200
  73. package/examples/basic/transaction-creation.js +0 -534
  74. package/examples/basic/transaction_signature_api_gap.js +0 -178
  75. package/examples/complete_workflow_demo.js +0 -783
  76. package/examples/covenants/advanced_covenant_demo.js +0 -219
  77. package/examples/covenants/covenant_interface_demo.js +0 -270
  78. package/examples/covenants/covenant_manual_signature_resolved.js +0 -212
  79. package/examples/covenants/covenant_signature_template.js +0 -117
  80. package/examples/covenants2/covenant_bidirectional_example.js +0 -262
  81. package/examples/covenants2/covenant_utils_demo.js +0 -120
  82. package/examples/covenants2/preimage_covenant_utils.js +0 -287
  83. package/examples/covenants2/production_integration.js +0 -256
  84. package/examples/data/covenant_utxos.json +0 -28
  85. package/examples/data/utxos.json +0 -26
  86. package/examples/definitive_working_demo.js +0 -261
  87. package/examples/final_working_contracts.js +0 -338
  88. package/examples/preimage/README.md +0 -178
  89. package/examples/preimage/extract_preimage_bidirectional.js +0 -421
  90. package/examples/preimage/generate_sample_preimage.js +0 -208
  91. package/examples/preimage/generate_sighash_examples.js +0 -152
  92. package/examples/preimage/parse_preimage.js +0 -117
  93. package/examples/preimage/test_preimage_extractor.js +0 -53
  94. package/examples/preimage/test_varint_extraction.js +0 -95
  95. package/examples/scripts/custom_script_helper_example.js +0 -273
  96. package/examples/scripts/custom_script_signature_test.js +0 -344
  97. package/examples/scripts/script_interpreter.js +0 -193
  98. package/examples/smart_contract/complete_workflow_demo.js +0 -343
  99. package/examples/smart_contract/covenant_builder_demo.js +0 -176
  100. package/examples/smart_contract/script_testing_integration.js +0 -198
  101. package/examples/smart_contract_templates.js +0 -718
  102. package/examples/working_smart_contracts.js +0 -348
  103. package/lib/smart_contract/test_integration.js +0 -269
  104. package/tests/browser-compatibility/README.md +0 -35
  105. package/tests/browser-compatibility/test-cdn-vs-local.html +0 -186
  106. package/tests/browser-compatibility/test-pbkdf2.html +0 -51
  107. package/tests/bundle-completeness-test.html +0 -131
  108. package/tests/bundle-demo.html +0 -476
  109. package/tests/smartcontract-test.html +0 -239
  110. package/tests/standalone-modules-test.html +0 -260
  111. package/tests/test.html +0 -612
  112. package/tests/test_builtin_verify.js +0 -117
  113. package/tests/test_debug_integration.js +0 -71
  114. package/tests/test_ecdsa_little.js +0 -70
  115. package/tests/test_shamir.js +0 -221
  116. package/tests/test_smartverify_der.js +0 -110
  117. package/tests/test_standalone_shamir.html +0 -83
  118. package/tests/unpkg-demo.html +0 -194
  119. package/utilities/blockchain-state.json +0 -118565
@@ -1,194 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>SmartLedger BSV - unpkg CDN Demo</title>
7
- <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- max-width: 800px;
11
- margin: 0 auto;
12
- padding: 20px;
13
- background: #f5f5f5;
14
- }
15
- .demo-section {
16
- background: white;
17
- padding: 20px;
18
- margin: 20px 0;
19
- border-radius: 8px;
20
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
21
- }
22
- h1 { color: #6B46C1; }
23
- h2 { color: #4C1D95; }
24
- .result {
25
- background: #f8f9fa;
26
- padding: 10px;
27
- border-left: 4px solid #6B46C1;
28
- margin: 10px 0;
29
- font-family: monospace;
30
- }
31
- .button {
32
- background: #6B46C1;
33
- color: white;
34
- border: none;
35
- padding: 10px 20px;
36
- border-radius: 4px;
37
- cursor: pointer;
38
- margin: 5px;
39
- }
40
- .button:hover { background: #4C1D95; }
41
- </style>
42
- </head>
43
- <body>
44
- <h1>🚀 SmartLedger BSV v3.0 - unpkg CDN Demo</h1>
45
-
46
- <div class="demo-section">
47
- <h2>📦 Loaded from unpkg CDN</h2>
48
- <p>This page demonstrates SmartLedger BSV loaded directly from unpkg:</p>
49
- <div class="result">
50
- <strong>CDN URL:</strong> https://unpkg.com/smartledger-bsv@3.0.0/bsv.min.js<br>
51
- <strong>Package:</strong> smartledger-bsv@3.0.0<br>
52
- <strong>Size:</strong> ~349KB (minified)
53
- </div>
54
- </div>
55
-
56
- <div class="demo-section">
57
- <h2>🔐 Security Information</h2>
58
- <div id="security-info" class="result">Loading...</div>
59
- </div>
60
-
61
- <div class="demo-section">
62
- <h2>🔑 Generate Bitcoin SV Keys</h2>
63
- <button class="button" onclick="generateKeys()">Generate New Keys</button>
64
- <div id="key-results" class="result">Click button to generate keys...</div>
65
- </div>
66
-
67
- <div class="demo-section">
68
- <h2>💬 Message Signing (Requires Message Module)</h2>
69
- <button class="button" onclick="loadMessageModule()">Load Message Module</button>
70
- <button class="button" onclick="signMessage()">Sign Message</button>
71
- <div id="message-results" class="result">Load message module first...</div>
72
- </div>
73
-
74
- <div class="demo-section">
75
- <h2>🎲 HD Wallet & Mnemonic (Requires Mnemonic Module)</h2>
76
- <button class="button" onclick="loadMnemonicModule()">Load Mnemonic Module</button>
77
- <button class="button" onclick="generateMnemonic()">Generate Mnemonic</button>
78
- <div id="mnemonic-results" class="result">Load mnemonic module first...</div>
79
- </div>
80
-
81
- <!-- Main BSV library from unpkg -->
82
- <script src="https://unpkg.com/smartledger-bsv@3.0.0/bsv.min.js"></script>
83
-
84
- <script>
85
- // Display security information
86
- function showSecurityInfo() {
87
- const info = document.getElementById('security-info');
88
- info.innerHTML = `
89
- <strong>Library:</strong> ${bsv.hardenedBy} BSV ${bsv.version}<br>
90
- <strong>Base Version:</strong> ${bsv.baseVersion}<br>
91
- <strong>Security Features:</strong> ${bsv.securityFeatures.join(', ')}<br>
92
- <strong>Hardened:</strong> ${bsv.isHardened ? 'Yes' : 'No'}<br>
93
- <strong>SmartLedger Available:</strong> ${bsv.SmartLedger ? 'Yes' : 'No'}
94
- `;
95
- }
96
-
97
- // Generate BSV keys
98
- function generateKeys() {
99
- try {
100
- const privateKey = new bsv.PrivateKey();
101
- const publicKey = privateKey.toPublicKey();
102
- const address = privateKey.toAddress();
103
-
104
- document.getElementById('key-results').innerHTML = `
105
- <strong>Private Key:</strong> ${privateKey.toString()}<br>
106
- <strong>Public Key:</strong> ${publicKey.toString()}<br>
107
- <strong>Address:</strong> ${address.toString()}<br>
108
- <strong>Network:</strong> ${address.network.name}
109
- `;
110
- } catch (error) {
111
- document.getElementById('key-results').innerHTML = `Error: ${error.message}`;
112
- }
113
- }
114
-
115
- // Load message module dynamically
116
- function loadMessageModule() {
117
- const script = document.createElement('script');
118
- script.src = 'https://unpkg.com/smartledger-bsv@3.0.0/bsv-message.min.js';
119
- script.onload = () => {
120
- document.getElementById('message-results').innerHTML = 'Message module loaded! Click "Sign Message" to test.';
121
- };
122
- script.onerror = () => {
123
- document.getElementById('message-results').innerHTML = 'Failed to load message module.';
124
- };
125
- document.head.appendChild(script);
126
- }
127
-
128
- // Sign a message
129
- function signMessage() {
130
- try {
131
- if (typeof bsvMessage === 'undefined') {
132
- document.getElementById('message-results').innerHTML = 'Message module not loaded yet.';
133
- return;
134
- }
135
-
136
- const privateKey = new bsv.PrivateKey();
137
- const message = new bsvMessage('Hello SmartLedger BSV from unpkg!');
138
- const signature = message.sign(privateKey);
139
-
140
- document.getElementById('message-results').innerHTML = `
141
- <strong>Message:</strong> "Hello SmartLedger BSV from unpkg!"<br>
142
- <strong>Signature:</strong> ${signature}<br>
143
- <strong>Address:</strong> ${privateKey.toAddress().toString()}<br>
144
- <strong>Verified:</strong> ${message.verify(privateKey.toAddress(), signature) ? 'Yes' : 'No'}
145
- `;
146
- } catch (error) {
147
- document.getElementById('message-results').innerHTML = `Error: ${error.message}`;
148
- }
149
- }
150
-
151
- // Load mnemonic module dynamically
152
- function loadMnemonicModule() {
153
- const script = document.createElement('script');
154
- script.src = 'https://unpkg.com/smartledger-bsv@3.0.0/bsv-mnemonic.min.js';
155
- script.onload = () => {
156
- document.getElementById('mnemonic-results').innerHTML = 'Mnemonic module loaded! Click "Generate Mnemonic" to test.';
157
- };
158
- script.onerror = () => {
159
- document.getElementById('mnemonic-results').innerHTML = 'Failed to load mnemonic module.';
160
- };
161
- document.head.appendChild(script);
162
- }
163
-
164
- // Generate mnemonic
165
- function generateMnemonic() {
166
- try {
167
- if (typeof bsvMnemonic === 'undefined') {
168
- document.getElementById('mnemonic-results').innerHTML = 'Mnemonic module not loaded yet.';
169
- return;
170
- }
171
-
172
- const mnemonic = new bsvMnemonic();
173
- const hdPrivateKey = mnemonic.toHDPrivateKey();
174
- const firstAddress = hdPrivateKey.deriveChild(0).privateKey.toAddress();
175
-
176
- document.getElementById('mnemonic-results').innerHTML = `
177
- <strong>Mnemonic:</strong> ${mnemonic.toString()}<br>
178
- <strong>Word Count:</strong> ${mnemonic.toString().split(' ').length}<br>
179
- <strong>HD Master Key:</strong> ${hdPrivateKey.toString().substring(0, 50)}...<br>
180
- <strong>First Address:</strong> ${firstAddress.toString()}
181
- `;
182
- } catch (error) {
183
- document.getElementById('mnemonic-results').innerHTML = `Error: ${error.message}`;
184
- }
185
- }
186
-
187
- // Initialize on page load
188
- window.addEventListener('load', () => {
189
- showSecurityInfo();
190
- console.log('SmartLedger BSV loaded from unpkg:', bsv);
191
- });
192
- </script>
193
- </body>
194
- </html>