How moneybutton/bsv works
Main Components
a) Core Components:
• Cryptography Module
• Key Management (key-pair.js, priv-key.js, pub-key.js)
• Encryption/Decryption (aes.js, aescbc.js)
• Hashing (hash.js, hash-cache.js)
• ECDSA Operations (ecdsa.js, ecies.js)
b) Bitcoin Protocol Components:
• Transaction Management
• Transaction Building (tx-builder.js)
• Transaction Verification (tx-verifier.js)
• Input/Output Handling (tx-in.js, tx-out.js)
• Block Management
• Block Handling (block.js)
• Block Headers (block-header.js)
• Merkle Trees (merkle.js)
c) Address Management:
• Address Generation
• Network-specific Implementations (mainnet/testnet)
d) BIP Implementation Layer:
• BIP32 (Hierarchical Deterministic Wallets)
• BIP39 (Mnemonic Codes)
e) Worker System:
• Web Worker Interface
• Worker Results Handler
┌─────────────────────────────────────────────┐
• Application Layer │
• (External Applications Using the Library) │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• Public API Layer │
• (index.js main entry point) │
• ┘
• ↕
┌─────────────────────────────────────────────┐
• Core Functionality Layer │
• ┬─────────────┬────────────────┤
• Crypto │ Protocol │ Address │
• Operations │ Handling │ Management │
• ┴─────────────┴────────────────┘
• ↕
┌─────────────────────────────────────────────┐
• Utility Layer │
• (Base58, Buffer Ops, Random, Constants) │
• ┘
Main Thread ←→ Worker Interface ←→ Worker Pool
Network Layer
• Mainnet Implementation
• Testnet Implementation
Implementation Details
• Use rectangles for modules
• Use hexagons for cryptographic operations
Additional Elements
• Configuration management showing how environment variables affect the system
• Test coverage indicators for each component
• External dependency relationships (minimal as per project goals)
• BIP implementation compliance