@bsv/sdk 1.9.3 → 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 (60) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/docs/fast-docs.png +0 -0
  3. package/docs/index.md +49 -44
  4. package/docs/swagger.png +0 -0
  5. package/package.json +1 -1
  6. package/docs/MARKDOWN_VALIDATION_GUIDE.md +0 -175
  7. package/docs/concepts/beef.md +0 -92
  8. package/docs/concepts/chain-tracking.md +0 -134
  9. package/docs/concepts/decentralized-identity.md +0 -221
  10. package/docs/concepts/fees.md +0 -249
  11. package/docs/concepts/identity-certificates.md +0 -307
  12. package/docs/concepts/index.md +0 -77
  13. package/docs/concepts/key-management.md +0 -185
  14. package/docs/concepts/script-templates.md +0 -176
  15. package/docs/concepts/sdk-philosophy.md +0 -80
  16. package/docs/concepts/signatures.md +0 -194
  17. package/docs/concepts/spv-verification.md +0 -118
  18. package/docs/concepts/transaction-encoding.md +0 -167
  19. package/docs/concepts/transaction-structure.md +0 -67
  20. package/docs/concepts/trust-model.md +0 -139
  21. package/docs/concepts/verification.md +0 -250
  22. package/docs/concepts/wallet-integration.md +0 -101
  23. package/docs/guides/development-wallet-setup.md +0 -374
  24. package/docs/guides/direct-transaction-creation.md +0 -147
  25. package/docs/guides/http-client-configuration.md +0 -488
  26. package/docs/guides/index.md +0 -138
  27. package/docs/guides/large-transactions.md +0 -448
  28. package/docs/guides/multisig-transactions.md +0 -792
  29. package/docs/guides/security-best-practices.md +0 -494
  30. package/docs/guides/transaction-batching.md +0 -132
  31. package/docs/guides/transaction-signing-methods.md +0 -419
  32. package/docs/reference/arc-config.md +0 -698
  33. package/docs/reference/brc-100.md +0 -33
  34. package/docs/reference/configuration.md +0 -835
  35. package/docs/reference/debugging.md +0 -705
  36. package/docs/reference/errors.md +0 -597
  37. package/docs/reference/index.md +0 -111
  38. package/docs/reference/network-config.md +0 -914
  39. package/docs/reference/op-codes.md +0 -325
  40. package/docs/reference/transaction-signatures.md +0 -95
  41. package/docs/tutorials/advanced-transaction.md +0 -572
  42. package/docs/tutorials/aes-encryption.md +0 -949
  43. package/docs/tutorials/authfetch-tutorial.md +0 -986
  44. package/docs/tutorials/ecdh-key-exchange.md +0 -549
  45. package/docs/tutorials/elliptic-curve-fundamentals.md +0 -606
  46. package/docs/tutorials/error-handling.md +0 -1216
  47. package/docs/tutorials/first-transaction-low-level.md +0 -205
  48. package/docs/tutorials/first-transaction.md +0 -275
  49. package/docs/tutorials/hashes-and-hmacs.md +0 -788
  50. package/docs/tutorials/identity-management.md +0 -729
  51. package/docs/tutorials/index.md +0 -219
  52. package/docs/tutorials/key-management.md +0 -538
  53. package/docs/tutorials/protowallet-development.md +0 -743
  54. package/docs/tutorials/script-construction.md +0 -690
  55. package/docs/tutorials/spv-merkle-proofs.md +0 -685
  56. package/docs/tutorials/testnet-transactions-low-level.md +0 -359
  57. package/docs/tutorials/transaction-broadcasting.md +0 -538
  58. package/docs/tutorials/transaction-types.md +0 -420
  59. package/docs/tutorials/type-42.md +0 -568
  60. package/docs/tutorials/uhrp-storage.md +0 -599
@@ -1,568 +0,0 @@
1
- # Type-42 Key Derivation
2
-
3
- **Duration**: 75 minutes
4
- **Prerequisites**: Basic TypeScript knowledge, Elliptic Curve Fundamentals tutorial completed, ECDH Key Exchange tutorial completed
5
-
6
- ## Learning Goals
7
-
8
- - Understand Type-42 key derivation protocol and its use cases
9
- - Implement Type-42 operations with the BSV TypeScript SDK
10
- - Create shared key universes between two parties
11
- - Apply Type-42 in practical Bitcoin applications like message signing and encryption
12
- - Understand the "anyone key" concept and its applications
13
-
14
- ## Introduction to Type-42
15
-
16
- Type-42 is a key derivation protocol that enables two parties with master keys to derive child keys from one another using a specific string called an "invoice number." This creates a shared key universe that only these two parties can access, enabling secure communication and transactions without revealing their master keys.
17
-
18
- The protocol gets its name from its historical use in Bitcoin payment systems, where invoice numbers were used to generate unique keys for each transaction. However, Type-42 has broader applications in secure messaging, authentication, and any scenario requiring shared key derivation.
19
-
20
- ## Setting Up Your Environment
21
-
22
- ```typescript
23
- import { PrivateKey, PublicKey, Utils } from '@bsv/sdk'
24
- ```
25
-
26
- ## Understanding Type-42 Process
27
-
28
- ### The Mathematical Foundation
29
-
30
- Type-42 key derivation follows these steps:
31
-
32
- 1. **Master Key Generation**: Each party generates a master private key
33
- 2. **Public Key Exchange**: Parties share their master public keys
34
- 3. **Shared Secret Creation**: Using ECDH, parties compute a shared secret
35
- 4. **Invoice Number Agreement**: Parties agree on a unique identifier (invoice number)
36
- 5. **HMAC Computation**: The shared secret is used as an HMAC key to hash the invoice number
37
- 6. **Key Derivation**: The HMAC output is used to derive child keys
38
-
39
- ### Security Properties
40
-
41
- - Only the two parties can compute the shared secret
42
- - Only they can use the HMAC function with their shared secret
43
- - No one else can link master keys to derived keys
44
- - Each invoice number creates a unique key pair in their shared universe
45
-
46
- ## Basic Type-42 Implementation
47
-
48
- ### Step 1: Master Key Setup
49
-
50
- ```typescript
51
- // Alice generates her master key pair
52
- const alice = PrivateKey.fromRandom()
53
- const alicePub = alice.toPublicKey()
54
-
55
- // Bob generates his master key pair
56
- const bob = PrivateKey.fromRandom()
57
- const bobPub = bob.toPublicKey()
58
-
59
- console.log('Alice master public key:', alicePub.toString())
60
- console.log('Bob master public key:', bobPub.toString())
61
- ```
62
-
63
- ### Step 2: Invoice Number Agreement
64
-
65
- ```typescript
66
- // Both parties agree on an invoice number to use
67
- // This could be a payment ID, message ID, or any unique identifier
68
- const invoiceNumber = '2-simple signing protocol-1'
69
-
70
- console.log('Using invoice number:', invoiceNumber)
71
- ```
72
-
73
- ### Step 3: Child Key Derivation
74
-
75
- ```typescript
76
- // Alice derives a child private key for signing
77
- const aliceSigningChild = alice.deriveChild(bobPub, invoiceNumber)
78
-
79
- // Bob derives Alice's corresponding public key
80
- const aliceSigningPub = alicePub.deriveChild(bob, invoiceNumber)
81
-
82
- // Verify the keys match
83
- const derivedPubFromPriv = aliceSigningChild.toPublicKey()
84
- const keysMatch = derivedPubFromPriv.toString() === aliceSigningPub.toString()
85
- console.log('Keys match:', keysMatch)
86
- // true
87
- ```
88
-
89
- ## Practical Example: Message Signing
90
-
91
- Let's implement a complete example where Alice signs a message for Bob using Type-42 derived keys:
92
-
93
- ```typescript
94
- import { PrivateKey, Utils } from '@bsv/sdk'
95
-
96
- async function demonstrateType42Signing() {
97
- // Step 1: Generate master keys
98
- const alice = PrivateKey.fromRandom()
99
- const alicePub = alice.toPublicKey()
100
-
101
- const bob = PrivateKey.fromRandom()
102
- const bobPub = bob.toPublicKey()
103
-
104
- // Step 2: Agree on invoice number
105
- const invoiceNumber = '2-secure-message-001'
106
-
107
- // Step 3: Alice derives her signing key
108
- const aliceSigningChild = alice.deriveChild(bobPub, invoiceNumber)
109
-
110
- // Step 4: Alice signs a message
111
- const message = Utils.toArray('Hello Bob, this is a secure message!', 'utf8')
112
- const signature = aliceSigningChild.sign(message)
113
-
114
- console.log('Message signed by Alice')
115
- console.log('Signature:', signature.toDER('hex'))
116
-
117
- // Step 5: Bob derives Alice's public key and verifies
118
- const aliceSigningPub = alicePub.deriveChild(bob, invoiceNumber)
119
- const verified = aliceSigningPub.verify(message, signature)
120
-
121
- console.log('Signature verified by Bob:', verified)
122
- // true
123
-
124
- return {
125
- alice,
126
- bob,
127
- aliceSigningChild,
128
- aliceSigningPub,
129
- message,
130
- signature,
131
- verified
132
- }
133
- }
134
-
135
- // Run the demonstration
136
- demonstrateType42Signing()
137
- ```
138
-
139
- ## Bidirectional Communication
140
-
141
- Type-42 enables both parties to derive keys for each other. Here's how Bob can also sign messages for Alice:
142
-
143
- ```typescript
144
- async function bidirectionalType42() {
145
- const alice = PrivateKey.fromRandom()
146
- const alicePub = alice.toPublicKey()
147
-
148
- const bob = PrivateKey.fromRandom()
149
- const bobPub = bob.toPublicKey()
150
-
151
- const invoiceNumber = '2-bidirectional-chat-001'
152
-
153
- // Alice signs a message for Bob
154
- const aliceMessage = Utils.toArray('Hi Bob!', 'utf8')
155
- const aliceSigningKey = alice.deriveChild(bobPub, invoiceNumber)
156
- const aliceSignature = aliceSigningKey.sign(aliceMessage)
157
-
158
- // Bob signs a reply for Alice
159
- const bobMessage = Utils.toArray('Hi Alice!', 'utf8')
160
- const bobSigningKey = bob.deriveChild(alicePub, invoiceNumber)
161
- const bobSignature = bobSigningKey.sign(bobMessage)
162
-
163
- // Cross-verification
164
- const aliceVerifyKey = alicePub.deriveChild(bob, invoiceNumber)
165
- const bobVerifyKey = bobPub.deriveChild(alice, invoiceNumber)
166
-
167
- const aliceVerified = aliceVerifyKey.verify(aliceMessage, aliceSignature)
168
- const bobVerified = bobVerifyKey.verify(bobMessage, bobSignature)
169
-
170
- console.log('Alice message verified:', aliceVerified)
171
- console.log('Bob message verified:', bobVerified)
172
-
173
- return { aliceVerified, bobVerified }
174
- }
175
- ```
176
-
177
- ## The "Anyone Key" Concept
178
-
179
- The SDK supports a special "anyone" key concept for scenarios where one party wants to create publicly verifiable signatures. The "anyone" key is simply the private key with value 1:
180
-
181
- ```typescript
182
- // The "anyone" private key
183
- const anyonePrivateKey = new PrivateKey(1)
184
- const anyonePublicKey = anyonePrivateKey.toPublicKey()
185
-
186
- console.log('Anyone public key:', anyonePublicKey.toString())
187
-
188
- // Using "anyone" key for public verification
189
- function createPubliclyVerifiableSignature() {
190
- const signer = PrivateKey.fromRandom()
191
- const invoiceNumber = '2-public-announcement-001'
192
-
193
- // Derive key using "anyone" as counterparty
194
- const signingKey = signer.deriveChild(anyonePublicKey, invoiceNumber)
195
-
196
- // Sign message
197
- const message = Utils.toArray('This is a public announcement', 'utf8')
198
- const signature = signingKey.sign(message)
199
-
200
- // Anyone can verify using the signer's public key
201
- const signerPub = signer.toPublicKey()
202
- const verifyKey = signerPub.deriveChild(anyonePrivateKey, invoiceNumber)
203
- const verified = verifyKey.verify(message, signature)
204
-
205
- console.log('Public signature verified:', verified)
206
-
207
- return {
208
- signerPublicKey: signerPub.toString(),
209
- signature: signature.toDER('hex'),
210
- verified
211
- }
212
- }
213
-
214
- createPubliclyVerifiableSignature()
215
- ```
216
-
217
- ## Advanced Type-42 Applications
218
-
219
- ### Multi-Purpose Key Derivation
220
-
221
- Use different invoice numbers for different purposes:
222
-
223
- ```typescript
224
- function multiPurposeKeyDerivation() {
225
- const alice = PrivateKey.fromRandom()
226
- const bob = PrivateKey.fromRandom()
227
- const bobPub = bob.toPublicKey()
228
-
229
- // Different keys for different purposes
230
- const signingKey = alice.deriveChild(bobPub, '2-signing-001')
231
- const encryptionKey = alice.deriveChild(bobPub, '2-encryption-001')
232
- const authKey = alice.deriveChild(bobPub, '2-auth-001')
233
-
234
- console.log('Signing key:', signingKey.toHex().substring(0, 16) + '...')
235
- console.log('Encryption key:', encryptionKey.toHex().substring(0, 16) + '...')
236
- console.log('Auth key:', authKey.toHex().substring(0, 16) + '...')
237
-
238
- // Each key is unique and serves a different purpose
239
- return { signingKey, encryptionKey, authKey }
240
- }
241
- ```
242
-
243
- ### Session-Based Key Derivation
244
-
245
- Create time-based or session-based keys:
246
-
247
- ```typescript
248
- function sessionBasedKeys() {
249
- const alice = PrivateKey.fromRandom()
250
- const bob = PrivateKey.fromRandom()
251
- const bobPub = bob.toPublicKey()
252
-
253
- // Create session-specific keys
254
- const sessionId = Date.now().toString()
255
- const sessionInvoice = `2-session-${sessionId}`
256
-
257
- const sessionKey = alice.deriveChild(bobPub, sessionInvoice)
258
-
259
- console.log('Session ID:', sessionId)
260
- console.log('Session key created:', sessionKey.toHex().substring(0, 16) + '...')
261
-
262
- return { sessionId, sessionKey }
263
- }
264
- ```
265
-
266
- ## Integration with Transactions
267
-
268
- Type-42 derived keys can be used in Bitcoin transactions:
269
-
270
- ```typescript
271
- import { Transaction, P2PKH } from '@bsv/sdk'
272
-
273
- async function type42Transaction() {
274
- const alice = PrivateKey.fromRandom()
275
- const bob = PrivateKey.fromRandom()
276
- const bobPub = bob.toPublicKey()
277
-
278
- const invoiceNumber = '2-payment-001'
279
-
280
- // Alice derives a key for this specific payment
281
- const paymentKey = alice.deriveChild(bobPub, invoiceNumber)
282
- const paymentAddress = paymentKey.toAddress()
283
-
284
- console.log('Payment address:', paymentAddress)
285
-
286
- // Bob can derive the same public key to verify ownership
287
- const alicePub = alice.toPublicKey()
288
- const verifyKey = alicePub.deriveChild(bob, invoiceNumber)
289
- const verifyAddress = verifyKey.toAddress()
290
-
291
- console.log('Addresses match:', paymentAddress === verifyAddress)
292
-
293
- return { paymentKey, paymentAddress, verifyAddress }
294
- }
295
- ```
296
-
297
- ## Error Handling and Validation
298
-
299
- Implement robust error handling for Type-42 operations:
300
-
301
- ```typescript
302
- function safeType42Derivation(
303
- privateKey: PrivateKey,
304
- counterpartyPublicKey: PublicKey,
305
- invoiceNumber: string
306
- ): PrivateKey | null {
307
- try {
308
- // Validate inputs
309
- if (!privateKey || !counterpartyPublicKey || !invoiceNumber) {
310
- throw new Error('Missing required parameters')
311
- }
312
-
313
- if (invoiceNumber.length === 0) {
314
- throw new Error('Invoice number cannot be empty')
315
- }
316
-
317
- // Perform derivation
318
- const derivedKey = privateKey.deriveChild(counterpartyPublicKey, invoiceNumber)
319
-
320
- // Validate result
321
- if (!derivedKey) {
322
- throw new Error('Key derivation failed')
323
- }
324
-
325
- return derivedKey
326
- } catch (error: any) {
327
- console.error('Type-42 derivation error:', error.message)
328
- return null
329
- }
330
- }
331
-
332
- // Usage example
333
- const alice = PrivateKey.fromRandom()
334
- const bob = PrivateKey.fromRandom()
335
- const bobPub = bob.toPublicKey()
336
-
337
- const derivedKey = safeType42Derivation(alice, bobPub, '2-safe-derivation-001')
338
- if (derivedKey) {
339
- console.log('Derivation successful')
340
- } else {
341
- console.log('Derivation failed')
342
- }
343
- ```
344
-
345
- ## Performance Considerations
346
-
347
- ### Caching Derived Keys
348
-
349
- For applications that frequently use the same invoice numbers:
350
-
351
- ```typescript
352
- class Type42KeyCache {
353
- private cache = new Map<string, PrivateKey>()
354
-
355
- constructor(private masterKey: PrivateKey) {}
356
-
357
- deriveKey(counterpartyPub: PublicKey, invoiceNumber: string): PrivateKey {
358
- const cacheKey = `${counterpartyPub.toString()}-${invoiceNumber}`
359
-
360
- if (this.cache.has(cacheKey)) {
361
- return this.cache.get(cacheKey)!
362
- }
363
-
364
- const derivedKey = this.masterKey.deriveChild(counterpartyPub, invoiceNumber)
365
- this.cache.set(cacheKey, derivedKey)
366
-
367
- return derivedKey
368
- }
369
-
370
- clearCache(): void {
371
- this.cache.clear()
372
- }
373
-
374
- getCacheSize(): number {
375
- return this.cache.size
376
- }
377
- }
378
-
379
- // Usage
380
- const alice = PrivateKey.fromRandom()
381
- const keyCache = new Type42KeyCache(alice)
382
-
383
- const bob = PrivateKey.fromRandom()
384
- const bobPub = bob.toPublicKey()
385
-
386
- // First call performs derivation
387
- const key1 = keyCache.deriveKey(bobPub, '2-cached-001')
388
-
389
- // Second call uses cache
390
- const key2 = keyCache.deriveKey(bobPub, '2-cached-001')
391
-
392
- console.log('Keys are identical:', key1.toHex() === key2.toHex())
393
- console.log('Cache size:', keyCache.getCacheSize())
394
- ```
395
-
396
- ## Security Best Practices
397
-
398
- ### 1. Invoice Number Guidelines
399
-
400
- ```typescript
401
- // Good: Structured, unique invoice numbers
402
- const goodInvoiceNumbers = [
403
- '2-payment-20241210-001',
404
- '2-message-session-abc123',
405
- '2-auth-token-xyz789'
406
- ]
407
-
408
- // Avoid: Predictable or reused invoice numbers
409
- const badInvoiceNumbers = [
410
- '1', // Too simple
411
- 'payment', // Not unique
412
- '2-payment-001' // Reused across different contexts
413
- ]
414
- ```
415
-
416
- ### 2. Master Key Protection
417
-
418
- ```typescript
419
- function secureMasterKeyUsage() {
420
- // Generate master key securely
421
- const masterKey = PrivateKey.fromRandom()
422
-
423
- // Never log or expose master keys
424
- // console.log('Master key:', masterKey.toHex()) // DON'T DO THIS
425
-
426
- // Use derived keys for operations
427
- const counterparty = PrivateKey.fromRandom().toPublicKey()
428
- const derivedKey = masterKey.deriveChild(counterparty, '2-secure-operation-001')
429
-
430
- // Log derived keys if needed (they don't reveal master key)
431
- console.log('Derived key (safe to log):', derivedKey.toHex().substring(0, 16) + '...')
432
-
433
- return derivedKey
434
- }
435
- ```
436
-
437
- ### 3. Counterparty Validation
438
-
439
- ```typescript
440
- function validateCounterparty(publicKey: PublicKey): boolean {
441
- try {
442
- // Ensure the public key is valid by checking its coordinates
443
- const x = publicKey.x
444
- const y = publicKey.y
445
- if (!x || !y) {
446
- return false
447
- }
448
-
449
- // Additional validation can be added here
450
- return true
451
- } catch (error: any) {
452
- return false
453
- }
454
- }
455
- ```
456
-
457
- ## Testing Type-42 Implementation
458
-
459
- ```typescript
460
- function testType42Implementation() {
461
- console.log('Testing Type-42 key derivation...')
462
-
463
- // Test 1: Basic derivation
464
- const alice = PrivateKey.fromRandom()
465
- const bob = PrivateKey.fromRandom()
466
- const bobPub = bob.toPublicKey()
467
- const alicePub = alice.toPublicKey()
468
-
469
- const invoiceNumber = '2-test-001'
470
-
471
- const aliceChild = alice.deriveChild(bobPub, invoiceNumber)
472
- const aliceChildPub = alicePub.deriveChild(bob, invoiceNumber)
473
-
474
- const test1 = aliceChild.toPublicKey().toString() === aliceChildPub.toString()
475
- console.log('Test 1 - Key consistency:', test1 ? 'PASS' : 'FAIL')
476
-
477
- // Test 2: Message signing and verification
478
- const message = Utils.toArray('Test message', 'utf8')
479
- const signature = aliceChild.sign(message)
480
- const verified = aliceChildPub.verify(message, signature)
481
-
482
- console.log('Test 2 - Sign/verify:', verified ? 'PASS' : 'FAIL')
483
-
484
- // Test 3: Different invoice numbers produce different keys
485
- const key1 = alice.deriveChild(bobPub, '2-test-001')
486
- const key2 = alice.deriveChild(bobPub, '2-test-002')
487
-
488
- const test3 = key1.toHex() !== key2.toHex()
489
- console.log('Test 3 - Unique keys:', test3 ? 'PASS' : 'FAIL')
490
-
491
- // Test 4: Bidirectional derivation
492
- const bobChild = bob.deriveChild(alicePub, invoiceNumber)
493
- const bobChildPub = bobPub.deriveChild(alice, invoiceNumber)
494
-
495
- const test4 = bobChild.toPublicKey().toString() === bobChildPub.toString()
496
- console.log('Test 4 - Bidirectional:', test4 ? 'PASS' : 'FAIL')
497
-
498
- return test1 && verified && test3 && test4
499
- }
500
-
501
- // Run tests
502
- const allTestsPassed = testType42Implementation()
503
- console.log('All tests passed:', allTestsPassed)
504
- ```
505
-
506
- ## Troubleshooting Common Issues
507
-
508
- ### Issue 1: Key Mismatch
509
-
510
- ```typescript
511
- // Problem: Derived keys don't match
512
- // Solution: Ensure consistent invoice numbers and key order
513
-
514
- function debugKeyMismatch() {
515
- const alice = PrivateKey.fromRandom()
516
- const bob = PrivateKey.fromRandom()
517
-
518
- // Wrong: Different invoice numbers
519
- const key1 = alice.deriveChild(bob.toPublicKey(), '2-test-001')
520
- const key2 = alice.toPublicKey().deriveChild(bob, '2-test-002') // Different number
521
-
522
- // Correct: Same invoice number
523
- const key3 = alice.deriveChild(bob.toPublicKey(), '2-test-001')
524
- const key4 = alice.toPublicKey().deriveChild(bob, '2-test-001') // Same number
525
-
526
- console.log('Wrong approach - keys match:',
527
- key1.toPublicKey().toString() === key2.toString())
528
- console.log('Correct approach - keys match:',
529
- key3.toPublicKey().toString() === key4.toString())
530
- }
531
- ```
532
-
533
- ### Issue 2: Invalid Public Key
534
-
535
- ```typescript
536
- function handleInvalidPublicKey() {
537
- try {
538
- const alice = PrivateKey.fromRandom()
539
- // This would cause an error if publicKey is invalid
540
- const invalidPub = null as any
541
-
542
- const derivedKey = alice.deriveChild(invalidPub, '2-test-001')
543
- } catch (error: any) {
544
- console.log('Caught invalid public key error:', error.message)
545
- // Handle the error appropriately
546
- }
547
- }
548
- ```
549
-
550
- ## Conclusion
551
-
552
- Type-42 key derivation provides a powerful mechanism for creating shared key universes between two parties. You've learned how to:
553
-
554
- - Generate master keys and derive child keys using invoice numbers
555
- - Implement secure message signing and verification
556
- - Use the "anyone key" for publicly verifiable signatures
557
- - Apply Type-42 in various Bitcoin applications
558
- - Handle errors and optimize performance
559
- - Follow security best practices
560
-
561
- Type-42 enables sophisticated cryptographic protocols while maintaining the security properties of elliptic curve cryptography. The derived keys are unlinkable to master keys by outside parties, providing privacy and security for Bitcoin applications.
562
-
563
- ## Further Reading
564
-
565
- - [ECDH Key Exchange Tutorial](./ecdh-key-exchange.md)
566
- - [Elliptic Curve Fundamentals Tutorial](./elliptic-curve-fundamentals.md)
567
- - [BSV Type-42 Documentation](https://docs.bsvblockchain.org/guides/sdks/ts/low-level/type_42)
568
- - [Messages Reference](../reference/messages.md)