Skip to content

Python program to publish a message to Bitcoin Blockchain (OP_RETURN)

Notifications You must be signed in to change notification settings

inauman/op_return

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Publish a Message on Bitcoin Blockchain

As part of my Master in Digital Currencies & Blockchain from University of Nicosia, Cyprus; I have created this program to publish a message on Bitcoin blockchain.

Getting Started

This program is written in Python 2.7 and requires the Bitcoin Core node (testnet) running locally on your machine. When you run the program, you need to provide your favorite message/quote as the input. Once the message is provided, it will grab one spendable transaction (UTXO - Unspent Transaction Output), calculate the fee, create the raw transaction, sign it, and publish it on the blockchain.

Prerequisite

  1. Install Bitcoin Core node (testnet)
  2. Install Python 2.7
  3. Install required Python modules
pip install ecdsa base58 hashlib python-bitcoinrpc python-jsonrpc

Sample

Input

Enter your Bitcoin Core RPC User Name:<<<Username>>>
Enter your Bitcoin Core RPC Password:<<<Password>>>
Enter your favorite message or quote:<<<Quote>>>

Output

Congratulations! You have just published a transaction to the Bitcoin blockchain.
Previoux TxnId: 330788c3dfc18808a04107d8c0c8f598d73eade8b1479e69b3db3ee3aa85aa98
New TxnId: 52e12ca20970a579bd62107054c45be33b5e21c31faa56de930df61bb043bf80

Acknowledgements

Big thanks to all the people who have taken the time to provide wonderful tutorials, videos, and answered the questions for newbees like me.

7 awesome youtube videos by Shlomi Zeltsinger

  1. Bitcoin Pyhton Tutorials for Beginners
  2. Constructing a Bitcoin transaction using python

Hexadecimal basics by Corey Schafer:

Understanding Binary, Hexadecimal, Decimal (Base-10), and more

ASCII Tutorial by dizauvi

Characters in a computer - ASCII Tutorial

Big Endian vs Little Endian by Michael Cote

Big Endian vs Little Endian

Bits vs Bytes as Fast As Possible by Techquickie

Bits vs Bytes as Fast As Possible

Bitcoin Command Line by Christopher

Learning Bitcoin from the Command Line

Python-Bitcoin/JSON RPC library by Jeff Garzik

Python interface to bitcoin's JSON-RPC API

About

Python program to publish a message to Bitcoin Blockchain (OP_RETURN)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages