Skip to main content

Questions tagged [python-bitcoinlib]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7 votes
2 answers
7k views

python-bitcoinlib | Create Private Keys, Public Keys and Addresses - How to Do It?

I'm trying to use the python-bitcoinlib library but its docs aren't entirely clear to me. I'm a programmer but quite new to Python, and not very versed in the Bitcoin protocol. What's the process, ...
Gal Grünfeld's user avatar
5 votes
2 answers
7k views

How to make a simple payment with the python-bitcoinlib?

I've been using the bitcoin-python library for making payments from within Python. This worked pretty simple: >>> import bitcoinrpc >>> conn = bitcoinrpc.connect_to_local() >>&...
kramer65's user avatar
  • 315
2 votes
1 answer
2k views

How can I sign transaction hex with Python library

I have a unsigned transaction hex. Now I want to sign this transaction input with my private key in Python. Are there any Python libraries? Transaction Hex ...
zono's user avatar
  • 1,945
2 votes
0 answers
67 views

How to get transaction fee info using Python from an Electrum server?

I can get a raw transaction and parse it using electrum and bitcoinlib fairly easily: import bitcoinlib from electrum.daemon import Daemon from electrum.simple_config import SimpleConfig class ...
moblie's user avatar
  • 121
2 votes
1 answer
223 views

Problem spending funds from P2WSH address: non-mandatory-script-verify-flag

I've tried to find an answer here and on BTT but without luck so far. I'm having issues creating a transaction to spend from a P2WSH address which I created and sent funds to. I based my code off of ...
katsu's user avatar
  • 21
2 votes
1 answer
1k views

What is the required input for python-bitcoinlib getrawtransaction command?

I am running a bitcoin node on my machine, fully synced with RPC commands enabled, rpc server live and txindex=1. In the command-line I can run the following RPC call and obtain the information ...
Oonah's user avatar
  • 95
1 vote
1 answer
136 views

Keep getting wrong bitcoin addresses

I'm trying to write a script that can generate a private key and the compressed and uncompressed addresses. It seems to work however the private key doesn't correspond to the addresses generated. Can'...
fredsta98's user avatar
1 vote
2 answers
426 views

Why do I have a socket.timeout with python-bitcoinlib?

I am using a small script and get a timeout from python. This is my script: import bitcoin import bitcoin.rpc from bitcoin.rpc import RawProxy p = RawProxy() hash = '...
bomben's user avatar
  • 518
1 vote
1 answer
86 views

How does bitcoin core API work locally (network) - bitcoinlib in python using too many web sockets

I'm trying to understand at a high level, the local network aspects of calling the bitcoin core api via bitcoinlib in python So the context around this question is that I wanted to work on some python ...
user2880722's user avatar
1 vote
1 answer
402 views

Unable to get Taproot address using bitcoinlib

I tried several ways to get a Taproot address from a Private Key with bitcoinlib, but I kept getting different addresses than those I get with Taproot wallets such as Unisat and OKX Wallet. Then, ...
Tprt's user avatar
  • 11
1 vote
1 answer
117 views

I am trying to convert the 12 words into BTC addresses, but they do not match

I am trying to convert the 12 words into BTC addresses, but they do not match the ones shown to me by Safepal, Coinomi, and Trust Wallet. I have tried using several libraries and doing it manually. I ...
Nigan's user avatar
  • 19
1 vote
1 answer
3k views

Invalid transaction. Error: TX decode failed. Make sure the tx has at least one input

I'm using bitcoinlib for python to create a transaction and send it but I'm getting the following error: Funds not sent, exception error: Error connecting to blockchair on url https://api.blockchair....
Sonny Parlin's user avatar
1 vote
1 answer
311 views

What is the Best Way to Learn python-bitcoinlib?

I have tried to find tutorials everywhere, but can't find anything. Is there any step by step guide to use the library?
user1192890's user avatar
1 vote
0 answers
9 views

Node accounting - open source or bitcoin software

I am running a LND node. experimenting for other almost 2 years with it. i then started a small (2 persons) consulting company. this node is now used to go on building expertise and trying stuff. it ...
tepeji's user avatar
  • 11
1 vote
0 answers
133 views

Chain 2 transactions in same block with bitcoinlib in Python

I asked yesterday if it's possible to have a tx from A to B then B to C in the same block, with the second tx spending the UTXO of the first one (with initial balance of B is 0) Apparently it is : Can ...
sgbbfbf's user avatar
  • 11
1 vote
1 answer
168 views

Error Validating Segwit Transactions using Python Blockcypher API: Error Running Input Script

As the title states, I'm trying to send a Litecoin transaction using the Blockcypher API Python SDK, and using Bitcoinlib for key management. I have extensively reviewed the documentation and source ...
Cursed's user avatar
  • 11
1 vote
0 answers
158 views

How to set change address with python bitcoinlib

I am using python's bitcoinlib to try and set up payments where a client sends funds to a server and then sends requests signed with their key as proof that the request came from them. The server ...
Colm Evans's user avatar
1 vote
0 answers
270 views

Bitcoin Transaction Builder in Python

is there a python code that helps build raw bitcoin transactions (Legacy and Segwit)? I have seen javascript but not in python.
Jim Quick's user avatar
1 vote
0 answers
39 views

Pass Java code to Python [closed]

I have a Java code that I need to pass to python but I don't know which libraries to use and how to start and if you can help me it is very grateful MNEMONIC = "twenty four word mnemonic here&...
you1977's user avatar
  • 19
1 vote
0 answers
136 views

Cannot import python-bitcoinlib into a simple script

Im writing a simple python script to connect to a local bitcoin node and list transactions. I created a virtual environment with: virtualenv bitcoinenv And then activated: source bitcoinenv/bin/...
Mark's user avatar
  • 137
1 vote
0 answers
90 views

BlockCypher API signature bitcoin transaction Error

I'm trying to make a bitcoin transaction using the BlockCypher API and I'm getting an error when I try to sign the transaction. This function creates an unsigned transaction: def buildTransaction(...
Salvador's user avatar
0 votes
1 answer
146 views

Should an offline address generated from private key send funds to wallet?

I'm trying to use the python package python-bitcoinlib to send a timelock transaction on testnet. The github has two examples to create an address, and then use that address to send the bitcoin to ...
Cannabijoy's user avatar
0 votes
1 answer
646 views

How to get scriptPubKey from public key hash

My goal is to create a transaction. For that I need to know the following things: The private key signing the transaction. Who can spend the bitcoins that I'm sending. Valid UTXOs that the sender can ...
Nahum Maurice's user avatar
0 votes
1 answer
695 views

How to getreceivedbyaddress() with the python-bitcoinlib?

I'm trying to use the python-bitcoinlib in my bitcoin project. I now understand how I can send a payment, but I can't find anything similar to the getreceivedbyaddress() command I normally used. Isn'...
kramer65's user avatar
  • 315
0 votes
1 answer
44 views

Recreate Java code in python

I have a java code that I need to pass to python but I don't know which libraries to use and how to start and if you can help me I would really appreciate it MNEMONIC = "twenty four mnemonic ...
you1977's user avatar
  • 19
0 votes
1 answer
76 views

Does python-bitcoinlib and the Bitcoin Core functional test framework share code? Were changes ever pushed down/upstream?

Does python-bitcoinlib and the Bitcoin Core functional test framework share code? Were changes ever pushed down/upstream?
Michael Folkson's user avatar
0 votes
0 answers
14 views

How to spend one or more p2tr inputs in python?

I see that bitcoinlib does not support taproot yet. Is there any good lib out there to spend one or more taproot inputs? I would like to create txs like this: ... "inputs": [ { &...
user80100's user avatar
0 votes
0 answers
42 views

Getting error "non-mandatory-script-verify-flag (Witness program hash mismatch)" when trying to send raw signed transaction

I'm trying to send a fairly simple segwit transaction with multiple input and outputs using bitcoinlib, here's how the simplified code looks like: from bitcoinlib.transactions import Output, Key, ...
Javier Villanueva's user avatar
0 votes
1 answer
219 views

How to get UTXOs Data from the network Using python?

I want to have the Bitcoin Network UTXOs only for a data analysis project and the purpose is visualization of the time series of 1>BTC wallets . how can I do it using python ? ( or is there any ...
user143828's user avatar
0 votes
1 answer
164 views

p2sh addresses in elements

I'm building a script and have it's hex representation, then I convert it to a pubkey and address, which results in something like: 3NqNAUBEWarVjKerLcCnPrTGbaQ4QFcAfr or ...
T. Rossi's user avatar
  • 133
0 votes
0 answers
169 views

Creating an OP_Return TX with Python bitcoinlib

How can I create an op_return TX with python bitcoinlib? The transaction should include the OP_RETURN HEX-Data and an address where I send my change money
Captain Evening's user avatar
0 votes
1 answer
574 views

python - No module named 'bitcoin' on Ubuntu using WSL on Windows 10

Which version of python should I use? When running pip3 install python-bitcoinlib I get 'Requirement already satisfied'. I run on Ubuntu using WSL in Windows 10. I have this error: >>> from ...
Rony Tesler's user avatar
0 votes
0 answers
44 views

how to get every inputs signature from a raw hex bitcoin transaction using python? [duplicate]

I have this raw transaction : ...
user3639702's user avatar
0 votes
1 answer
663 views

How to create SegWit address from mnemonic in Python 3.8.10

I am having trouble creating SegWit address from mnemonic. I can't find any useful code to do that. I tried using BitcoinLib but I don't know how to disable saving wallets to disk. EDIT: I found ...
cloudzik's user avatar