{"id":601,"date":"2026-07-17T13:49:01","date_gmt":"2026-07-17T13:49:01","guid":{"rendered":"https:\/\/nownodes.io\/blog\/?p=601"},"modified":"2026-07-17T13:49:02","modified_gmt":"2026-07-17T13:49:02","slug":"how-to-make-a-bitcoin-transaction-with-python","status":"publish","type":"post","link":"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/","title":{"rendered":"How to Make a Bitcoin Transaction With Python"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You can send a real Bitcoin transaction from a Python script in about five lines of code. The harder part \u2014 the part that separates copying a snippet from building something that survives production \u2014 is understanding what those five lines actually do. This guide walks the full path, from your first wallet to signing a raw transaction by hand and talking to the network at the protocol level.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll start simple with a library that hides the details, then peel back each layer: how a transaction is really structured, how it gets signed, and how your code reaches the network. Everything here runs on Bitcoin&#8217;s test network, so you can experiment without risking a cent. Let&#8217;s get into it.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-a-bitcoin-transaction-really-is\">What a Bitcoin Transaction Really Is<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Before writing any code, it helps to know what you&#8217;re building. A Bitcoin transaction doesn&#8217;t &#8220;move&#8221; coins the way a bank transfer shifts a balance. It consumes previous outputs and creates new ones \u2014 nothing more, nothing less.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As Andreas M. Antonopoulos writes in <a href=\"https:\/\/github.com\/bitcoinbook\/bitcoinbook\" rel=\"nofollow noopener noreferrer\"><em>Mastering Bitcoin<\/em><\/a>, &#8220;Transactions are the most important part of the Bitcoin system. Everything else in Bitcoin is designed to ensure that transactions can be created, propagated on the network, validated, and finally added to the global ledger of transactions.&#8221; Every line of Python you write is in service of that one object.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>UTXO (Unspent Transaction Output):<\/strong> a chunk of bitcoin locked to an address that hasn&#8217;t been spent yet. Your wallet balance is simply the sum of the UTXOs you control. A transaction spends whole UTXOs as inputs and produces fresh UTXOs as outputs.<\/p>\n<\/blockquote>\n\n\n<h3 class=\"wp-block-heading\" id=\"inputs-outputs-and-change\">Inputs, Outputs, and Change<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Every transaction has inputs (the UTXOs you&#8217;re spending) and outputs (where the value goes). If an input is larger than the amount you want to send, you add a second output that pays the remainder back to yourself. That&#8217;s <em>change<\/em> \u2014 the same idea as getting coins back from a cash payment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whatever you don&#8217;t assign to an output becomes the miner fee. There&#8217;s no separate &#8220;fee&#8221; field anywhere in the format; the fee is just inputs minus outputs. In mid-2026 the <a href=\"https:\/\/99bitcoins.com\/cryptocurrency\/bitcoin\/fees\/\" rel=\"nofollow noopener noreferrer\">average Bitcoin fee<\/a> sits around $0.82, though it swings sharply with demand.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"why-it-needs-a-signature\">Why It Needs a Signature<\/h3>\n\n\n<p class=\"wp-block-paragraph\">To spend a UTXO, you prove ownership with a digital signature made from your private key. Miners and the wider network check that signature before accepting the transaction into a block. Get the signing wrong and the network silently rejects it \u2014 which is precisely why the &#8220;easy&#8221; libraries exist.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-you-need-before-you-start\">What You Need Before You Start<\/h2>\n\n\n<p class=\"wp-block-paragraph\">You need Python 3.7 or newer, a code editor, and a <strong>python bitcoin<\/strong> library (we&#8217;ll compare three). You also need test coins, which brings us to the testnet.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Testnet:<\/strong> a parallel Bitcoin network that behaves like the real one but uses valueless coins, so developers can test freely. Never send real BTC to a testnet address \u2014 it&#8217;s gone for good.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">One update worth knowing before you begin. The long-running testnet3 has been replaced by <strong>testnet4<\/strong>, defined in <a href=\"https:\/\/bips.dev\/94\/\" rel=\"nofollow noopener noreferrer\">BIP94<\/a> and shipped in Bitcoin Core 28.0 in late 2024. Testnet4 fixes the difficulty-reset exploits that made testnet3 unstable, and current releases select it with the <code>-testnet4<\/code> flag. Grab free coins from a testnet4 faucet before writing your first send.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"the-quick-way-send-bitcoin-with-the-bit-library\">The Quick Way: Send Bitcoin With the bit Library<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The fastest route to a working transaction is the <strong>bit<\/strong> library, which folds key generation, fee estimation, signing, and broadcasting into single method calls. Install it with one command:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install bit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a testnet wallet like this. The <strong>WIF<\/strong> (Wallet Import Format) string is your private key in a portable form \u2014 save it, or you&#8217;ll generate a brand-new wallet on every run:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from bit import PrivateKeyTestnet\n\nkey = PrivateKeyTestnet()\nprint(key.address)   # your testnet address\nprint(key.to_wif())  # save this to reuse the wallet<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload the same wallet later by passing the WIF back in: <code>key = PrivateKeyTestnet('your-wif-here')<\/code>. Now fund the address from a faucet, wait for one confirmation, and read the balance:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>key = PrivateKeyTestnet('your-wif-here')\nprint(key.get_balance('btc'))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sending is a single call. The <code>send()<\/code> method takes a list of outputs, so you can pay several recipients in one transaction \u2014 here we send a small amount to one example testnet address:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>outputs = &#91;('mkH41dfD4S8DEoSfcVSvEfpyZ9siogWWtr', 0.0001, 'btc')]\ntx_hash = key.send(outputs)\nprint(tx_hash)  # look this up on a testnet explorer<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the catch. bit is delightfully simple, but its <a href=\"https:\/\/ofek.dev\/bit\/\" rel=\"nofollow noopener noreferrer\">last release<\/a> \u2014 version 0.8.0 \u2014 landed in December 2021, and it was built around the older testnet3 backends. For a quick demo it&#8217;s perfect. For anything you plan to maintain, reach for a library that still ships updates.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Library<\/th><th>Best for<\/th><th>Actively maintained<\/th><th>Level<\/th><\/tr><\/thead><tbody><tr><td><strong>bit<\/strong><\/td><td>Your fastest first transaction<\/td><td>No (last release 2021)<\/td><td>Beginner<\/td><\/tr><tr><td><strong>bitcoinlib<\/strong><\/td><td>Wallets and production apps<\/td><td>Yes<\/td><td>Intermediate<\/td><\/tr><tr><td><strong>python-bitcoinlib<\/strong><\/td><td>Low-level protocol and wire messages<\/td><td>Yes<\/td><td>Advanced<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<h2 class=\"wp-block-heading\" id=\"a-more-maintained-path-bitcoinlib\">A More Maintained Path: bitcoinlib<\/h2>\n\n\n<p class=\"wp-block-paragraph\">When you outgrow bit, <a href=\"https:\/\/bitcoinlib.readthedocs.io\/\" rel=\"nofollow noopener noreferrer\"><strong>bitcoinlib<\/strong><\/a> (maintained by 1200wd) is the natural next step. It&#8217;s actively developed, supports modern address types like Bech32\/SegWit, manages HD wallets, and can talk to an external provider so you don&#8217;t have to sync the whole chain locally.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A minimal send looks like this. The library creates the wallet, tracks its UTXOs, and assembles the transaction for you:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from bitcoinlib.wallets import Wallet\n\nw = Wallet.create('DemoWallet', network='testnet')\nprint(w.get_key().address)     # fund this from a faucet\nw.scan()                       # refresh UTXOs\nw.send_to('tb1q...', 10000)    # amount in satoshis<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The trade-off is a larger API surface. In return you get SegWit support, multisig, and the freedom to point the library at an endpoint of your choice \u2014 which matters the moment you leave testnet for real value.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"under-the-hood-a-transaction-from-scratch\">Under the Hood: A Transaction From Scratch<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Libraries are wonderful until something breaks and you have no idea why. To truly understand Bitcoin with Python, it&#8217;s worth building a transaction the hard way at least once. Andrej Karpathy&#8217;s <a href=\"https:\/\/karpathy.github.io\/2021\/06\/21\/blockchain\/\" rel=\"nofollow noopener noreferrer\">from-scratch tour of Bitcoin in Python<\/a> is the classic walkthrough, and the steps break down cleanly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First you generate a private key \u2014 really just a large random number \u2014 and derive the public key from it using the <strong>secp256k1<\/strong> elliptic curve. Hashing that public key and encoding the result (Base58Check for legacy addresses, Bech32 for SegWit) produces your address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then you assemble the transaction: reference the UTXOs you&#8217;re spending as inputs, define your outputs, and leave the difference as the fee. Each input carries a script that will later unlock the coins it points to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Signing is the delicate part. You serialize the transaction, hash it, and produce an ECDSA signature over that hash, tagged with <code>SIGHASH_ALL<\/code> to commit to every input and output. Swap the signature and public key into the input scripts, serialize the whole thing to raw hex, and it&#8217;s ready to broadcast. It&#8217;s fiddly \u2014 one misplaced byte means rejection \u2014 but doing it once demystifies every library call you&#8217;ll ever make afterward.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"talking-to-the-network-the-p2p-wire-protocol\">Talking to the Network: The P2P Wire Protocol<\/h2>\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s a deeper layer still: the peer-to-peer <strong>wire protocol<\/strong> that clients use to gossip transactions and blocks. This is where python-bitcoinlib shines, exposing message classes that mirror Bitcoin Core&#8217;s own \u2014 including the ones defined in files like <code>msg_filteradd.py<\/code> in the Python wire message set.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>msg_filteradd (BIP37):<\/strong> a P2P wire message that adds a single data element to a connection&#8217;s Bloom filter. Lightweight clients use it so peers return only the transactions relevant to their addresses, instead of the entire block stream.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">A few rules govern this. The data you add must be <a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0037.mediawiki\" rel=\"nofollow noopener noreferrer\">520 bytes or smaller<\/a>, and Bloom filters are append-only \u2014 there is no <code>filterremove<\/code>, because you can&#8217;t pull an item out without rebuilding the filter from scratch. You set an initial filter right after the version handshake, then use <code>filteradd<\/code> to extend it element by element.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why care about this? It&#8217;s the machinery behind light wallets that watch specific addresses without downloading the whole chain. Working at this level in Python \u2014 with <code>msg_filteradd<\/code>, <code>msg_version<\/code>, and the rest of the wire vocabulary \u2014 is how you build custom network tooling rather than just firing off payments.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"from-a-transaction-to-your-own-cryptocurrency-in-python\">From a Transaction to Your Own Cryptocurrency in Python<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Once you can build and sign transactions, a common next question is how to <strong>create your own cryptocurrency<\/strong> with <strong>Python<\/strong>. There are two honest answers, and they differ enormously in scope.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The lightweight route is a token: you deploy a smart contract on an existing chain \u2014 an ERC-20-style token, for example \u2014 where Python handles deployment and interaction rather than consensus. The heavyweight route is a genuinely new coin, which means forking Bitcoin&#8217;s codebase or writing your own client software, complete with a consensus layer, a peer network, and a genesis block.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For learning, many developers write a toy blockchain in Python: a chain of hashed blocks, a proof-of-work loop, and a simple transaction pool. It won&#8217;t secure real value, but it makes the moving parts concrete. Just don&#8217;t confuse a teaching model with a production network \u2014 the distance between them is vast.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-connect-your-python-app-to-bitcoin\">How to Connect Your Python App to Bitcoin<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Every example above eventually has to reach the live network to broadcast a transaction or read a balance. You have two options. Self-host the full Bitcoin software (<code>bitcoind<\/code>), which means downloading the entire chain \u2014 hundreds of gigabytes \u2014 and keeping it online. Or connect to a hosted endpoint and skip the maintenance entirely.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc-1024x683.png\" alt=\"\" class=\"wp-image-2546\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc-1024x683.png 1024w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc-300x200.png 300w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc-768x512.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/nownodes.io\/nodes\/bitcoin-btc\">NOWNodes<\/a> takes the second approach. You get an API key and a ready endpoint that your Python script points at, with RPC and REST (Blockbook) access across 120+ networks, Bitcoin and its testnet included. The free personal plan allows up to 20,000 requests a day \u2014 plenty for development and testing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pointing Python at it is a normal HTTP request. You post a JSON-RPC payload to the endpoint with your API key in the header:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\n\nurl = \"https:\/\/btc.nownodes.io\/\"\nheaders = {\"api-key\": \"YOUR_API_KEY\", \"Content-Type\": \"application\/json\"}\npayload = {\"jsonrpc\": \"2.0\", \"id\": \"1\", \"method\": \"getblockchaininfo\", \"params\": &#91;]}\n\nresponse = requests.post(url, json=payload, headers=headers)\nprint(response.json())<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That keeps your code focused on wallet and transaction logic instead of infrastructure you&#8217;d otherwise babysit yourself. It also lets you switch between mainnet and testnet4 by changing a single endpoint, with no re-syncing involved.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"best-practices-and-common-pitfalls\">Best Practices and Common Pitfalls<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc1-1024x683.png\" alt=\"\" class=\"wp-image-2547\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc1-1024x683.png 1024w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc1-300x200.png 300w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc1-768x512.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/10\/btc1.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A few habits will save you real money later. Never hard-code a mainnet private key or seed phrase into a script or a repository \u2014 treat it like the password to a vault, because that&#8217;s exactly what it is. Always rehearse on testnet4 before touching mainnet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Watch your fees and your UTXOs. Underpay and your transaction sits unconfirmed for hours; ignore UTXO management and you&#8217;ll accumulate dust that costs more to spend than it&#8217;s worth. And prefer maintained libraries \u2014 an abandoned dependency is a security liability dressed up as a convenience.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Making a Bitcoin transaction with Python can be a five-line exercise or a deep dive into elliptic curves and wire messages \u2014 and the useful truth is that you&#8217;ll want both. Start with bit to watch a transaction actually land, move to bitcoinlib for anything real, and read the from-scratch version once so the magic turns into mechanics you understand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The one piece you can&#8217;t skip is network access. Whether you self-host <code>bitcoind<\/code> or plug into a hosted endpoint, your Python code is only as reliable as its connection to Bitcoin. Get that right, keep your keys safe, and everything else is just code.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n\n<p class=\"wp-block-paragraph\"><strong>Can you really send Bitcoin with Python?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. With a library like bit or bitcoinlib you can generate a wallet, sign, and broadcast a transaction in a handful of lines. The library handles the key math and serialization; you supply the recipient and the amount.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Which Python Bitcoin library is best?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It depends on your goal. bit is the simplest for a first transaction, bitcoinlib is the better-maintained choice for wallets and production apps, and python-bitcoinlib gives you low-level access to Bitcoin&#8217;s data structures and P2P wire protocol.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Is the bit library still maintained?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not actively \u2014 its last release, 0.8.0, shipped in December 2021. It still works for simple demos, but for current projects, and especially for testnet4, a maintained library or a hosted endpoint is the safer bet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is testnet4 and why does it matter?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Testnet4 is Bitcoin&#8217;s current test network, defined in BIP94 and added in Bitcoin Core 28.0 in 2024. It replaced testnet3, which suffered from difficulty-reset exploits. Use a testnet4 faucet to get free, valueless coins for testing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is msg_filteradd.py in Bitcoin&#8217;s Python wire protocol?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s a P2P wire message class (BIP37) that adds a data element to a connection&#8217;s Bloom filter. Light clients use <code>msg_filteradd<\/code> so peers return only relevant transactions. The data must be 520 bytes or smaller, and the filter is append-only.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can you create your own cryptocurrency with Python?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Partly. Python is well suited to deploying and interacting with tokens on existing chains, and to writing a toy blockchain for learning. A real independent coin usually means forking Bitcoin&#8217;s codebase and running your own consensus network \u2014 far more than a single script.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do I need to run the full Bitcoin software to send a transaction?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. You can broadcast through a hosted endpoint instead of downloading the whole chain. A provider like NOWNodes gives you an API endpoint so your Python code can send and query without self-hosting <code>bitcoind<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How much does a Bitcoin transaction cost?<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fee equals inputs minus outputs, set by you and paid to miners. In mid-2026 the average fee is roughly $0.82, but it rises and falls with network demand, so estimate before you send.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can send a real Bitcoin transaction from a Python script in about five lines of code. The harder part \u2014 the part that separates copying a snippet from building something that survives production \u2014 is understanding what those five lines actually do. This guide walks the full path, from your first wallet to signing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":608,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[102],"tags":[],"class_list":["post-601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev-report"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Make a Bitcoin Transaction With Python (2026)<\/title>\n<meta name=\"description\" content=\"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nownodes.io\/blog\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Make a Bitcoin Transaction With Python (2026)\" \/>\n<meta property=\"og:description\" content=\"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nownodes.io\/blog\/\" \/>\n<meta property=\"og:site_name\" content=\"NOWNodes Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-17T13:49:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-17T13:49:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/NN_TON-1-min-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"NOWNodes Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nownodes\" \/>\n<meta name=\"twitter:site\" content=\"@nownodes\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"NOWNodes Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nownodes.io\/blog#article\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/\"},\"author\":{\"name\":\"NOWNodes Team\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c\"},\"headline\":\"How to Make a Bitcoin Transaction With Python\",\"datePublished\":\"2026-07-17T13:49:01+00:00\",\"dateModified\":\"2026-07-17T13:49:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/\"},\"wordCount\":2158,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"articleSection\":[\"Dev Report\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nownodes.io\/blog#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/\",\"url\":\"https:\/\/nownodes.io\/blog\",\"name\":\"How to Make a Bitcoin Transaction With Python (2026)\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#website\"},\"datePublished\":\"2026-07-17T13:49:01+00:00\",\"dateModified\":\"2026-07-17T13:49:02+00:00\",\"description\":\"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.\",\"breadcrumb\":{\"@id\":\"https:\/\/nownodes.io\/blog#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nownodes.io\/blog\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nownodes.io\/blog#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/nownodes.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dev Report\",\"item\":\"https:\/\/nownodes.io\/blog\/category\/dev-report\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Make a Bitcoin Transaction With Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nownodes.io\/blog\/#website\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"name\":\"NOWNodes Blog\",\"description\":\"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes\",\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nownodes.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\",\"name\":\"NOWNodes Blog\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"contentUrl\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"width\":1164,\"height\":1164,\"caption\":\"NOWNodes Blog\"},\"image\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/nownodes\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c\",\"name\":\"NOWNodes Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g\",\"caption\":\"NOWNodes Team\"},\"sameAs\":[\"http:\/\/65.108.139.113\"],\"url\":\"https:\/\/nownodes.io\/blog\/author\/nownodes\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Make a Bitcoin Transaction With Python (2026)","description":"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nownodes.io\/blog\/","og_locale":"en_US","og_type":"article","og_title":"How to Make a Bitcoin Transaction With Python (2026)","og_description":"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.","og_url":"https:\/\/nownodes.io\/blog\/","og_site_name":"NOWNodes Blog","article_published_time":"2026-07-17T13:49:01+00:00","article_modified_time":"2026-07-17T13:49:02+00:00","og_image":[{"width":2560,"height":1440,"url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/05\/NN_TON-1-min-scaled.jpg","type":"image\/jpeg"}],"author":"NOWNodes Team","twitter_card":"summary_large_image","twitter_creator":"@nownodes","twitter_site":"@nownodes","twitter_misc":{"Written by":"NOWNodes Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nownodes.io\/blog#article","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/"},"author":{"name":"NOWNodes Team","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c"},"headline":"How to Make a Bitcoin Transaction With Python","datePublished":"2026-07-17T13:49:01+00:00","dateModified":"2026-07-17T13:49:02+00:00","mainEntityOfPage":{"@id":"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/"},"wordCount":2158,"commentCount":0,"publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"articleSection":["Dev Report"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nownodes.io\/blog#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nownodes.io\/blog\/how-to-make-a-bitcoin-transaction-with-python\/","url":"https:\/\/nownodes.io\/blog","name":"How to Make a Bitcoin Transaction With Python (2026)","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/#website"},"datePublished":"2026-07-17T13:49:01+00:00","dateModified":"2026-07-17T13:49:02+00:00","description":"Learn how to make a Bitcoin transaction with Python \u2014 from a five-line send with the bit library to signing raw transactions and the P2P wire protocol.","breadcrumb":{"@id":"https:\/\/nownodes.io\/blog#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nownodes.io\/blog"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nownodes.io\/blog#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/nownodes.io\/blog"},{"@type":"ListItem","position":2,"name":"Dev Report","item":"https:\/\/nownodes.io\/blog\/category\/dev-report"},{"@type":"ListItem","position":3,"name":"How to Make a Bitcoin Transaction With Python"}]},{"@type":"WebSite","@id":"https:\/\/nownodes.io\/blog\/#website","url":"https:\/\/nownodes.io\/blog\/","name":"NOWNodes Blog","description":"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes","publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nownodes.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nownodes.io\/blog\/#organization","name":"NOWNodes Blog","url":"https:\/\/nownodes.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","contentUrl":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","width":1164,"height":1164,"caption":"NOWNodes Blog"},"image":{"@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/nownodes"]},{"@type":"Person","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/c041891469390738b68a2aafe063f93c","name":"NOWNodes Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084e45aa2f2bfa61b9ce9f41af97a74f38e87c065b0d49f23a1bb84727320c2e?s=96&d=mm&r=g","caption":"NOWNodes Team"},"sameAs":["http:\/\/65.108.139.113"],"url":"https:\/\/nownodes.io\/blog\/author\/nownodes"}]}},"modified_by":"\u0410nastasia","_links":{"self":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/comments?post=601"}],"version-history":[{"count":5,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/601\/revisions"}],"predecessor-version":[{"id":2548,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/601\/revisions\/2548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media\/608"}],"wp:attachment":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media?parent=601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/categories?post=601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/tags?post=601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}