SUBTC CLI V2 — Full Payment Flow Example
This guide shows a complete payment flow<br>using SUBTC CLI V2.
We combine Inbox, Wait, Send, and Poll<br>for real-world usage.
Scenario
Alice wants to receive 20,000 satoshis<br>to her testnet wallet from Bob.
Step 1: Create Wallet
./subtc wallet create
Example Output:<br>────────────────────────────────────────────<br>wallet_id: w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758
Step 2: Create Inbox
./subtc inbox w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758 20000
Inbox ensures expected payment is tracked.
Step 3: Generate Receive Address
./subtc wallet receive w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758
Receive Address:<br>tb1qwphc20fty0l42cn3tnwv32uz85zm9jm2thdl4y
Step 4: Wait for Payment (Optional Blocking)
./subtc wait w_ce9e16e59a72cd59840ce2256662a2400bc114y 20000 300
- Blocks until 20,000 sat are received
- Timeout 300 seconds
- Can trigger webhook when payment arrives
Step 5: Send Payment
Bob sends 50,000 sat (auto idempotency):
./subtc send w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758 tb1qjcr7lcucmwudwqscew4r078gxkw549ruq5r97w 50000
Output:<br>────────────────────────────────────────────<br>txid: 3d72d72aa9f43be50e4dfb35971107252143fdf3da859d74427336b5ef8fd
Step 6: Check Balance
./subtc wallet balance w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758
Balance:<br>97,000 sat (0.00097000 BTC)
Step 7: Poll for Payment (Optional Non-blocking)
./subtc poll w_ce9e16e59a72cd59840ce2256662a2400bc114ea3758 tb1qwphc20fty0l42cn3tnwv32uz85zm9jm2thdl4y 20000 --loop
Loop every 3 seconds until confirmed.
Summary
- Create wallet
- Generate receive address
- Create Inbox for expected payment
- Wait or Poll for incoming funds
- Send payment
- Check balances
Why This Flow
- Combines all V2 tools
- Works for testnet and mainnet
- Ideal for automation, bots, and AI agents
- Supports real-world payment scenarios
Notes
- Minimum send: 50,000 sat
- Fee: 3%
- Mainnet requires YES confirmation
- Use SUBTC_KEY and SUBTC_NET env variables to override defaults
Use Cases
- Donation systems
- Marketplace payments
- Testnet app automation
- AI payment agents