How bitgo/bitgojs works
BitGoJS is a monorepo SDK for building cryptocurrency applications, centered on managing BitGo wallets and constructing and signing transactions across many networks. The principal workflow is an application using the SDK to access a wallet and coin implementation, then build/sign a transaction and interact with BitGo’s co-signing platform. The repository also includes a local signing proxy, chain-specific transaction libraries, public explorer access, and specialized Lightning, passkey, key-card, and Babylon staking capabilities. The README and tree support this high-level map; sampled source confirms selected Express, Lightning, and staking paths, but not every subsystem’s internal wiring.
Main entry points: index.ts Coin implementations · bitgo.ts BitGo client · wallet.ts Wallet API · coinFactory.ts Coin factory
Components 22
SDK client
- BitGo client
modules/bitgo/src/bitgo.ts - Wallet API
modules/sdk-api/src/v1/wallet.ts - Coin factory
modules/bitgo/src/v2/coinFactory.ts
Chain transactions
- Coin implementations
modules/bitgo/src/v2/coins/index.ts - Account transactions
modules/account-lib/src/index.ts - UTXO transactions
modules/abstract-utxo/src/abstractUtxoCoin.ts - Ethereum transactions
modules/abstract-eth/src/abstractEthLikeCoin.ts - Cosmos transactions
modules/abstract-cosmos/src/index.ts - Substrate transactions
modules/abstract-substrate/src/abstractSubstrateCoin.ts - Chain configuration
modules/abstract-utxo/src/config.ts
Signing services
- Local signing proxy
modules/express/src/expressApp.ts - Wallet route handlers
modules/express/src/clientRoutes.ts - Lightning routes
modules/express/src/lightning/lightningInvoiceRoutes.ts - Lightning signer
modules/express/src/lightning/lightningSignerRoutes.ts
Specialized capabilities
- Lightning wallets
modules/abstract-lightning/src/wallet/wallet.ts - Block explorer APIs
modules/blockapis/src/index.ts - Key cards
modules/key-card/src/index.ts - Passkey crypto
modules/passkey-crypto/src/index.ts - Babylon BTC staking
modules/babylonlabs-io-btc-staking-ts/src/staking/manager.ts - BitGo staking adapter
modules/utxo-staking/src/babylon/stakingManager.ts
Other components
- SDK consumer
- BitGo platform
Connections 21
- SDK consumer → BitGo client: uses SDK
- BitGo client → Wallet API: accesses wallets
- BitGo client → Coin factory: selects coin
- Coin factory → Coin implementations: creates coin
- Coin implementations → Account transactions: builds transactions
- Coin implementations → UTXO transactions: builds transactions
- Coin implementations → Ethereum transactions: builds transactions
- Coin implementations → Cosmos transactions: builds transactions
- Coin implementations → Substrate transactions: builds transactions
- Coin implementations → Chain configuration: uses configuration
- Wallet API → BitGo platform: calls platform API
- Local signing proxy → Wallet route handlers: dispatches routes
- Wallet route handlers → Wallet API: uses wallet API
- Lightning routes → Lightning wallets: invokes wallet
- Lightning signer → Lightning wallets: uses wallet data
- SDK consumer → Local signing proxy: uses proxy
- SDK consumer → Block explorer APIs: queries explorers
- SDK consumer → Key cards: uses key-card tools
- SDK consumer → Passkey crypto: uses passkey tools
- SDK consumer → BitGo staking adapter: creates staking manager
- BitGo staking adapter → Babylon BTC staking: extends manager