@bsv/sdk 1.6.12 → 1.6.15
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 +4 -4
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/transaction/broadcasters/DefaultBroadcaster.js +1 -1
- package/dist/cjs/src/transaction/broadcasters/DefaultBroadcaster.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/transaction/broadcasters/DefaultBroadcaster.js +1 -1
- package/dist/esm/src/transaction/broadcasters/DefaultBroadcaster.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/transaction/http/HttpClient.d.ts +2 -0
- package/dist/types/src/transaction/http/HttpClient.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/MARKDOWN_VALIDATION_GUIDE.md +175 -0
- package/docs/concepts/beef.md +8 -0
- package/docs/concepts/chain-tracking.md +12 -0
- package/docs/concepts/decentralized-identity.md +37 -0
- package/docs/concepts/fees.md +32 -0
- package/docs/concepts/identity-certificates.md +53 -1
- package/docs/concepts/index.md +15 -0
- package/docs/concepts/key-management.md +9 -0
- package/docs/concepts/script-templates.md +13 -0
- package/docs/concepts/sdk-philosophy.md +8 -0
- package/docs/concepts/signatures.md +15 -0
- package/docs/concepts/spv-verification.md +12 -0
- package/docs/concepts/transaction-encoding.md +19 -0
- package/docs/concepts/transaction-structure.md +4 -0
- package/docs/concepts/trust-model.md +16 -0
- package/docs/concepts/verification.md +31 -0
- package/docs/concepts/wallet-integration.md +6 -0
- package/docs/guides/development-wallet-setup.md +374 -0
- package/docs/guides/direct-transaction-creation.md +12 -2
- package/docs/guides/http-client-configuration.md +122 -48
- package/docs/guides/index.md +117 -9
- package/docs/guides/large-transactions.md +448 -0
- package/docs/guides/multisig-transactions.md +792 -0
- package/docs/guides/security-best-practices.md +494 -0
- package/docs/guides/transaction-batching.md +132 -0
- package/docs/guides/transaction-signing-methods.md +230 -79
- package/docs/index.md +0 -2
- package/docs/reference/configuration.md +6 -0
- package/docs/reference/debugging.md +5 -0
- package/docs/reference/errors.md +50 -0
- package/docs/reference/index.md +14 -1
- package/docs/reference/op-codes.md +20 -1
- package/docs/reference/transaction-signatures.md +2 -1
- package/docs/reference/transaction.md +9 -0
- package/docs/tutorials/advanced-transaction.md +1 -4
- package/docs/tutorials/aes-encryption.md +3 -1
- package/docs/tutorials/authfetch-tutorial.md +29 -0
- package/docs/tutorials/ecdh-key-exchange.md +2 -0
- package/docs/tutorials/elliptic-curve-fundamentals.md +3 -0
- package/docs/tutorials/error-handling.md +1 -0
- package/docs/tutorials/first-transaction-low-level.md +1 -0
- package/docs/tutorials/first-transaction.md +5 -8
- package/docs/tutorials/hashes-and-hmacs.md +5 -31
- package/docs/tutorials/identity-management.md +27 -0
- package/docs/tutorials/index.md +114 -77
- package/docs/tutorials/key-management.md +5 -3
- package/docs/tutorials/protowallet-development.md +27 -0
- package/docs/tutorials/spv-merkle-proofs.md +9 -6
- package/docs/tutorials/testnet-transactions-low-level.md +25 -18
- package/docs/tutorials/transaction-broadcasting.md +10 -7
- package/docs/tutorials/transaction-types.md +5 -4
- package/docs/tutorials/type-42.md +0 -14
- package/docs/tutorials/uhrp-storage.md +23 -3
- package/package.json +1 -1
- package/src/identity/README.md +0 -1
- package/src/primitives/__tests/SymmetricKey.test.ts +45 -0
- package/src/primitives/__tests/SymmetricKeyCompatibility.test.ts +150 -0
- package/src/transaction/__tests/Transaction.test.ts +1 -1
- package/src/transaction/broadcasters/DefaultBroadcaster.ts +1 -1
- package/src/transaction/broadcasters/__tests/ARC.test.ts +1 -1
- package/src/transaction/http/HttpClient.ts +2 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
**Duration**: 60 minutes
|
|
4
4
|
**Prerequisites**: Node.js, basic TypeScript knowledge, understanding of HTTP and authentication
|
|
5
5
|
**Learning Goals**:
|
|
6
|
+
|
|
6
7
|
- Understand BRC-103/104 authentication protocols
|
|
7
8
|
- Implement authenticated HTTP requests with AuthFetch
|
|
8
9
|
- Handle peer-to-peer authentication and certificate exchange
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
## When to Use AuthFetch
|
|
12
13
|
|
|
13
14
|
**Use AuthFetch when you need:**
|
|
15
|
+
|
|
14
16
|
- BRC-103/104 cryptographic authentication
|
|
15
17
|
- Wallet-signed HTTP requests for identity verification
|
|
16
18
|
- Certificate-based peer authentication
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
- APIs that require cryptographic proof of identity
|
|
19
21
|
|
|
20
22
|
**For general HTTP client configuration, use [HTTP Client Configuration Guide](../guides/http-client-configuration.md) instead:**
|
|
23
|
+
|
|
21
24
|
- Custom HTTP client setup (Axios, fetch, etc.)
|
|
22
25
|
- Transaction broadcasting via ARC endpoints
|
|
23
26
|
- Environment-specific configuration (timeouts, retries)
|
|
@@ -39,6 +42,7 @@ AuthFetch is a specialized HTTP client that implements BRC-103 and BRC-104 authe
|
|
|
39
42
|
## What You'll Build
|
|
40
43
|
|
|
41
44
|
In this tutorial, you'll create:
|
|
45
|
+
|
|
42
46
|
- Basic authenticated HTTP client
|
|
43
47
|
- Peer-to-peer communication system
|
|
44
48
|
- Certificate exchange mechanism
|
|
@@ -955,3 +959,28 @@ async function demonstrateErrorHandling() {
|
|
|
955
959
|
}
|
|
956
960
|
|
|
957
961
|
demonstrateErrorHandling().catch(console.error)
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
## Conclusion
|
|
965
|
+
|
|
966
|
+
Congratulations! You've successfully implemented a comprehensive authenticated communication system using the BSV TypeScript SDK. In this tutorial, you've learned how to:
|
|
967
|
+
|
|
968
|
+
### Core Concepts Mastered
|
|
969
|
+
|
|
970
|
+
1. **AuthFetch Integration**: Implemented authentication using identity-based signing
|
|
971
|
+
2. **Certificate Management**: Created and managed identity certificates for secure communication
|
|
972
|
+
3. **Request Signing**: Automatically signed requests with proper identity validation
|
|
973
|
+
4. **Error Handling**: Built robust error handling for authentication failures
|
|
974
|
+
5. **Network Resilience**: Implemented retry logic and connectivity testing
|
|
975
|
+
|
|
976
|
+
## Next Steps
|
|
977
|
+
|
|
978
|
+
- Learn about [Identity Management](./identity-management.md) for advanced identity workflows
|
|
979
|
+
- Explore [Authenticated API Communication](../guides/authenticated-api-communication.md) for server-side implementation
|
|
980
|
+
- Understand [Security Best Practices](../guides/security-best-practices.md) for production deployments
|
|
981
|
+
|
|
982
|
+
## Additional Resources
|
|
983
|
+
|
|
984
|
+
- [AuthFetch API Reference](../reference/auth.md)
|
|
985
|
+
- [Identity Client Documentation](../reference/identity.md)
|
|
986
|
+
- [BSV Identity Protocols](https://projectbabbage.com/docs/guides/identity)
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
**Prerequisites**: Basic TypeScript knowledge, [Elliptic Curve Fundamentals](./elliptic-curve-fundamentals.md) tutorial completed
|
|
5
5
|
|
|
6
6
|
## Learning Goals
|
|
7
|
+
|
|
7
8
|
- Understand Elliptic Curve Diffie-Hellman (ECDH) key exchange principles
|
|
8
9
|
- Implement secure key exchange using the BSV TypeScript SDK
|
|
9
10
|
- Create shared secrets for encrypted communication
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
Elliptic Curve Diffie-Hellman (ECDH) is a key agreement protocol that allows two parties to establish a shared secret over an unsecured communication channel. Unlike traditional encryption where you need to share a secret key beforehand, ECDH allows two parties who have never met to create a shared secret that only they know.
|
|
16
17
|
|
|
17
18
|
The mathematical foundation of ECDH relies on the commutative property of elliptic curve point multiplication:
|
|
19
|
+
|
|
18
20
|
- Alice computes: `(Alice's private key) × (Bob's public key)`
|
|
19
21
|
- Bob computes: `(Bob's private key) × (Alice's public key)`
|
|
20
22
|
- Both arrive at the same shared secret point
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
## Learning Goals
|
|
7
7
|
|
|
8
8
|
By the end of this tutorial, you will:
|
|
9
|
+
|
|
9
10
|
- Understand the mathematical foundations of elliptic curves used in Bitcoin
|
|
10
11
|
- Work with BigNumber for handling large integers in cryptographic operations
|
|
11
12
|
- Manipulate elliptic curve points using the SDK
|
|
@@ -590,6 +591,7 @@ In this tutorial, you've learned:
|
|
|
590
591
|
### Next Steps
|
|
591
592
|
|
|
592
593
|
Now that you understand elliptic curve fundamentals, you can explore:
|
|
594
|
+
|
|
593
595
|
- **[ECDH Key Exchange](./ecdh-key-exchange.md)**: Implementing secure communication protocols
|
|
594
596
|
- **[Signature Concepts](../concepts/signatures.md)**: Creating and verifying ECDSA signatures
|
|
595
597
|
- **[Key Management](./key-management.md)**: Generating multiple keys from a master key
|
|
@@ -600,4 +602,5 @@ Understanding of `WalletClient` usage (for practical applications)
|
|
|
600
602
|
While the `WalletClient` abstracts these operations for convenience, understanding the underlying mathematics helps you make informed decisions about security and implementation.
|
|
601
603
|
|
|
602
604
|
## Integration with `WalletClient`
|
|
605
|
+
|
|
603
606
|
For production applications, the `WalletClient` provides secure key management:
|
|
@@ -439,6 +439,7 @@ robustTransactionCreation().catch(console.error)
|
|
|
439
439
|
```
|
|
440
440
|
|
|
441
441
|
This example demonstrates:
|
|
442
|
+
|
|
442
443
|
- **Specific error pattern matching** for different error types
|
|
443
444
|
- **Dynamic amount adjustment** for insufficient funds
|
|
444
445
|
- **Wallet synchronization handling** with appropriate delays
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
**Prerequisites**: Node.js, basic TypeScript knowledge
|
|
5
5
|
|
|
6
6
|
## Learning Goals
|
|
7
|
+
|
|
7
8
|
- Install and configure the BSV TypeScript SDK
|
|
8
9
|
- Create a simple transaction using `WalletClient` interface on the mainnet network. This approach makes it easy to build transactions by abstracting away many of the low-level details. By the end, you'll understand the basic components of a BSV transaction and how to construct, sign, and broadcast one on the BSV blockchain.
|
|
9
10
|
|
|
@@ -15,7 +16,7 @@ In this tutorial, you'll learn how to create your first Bitcoin SV transactions
|
|
|
15
16
|
|
|
16
17
|
> **💡 Try It Interactive**: Want to experiment with the code examples from this tutorial? Check out our [Interactive BSV Coding Environment](https://fast.brc.dev/) where you can run SDK code directly in your browser without any setup!
|
|
17
18
|
|
|
18
|
-
## Precondition
|
|
19
|
+
## Precondition
|
|
19
20
|
|
|
20
21
|
Install a BRC-100 compliant wallet such as the [MetaNet Desktop Wallet](https://metanet.bsvb.tech/). When you install it, you'll receive a small amount of funds to play with.
|
|
21
22
|
|
|
@@ -118,8 +119,8 @@ Run it as follows:
|
|
|
118
119
|
npx ts-node step1-simple-transaction.ts
|
|
119
120
|
```
|
|
120
121
|
|
|
121
|
-
|
|
122
122
|
**What's happening here:**
|
|
123
|
+
|
|
123
124
|
- We connect to your BRC-100 wallet (like MetaNet Desktop)
|
|
124
125
|
- Create a transaction with one output containing "Hello BSV!" data
|
|
125
126
|
- The wallet automatically handles inputs, change, and fees
|
|
@@ -161,7 +162,6 @@ async function createToken() {
|
|
|
161
162
|
createToken().catch(console.error)
|
|
162
163
|
```
|
|
163
164
|
|
|
164
|
-
|
|
165
165
|
Run it as follows:
|
|
166
166
|
|
|
167
167
|
```bash
|
|
@@ -169,8 +169,8 @@ Run it as follows:
|
|
|
169
169
|
npx ts-node step2-create-token.ts
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
|
|
173
172
|
**What's happening here:**
|
|
173
|
+
|
|
174
174
|
- We create a minimal token (1 satoshi with OP_NOP script)
|
|
175
175
|
- Store it in a wallet basket called 'my-tokens' for organization
|
|
176
176
|
- This creates a spendable output we can use later
|
|
@@ -225,7 +225,6 @@ async function spendToken() {
|
|
|
225
225
|
spendToken().catch(console.error)
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
|
|
229
228
|
Run it as follows:
|
|
230
229
|
|
|
231
230
|
```bash
|
|
@@ -233,15 +232,13 @@ Run it as follows:
|
|
|
233
232
|
npx ts-node step3-spend-token.ts
|
|
234
233
|
```
|
|
235
234
|
|
|
236
|
-
|
|
237
235
|
**What's happening here:**
|
|
236
|
+
|
|
238
237
|
- We list tokens from our 'my-tokens' basket
|
|
239
238
|
- Spend the first available token by providing its outpoint
|
|
240
239
|
- Create a new output with proof that we spent the token
|
|
241
240
|
- The BEEF (Blockchain Exchange Format) provides the transaction history
|
|
242
241
|
|
|
243
|
-
|
|
244
|
-
|
|
245
242
|
## What You've Learned
|
|
246
243
|
|
|
247
244
|
Congratulations! You've successfully created your first BSV transactions. Here's what you accomplished:
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
## Learning Goals
|
|
7
7
|
|
|
8
8
|
By completing this tutorial, you will:
|
|
9
|
+
|
|
9
10
|
- Understand cryptographic hash functions and their properties
|
|
10
11
|
- Master the Hash module classes and helper functions in the BSV TypeScript SDK
|
|
11
12
|
- Implement various hash algorithms (SHA-256, SHA-512, SHA-1, RIPEMD-160)
|
|
@@ -34,6 +35,7 @@ import { Hash, Utils } from '@bsv/sdk'
|
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
The `Hash` module contains:
|
|
38
|
+
|
|
37
39
|
- Hash function classes (`SHA256`, `SHA512`, `SHA1`, `RIPEMD160`)
|
|
38
40
|
- HMAC classes (`SHA256HMAC`, `SHA512HMAC`, `SHA1HMAC`)
|
|
39
41
|
- Helper functions (`sha256`, `sha512`, `hash256`, `hash160`, `sha256hmac`)
|
|
@@ -758,6 +760,7 @@ function efficientHashing(messages: string[]): string[] {
|
|
|
758
760
|
This tutorial covered comprehensive usage of cryptographic hashing and HMACs in the BSV TypeScript SDK:
|
|
759
761
|
|
|
760
762
|
**Key Concepts Learned:**
|
|
763
|
+
|
|
761
764
|
- Hash function fundamentals and Bitcoin-specific applications
|
|
762
765
|
- SHA-256, SHA-512, SHA-1, and RIPEMD-160 implementation
|
|
763
766
|
- HMAC creation and verification for message authentication
|
|
@@ -766,6 +769,7 @@ This tutorial covered comprehensive usage of cryptographic hashing and HMACs in
|
|
|
766
769
|
- Security best practices for key management and validation
|
|
767
770
|
|
|
768
771
|
**Practical Applications:**
|
|
772
|
+
|
|
769
773
|
- Data integrity verification systems
|
|
770
774
|
- Message authentication protocols
|
|
771
775
|
- Transaction metadata protection
|
|
@@ -773,6 +777,7 @@ This tutorial covered comprehensive usage of cryptographic hashing and HMACs in
|
|
|
773
777
|
- Secure key derivation patterns
|
|
774
778
|
|
|
775
779
|
**Security Considerations:**
|
|
780
|
+
|
|
776
781
|
- Proper input validation and error handling
|
|
777
782
|
- Constant-time comparison to prevent timing attacks
|
|
778
783
|
- Secure key generation and storage practices
|
|
@@ -781,34 +786,3 @@ This tutorial covered comprehensive usage of cryptographic hashing and HMACs in
|
|
|
781
786
|
The Hash module in the BSV TypeScript SDK provides both low-level control through classes and high-level convenience through helper functions, enabling developers to implement robust cryptographic solutions for Bitcoin applications.
|
|
782
787
|
|
|
783
788
|
Continue exploring advanced cryptographic topics with the [ECDH Key Exchange](./ecdh-key-exchange.md) and [AES Symmetric Encryption](./aes-encryption.md) tutorials to build complete cryptographic systems.
|
|
784
|
-
|
|
785
|
-
```typescript
|
|
786
|
-
// Example usage
|
|
787
|
-
const metadataProtector = new SecureTransactionMetadata('user_password_123')
|
|
788
|
-
|
|
789
|
-
const originalMetadata: TransactionMetadata = {
|
|
790
|
-
description: 'Payment for services',
|
|
791
|
-
category: 'business',
|
|
792
|
-
tags: ['consulting', 'development'],
|
|
793
|
-
amount: 100
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
const protectedData = metadataProtector.protectMetadata(originalMetadata)
|
|
797
|
-
console.log('Protected metadata:', protectedData)
|
|
798
|
-
|
|
799
|
-
const extracted = metadataProtector.verifyAndExtract(protectedData)
|
|
800
|
-
console.log('Extracted metadata:', extracted)
|
|
801
|
-
console.log('Metadata matches:', JSON.stringify(originalMetadata) === JSON.stringify(extracted))
|
|
802
|
-
```
|
|
803
|
-
|
|
804
|
-
Follow these instructions to make the following change to my code document.
|
|
805
|
-
|
|
806
|
-
Instruction: Update all occurrences of "WalletClient" to be formatted as inline code `WalletClient`, except in headers and when it appears in actual code blocks.
|
|
807
|
-
|
|
808
|
-
Code Edit:
|
|
809
|
-
```typescript
|
|
810
|
-
// Understanding of `WalletClient` usage (for practical applications)
|
|
811
|
-
While the `WalletClient` provides high-level transaction operations, understanding hashes and HMACs enables you to build sophisticated cryptographic applications and secure data verification systems.
|
|
812
|
-
|
|
813
|
-
## Integration with `WalletClient`
|
|
814
|
-
For production applications, the `WalletClient` provides secure hash operations:
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
**Duration**: 90 minutes
|
|
4
4
|
**Prerequisites**: Node.js, basic TypeScript knowledge, understanding of digital certificates
|
|
5
5
|
**Learning Goals**:
|
|
6
|
+
|
|
6
7
|
- Understand decentralized identity concepts
|
|
7
8
|
- Use IdentityClient for certificate management
|
|
8
9
|
- Implement identity verification systems
|
|
@@ -700,3 +701,29 @@ async function demonstrateVerificationService() {
|
|
|
700
701
|
}
|
|
701
702
|
|
|
702
703
|
demonstrateVerificationService().catch(console.error)
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
## Conclusion
|
|
707
|
+
|
|
708
|
+
Congratulations! You've successfully built a comprehensive identity management system using the BSV TypeScript SDK. In this tutorial, you've learned how to create, manage, and verify digital identities on the BSV blockchain.
|
|
709
|
+
|
|
710
|
+
### Core Concepts Mastered
|
|
711
|
+
|
|
712
|
+
1. **Identity Creation**: Generated unique BSV identities using cryptographic key pairs
|
|
713
|
+
2. **Certificate Management**: Created and managed identity certificates for enhanced trust
|
|
714
|
+
3. **Identity Resolution**: Implemented identity lookup and verification services
|
|
715
|
+
4. **Trust Scoring**: Built systems to calculate and evaluate identity trustworthiness
|
|
716
|
+
5. **Batch Processing**: Optimized identity operations for handling multiple identities efficiently
|
|
717
|
+
|
|
718
|
+
## Next Steps
|
|
719
|
+
|
|
720
|
+
- Learn about [AuthFetch Integration](./authfetch-tutorial.md) to use identities for API authentication
|
|
721
|
+
- Explore [Identity Verification Systems](../guides/identity-verification-systems.md) for advanced verification patterns
|
|
722
|
+
- Understand [Security Best Practices](../guides/security-best-practices.md) for production identity systems
|
|
723
|
+
|
|
724
|
+
## Additional Resources
|
|
725
|
+
|
|
726
|
+
- [Identity Client API Reference](../reference/identity.md)
|
|
727
|
+
- [Certificate Management Guide](../concepts/identity-certificates.md)
|
|
728
|
+
- [Decentralized Identity Concepts](../concepts/decentralized-identity.md)
|
|
729
|
+
- [BSV Identity Standards](https://projectbabbage.com/docs/guides/identity)
|
package/docs/tutorials/index.md
CHANGED
|
@@ -9,174 +9,211 @@ Before diving into the tutorials, you can experiment with many of these concepts
|
|
|
9
9
|
## Getting Started Track
|
|
10
10
|
|
|
11
11
|
### [Your First BSV Transaction](./first-transaction.md)
|
|
12
|
+
|
|
12
13
|
- **Duration**: 30 minutes
|
|
13
14
|
- **Prerequisites**: Node.js, basic TypeScript knowledge
|
|
14
15
|
- **Learning Goals**:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
- Install and configure the SDK
|
|
18
|
+
- Create a simple P2PKH transaction
|
|
19
|
+
- Understand BSV transaction anatomy
|
|
18
20
|
|
|
19
21
|
### [Transaction Types and Data](./transaction-types.md)
|
|
22
|
+
|
|
20
23
|
- **Duration**: 30 minutes
|
|
21
24
|
- **Prerequisites**: Completed "Your First BSV Transaction" tutorial
|
|
22
25
|
- **Learning Goals**:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
- Create transactions with multiple outputs
|
|
28
|
+
- Add data to transactions
|
|
29
|
+
- Work with different output types
|
|
30
|
+
- Use advanced `WalletClient` features
|
|
27
31
|
|
|
28
32
|
### [Key Management and Cryptography](./key-management.md)
|
|
33
|
+
|
|
29
34
|
- **Duration**: 45 minutes
|
|
30
35
|
- **Prerequisites**: Completed "Your First BSV Transaction" tutorial
|
|
31
36
|
- **Learning Goals**:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
|
|
38
|
+
- Generate and manage private/public keys
|
|
39
|
+
- Understand ECDSA signatures
|
|
40
|
+
- Create and verify digital signatures
|
|
35
41
|
|
|
36
42
|
### [Transaction Broadcasting](./transaction-broadcasting.md)
|
|
43
|
+
|
|
37
44
|
- **Duration**: 25 minutes
|
|
38
45
|
- **Prerequisites**: Completed "Your First BSV Transaction" tutorial, Node.js, basic TypeScript knowledge
|
|
39
46
|
- **Learning Goals**:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
45
53
|
|
|
46
54
|
## Intermediate Development Track
|
|
47
55
|
|
|
48
56
|
### [Working with ProtoWallet for Development](./protowallet-development.md)
|
|
57
|
+
|
|
49
58
|
- **Duration**: 45 minutes
|
|
50
59
|
- **Prerequisites**: Basic TypeScript knowledge, understanding of cryptographic concepts
|
|
51
60
|
- **Learning Goals**:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
56
66
|
|
|
57
67
|
### [Authenticated HTTP Requests with AuthFetch](./authfetch-tutorial.md)
|
|
68
|
+
|
|
58
69
|
- **Duration**: 60 minutes
|
|
59
70
|
- **Prerequisites**: Understanding of HTTP protocols, basic cryptography knowledge
|
|
60
71
|
- **Learning Goals**:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
65
77
|
|
|
66
78
|
### [Decentralized File Storage with UHRP](./uhrp-storage.md)
|
|
79
|
+
|
|
67
80
|
- **Duration**: 75 minutes
|
|
68
81
|
- **Prerequisites**: Understanding of content-addressed storage concepts
|
|
69
82
|
- **Learning Goals**:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
|
74
88
|
|
|
75
89
|
### [Identity Management and Certificates](./identity-management.md)
|
|
90
|
+
|
|
76
91
|
- **Duration**: 90 minutes
|
|
77
92
|
- **Prerequisites**: Understanding of PKI and certificate concepts
|
|
78
93
|
- **Learning Goals**:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
83
99
|
|
|
84
100
|
### [Advanced Transaction Construction](./advanced-transaction.md)
|
|
101
|
+
|
|
85
102
|
- **Duration**: 75 minutes
|
|
86
103
|
- **Learning Goals**:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
104
|
+
|
|
105
|
+
- Multi-input/multi-output transactions
|
|
106
|
+
- Fee calculation and optimization
|
|
107
|
+
- Change output handling
|
|
90
108
|
|
|
91
109
|
### [Script Construction and Custom Logic](./script-construction.md)
|
|
110
|
+
|
|
92
111
|
- **Duration**: 90 minutes
|
|
93
112
|
- **Learning Goals**:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
113
|
+
|
|
114
|
+
- Understand Bitcoin Script basics
|
|
115
|
+
- Create custom locking scripts
|
|
116
|
+
- Implement unlocking logic
|
|
97
117
|
|
|
98
118
|
### [SPV and Merkle Proof Verification](./spv-merkle-proofs.md)
|
|
119
|
+
|
|
99
120
|
- **Duration**: 90 minutes
|
|
100
121
|
- **Learning Goals**:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
|
|
123
|
+
- Understand SPV principles
|
|
124
|
+
- Verify Merkle proofs
|
|
125
|
+
- Implement lightweight verification
|
|
104
126
|
|
|
105
127
|
### [Error Handling and Edge Cases](./error-handling.md)
|
|
128
|
+
|
|
106
129
|
- **Duration**: 60 minutes
|
|
107
130
|
- **Learning Goals**:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
131
|
+
|
|
132
|
+
- Robust error handling patterns
|
|
133
|
+
- Network failure recovery
|
|
134
|
+
- Transaction validation edge cases
|
|
111
135
|
|
|
112
136
|
## Low-Level Cryptography Track
|
|
113
137
|
|
|
114
138
|
### [Elliptic Curve Fundamentals: Numbers & Points](./elliptic-curve-fundamentals.md)
|
|
139
|
+
|
|
115
140
|
- **Duration**: 90 minutes
|
|
116
141
|
- **Learning Goals**:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
|
121
147
|
|
|
122
148
|
### [ECDH Key Exchange](./ecdh-key-exchange.md)
|
|
149
|
+
|
|
123
150
|
- **Duration**: 75 minutes
|
|
124
151
|
- **Learning Goals**:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
129
157
|
|
|
130
158
|
### [AES Symmetric Encryption](./aes-encryption.md)
|
|
159
|
+
|
|
131
160
|
- **Duration**: 60 minutes
|
|
132
161
|
- **Learning Goals**:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
|
139
169
|
|
|
140
170
|
### [Hashes and HMACs](./hashes-and-hmacs.md)
|
|
171
|
+
|
|
141
172
|
- **Duration**: 75 minutes
|
|
142
173
|
- **Learning Goals**:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
|
150
182
|
|
|
151
183
|
### [Type-42 Key Derivation](./type-42.md)
|
|
184
|
+
|
|
152
185
|
- **Duration**: 75 minutes
|
|
153
186
|
- **Prerequisites**: Basic TypeScript knowledge, Elliptic Curve Fundamentals tutorial completed, ECDH Key Exchange tutorial completed
|
|
154
187
|
- **Learning Goals**:
|
|
155
|
-
- Understand Type-42 key derivation protocol and its use cases
|
|
156
|
-
- Implement Type-42 operations with the BSV TypeScript SDK
|
|
157
|
-
- Create shared key universes between two parties
|
|
158
|
-
- Apply Type-42 in practical Bitcoin applications like message signing and encryption
|
|
159
|
-
- Understand the "anyone key" concept and its applications
|
|
160
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
|
|
161
194
|
|
|
162
195
|
## Alternative Low-Level Transaction API Track
|
|
163
196
|
|
|
164
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.
|
|
165
198
|
|
|
166
199
|
### [Your First BSV Transaction (Low-level API)](./first-transaction-low-level.md)
|
|
200
|
+
|
|
167
201
|
- **Duration**: 45 minutes
|
|
168
202
|
- **Prerequisites**: Node.js, basic TypeScript knowledge
|
|
169
203
|
- **Learning Goals**:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
174
209
|
|
|
175
210
|
### [Working with Testnet Transactions (Low-level API)](./testnet-transactions-low-level.md)
|
|
211
|
+
|
|
176
212
|
- **Duration**: 60 minutes
|
|
177
213
|
- **Prerequisites**: Completed "Your First BSV Transaction (Low-level API)" tutorial
|
|
178
214
|
- **Learning Goals**:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
**Prerequisites**: Completed "Your First BSV Transaction" tutorial, Node.js, basic TypeScript knowledge
|
|
5
5
|
|
|
6
6
|
## Learning Goals
|
|
7
|
+
|
|
7
8
|
- Generate and manage private/public keys
|
|
8
9
|
- Understand ECDSA signatures
|
|
9
10
|
- Create and verify digital signatures
|
|
@@ -373,7 +374,6 @@ Run the script:
|
|
|
373
374
|
npx ts-node signatures-low-level.ts
|
|
374
375
|
```
|
|
375
376
|
|
|
376
|
-
|
|
377
377
|
### Key Benefits of `WalletClient` for Signatures
|
|
378
378
|
|
|
379
379
|
1. **Enhanced Security**: Private keys never leave the wallet environment
|
|
@@ -383,7 +383,7 @@ npx ts-node signatures-low-level.ts
|
|
|
383
383
|
|
|
384
384
|
## Step 5: Practical Application: Signing Transactions with `WalletClient`
|
|
385
385
|
|
|
386
|
-
Let's put our knowledge to practical use by creating and signing a Bitcoin transaction using the `WalletClient`.
|
|
386
|
+
Let's put our knowledge to practical use by creating and signing a Bitcoin transaction using the `WalletClient`.
|
|
387
387
|
|
|
388
388
|
Create a file called `wallet-transaction-signing.ts`:
|
|
389
389
|
|
|
@@ -502,6 +502,7 @@ npx ts-node wallet-transaction-signing.ts
|
|
|
502
502
|
```
|
|
503
503
|
|
|
504
504
|
This example demonstrates:
|
|
505
|
+
|
|
505
506
|
1. Creating a transaction with inputs and outputs
|
|
506
507
|
2. Getting the transaction hash that needs to be signed
|
|
507
508
|
3. How the `WalletClient` would sign this hash securely
|
|
@@ -525,7 +526,8 @@ Congratulations! You've learned the fundamentals of key management and cryptogra
|
|
|
525
526
|
|
|
526
527
|
These cryptographic concepts form the foundation of Bitcoin and blockchain technology. By understanding how keys and signatures work, you're well-equipped to build secure and robust applications using the BSV TypeScript SDK.
|
|
527
528
|
|
|
528
|
-
For more advanced techniques like different signature hash types (SIGHASH flags), manual signature creation, and multi-signature transactions, refer to the
|
|
529
|
+
For more advanced techniques like different signature hash types (SIGHASH flags), manual signature creation, and multi-signature transactions, refer to the following documents:
|
|
530
|
+
|
|
529
531
|
- [Advanced Transaction Signing](../guides/advanced-transaction-signing.md) (How-To Guide)
|
|
530
532
|
- [Transaction Signatures Reference](../reference/transaction-signatures.md) (Technical Reference)
|
|
531
533
|
|