Skip to content

Commit ac73515

Browse files
Merge pull request #7341 from BitGo/BTC-2652.abstract-utxo-code-readme
feat(abstract-utxo): add comprehensive README and update .gitignore
2 parents cdb05b6 + 196eca7 commit ac73515

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

modules/abstract-utxo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
.idea/
33
dist/
4+
.vscode

modules/abstract-utxo/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
11
# BitGo abstract-utxo
2+
3+
This module provides the foundational `AbstractUtxoCoin` class and concrete implementations for Bitcoin and Bitcoin-like UTXO-based cryptocurrencies within the BitGo platform.
4+
5+
## Overview
6+
7+
The `AbstractUtxoCoin` class serves as the base implementation for all UTXO-based coins, providing common functionality for transaction building, signing, verification, and recovery operations. Each supported cryptocurrency extends this class to provide coin-specific behavior while leveraging the shared UTXO infrastructure.
8+
9+
## Supported Coins
10+
11+
Concrete implementations are provided in the `src/impl/` directory:
12+
13+
- **btc/** - Bitcoin (BTC) and Bitcoin testnet variants
14+
- **bch/** - Bitcoin Cash (BCH)
15+
- **bcha/** - Bitcoin Cash ABC (BCHA)
16+
- **bsv/** - Bitcoin SV (BSV)
17+
- **btg/** - Bitcoin Gold (BTG)
18+
- **ltc/** - Litecoin (LTC)
19+
- **dash/** - Dash (DASH)
20+
- **doge/** - Dogecoin (DOGE)
21+
- **zec/** - Zcash (ZEC)
22+
23+
## Key Features
24+
25+
### Transaction Operations
26+
- **Building & Signing**: Support for both legacy and PSBT transaction formats
27+
- **Multi-signature**: 2-of-3 multisig with various script types (P2SH, P2WSH, P2SH-P2WSH, P2TR-MuSig2)
28+
- **Verification**: Comprehensive transaction intent verification before signing
29+
- **Explanation**: Decode and explain transaction details (inputs, outputs, fees)
30+
31+
### Wallet Types
32+
- **Fixed Script Wallets**: Traditional HD wallets with deterministic address generation
33+
- **Descriptor Wallets**: Modern wallet format using output script descriptors
34+
- **Distributed Custody**: Support for enterprise custody configurations
35+
36+
### Address Management
37+
- Address validation and derivation verification
38+
- Support for multiple address formats (base58, bech32, cashaddr for BCH)
39+
- Chain/index-based address generation for fixed script wallets
40+
41+
### Recovery Operations
42+
- **Backup Key Recovery**: Recover funds using backup key when BitGo is unavailable
43+
- **Cross-Chain Recovery**: Recover coins sent to wrong chain (e.g., BTC sent to LTC address)
44+
- **V1 Wallet Recovery**: Support for legacy V1 wallet recovery
45+
46+
### Advanced Features
47+
- BIP322 message signing support
48+
- MuSig2 for Taproot multisig
49+
- Replay protection for chain splits
50+
- Custom change address handling
51+
- RBF (Replace-by-Fee) transaction support
52+
53+
## Development Setup
54+
55+
### VSCode Configuration
56+
57+
For an optimal development experience in VSCode, configure the Mocha Test Explorer with the following settings in `.vscode/settings.json`:
58+
59+
```json
60+
{
61+
"mochaExplorer.files": "test/**/*.ts",
62+
"mochaExplorer.nodeArgv": ["--import", "tsx"],
63+
"mochaExplorer.logpanel": true
64+
}
65+
```
66+
67+
This configuration enables:
68+
- **Test Discovery**: Automatically finds all TypeScript test files in the `test/` directory
69+
- **TypeScript Support**: Uses `tsx` for running TypeScript tests without compilation
70+
- **Log Panel**: Displays test output for easier debugging
71+
72+
### Running Tests
73+
74+
With the Mocha Test Explorer configured, you can:
75+
- View and run individual tests or test suites from the VSCode Test Explorer panel
76+
- Set breakpoints and debug tests directly in the editor
77+
- Monitor test output in the integrated log panel

0 commit comments

Comments
 (0)