Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

61 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
96 views

How to verify a lnurl-auth callback with python

I want to create a Python implementation of an lnurl-auth server. I started a quick HTTP server to be the callback url, and captured the signed callback sent by BLW on Android. ?tag=login &k1=...
3
votes
1answer
266 views

Python library for Multisignature HD wallets

Is there is any python library is available that allow creation of Multisignature HD wallets ?
2
votes
0answers
58 views

How to generate unspendable testnet bitcoin address with python?

I'm trying to generate a testnet address. However, I tried to write this python program (using help of various online code places), and I created this program. The program is designed to take a 20 ...
2
votes
0answers
686 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...
2
votes
0answers
465 views

How to add blockchain.info API key to pibitcointools

I have a query-intensive app I'm building that keeps timing out with the message: Traceback (most recent call last): File "test.py", line 72, in <module> array = bitcoin.multiaccess (...
2
votes
1answer
895 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 ...
1
vote
0answers
38 views

Using RBF in python application

I'd like to create transactions within my python application, that support replace-by-fee RBF (BIP125). Apparently, if I want to be able to replace my transaction later on, I need to signal that ...
1
vote
0answers
34 views

P2SH address as a product of public keys

Assuming the multisig 2 of 3, if I do have extended public keys (xpub) for all 3 cosigners (with proper derivations), can I somewhat get the result address (P2SH)? How to calculate the "script&...
1
vote
0answers
33 views

bitcoin-etl: problems with installing

I am trying to install bitcoin-etl: https://github.com/blockchain-etl/bitcoin-etl to analyze bitcoin blockchain. I have Mac OS and python3, I run this in terminal: pip install bitcoin-etl Also tried ...
1
vote
0answers
314 views

Connection refused when using bitcoinrpc on Linux

I am new to python-bitcoinrpc(also new to VM Linux actually) and I want to use the blockchain parser from alecalve to get ordered blocks. I used Windows to download the blockchain data into an ...
1
vote
0answers
163 views

Bitcoin walletnotify doesn't pass the txid as %s

Thoroughly searched this online but haven't found an answer yet. Basically I'm using the below line in my conf file: walletnotify=C:\pathname\filename.py %s It is supposed to run my python file ...
1
vote
0answers
29 views

Why does this return an ssl error when using pybitcointools?

Really confused as to why this error persists. I have upgraded pip ( I believe) And have installed pybitcointools...
1
vote
0answers
179 views

getblockchaininfo timeout using API only

Thanks in advance. If I call getblockchaininfo through bitcoin-cli it just works. It might take a while but it works all the time. If I call it from within a Python Script from bitcoin.rpc import ...
1
vote
2answers
726 views

How to recover wallet by importing private key on testnet?

I want to test the functionality of wallet recovery via private key import on the testnet. Preferably thru an online service. I only want to test the functionality so that I can verify that it's ...
1
vote
0answers
381 views

Having trouble using GDAX API to place market buy order

Here is the documentation I'm following and to place a buy order, the syntax follows the following format: # Buy 0.01 BTC @ 100 USD auth_client.buy(price='100.00', #USD size='0.01', #...
1
vote
0answers
208 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?
1
vote
0answers
393 views

Running trezorctl / python-trezor on macOS Sierra

As I am not familiar with python I am currently having trouble getting trezorctl running. After installing pip and running pip install trezor from my admin account I get the following error message ...
1
vote
0answers
795 views

Electrum - using a fixed fee regardless of transaction size

I am using Electrum 2.7.12, and I intend to use the python console to paytomany() while using a fixed fee. I have tried following directions from http://matt.ramuta.me/blog/1419787186410-how-to-write-...
1
vote
0answers
153 views

Troubleshooting pybitcointools: signing transaction valid only for certain hash values

From my pybitcointools fork's issues: I'm having some weird issues with the signature sometimes it works and other times it doesn't. When I see '[ALL]' in scriptSig that's when I know it's ...
1
vote
0answers
486 views

Is there any library to process scriptSig script in transaction, and other scripts?

I'm trying to parse hex representation of scriptSig, in normal transactions there are variable int, r&s, pubkey. But some are really weird, like those ones: ...
1
vote
0answers
470 views

How to get bitcoin address from the pubkey_hash using bitcoin-abe or something else?

I'm using: https://github.com/bitcoin-abe/bitcoin-abe to import the blockchain into a mysql DB it is almost done after 5 days. So I started looking at the data and didn't see any addresses. I know the ...
0
votes
2answers
21 views

Lost 3 words out of 12, and not sure of order, mnemonic seed

I lost 3 words out 12 and not sure of the order of the rest besides the first 3, and the last one. I wrote a Python script with mnemonic and the crypto.com wallet library, it works, to my knowledge ...
0
votes
0answers
21 views

Are these equivalent: GetHash in src/primitives/transaction.cpp, and rehash in test/functional/test_framework/messages.py

Are these equivalent? rehash method of the Python Test Framework data structure CTransaction (link) GetHash method of CMutableTransaction (link, link) If not, is there an equivalent to rehash in Core?
0
votes
0answers
80 views

Simple Python code miner which automatically mines and stops

I'm new at BTC mining and I'm still learning. I'm almost medium level in Python. I'm looking for a Python miner that automatically mines using the last block and stops when a new block is found and if ...
0
votes
1answer
44 views

Account Extended Public Key from mnemonic

tell me please, how we can receive Account Extended Public Key from mnemonic phrase via PHP or Python? Or possible in internet we have ready console scripts? I'm going to https://iancoleman.io/bip39/ ...
0
votes
0answers
52 views

What is the easyest python3 script to generate pubkey + addresses from 24 words + passphrase?

Coldcard can generate 24 words from dice, but then I still need to verify that applying my passphrase on top of the 24 words, give me the addresses that coldcard is showing me. What is the easyest ...
0
votes
0answers
24 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
0
votes
1answer
340 views

How do i properly encode and decode base58 in python?

I was following the tutorial here : https://hackernoon.com/how-to-generate-bitcoin-addresses-technical-address-generation-explanation-rus3z9e i imported base58 to my python project : import base58 I ...
0
votes
1answer
118 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 ...
0
votes
0answers
31 views

Blockchain Info BTC Hash-Rate API

I'd like to get the history of hash rate, Miners Revenue, Difficulty, Block Size of BTC (& other coins) since 2013 and preferably in different granularity (i.e., 1d, 1hr,...) with Python. I know ...
0
votes
1answer
141 views

Struggling to Decode Raw Hex Data of a Block

I am trying to Decode the Raw hex data of a Coinbase Block to check my understanding of the DS but I am facing some difficulties in decoding marked by a ? below: Q1. Can someone please check the ...
0
votes
0answers
129 views

How do you Derive Addresses from a BIP49 Master Public Key using P2WPKH-P2SH?

I am trying to derive addresses from a master public key (aka extended public key) in python. I don't fully understand the math behind the key derivation, but have been able to decode the master ...
0
votes
0answers
153 views

How to run simple python function on GPU using cuda and numba?

I have a simple code that I would like to run on GPU. I have seen many tutorial and it seems like I have to put @cuda.jit before my function to use it on gpu, but it is not working. For the moment, ...
0
votes
0answers
36 views

calculate transaction fee

I have been trying to write an application for transferring bitcoin programmatically using python and bit library. However, I'm currently stuck on how to calculate transaction fee. from bit import Key ...
0
votes
0answers
27 views

Coin selection algorithm using Python and Bitcoin Core JSON-RPC

I am looking for the easiest way to implement this using Python: Save all the amount of UTXOs in an array(not sure if tuple or list or set or dictionary) User wants to send 0.1 BTC, won't pay more ...
0
votes
0answers
107 views

How to modify for Hex to base58check converter via python

I am far from programming, I found this convenient script, it just has an input - a text file with a HEX list in a column and the output of the result - a text file with a WIF list in a stack. I would ...
0
votes
0answers
79 views

What's up with the block size of block# 295182?

I found an anomaly in the block size data: block 295182. This one seems to have a way higher payload. What happened there? Or is this there something wrong with my parsing? This file block does ...
0
votes
0answers
96 views

bitcoin core wallet and python bitcoin-lib

I have a regtest bitcoin environment with nodes and wallets. I'm running bitcoind and bitcoin-cli, version v0.21.0.0. So in my node i created my wallet with a bitcoin-cli -regtest createwallet node1 &...
0
votes
0answers
113 views

Generate BTC Compressed Address

The below code generate uncompressed address with and the Private key for this uncompressed address. How to generate compressed address with it's private key ? I know there is packages like bitcoin ...
0
votes
0answers
82 views

How Create Bitcoin wallet from a private key works?

I'm trying to understand how i can create a pair of bitcoin private key and public key with : https://github.com/Destiner/blocksmith for example : import blocksmith kg = blocksmith.KeyGenerator() ...
0
votes
1answer
204 views

How can I pull the "Candles" argument from the Huobi websocket data?

I've a problem with Huobi Websocket, I know my ways in REST API but new to asyncio and websockets, and Huobi only gives resonable amount of history through websocket request so I'm stuck with it. I'm ...
0
votes
0answers
63 views

Process for finding nonce

Assume we have a transaction in hex (tx_hex) and we want to find a nonce such that SHA-256(SHA-256(nonce|| tx_hex)) = new_transaction_id ('||' denotes concatenation) first bits consist of 32 zeros. ...
0
votes
1answer
831 views

How can I generate SegWit addresses from a mnemonic using python?

So, I have written a script that generates BIP39 mnemonics. I now want to generate N native SegWit public keys from this mnemonic. I have found this, but it generates legacy addresses. It uses the ...
0
votes
1answer
1k views

How to generate Hash160 from a private key with the Bitcoin module

I want to fix the script code. The script generates from a random private key Bitcoin Address by function (pubtoaddr) and works on the Bitcoin module: https://github.com/primal100/pybitcointools/blob/...
0
votes
1answer
159 views

SPV client TCP connection in python

I am trying to implement an SPV client in python (for my own learning). I want to start by making a simple TCP connection to a full node, but I either cannot get a response to my version message, or ...
0
votes
0answers
104 views

Parsing transaction hash from rawblock data

I got block raw data next url https://blockchain.info/rawblock/00000000000000000002447735c7723ee9188322c0938e6587866a4458b9135f?format=hex Can I find transaction hash in url used python?
0
votes
0answers
35 views

Can I get all block header data like the SPV node?

It hasn't been long since I studied Blockchain. I only need header data, not all block data, for study purposes. As far as I know, the SPV node stores only the block's header information. Can i get ...
0
votes
1answer
5k views

Help needed with PyWallet and wallet dump using MacOS

Could anyone please give me some guidance on how to perform a wallet dump using PyWallet on a MacBook (macOS 10.12 Sierra)? I’m not very savvy with this stuff at all. Have an old wallet.dat file from ...
0
votes
0answers
388 views

Issue generating private Key and segwit address with python

I used the following script to generate my private key and the corresponding segwit address. Then to test it, i sent funds to the address and imported the private key on blockchain wallet; RESULT: ...
0
votes
0answers
33 views

How to create a Bitcoin Transaction With Protocoin

Please how do I create a btc transaction and broadcast it with protocoin library? I want to create a transaction that will relay to the node without validating inputs and outputs. Of course I know the ...