Overview
TheBitcoinModule provides native Bitcoin operations including message signing, PSBT signing, sending Bitcoin, and balance queries. Access it via DynamicSDK.instance.bitcoin.
Prerequisites
- Dynamic SDK initialized (see Quickstart)
- User authenticated (see Authentication)
- Bitcoin wallet available (see Wallet Creation)
Get Balance
Query the Bitcoin balance (in satoshis) for a wallet.Sign a Message
Sign a message using the connected Bitcoin wallet. Supports optionalprotocol and addressType parameters.
With Protocol and Address Type
| Parameter | Type | Description |
|---|---|---|
walletId | String | The wallet ID to sign with |
message | String | The message to sign |
protocol | String? | Signing protocol: ecdsa or bip322-simple |
addressType | String? | Address type: payment or ordinals |
Send Bitcoin
Send Bitcoin to a recipient address. The amount is specified in satoshis.| Parameter | Type | Description |
|---|---|---|
walletId | String | The wallet ID to send from |
recipientAddress | String | The recipient Bitcoin address |
amount | String | Amount in satoshis |
feePriority | String? | Fee priority: high, medium, or low |
Build a PSBT
Build an unsigned Partially Signed Bitcoin Transaction (PSBT) without broadcasting it.Sign a PSBT
Sign a PSBT using the connected wallet.Sign Multiple PSBTs
Batch-sign multiple PSBTs in a single call.Send Raw Transaction
Broadcast a raw transaction hex to the Bitcoin network.Complete Example
API Reference
| Method | Returns | Description |
|---|---|---|
getBalance | Future<String> | Get wallet balance in satoshis |
signMessage | Future<String> | Sign a message |
sendBitcoin | Future<String> | Send BTC, returns transaction ID |
buildPsbt | Future<String> | Build unsigned PSBT (base64) |
signPsbt | Future<String> | Sign a single PSBT |
signPsbts | Future<List<String>> | Sign multiple PSBTs |
sendRawTransaction | Future<String> | Broadcast raw transaction hex |
Next Steps
- TON Operations - TON blockchain operations
- SUI Operations - SUI blockchain operations
- Token Balances - Multi-chain balance queries