@bsv/sdk 1.9.2 → 1.9.4

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 (93) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/kvstore/GlobalKVStore.js +116 -98
  3. package/dist/cjs/src/kvstore/GlobalKVStore.js.map +1 -1
  4. package/dist/cjs/src/kvstore/types.js.map +1 -1
  5. package/dist/cjs/src/overlay-tools/index.js +1 -0
  6. package/dist/cjs/src/overlay-tools/index.js.map +1 -1
  7. package/dist/cjs/src/overlay-tools/withDoubleSpendRetry.js +55 -0
  8. package/dist/cjs/src/overlay-tools/withDoubleSpendRetry.js.map +1 -0
  9. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  10. package/dist/esm/src/kvstore/GlobalKVStore.js +117 -99
  11. package/dist/esm/src/kvstore/GlobalKVStore.js.map +1 -1
  12. package/dist/esm/src/kvstore/types.js.map +1 -1
  13. package/dist/esm/src/overlay-tools/index.js +1 -0
  14. package/dist/esm/src/overlay-tools/index.js.map +1 -1
  15. package/dist/esm/src/overlay-tools/withDoubleSpendRetry.js +48 -0
  16. package/dist/esm/src/overlay-tools/withDoubleSpendRetry.js.map +1 -0
  17. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  18. package/dist/types/src/kvstore/GlobalKVStore.d.ts.map +1 -1
  19. package/dist/types/src/kvstore/types.d.ts +2 -0
  20. package/dist/types/src/kvstore/types.d.ts.map +1 -1
  21. package/dist/types/src/overlay-tools/index.d.ts +1 -0
  22. package/dist/types/src/overlay-tools/index.d.ts.map +1 -1
  23. package/dist/types/src/overlay-tools/withDoubleSpendRetry.d.ts +14 -0
  24. package/dist/types/src/overlay-tools/withDoubleSpendRetry.d.ts.map +1 -0
  25. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  26. package/dist/umd/bundle.js +2 -2
  27. package/dist/umd/bundle.js.map +1 -1
  28. package/docs/fast-docs.png +0 -0
  29. package/docs/index.md +49 -44
  30. package/docs/reference/kvstore.md +9 -0
  31. package/docs/reference/overlay-tools.md +32 -0
  32. package/docs/swagger.png +0 -0
  33. package/package.json +1 -1
  34. package/src/kvstore/GlobalKVStore.ts +134 -114
  35. package/src/kvstore/__tests/GlobalKVStore.test.ts +11 -1
  36. package/src/kvstore/types.ts +2 -0
  37. package/src/overlay-tools/index.ts +1 -0
  38. package/src/overlay-tools/withDoubleSpendRetry.ts +71 -0
  39. package/docs/MARKDOWN_VALIDATION_GUIDE.md +0 -175
  40. package/docs/concepts/beef.md +0 -92
  41. package/docs/concepts/chain-tracking.md +0 -134
  42. package/docs/concepts/decentralized-identity.md +0 -221
  43. package/docs/concepts/fees.md +0 -249
  44. package/docs/concepts/identity-certificates.md +0 -307
  45. package/docs/concepts/index.md +0 -77
  46. package/docs/concepts/key-management.md +0 -185
  47. package/docs/concepts/script-templates.md +0 -176
  48. package/docs/concepts/sdk-philosophy.md +0 -80
  49. package/docs/concepts/signatures.md +0 -194
  50. package/docs/concepts/spv-verification.md +0 -118
  51. package/docs/concepts/transaction-encoding.md +0 -167
  52. package/docs/concepts/transaction-structure.md +0 -67
  53. package/docs/concepts/trust-model.md +0 -139
  54. package/docs/concepts/verification.md +0 -250
  55. package/docs/concepts/wallet-integration.md +0 -101
  56. package/docs/guides/development-wallet-setup.md +0 -374
  57. package/docs/guides/direct-transaction-creation.md +0 -147
  58. package/docs/guides/http-client-configuration.md +0 -488
  59. package/docs/guides/index.md +0 -138
  60. package/docs/guides/large-transactions.md +0 -448
  61. package/docs/guides/multisig-transactions.md +0 -792
  62. package/docs/guides/security-best-practices.md +0 -494
  63. package/docs/guides/transaction-batching.md +0 -132
  64. package/docs/guides/transaction-signing-methods.md +0 -419
  65. package/docs/reference/arc-config.md +0 -698
  66. package/docs/reference/brc-100.md +0 -33
  67. package/docs/reference/configuration.md +0 -835
  68. package/docs/reference/debugging.md +0 -705
  69. package/docs/reference/errors.md +0 -597
  70. package/docs/reference/index.md +0 -111
  71. package/docs/reference/network-config.md +0 -914
  72. package/docs/reference/op-codes.md +0 -325
  73. package/docs/reference/transaction-signatures.md +0 -95
  74. package/docs/tutorials/advanced-transaction.md +0 -572
  75. package/docs/tutorials/aes-encryption.md +0 -949
  76. package/docs/tutorials/authfetch-tutorial.md +0 -986
  77. package/docs/tutorials/ecdh-key-exchange.md +0 -549
  78. package/docs/tutorials/elliptic-curve-fundamentals.md +0 -606
  79. package/docs/tutorials/error-handling.md +0 -1216
  80. package/docs/tutorials/first-transaction-low-level.md +0 -205
  81. package/docs/tutorials/first-transaction.md +0 -275
  82. package/docs/tutorials/hashes-and-hmacs.md +0 -788
  83. package/docs/tutorials/identity-management.md +0 -729
  84. package/docs/tutorials/index.md +0 -219
  85. package/docs/tutorials/key-management.md +0 -538
  86. package/docs/tutorials/protowallet-development.md +0 -743
  87. package/docs/tutorials/script-construction.md +0 -690
  88. package/docs/tutorials/spv-merkle-proofs.md +0 -685
  89. package/docs/tutorials/testnet-transactions-low-level.md +0 -359
  90. package/docs/tutorials/transaction-broadcasting.md +0 -538
  91. package/docs/tutorials/transaction-types.md +0 -420
  92. package/docs/tutorials/type-42.md +0 -568
  93. package/docs/tutorials/uhrp-storage.md +0 -599
@@ -1,219 +0,0 @@
1
- # Tutorials
2
-
3
- Welcome to the BSV TypeScript SDK tutorials. These step-by-step lessons will teach you how to use the SDK through practical examples.
4
-
5
- ## 🚀 Try Examples Interactively
6
-
7
- Before diving into the tutorials, you can experiment with many of these concepts in our **[Interactive BSV Coding Environment](https://fast.brc.dev/)**. Run SDK code directly in your browser without any setup required!
8
-
9
- ## Getting Started Track
10
-
11
- ### [Your First BSV Transaction](./first-transaction.md)
12
-
13
- - **Duration**: 30 minutes
14
- - **Prerequisites**: Node.js, basic TypeScript knowledge
15
- - **Learning Goals**:
16
-
17
- - Install and configure the SDK
18
- - Create a simple P2PKH transaction
19
- - Understand BSV transaction anatomy
20
-
21
- ### [Transaction Types and Data](./transaction-types.md)
22
-
23
- - **Duration**: 30 minutes
24
- - **Prerequisites**: Completed "Your First BSV Transaction" tutorial
25
- - **Learning Goals**:
26
-
27
- - Create transactions with multiple outputs
28
- - Add data to transactions
29
- - Work with different output types
30
- - Use advanced `WalletClient` features
31
-
32
- ### [Key Management and Cryptography](./key-management.md)
33
-
34
- - **Duration**: 45 minutes
35
- - **Prerequisites**: Completed "Your First BSV Transaction" tutorial
36
- - **Learning Goals**:
37
-
38
- - Generate and manage private/public keys
39
- - Understand ECDSA signatures
40
- - Create and verify digital signatures
41
-
42
- ### [Transaction Broadcasting](./transaction-broadcasting.md)
43
-
44
- - **Duration**: 25 minutes
45
- - **Prerequisites**: Completed "Your First BSV Transaction" tutorial, Node.js, basic TypeScript knowledge
46
- - **Learning Goals**:
47
-
48
- - Understand `WalletClient` vs direct broadcasting approaches
49
- - Configure broadcasting for testnet vs mainnet
50
- - Implement custom broadcasters (ARC, WhatsOnChain)
51
- - Handle broadcasting errors and implement retry logic
52
- - Monitor and verify transaction acceptance
53
-
54
- ## Intermediate Development Track
55
-
56
- ### [Working with ProtoWallet for Development](./protowallet-development.md)
57
-
58
- - **Duration**: 45 minutes
59
- - **Prerequisites**: Basic TypeScript knowledge, understanding of cryptographic concepts
60
- - **Learning Goals**:
61
-
62
- - Create and configure ProtoWallet instances
63
- - Perform key derivation and management
64
- - Implement signing, encryption, and HMAC operations
65
- - Build development toolkits and testing environments
66
-
67
- ### [Authenticated HTTP Requests with AuthFetch](./authfetch-tutorial.md)
68
-
69
- - **Duration**: 60 minutes
70
- - **Prerequisites**: Understanding of HTTP protocols, basic cryptography knowledge
71
- - **Learning Goals**:
72
-
73
- - Implement BRC-103/104 authentication protocols
74
- - Set up certificate exchange and peer authentication
75
- - Build secure API clients with cryptographic request signing
76
- - Handle authentication errors and implement retry logic
77
-
78
- ### [Decentralized File Storage with UHRP](./uhrp-storage.md)
79
-
80
- - **Duration**: 75 minutes
81
- - **Prerequisites**: Understanding of content-addressed storage concepts
82
- - **Learning Goals**:
83
-
84
- - Upload and download files using UHRP protocol
85
- - Implement file integrity verification
86
- - Manage file retention and renewal
87
- - Build batch file operations and management systems
88
-
89
- ### [Identity Management and Certificates](./identity-management.md)
90
-
91
- - **Duration**: 90 minutes
92
- - **Prerequisites**: Understanding of PKI and certificate concepts
93
- - **Learning Goals**:
94
-
95
- - Work with decentralized identity systems
96
- - Resolve identities by keys and attributes
97
- - Manage identity certificates and verification
98
- - Build identity-based authentication services
99
-
100
- ### [Advanced Transaction Construction](./advanced-transaction.md)
101
-
102
- - **Duration**: 75 minutes
103
- - **Learning Goals**:
104
-
105
- - Multi-input/multi-output transactions
106
- - Fee calculation and optimization
107
- - Change output handling
108
-
109
- ### [Script Construction and Custom Logic](./script-construction.md)
110
-
111
- - **Duration**: 90 minutes
112
- - **Learning Goals**:
113
-
114
- - Understand Bitcoin Script basics
115
- - Create custom locking scripts
116
- - Implement unlocking logic
117
-
118
- ### [SPV and Merkle Proof Verification](./spv-merkle-proofs.md)
119
-
120
- - **Duration**: 90 minutes
121
- - **Learning Goals**:
122
-
123
- - Understand SPV principles
124
- - Verify Merkle proofs
125
- - Implement lightweight verification
126
-
127
- ### [Error Handling and Edge Cases](./error-handling.md)
128
-
129
- - **Duration**: 60 minutes
130
- - **Learning Goals**:
131
-
132
- - Robust error handling patterns
133
- - Network failure recovery
134
- - Transaction validation edge cases
135
-
136
- ## Low-Level Cryptography Track
137
-
138
- ### [Elliptic Curve Fundamentals: Numbers & Points](./elliptic-curve-fundamentals.md)
139
-
140
- - **Duration**: 90 minutes
141
- - **Learning Goals**:
142
-
143
- - Understand the mathematical foundations of elliptic curves
144
- - Work with BigInteger numbers in the SDK
145
- - Manipulate elliptic curve points
146
- - Implement point addition and scalar multiplication
147
-
148
- ### [ECDH Key Exchange](./ecdh-key-exchange.md)
149
-
150
- - **Duration**: 75 minutes
151
- - **Learning Goals**:
152
-
153
- - Understand Elliptic Curve Diffie-Hellman (ECDH) key exchange principles
154
- - Implement secure key exchange using the SDK
155
- - Create shared secrets for encrypted communication
156
- - Apply ECDH in practical Bitcoin applications
157
-
158
- ### [AES Symmetric Encryption](./aes-encryption.md)
159
-
160
- - **Duration**: 60 minutes
161
- - **Learning Goals**:
162
-
163
- - Understand AES-GCM symmetric encryption principles
164
- - Use the `SymmetricKey` class for encryption and decryption
165
- - Implement secure key generation and management
166
- - Apply AES encryption in practical Bitcoin applications
167
- - Combine AES with ECDH for secure communication
168
- - Handle different data formats and encoding
169
-
170
- ### [Hashes and HMACs](./hashes-and-hmacs.md)
171
-
172
- - **Duration**: 75 minutes
173
- - **Learning Goals**:
174
-
175
- - Understand cryptographic hash functions and their properties
176
- - Master the Hash module classes and helper functions in the BSV TypeScript SDK
177
- - Implement various hash algorithms (SHA-256, SHA-512, SHA-1, RIPEMD-160)
178
- - Create and verify HMACs for message authentication
179
- - Apply Bitcoin-specific hashing patterns (hash256, hash160)
180
- - Build practical applications using hashing for data integrity and authentication
181
- - Understand performance considerations and security best practices
182
-
183
- ### [Type-42 Key Derivation](./type-42.md)
184
-
185
- - **Duration**: 75 minutes
186
- - **Prerequisites**: Basic TypeScript knowledge, Elliptic Curve Fundamentals tutorial completed, ECDH Key Exchange tutorial completed
187
- - **Learning Goals**:
188
-
189
- - Understand Type-42 key derivation protocol and its use cases
190
- - Implement Type-42 operations with the BSV TypeScript SDK
191
- - Create shared key universes between two parties
192
- - Apply Type-42 in practical Bitcoin applications like message signing and encryption
193
- - Understand the "anyone key" concept and its applications
194
-
195
- ## Alternative Low-Level Transaction API Track
196
-
197
- These tutorials demonstrate how to use the lower-level APIs of the BSV TypeScript SDK for more direct control over transaction creation and management.
198
-
199
- ### [Your First BSV Transaction (Low-level API)](./first-transaction-low-level.md)
200
-
201
- - **Duration**: 45 minutes
202
- - **Prerequisites**: Node.js, basic TypeScript knowledge
203
- - **Learning Goals**:
204
-
205
- - Work with low-level transaction APIs
206
- - Create transactions without WalletClient abstraction
207
- - Understand transaction construction internals
208
- - Manually manage inputs, outputs, and signing
209
-
210
- ### [Working with Testnet Transactions (Low-level API)](./testnet-transactions-low-level.md)
211
-
212
- - **Duration**: 60 minutes
213
- - **Prerequisites**: Completed "Your First BSV Transaction (Low-level API)" tutorial
214
- - **Learning Goals**:
215
-
216
- - Set up a BSV testnet environment with low-level APIs
217
- - Manually handle testnet transactions
218
- - Understand UTXO management without WalletClient
219
- - Implement custom transaction workflows