-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Description
Problem Statement
Users of the bit library experience silent transaction broadcast failures where .send() appears successful but the transaction never reaches the network mempool. The transaction hash is returned to the user, but blockchain explorers show "Transaction Not Found."
Symptoms
- Transaction signing completes successfully
.send()returns a valid transaction hash (TXID)- Checking the TXID on blockchain explorers (blockstream.info, blockchain.com) shows no transaction
- No error is raised - silent failure
- Issue reported since May 2020 (Issue Transaction broadcast failed, or Unspents were already used #110, Issue ConnectionError: Transaction broadcast failed, or Unspents were already used. #170)
Root Cause Analysis
Two concurrent issues in bit/network/services.py:
Issue 1: Malformed HTTP Request Payload
- The
BlockstreamAPI.broadcast_tx()andbroadcast_tx_testnet()methods wrap transaction hex in a dictionary - Blockstream API specification requires raw hex string in request body
- Server rejects malformed request with HTTP 400
- Dispatcher interprets error as connection failure
Issue 2: Deprecated Service Provider Dependencies
- Dispatcher falls back to non-functional services:
- Smartbit: Service permanently shut down
- Bitcore: API endpoints unreliable/unreachable
- Blockchair: Requires API key not implemented in library
- Blockchain.com: Produces unreliable response patterns
- Result: Failed transaction attempts exhaust fallback list, return generic ConnectionError
Technical Details
# CURRENT (BROKEN) - Wraps hex in dictionary
r = requests.post(cls.MAIN_TX_PUSH_API, data={cls.TX_PUSH_PARAM: tx_hex}, timeout=DEFAULT_TIMEOUT)
# BLOCKSTREAM API SPEC REQUIREMENT - Raw hex string
# Reference: https://github.com/Blockstream/esplora/blob/master/API.md
# POST /tx endpoint expects: raw transaction hex as request bodyImpact
- Affects all users attempting to broadcast Bitcoin transactions via
bitlibrary - Silent failures (no exception raised) make debugging difficult
- Users unaware whether issue is code or network related
- Workaround: Use external tools to broadcast same transaction hex
Files Affected
bit/network/services.py(2 methods, 2 configuration lists)
Related Issues
- Issue Transaction broadcast failed, or Unspents were already used #110: "Transaction broadcast failed, or Unspents were already used" (May 2020)
- Issue ConnectionError: Transaction broadcast failed, or Unspents were already used. #170: "ConnectionError: Transaction broadcast failed" (November 2022)
- Stack Overflow: Multiple reports of silent broadcast failures (2021-2023)
Severity
Critical - Core functionality (transaction broadcasting) is broken for all users
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels