@bsv/sdk 1.6.8 → 1.6.10
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 +9 -4
- package/dist/cjs/package.json +7 -5
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +11 -3
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/utils/toOriginHeader.js +21 -0
- package/dist/cjs/src/wallet/substrates/utils/toOriginHeader.js.map +1 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +9 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
- package/dist/esm/src/wallet/substrates/utils/toOriginHeader.js +17 -0
- package/dist/esm/src/wallet/substrates/utils/toOriginHeader.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/utils/toOriginHeader.d.ts +2 -0
- package/dist/types/src/wallet/substrates/utils/toOriginHeader.d.ts.map +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/concepts/beef.md +84 -0
- package/docs/concepts/chain-tracking.md +122 -0
- package/docs/concepts/decentralized-identity.md +184 -0
- package/docs/concepts/fees.md +217 -0
- package/docs/concepts/identity-certificates.md +255 -0
- package/docs/concepts/index.md +62 -0
- package/docs/concepts/key-management.md +176 -0
- package/docs/concepts/script-templates.md +163 -0
- package/docs/concepts/sdk-philosophy.md +72 -0
- package/docs/concepts/signatures.md +179 -0
- package/docs/concepts/spv-verification.md +106 -0
- package/docs/concepts/transaction-encoding.md +148 -0
- package/docs/concepts/transaction-structure.md +63 -0
- package/docs/concepts/trust-model.md +123 -0
- package/docs/concepts/verification.md +219 -0
- package/docs/concepts/wallet-integration.md +95 -0
- package/docs/guides/direct-transaction-creation.md +137 -0
- package/docs/guides/http-client-configuration.md +414 -0
- package/docs/guides/index.md +30 -0
- package/docs/guides/transaction-signing-methods.md +268 -0
- package/docs/index.md +74 -0
- package/docs/reference/arc-config.md +698 -0
- package/docs/reference/brc-100.md +33 -0
- package/docs/reference/configuration.md +829 -0
- package/docs/reference/debugging.md +700 -0
- package/docs/reference/errors.md +547 -0
- package/docs/reference/index.md +98 -0
- package/docs/reference/network-config.md +914 -0
- package/docs/reference/op-codes.md +306 -0
- package/docs/reference/transaction-signatures.md +94 -0
- package/docs/{wallet.md → reference/wallet.md} +9 -0
- package/docs/requirements.txt +3 -0
- package/docs/tutorials/advanced-transaction.md +575 -0
- package/docs/tutorials/aes-encryption.md +947 -0
- package/docs/tutorials/authfetch-tutorial.md +957 -0
- package/docs/tutorials/ecdh-key-exchange.md +547 -0
- package/docs/tutorials/elliptic-curve-fundamentals.md +603 -0
- package/docs/tutorials/error-handling.md +1215 -0
- package/docs/tutorials/first-transaction-low-level.md +204 -0
- package/docs/tutorials/first-transaction.md +278 -0
- package/docs/tutorials/hashes-and-hmacs.md +814 -0
- package/docs/tutorials/identity-management.md +702 -0
- package/docs/tutorials/index.md +182 -0
- package/docs/tutorials/key-management.md +536 -0
- package/docs/tutorials/protowallet-development.md +716 -0
- package/docs/tutorials/script-construction.md +690 -0
- package/docs/tutorials/spv-merkle-proofs.md +682 -0
- package/docs/tutorials/testnet-transactions-low-level.md +352 -0
- package/docs/tutorials/transaction-broadcasting.md +535 -0
- package/docs/tutorials/transaction-types.md +419 -0
- package/docs/tutorials/type-42.md +582 -0
- package/docs/tutorials/uhrp-storage.md +579 -0
- package/package.json +7 -5
- package/src/transaction/__tests/Transaction.test.ts +1 -1
- package/src/wallet/substrates/HTTPWalletJSON.ts +11 -1
- package/src/wallet/substrates/WalletWireProcessor.ts +1 -1
- package/src/wallet/substrates/__tests/toOriginHeader.test.ts +34 -0
- package/src/wallet/substrates/utils/toOriginHeader.ts +15 -0
- package/docs/README.md +0 -21
- /package/docs/{auth.md → reference/auth.md} +0 -0
- /package/docs/{compat.md → reference/compat.md} +0 -0
- /package/docs/{identity.md → reference/identity.md} +0 -0
- /package/docs/{kvstore.md → reference/kvstore.md} +0 -0
- /package/docs/{messages.md → reference/messages.md} +0 -0
- /package/docs/{overlay-tools.md → reference/overlay-tools.md} +0 -0
- /package/docs/{primitives.md → reference/primitives.md} +0 -0
- /package/docs/{registry.md → reference/registry.md} +0 -0
- /package/docs/{script.md → reference/script.md} +0 -0
- /package/docs/{storage.md → reference/storage.md} +0 -0
- /package/docs/{totp.md → reference/totp.md} +0 -0
- /package/docs/{transaction.md → reference/transaction.md} +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Transaction Signing Methods
|
|
2
|
+
|
|
3
|
+
*This is a How-To guide for different transaction signing approaches with the BSV TypeScript SDK.*
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This guide demonstrates two different approaches to signing Bitcoin transactions with the BSV TypeScript SDK:
|
|
8
|
+
|
|
9
|
+
1. **Using WalletClient** - A high-level approach that abstracts key management and signing details
|
|
10
|
+
2. **Using Low-level APIs** - A direct approach with more control over the transaction signing process
|
|
11
|
+
|
|
12
|
+
Each method has its advantages depending on your use case. The WalletClient approach is recommended for production applications where security is paramount, while the low-level approach gives you more control and is useful for educational purposes or specialized applications.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- Completed the [Key Management and Cryptography tutorial](../tutorials/key-management.md)
|
|
17
|
+
- Familiarity with Bitcoin transaction structure
|
|
18
|
+
- Understanding of basic cryptographic principles
|
|
19
|
+
|
|
20
|
+
## Method 1: Transaction Signing with WalletClient
|
|
21
|
+
|
|
22
|
+
The WalletClient provides a secure, high-level interface for managing keys and signing transactions. This approach is recommended for production applications as it:
|
|
23
|
+
|
|
24
|
+
- Abstracts away complex key management
|
|
25
|
+
- Provides better security by isolating private keys
|
|
26
|
+
- Handles transaction construction and signing in a unified way
|
|
27
|
+
|
|
28
|
+
### Example Code
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { WalletClient, Transaction } from '@bsv/sdk'
|
|
32
|
+
|
|
33
|
+
async function walletTransactionDemo() {
|
|
34
|
+
console.log('\n=== Transaction Signing with WalletClient ===')
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
// 1. WalletClient Key Management
|
|
38
|
+
const wallet = new WalletClient('auto', 'localhost')
|
|
39
|
+
console.log('\n1. WalletClient Key Management')
|
|
40
|
+
|
|
41
|
+
// Define protocol and key identifiers for wallet operations
|
|
42
|
+
// Use 1 to represent medium security level
|
|
43
|
+
// Cast it to any to bypass strict type checking since we don't have the SecurityLevel enum
|
|
44
|
+
const protocolID = [1, 'example'] as any
|
|
45
|
+
const keyID = 'transaction-signing-key'
|
|
46
|
+
|
|
47
|
+
console.log(`Protocol ID: ${protocolID[0]}-${protocolID[1]}`)
|
|
48
|
+
console.log(`Key ID: ${keyID}`)
|
|
49
|
+
|
|
50
|
+
// Get a public key from the wallet
|
|
51
|
+
// In a real application, this would be a key securely managed by the wallet
|
|
52
|
+
const publicKeyResult = await wallet.getPublicKey({ protocolID, keyID })
|
|
53
|
+
const publicKeyHex = publicKeyResult.publicKey
|
|
54
|
+
console.log(`Public Key: ${publicKeyHex}`)
|
|
55
|
+
|
|
56
|
+
// 2. Creating a transaction with WalletClient
|
|
57
|
+
console.log('\n2. Creating a transaction with WalletClient')
|
|
58
|
+
|
|
59
|
+
// Set up payment details
|
|
60
|
+
const recipientAddress = '1DBz6V6CmvjZTvfjvJpfnrBk9Lf8fJ8dW8' // Example recipient
|
|
61
|
+
const amountSatoshis = 100
|
|
62
|
+
|
|
63
|
+
// Create a payment action using WalletClient
|
|
64
|
+
// This builds a complete transaction structure internally
|
|
65
|
+
const actionResult = await wallet.createAction({
|
|
66
|
+
description: `Payment to ${recipientAddress}`,
|
|
67
|
+
// Define outputs for the transaction
|
|
68
|
+
outputs: [
|
|
69
|
+
{
|
|
70
|
+
// In a real application, you would create a proper P2PKH script for the recipient
|
|
71
|
+
lockingScript: '76a914eb0bd5edba389198e73f8efabddfc61666969ff788ac', // Example P2PKH script
|
|
72
|
+
satoshis: amountSatoshis,
|
|
73
|
+
outputDescription: `Payment to ${recipientAddress}`
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
// Set options to ensure we get a signable transaction
|
|
77
|
+
options: {
|
|
78
|
+
signAndProcess: false // This ensures we get a signable transaction back
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
console.log('Payment action created:')
|
|
83
|
+
if (actionResult.signableTransaction) {
|
|
84
|
+
console.log(`- Action Reference: ${actionResult.signableTransaction.reference}`)
|
|
85
|
+
} else {
|
|
86
|
+
console.log('No signable transaction returned - check wallet configuration')
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
console.log(`- Description: Payment to ${recipientAddress}`)
|
|
90
|
+
console.log(`- Amount: ${amountSatoshis} satoshis`)
|
|
91
|
+
|
|
92
|
+
// 3. Sign the transaction with WalletClient
|
|
93
|
+
console.log('\n3. Signing transaction with WalletClient')
|
|
94
|
+
|
|
95
|
+
// Request wallet to sign the action/transaction
|
|
96
|
+
const signResult = await wallet.signAction({
|
|
97
|
+
// Use the reference from the createAction result
|
|
98
|
+
reference: actionResult.signableTransaction.reference,
|
|
99
|
+
// The spends parameter is a map of input indexes to unlocking scripts
|
|
100
|
+
// For wallet-managed keys, we provide an empty map and let the wallet handle it
|
|
101
|
+
spends: {}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
console.log('Transaction signed successfully!')
|
|
105
|
+
if (signResult.txid) {
|
|
106
|
+
console.log(`Transaction ID: ${signResult.txid}`)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 4. Examine the transaction
|
|
110
|
+
console.log('\n4. Examining the transaction')
|
|
111
|
+
|
|
112
|
+
// Check if we have a transaction ID from the sign result
|
|
113
|
+
if (signResult.txid) {
|
|
114
|
+
console.log(`Transaction ID: ${signResult.txid}`)
|
|
115
|
+
console.log('Transaction was successfully signed and broadcast!')
|
|
116
|
+
|
|
117
|
+
// Note: In a real application, you would fetch the transaction details
|
|
118
|
+
// from the blockchain using the txid to examine its structure
|
|
119
|
+
|
|
120
|
+
// In a real application, you would examine the transaction structure here
|
|
121
|
+
console.log('\nTo examine the transaction structure, you would:')
|
|
122
|
+
console.log('1. Fetch the transaction from the blockchain using the txid')
|
|
123
|
+
console.log('2. Parse the transaction to view inputs, outputs, and scripts')
|
|
124
|
+
console.log('3. Verify signatures and validate the transaction')
|
|
125
|
+
|
|
126
|
+
console.log('\nExample output information you would see:')
|
|
127
|
+
console.log('- Input count: typically 1 or more inputs from your wallet')
|
|
128
|
+
console.log('- Output count: at least 2 (payment + change)')
|
|
129
|
+
console.log('- Input scripts: Contains signatures and public keys')
|
|
130
|
+
console.log('- Output scripts: Contains P2PKH or other locking scripts')
|
|
131
|
+
} else {
|
|
132
|
+
console.log('No transaction ID available - transaction may not have been broadcast')
|
|
133
|
+
}
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error('Error during wallet transaction operations:', error)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Run the demo
|
|
140
|
+
walletTransactionDemo().catch(console.error)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Key Benefits of the WalletClient Approach
|
|
144
|
+
|
|
145
|
+
1. **Security**: Private keys are managed by the wallet service, reducing exposure
|
|
146
|
+
2. **Abstraction**: Complex transaction construction details are handled internally
|
|
147
|
+
3. **Integration**: Designed for integration with secure key management systems
|
|
148
|
+
4. **Consistency**: Provides a standardized approach to transaction creation and signing
|
|
149
|
+
|
|
150
|
+
## Method 2: Transaction Signing with Low-level APIs
|
|
151
|
+
|
|
152
|
+
The low-level approach gives you direct control over the transaction signing process. This is useful for:
|
|
153
|
+
|
|
154
|
+
- Educational purposes to understand the underlying mechanics
|
|
155
|
+
- Specialized applications requiring custom transaction structures
|
|
156
|
+
- Situations where you need fine-grained control over the signing process
|
|
157
|
+
|
|
158
|
+
### Example Code
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
import { PrivateKey, PublicKey, Transaction, P2PKH } from '@bsv/sdk'
|
|
162
|
+
|
|
163
|
+
async function transactionSigningDemo() {
|
|
164
|
+
// Generate keys for our demo
|
|
165
|
+
const privateKey = PrivateKey.fromRandom()
|
|
166
|
+
const address = privateKey.toAddress()
|
|
167
|
+
|
|
168
|
+
console.log('\n=== Keys for Transaction Signing ===')
|
|
169
|
+
console.log(`Private Key (WIF): ${privateKey.toWif()}`)
|
|
170
|
+
console.log(`Address: ${address.toString()}`)
|
|
171
|
+
|
|
172
|
+
// Create a new transaction
|
|
173
|
+
const tx = new Transaction()
|
|
174
|
+
|
|
175
|
+
// For demonstration, we'll add a dummy input
|
|
176
|
+
// In a real scenario, this would be a reference to a UTXO
|
|
177
|
+
// For our example, we'll create a simple transaction structure
|
|
178
|
+
// In a real scenario, you would use actual UTXOs
|
|
179
|
+
|
|
180
|
+
// First, create a dummy transaction that will serve as our input source
|
|
181
|
+
const dummyTx = new Transaction()
|
|
182
|
+
dummyTx.addOutput({
|
|
183
|
+
lockingScript: new P2PKH().lock(address),
|
|
184
|
+
satoshis: 100
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
// Now add an input that references our dummy transaction
|
|
188
|
+
tx.addInput({
|
|
189
|
+
sourceTransaction: dummyTx, // Reference to the dummy transaction
|
|
190
|
+
sourceOutputIndex: 0,
|
|
191
|
+
unlockingScriptTemplate: new P2PKH().unlock(privateKey)
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
// Add an output
|
|
195
|
+
tx.addOutput({
|
|
196
|
+
lockingScript: new P2PKH().lock(address),
|
|
197
|
+
satoshis: 100
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
console.log('\n=== Transaction Before Signing ===')
|
|
201
|
+
console.log(`Input Count: ${tx.inputs.length}`)
|
|
202
|
+
console.log(`Output Count: ${tx.outputs.length}`)
|
|
203
|
+
console.log(`First input has unlocking script: ${tx.inputs[0].unlockingScript ? 'Yes' : 'No'}`)
|
|
204
|
+
console.log(`First input has unlocking script template: ${tx.inputs[0].unlockingScriptTemplate ? 'Yes' : 'No'}`)
|
|
205
|
+
|
|
206
|
+
// Now, sign the transaction
|
|
207
|
+
await tx.sign()
|
|
208
|
+
|
|
209
|
+
console.log('\n=== Transaction After Signing ===')
|
|
210
|
+
console.log(`Transaction ID: ${Buffer.from(tx.id()).toString('hex')}`)
|
|
211
|
+
console.log(`First input has unlocking script: ${tx.inputs[0].unlockingScript ? 'Yes' : 'No'}`)
|
|
212
|
+
|
|
213
|
+
// Let's look at the unlocking script (scriptSig) that contains the signature
|
|
214
|
+
if (tx.inputs[0].unlockingScript) {
|
|
215
|
+
console.log(`\nUnlocking Script (ASM): ${tx.inputs[0].unlockingScript.toASM()}`)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Serialize the transaction to hex
|
|
219
|
+
const txHex = tx.toHex()
|
|
220
|
+
console.log(`\nSigned Transaction (hex, first 64 chars): ${txHex.substring(0, 64)}...`)
|
|
221
|
+
|
|
222
|
+
// Verify the signature(s) in the transaction
|
|
223
|
+
const isValid = await tx.verify()
|
|
224
|
+
console.log(`\nTransaction signature verification: ${isValid ? 'Valid ✓' : 'Invalid ✗'}`)
|
|
225
|
+
console.log('\nNote: The verification shows as invalid because this is a simplified example.')
|
|
226
|
+
console.log('In real transactions, proper UTXOs and transaction validation would be required.')
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Run our transaction signing demo
|
|
230
|
+
transactionSigningDemo().catch(console.error)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Key Benefits of the Low-level Approach
|
|
234
|
+
|
|
235
|
+
1. **Control**: Direct control over every aspect of the transaction
|
|
236
|
+
2. **Transparency**: Clear visibility into the transaction structure and signing process
|
|
237
|
+
3. **Flexibility**: Ability to customize transaction construction for specialized use cases
|
|
238
|
+
4. **Educational Value**: Better understanding of the underlying Bitcoin transaction mechanics
|
|
239
|
+
|
|
240
|
+
## Choosing the Right Approach
|
|
241
|
+
|
|
242
|
+
Consider the following factors when deciding which approach to use:
|
|
243
|
+
|
|
244
|
+
| Factor | WalletClient Approach | Low-level Approach |
|
|
245
|
+
|--------|----------------------|-------------------|
|
|
246
|
+
| Security | Higher (keys managed by wallet) | Lower (direct key handling) |
|
|
247
|
+
| Complexity | Lower (abstracted API) | Higher (manual transaction construction) |
|
|
248
|
+
| Control | Limited (managed by wallet) | Complete (direct access) |
|
|
249
|
+
| Use Case | Production applications | Educational, specialized applications |
|
|
250
|
+
| Integration | Better for enterprise systems | Better for custom implementations |
|
|
251
|
+
|
|
252
|
+
## Best Practices
|
|
253
|
+
|
|
254
|
+
Regardless of which approach you choose, follow these best practices:
|
|
255
|
+
|
|
256
|
+
1. **Never expose private keys**: Keep private keys secure and never expose them in logs or user interfaces
|
|
257
|
+
2. **Test thoroughly**: Always test transaction signing in a test environment before production
|
|
258
|
+
3. **Verify signatures**: Always verify signatures after signing to ensure transaction validity
|
|
259
|
+
4. **Handle errors gracefully**: Implement proper error handling for signing failures
|
|
260
|
+
5. **Consider SIGHASH flags**: Use appropriate signature hash types for your use case
|
|
261
|
+
6. **Document key management**: Maintain clear documentation of your key management approach
|
|
262
|
+
|
|
263
|
+
## Related Resources
|
|
264
|
+
|
|
265
|
+
- [Key Management and Cryptography Tutorial](../tutorials/key-management.md)
|
|
266
|
+
- [Advanced Transaction Signing](./advanced-transaction-signing.md)
|
|
267
|
+
- [Transaction Signatures Reference](../reference/transaction-signatures.md)
|
|
268
|
+
- [Bitcoin Transaction Specification](https://reference.cash/protocol/blockchain/transaction)
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# BSV TypeScript SDK Documentation
|
|
2
|
+
|
|
3
|
+
## SDK Overview
|
|
4
|
+
|
|
5
|
+
The BSV TypeScript SDK is designed to provide an updated and unified layer for developing scalable applications on the BSV Blockchain. It addresses the limitations of previous tools by offering a fresh, peer-to-peer approach, adhering to SPV principles, and ensuring privacy and scalability.
|
|
6
|
+
|
|
7
|
+
This documentation is organized to help you learn, solve problems, understand concepts, and find technical references.
|
|
8
|
+
|
|
9
|
+
## Documentation Categories
|
|
10
|
+
|
|
11
|
+
### [🚀 Tutorials](./tutorials/index.md)
|
|
12
|
+
|
|
13
|
+
Learn step-by-step with practical, guided examples:
|
|
14
|
+
|
|
15
|
+
- [Your First BSV Transaction](./tutorials/first-transaction.md)
|
|
16
|
+
- [Key Management and Cryptography](./tutorials/key-management.md)
|
|
17
|
+
- [Transaction Broadcasting and ARC](./tutorials/transaction-broadcasting.md)
|
|
18
|
+
- [View all tutorials →](./tutorials/index.md)
|
|
19
|
+
|
|
20
|
+
### [🔧 How-To Guides](./guides/index.md)
|
|
21
|
+
|
|
22
|
+
Problem-oriented guides for specific tasks:
|
|
23
|
+
|
|
24
|
+
- [Creating Multi-signature Transactions](./guides/multisig-transactions.md)
|
|
25
|
+
- [Implementing Transaction Batching](./guides/transaction-batching.md)
|
|
26
|
+
- [Configuring Custom ARC Endpoints](./guides/custom-arc-endpoints.md)
|
|
27
|
+
- [View all guides →](./guides/index.md)
|
|
28
|
+
|
|
29
|
+
### [📚 Reference](./reference/index.md)
|
|
30
|
+
|
|
31
|
+
Complete technical specifications and API documentation:
|
|
32
|
+
|
|
33
|
+
- [BRC-100 Wallet Interface (Swagger)](./reference/brc-100.md)
|
|
34
|
+
- [Primitives](./reference/primitives.md)
|
|
35
|
+
- [Script](./reference/script.md)
|
|
36
|
+
- [Transaction](./reference/transaction.md)
|
|
37
|
+
- [View all references →](./reference/index.md)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### [🏗️ Concepts & Explanations](./concepts/index.md)
|
|
42
|
+
|
|
43
|
+
Understanding the architecture and design principles:
|
|
44
|
+
|
|
45
|
+
- [SDK Design Philosophy](./concepts/sdk-philosophy.md)
|
|
46
|
+
- [Transaction Structure](./concepts/transaction-structure.md)
|
|
47
|
+
- [SPV Verification](./concepts/spv-verification.md)
|
|
48
|
+
- [BEEF Format](./concepts/beef.md)
|
|
49
|
+
- [View all concepts →](./concepts/index.md)
|
|
50
|
+
|
|
51
|
+
## Getting Started
|
|
52
|
+
|
|
53
|
+
If you're new to the BSV TypeScript SDK, we recommend starting with our [Getting Started Tutorial](./tutorials/first-transaction.md).
|
|
54
|
+
|
|
55
|
+
## Try It Interactive
|
|
56
|
+
|
|
57
|
+
🚀 **[Interactive BSV Coding Environment](https://fast.brc.dev/)**
|
|
58
|
+
|
|
59
|
+
Experience the BSV TypeScript SDK directly in your browser! Our interactive coding environment lets you:
|
|
60
|
+
|
|
61
|
+
- Run SDK code examples without any setup
|
|
62
|
+
- Experiment with transactions, keys, and scripts in real-time
|
|
63
|
+
- Learn by doing with immediate feedback
|
|
64
|
+
- Test concepts from our tutorials interactively
|
|
65
|
+
|
|
66
|
+
Perfect for getting started quickly or experimenting with new ideas.
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
To install the SDK, run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install @bsv/sdk
|
|
74
|
+
```
|