Questions tagged [python]

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

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

Python library for Multisignature HD wallets

Is there is any python library is available that allow creation of Multisignature HD wallets ?
2
votes
1answer
2k 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, ...
2
votes
0answers
778 views

I can't connect to RPC from python. JSONRPCException: -342

Tryed to run this code : from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import logging import json logging.basicConfig() logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG) ...
2
votes
1answer
320 views

Python code to vb.net (2012) - help me to eliminate the errors

I wanted to convert the following bitcoin mining python code to VB.net (2012) and I tried to convert it's functionality, but it throws some errors and I'm stuck as I even can't get the resulting value ...
2
votes
0answers
444 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
489 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
127 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...
1
vote
1answer
293 views

Bitcoin RPC connection

I am trying to insert bitcoin transactions into MongoDB using python3. Below is my code : import pymongo import sys import json import time from bitcoinrpc.authproxy import AuthServiceProxy, ...
1
vote
0answers
24 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
114 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
1answer
274 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
373 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
195 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
226 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
746 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
147 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
412 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
431 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
1answer
29 views

What is the program in Python that print information about the current block?

What is the program in Python that print information about the current block the world try to mine (I mean Version, Previous Block, Merkle Root, Time, Bits) plus how many zeros we are looking for for ...
0
votes
0answers
11 views

Resource pool and bitcoin rpc (python)

Is it safe to use a resource pool (e.g. https://github.com/Bogdanp/resource_pool/blob/master/resource_pool.py) for: rpc_connection = AuthServiceProxy("http://%s:%s@%s:%s"%(user, password...)) What ...
0
votes
0answers
84 views

submitblock to btc-core fails to decode

I'm trying to create a little mining-script that connects over rpc to bitcoin core. I have problems following the documentation and all attempts to create a valid block (with dummy-nonce for testing) ...
0
votes
2answers
92 views

How to get the block hash in the chainstate leveldb?

From this link What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?, to get the block hash I use the obfuscation key and xor it with the result I get from the db. So I ...
0
votes
0answers
20 views

Blockchain.info block explorer help

Using the python blockchain.info client When I attempt to get blocks and print the result I get this output: <blockchain.blockexplorer.SimpleBlock object at 0x103c6b208> How can I access the ...
0
votes
1answer
31 views

Retrieve number of OP-RETURN transaction

Is there a possible way to extract the bitcoin transaction protocoll with Python and extract specifically OP RETURN transaction? I want to plot the number of those over the course of time to derive ...
0
votes
0answers
73 views

How can I generate a bitcoin address offline in Python?

I am new to python and bitcoin so please bear with my question. I want to integrate bitcoin as a payment method in my platform, I want to use 3rd party api service for sending transactions to block-...
0
votes
1answer
56 views

How do I use an issued API key in my python 3 script to bypass the request limiter?

I got an API key from blockchain.info to bypass the request limiter, but I don't know how to use it and I can't find any relevant info online. url = "https://blockchain.info/rawblock/" + str(s) ...
0
votes
1answer
67 views

broadcasting error for raw bitcoin transaction testnet

I am trying to create a raw transaction and send it to the testnet. I am using testnet keys and here is the simplified readable output from my script: decoded private key: ...
0
votes
2answers
68 views

What are the web3py equivalent for communicating with bitcoin in Python?

I am fairly new to working with Python, I have a requirement where I need to perform some basic bitcoin operations on my local system rather than relying on some external API's, those function mainly ...
0
votes
1answer
121 views

Question about Python library coincurve/libsecp256k

I am a noob with cryptography, just trying to learn using python and the library Coincurve ( https://github.com/ofek/coincurve ) which is a mature Python binding for libsecp256k1. The following code ...
0
votes
0answers
75 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 ...
0
votes
0answers
39 views

How can I connect to my own bitcoind node via json-rpc calls from python3 (or Django)? I'm using Windows 10

Context: I'm using bitcoind on Windows 10 and am able to operate it from bitcoin-cli already. Just want to do it programmatically from python3. Bitcoin wiki says python-jsonrpc is for old versions ...
0
votes
0answers
91 views

python-bitcoinrpc: modulenotfounderror no module named 'bitcoinrpc'

I'm running bitcoind/ bitcoind -regtest on Windows 10 and am already able to use bitcoin-cli -regtest along with json-rpc methods to perform basic operations and get balances etc. When I try to do ...
0
votes
0answers
61 views

SHA256 hash generating python

Can somebody give me complete python code that outputs a valid and random sha256 mining hash using python? I know bitcoin with a laptop is incredibly unprofitable, especially with python, I am just ...
0
votes
0answers
160 views

Fastest way to generate millions of public keys from private keys (Python/C#)

I have run into a problem when trying to generate public keys from my mnemonics via privatekeys. The mnemonic -> privkey is fairly fast. Although when deriving the m/44./0./0./0/0 public adress it ...
0
votes
0answers
82 views

examples of using pycoin in python script

Im attempting to create a python script/app that creates and holds its own funds for trading btc and alts. I cant find any examples of how to use pycoin as anything other than a command line tool. ...
0
votes
1answer
139 views

Python - Querying bitcoin's block header using leveldb

I am facing a stupid problem. I am trying to read bitcoin/blocks/index leveldb using plyvel. I've set up a regtest and i know there is a block with the hash : ...
0
votes
1answer
97 views

How do I get the value of a btc address transaction with pybitcoin tools?

Lets say that I execute the code below when the user accesses the deposit page. my_private_key = random_key() my_public_key = privtopub(my_private_key) my_address = pubtoaddr(my_public_key) And I ...
0
votes
1answer
51 views

Trying to create a bitcoin based webapp in python which takes BTC deposits. How would I use pybitcointools to implement this?

Trying to create a bitcoin based webapp in python which takes BTC deposits (New to Bitcoin in general, but want to get involved). Although I would preferably want to use a different address for each ...
0
votes
1answer
248 views

Pycoin: How to sign SegWit transaction via Pycoin?

My target is to make transaction with unspent transaction outputs(UTXOS). The information of UTXOs is as follow. [ { "pt_idx": 0, "subaccount": 37, "ga_asset_id": 1, "value": "...
0
votes
0answers
120 views

Issues when attempting to get accounts using the GDAX API

Here is the github I have working with: https://github.com/danpaquin/gdax-python When I run the following code: auth_client.get_accounts() I'm getting the following error: TypeError: expected ...
0
votes
0answers
191 views

Help with multi-input transaction by code

I'm trying to consolidate multiple inputs into a single output, all left over is for the miner. When I send my transaction to a peer, it is never mined. I believe something is invalid in the multi-...
0
votes
1answer
405 views

How to generate Electrum address with pybitcointools

I want to create a payment service where I want to be able to charge each client according to its invoice. I picked Electrum as my underlying wallet and pybitcontools as my Python interface. I would ...
0
votes
5answers
1k views

How to read each bitcoin block by python

I need to read all Bitcoin transactions from the first one until now and extract all Bitcoin addresses for further analyses Any idea how to do it in Python?