Current network: signet

🚀 About MemPush

Project Description

MemPush is a lightweight Flask web application for managing and pushing Bitcoin transactions to the mempool. This tool provides a simple interface to submit raw transactions, track their status, and manually push them to the Bitcoin network.

✨ Key Features:
  • Submit raw Bitcoin transactions
  • Track transaction status (pending, confirmed, failed)
  • Manual transaction pushing to mempool
  • RESTful API for programmatic access
  • Transaction history management
  • Real-time status updates
  • Multi-network support (mainchain, testnetv3, testnetv4, signet)

API Documentation

Note: All API endpoints are network-specific. Replace <network> with one of: mainchain, testnetv3, testnetv4, or signet.
🔌 REST API Endpoints:
GET /<network>/api/transactions

Returns a JSON array of all transactions for the specified network, ordered by creation date (newest first).

Example: curl -X GET http://localhost:5000/mainchain/api/transactions
GET /<network>/api/transaction/<txid>

Returns complete transaction information for a specific transaction ID on the specified network.

Example: curl -X GET http://localhost:5000/mainchain/api/transaction/abc123...
POST /<network>/api/transaction

Submit a transaction ID to fetch and store the transaction from the mempool for the specified network.

Request: {"txid": "your_txid_here"}
Example: curl -X POST http://localhost:5000/mainchain/api/transaction -H "Content-Type: application/json" -d '{"txid": "abc123..."}'
POST /<network>/api/transaction/push

Submit a raw transaction in hex format and push it to the mempool for the specified network.

Request: {"raw_tx": "your_hex_transaction_here"}
Example: curl -X POST http://localhost:5000/testnetv3/api/transaction/push -H "Content-Type: application/json" -d '{"raw_tx": "0100000001..."}'
POST /<network>/transaction/<txid>/push

Push an existing transaction to the mempool for the specified network.

Example: curl -X POST http://localhost:5000/mainchain/transaction/abc123.../push
POST /<network>/transaction/<txid>/delete

Delete a confirmed or failed transaction from the specified network.

Example: curl -X POST http://localhost:5000/mainchain/transaction/abc123.../delete
📊 Response Status Codes:
  • 200 Success
  • 201 Created
  • 400 Bad Request (invalid input)
  • 403 Forbidden (unauthorized action)
  • 404 Not Found
  • 500 Server Error

Technical Details

🔧 Dependencies:
  • Flask: Web framework for the application
  • SQLAlchemy: Database ORM for transaction storage
  • bitcoinlib: Bitcoin transaction parsing and validation
  • requests: HTTP client for mempool API integration
🌐 External Services:

mempool.space: Primary mempool service for transaction pushing and status checking

  • Mainchain: https://mempool.space/
  • Testnet v3: https://mempool.space/testnet/
  • Testnet v4: https://mempool.space/testnet4/
  • Signet: https://mempool.space/signet/

mempool.space: Explorer service

  • Mainchain: https://mempool.space/
  • Testnet v3: https://mempool.space/testnet/
  • Testnet v4: https://mempool.space/testnet4/
  • Signet: https://mempool.space/signet/
🔐 Security Features:
  • Input validation for hex format
  • Transaction ID verification
  • Error handling and logging
  • Database transaction integrity

Open Source

This project is open source and available on GitHub!

View on GitHub

This project is available under the MIT License.

Quick Start

🚀 Getting Started:
  1. Clone the repository:
    git clone https://github.com/valerio-vaccaro/mempush.git
  2. Set up virtual environment:
    python -m venv venv && source venv/bin/activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Initialize database:
    flask db upgrade
  5. Run the application:
    flask run
  6. Access the web interface:
    Open your browser and navigate to http://localhost:5000 (redirects to /mainchain/)
  7. Switch networks:
    Use the network dropdown in the navigation bar to switch between mainchain, testnetv3, testnetv4, and signet
🌐 Supported Networks:
  • Mainchain: http://localhost:5000/mainchain/
  • Testnet v3: http://localhost:5000/testnetv3/
  • Testnet v4: http://localhost:5000/testnetv4/
  • Signet: http://localhost:5000/signet/