Questions tagged [python-bitcoinlib]

27 questions
7
votes
2 answers

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, code-wise, with the library, for the…
5
votes
2 answers

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() >>> conn.sendtoaddress('bitcoin_address_here', 0.5) The Readme of that…
kramer65
  • 315
  • 2
  • 10
2
votes
1 answer

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 about the transaction I require. I am using the cli as…
2
votes
1 answer

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…
zono
  • 1,895
  • 1
  • 19
  • 35
2
votes
1 answer

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 this example:…
0x0ff
  • 21
  • 3
1
vote
2 answers

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 = '0000000000000001b6b9a13b095e96db41c4a928b97ef2d944a9b31b2cc7bdc4' infoblock =…
bomben
  • 498
  • 2
  • 4
  • 11
1
vote
1 answer

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
  • 21
  • 1
  • 5
1
vote
1 answer

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 code for the tools I'm working with, and I have…
1
vote
0 answers

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 keeps track of how much funds are remaining.…
Colm Evans
  • 11
  • 2
1
vote
0 answers

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
  • 11
  • 2
1
vote
1 answer

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 managed to successfully convert to SegWit, but…
1
vote
0 answers

Pass Java code to 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 it is very grateful MNEMONIC = "twenty four word mnemonic here" ACCOUNT_KEY = "" WALLET_PRIVATE_KEY = "" // We'll…
you1977
  • 19
  • 2
1
vote
1 answer

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't seem to find where I'm going wrong…
1
vote
0 answers

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/activate The I installed python-bitcoinlib with: pip…
Mark
  • 137
  • 3
1
vote
0 answers

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(fromAddress, toAddress, value = -1, feePreference =…
1
2