A powerful Bitcoin CLI tool for creating and broadcasting Bitcoin transactions with OP_RETURN data using WIF private keys. Built with Go and featuring a modern, user-friendly interface.
- π Easy OP_RETURN Creation - Create Bitcoin transactions with custom data payloads
- π WIF Private Key Support - Works with standard WIF keys and Electrum p2wpkh format
- π° Fixed 20% Fee Structure - Transparent, predictable pricing with automatic network fee calculation
- π Multi-Network Support - Works with both Bitcoin mainnet and testnet
- π‘ Real-time UTXO Management - Live UTXO validation and refresh capabilities
- π¨ Beautiful CLI Interface - Modern, colored output with clear information display
- π‘οΈ Built-in Safety Checks - Dust threshold validation and UTXO availability verification
- Go 1.19 or higher
- Git
# Clone the repository
git clone https://github.com/slashbinslashnoname/go-opreturn.git
cd go-opreturn
# Build the binary
make build
# Or build manually
go build -o go-opreturn main.goPre-built binaries are available for various platforms in the releases section.
# Run with default settings (mainnet)
./go-opreturn
# Specify network
./go-opreturn --network testnet./go-opreturn [flags]
Flags:
-n, --network string Bitcoin network (mainnet or testnet) (default "mainnet")
-h, --help help for opreturner- Select Network - Choose between mainnet or testnet
- Enter WIF Key - Provide your WIF private key (supports Electrum p2wpkh: prefix)
- Select UTXO - Choose from available unspent transaction outputs
- Enter OP_RETURN Data - Specify your custom data (max 80 bytes)
- Review & Confirm - Check transaction details before creation
- Get Transaction Hex - Receive the raw transaction for broadcasting
Go-OPReturn uses a fixed 20% fee structure:
- Service Fee: 20% of the selected UTXO value
- Network Fee: Automatically calculated based on current mempool.space rates
- Recipient Amount: Service fee minus network fee
- Change: Remaining amount returned to your address
For a 10,000 satoshi UTXO:
- Service Fee: 2,000 satoshis (20%)
- Network Fee: ~500 satoshis (varies by network conditions)
- Recipient Amount: 1,500 satoshis
- Change: 7,500 satoshis
- Mainnet - Production Bitcoin network
- Testnet - Bitcoin test network for development and testing
Go-OPReturn uses the following external APIs:
- mempool.space - UTXO data and fee rate information
- Mainnet:
https://mempool.space/api - Testnet:
https://mempool.space/testnet/api
- UTXO Validation - Multiple validation checks to ensure UTXO availability
- Dust Threshold Protection - Prevents creation of dust outputs
- Live Status Checking - Real-time verification before transaction creation
- Network Fee Optimization - Dynamic fee calculation based on current network conditions
- Maximum Data Size: 80 bytes
- Output Type: Null data script (OP_RETURN)
- Transaction Structure: 1 input, 3 outputs (recipient, OP_RETURN, change)
- SegWit (P2WPKH) - Native SegWit addresses (bc1...)
- Legacy WIF Keys - Standard WIF private key format
- Electrum Format - p2wpkh: prefixed keys
- SegWit Support - Native SegWit transaction signing
- Witness Data - Proper witness structure for SegWit transactions
- Script Signature - Empty scriptSig for SegWit inputs
go-opreturn/
βββ main.go # Main application code
βββ go.mod # Go module dependencies
βββ go.sum # Go module checksums
βββ Makefile # Build and development tasks
βββ README.md # This file
- btcsuite/btcd - Bitcoin protocol implementation
- btcsuite/btcutil - Bitcoin utility functions
- charmbracelet/lipgloss - Terminal styling
- manifoldco/promptui - Interactive prompts
- spf13/cobra - CLI framework
# Build for current platform
make build
# Build for all platforms
make build-all
# Clean build artifacts
make clean
# Run tests
make test-
"No UTXOs available"
- Check if the address has confirmed transactions
- Ensure you're using the correct network (mainnet/testnet)
-
"UTXO validation failed"
- The selected UTXO may have been spent
- Use the refresh option to get updated UTXO list
-
"Dust threshold" errors
- UTXO value is too small (minimum 1000 satoshis)
- Select a larger UTXO or wait for more confirmations
-
"WIF key network mismatch"
- Ensure your WIF key matches the selected network
- Use testnet keys for testnet, mainnet keys for mainnet
The tool provides extensive debug output including:
- UTXO selection details
- Transaction structure information
- Fee calculations
- Validation steps
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- This tool handles private keys - use with caution
- Always test with small amounts first
- Keep your private keys secure and never share them
- The authors are not responsible for any loss of funds
- Use at your own risk
If you need help or have questions:
- Open an issue on GitHub
- Check the troubleshooting section above
- Review the debug output for detailed information
- Support for multiple UTXO inputs
- Batch transaction creation
- Custom fee rate selection
- Transaction template saving
- Integration with more Bitcoin APIs
- Web interface option
Made with β€οΈ for the Bitcoin community