Skip to content

πŸš€ Store messages permanently on Bitcoin blockchain using OP_RETURN. User-friendly Google Colab interface + Desktop CLI version. Perfect for timestamping, proof-of-existence, and on-chain messaging.

Notifications You must be signed in to change notification settings

zoeir/Bitcoin-Message-Transaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Bitcoin Message Transaction Creator

Python 3.6+ License: MIT Google Colab Bitcoin

Create Bitcoin transactions with embedded OP_RETURN messages. This tool allows you to permanently store text messages on the Bitcoin blockchain while sending BTC to any address.

🌟 Features

  • βœ… OP_RETURN Message Embedding - Store up to 80 bytes of data on-chain
  • βœ… Interactive UI - User-friendly interface in Google Colab
  • βœ… CLI Version - Command-line interface for desktop use
  • βœ… Automatic Change Calculation - Returns remaining funds to sender
  • βœ… Testnet & Mainnet Support - Test safely before going live
  • βœ… Transaction Export - Save RawTX to file for broadcasting
  • βœ… Real-time Message Length Validation - Prevents errors before creation

πŸ“‹ Table of Contents

πŸš€ Installation

Prerequisites

- Python 3.6 or higher
- Git

Clone Repository

git clone https://github.com/zoeir/Bitcoin-Message-Transaction.git
cd Bitcoin-Message-Transaction

Install Dependencies

pip install ipywidgets zmq urllib3 requests pycryptodome

πŸ“– Usage

https://colab.research.google.com/drive/1tw9y8FXSwaEYYfNnC7jwiqTdVatUiqIV

Perfect for users who want a graphical interface without installing anything locally.

Step 1: Open Google Colab

Navigate to Google Colab

Step 2: Create New Notebook

Click File β†’ New Notebook

Step 3: Install Dependencies

Copy and paste this code into the first cell:

!pip install ipywidgets zmq urllib3 requests pycryptodome
!git clone https://github.com/zoeir/Bitcoin-Message-Transaction.git > /dev/null 2>&1
%cd Bitcoin-Message-Transaction

Run the cell (press Shift + Enter)

Step 4: Load the Script

In a new cell, copy the entire content of colab.py and run it.

Step 5: Fill the Form

An interactive form will appear with the following fields:

| Field | Description | Example |
|-------|-------------|---------|
| πŸ”‘ **Private Key (WIF)** | Your Bitcoin private key in WIF format | `5J64pq77XjeacCezwmAr2V1s7snvvJkuAz8sENxw7xCkikceV6e` |
| πŸ†” **UTXO TXID** | Transaction ID containing your funds | `2a29fdb4e188f827da3c3175856b3ed95819b323bb303a46b8036534e78c76db` |
| πŸ”’ **UTXO Index** | Output index (usually 0) | `0` |
| πŸ’° **UTXO Value** | Amount in satoshi | `30352330` |
| πŸ’Έ **Transaction Fee** | Network fee (500-10000 sat) | `1000` |
| πŸ“€ **Send Amount** | Amount to send in satoshi | `600` |
| πŸ“ **Recipient Address** | Destination Bitcoin address | `1LdRcdxfbSnmCYYNdeYpUnztiYzVfBEQeC` |
| πŸ’¬ **Message** | Your text message (max 80 bytes) | `Hello Bitcoin!` |
| πŸ§ͺ **Use Testnet** | Enable for testing | β˜‘οΈ Checked |

Step 6: Create Transaction

Click "Create Bitcoin Transaction" button

Step 7: Copy RawTX

The output will display:

  • βœ… Your BTC Address- βœ… Recipient Address - βœ… Send Amount- βœ… Transaction Fee- βœ… Change Returned- βœ… OP_RETURN Message- βœ… RawTX (Hex) ← Copy this for broadcasting---

πŸ–₯️ Python CLI Version

For users who prefer command-line interface on their desktop/laptop.

Step 1: Navigate to Repository

cd Bitcoin-Message-Transaction

Step 2: Run the Script

python3 main.py

Step 3: Follow Interactive Prompts

The script will ask for:

=================================
BITCOIN MESSAGE TRANSACTION CREATOR
Enter your Private Key (WIF): 5J64pq77Xjeac...

--- UTXO Information ---
Enter UTXO TXID: 2a29fdb4e188f827...
Enter UTXO Index (default 0): 0
Enter UTXO Value (satoshi): 30352330

--- Transaction Details ---
Enter Recipient Address: 1LdRcdxfbSnmCYYNdeYpUnztiYzVfBEQeC
Enter Send Amount (satoshi): 600
Enter Transaction Fee (satoshi, default 1000): 1000

--- OP_RETURN Message ---
Enter your message (up to 80 bytes): Hello Bitcoin!

--- Network Selection ---
Use Testnet? (y/n, default y): y

Step 4: Review Output

============================================================
BITCOIN TRANSACTION (OP_RETURN)
Your BTC Address: 14NWDXkQwcGN1Pd9fboL8npVynD5SfyJAE
Recipient Address: 1LdRcdxfbSnmCYYNdeYpUnztiYzVfBEQeC
Send Amount: 600 satoshi
Transaction Fee: 1000 satoshi
Change Returned: 30350730 satoshi

OP_RETURN Message: Hello Bitcoin!

RawTX (Hex):
0100000001db768ce7346503b8463a30bb23b31958d93e6b8575313cda..
============================================================

βœ“ Transaction saved to file: RawTX_OP_RETURN.txt


πŸ“‘ Broadcasting Transaction

After creating your transaction, broadcast it using any of these services:

Mainnet Services

Service URL
🌐 Bitcoin Message bitcoinmessage.ru

Steps:

  1. Copy your RawTX (Hex) from the output
  2. Visit any broadcast service above
  3. Paste the RawTX into the form
  4. Click "Broadcast" or "Push"
  5. Wait for confirmation

πŸ“¦ Requirements

Python Packages

  • pycryptodome - Cryptographic library
  • ipywidgets (Colab only) - Interactive widgets
  • IPython (Colab only) - Display utilities

Repository Dependencies

This tool requires modules from Bitcoin-Message-Transaction:

  • secp256k1.py - Elliptic curve operations
  • sighash.py - Transaction signing

πŸ’‘ Examples

Example 1: Simple Message

Message: "Hello from the blockchain!" Send Amount: 1000 satoshi Fee: 1000 satoshi

Example 2: Timestamp Proof

Message: "Document hash: 5d41402abc4b2a76b9719d911017c592" Send Amount: 546 satoshi (dust limit) Fee: 2000 satoshi

Example 3: Identity Proof

Message: "github.com/zoeir/Bitcoin-Message-Transaction/ - Verified 2025" Send Amount: 600 satoshi Fee: 1500 satoshi


πŸ”’ Security

⚠️ Important Security Notes

  • Never share your private key with anyone
  • Test on Testnet first before using real BTC
  • Double-check addresses before broadcasting
  • Backup your private keys securely offline
  • Use secure connections when broadcasting transactions
  • OP_RETURN data is permanent and cannot be deleted

Best Practices

  1. βœ… Use testnet for testing
  2. βœ… Verify recipient address multiple times
  3. βœ… Start with small amounts
  4. βœ… Keep private keys in encrypted storage
  5. βœ… Never commit private keys to Git

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

git clone https://github.com/zoeir/Bitcoin-Message-Transaction.git
cd Bitcoin-Message-Transaction
pip install -r requirements.txt

Reporting Issues

Please use the GitHub Issues page to report bugs or request features.

---## πŸ“„ LicenseThis project is licensed under the MIT License - see the LICENSE file for details. ---## πŸ™ Acknowledgments- Bitcoin Core developers

  • Bitcoin-Message-Transaction repository
  • Python cryptography community---## πŸ“ž Support- 🌐 Website: bitcoinmessage.ru
  • πŸ“§ Issues: GitHub Issues
  • πŸ’¬ Discussions: GitHub Discussions---## ⭐ Star HistoryIf you find this project useful, please consider giving it a star! ⭐---Made with ❀️ for the Bitcoin community---## πŸ“Έ Screenshots

Google Colab Interface

Colab Interface

CLI Version Output

CLI Output



πŸ“Š Statistics

GitHub stars GitHub forks GitHub issues GitHub pull requests


About

πŸš€ Store messages permanently on Bitcoin blockchain using OP_RETURN. User-friendly Google Colab interface + Desktop CLI version. Perfect for timestamping, proof-of-existence, and on-chain messaging.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published