Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
473 views

Can I, and how do I query the Bitcoin Core wallet to give me a list of all transactions for any specified address?

I've read some conflicting things on this. Given any address, what would be the json command and or how would I import into python, such a query to my bitcoin core wallet for an array of all the tx ...
1
vote
1answer
197 views

Wrong testnet address generation [python]

I'm trying to generate a testnet address without success.Main net address is working fine. Here is my code. The generated testnet address from this code is :CNFNz61dzQ2NQ9RCnjJFrm2de7nLbbT9xSv which ...
1
vote
1answer
600 views

Can I connect to Litecoin, Dash, BitcoinCash, Doge, etc. RPC with Bitcoin RPC client?

I want to set up a few nodes for different Bitcoin-derived cryptocurrencies and regularly query them for data via the JSON-RPC API. The thing is: I can't find much information on any other RPC API ...
1
vote
1answer
841 views

Is it possible to spend bitcoins from private key 0?

In [1]: from bitcoin import * In [2]: privtoaddr(0) Out[2]: '16QaFeudRUt8NYy2yzjm3BMvG4xBbAsBFM' On blockchain.info, there is 0.01 BTC unspent in this address. Is it possible to spend the bitcoins? ...
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', #...
0
votes
0answers
129 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
259 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-...
1
vote
1answer
4k views

ecdsa - Create Private key and Bitcoin Address

I have the following code: import binascii import hashlib from fastecdsa import keys, curve # generate a private key for curve P256 priv_key = keys.gen_private_key(curve.secp256k1) print (priv_key) ...
0
votes
1answer
458 views

How secure is bitcoin private key generated by this script? [closed]

I found this python script on github. It generates a pair of bitcoin private key and address. I know the private key may be vulnerable if it is created insecurely. I don't have much knowledge ...
1
vote
0answers
38 views

Which exchanges, if any, satisfy the following requirements? [closed]

Accepts non-US/non-EU citizens (specifically, they must accept South African citizens). Must be a mostly international or US based exchange (like Coinbase or Kraken). That is, it's supply and demand ...
3
votes
1answer
337 views

Cannot make valid Bitcoin Cash transaction

I've been way in over my head hacking around in various Python Bitcoin libraries. From what I understand, input public keys have to be compressed to be accepted. Is that correct? I have an ...
0
votes
1answer
222 views

What python code is necessary to convert the integers of a bitcoin public key into the proper hex version thereof?

If I get a public key of two integers, x and y values what code is necessary to convert them into their hex versions without any additional letters, or numbers? This is half a Python programming ...
2
votes
1answer
376 views

Python testnet raw transaction creation error

Based on the script from github. I tried to construct a valid testnet transaction. I had to do some modifications to the script so here is the current code. import struct import base58 import hashlib ...
0
votes
1answer
380 views

How to get the number of Bitcoin transactions every 30mins using API in python?

I'd like to get number of Bitcoin transactions every 30 minutes using API in python. Does someone know sample code how to mount in Github or any website?
2
votes
3answers
3k views

Bitcoin library in python

I need a good library for bitcoin and other BTC-like cryptocurrencies in python. I'm looking for something similar to bitcoinjs but in python. Minimal requirements: generate an EC keypair and get ...
4
votes
1answer
3k views

How to generate mycelium addresses from the 12 words in python

I am trying to re-generate the receiving addresses (and change addresses, for that matter) my mycelium wallet has generated. So far I've used trezor's implementation of BIP39 to generate the entropy ...
4
votes
2answers
8k views

How to access market price from Python?

I am struggling to get access to the kind of information I have on cryptowat.ch. For example on Kraken there is an API, but I didn't find how to get the past history, the volume information, etc. Is ...
0
votes
1answer
5k views

Bittrex websockets: How to get the order history?

Using the Bittrex websockets API I am able to get the summary updates for all markets and also the exchange updates for specific markets. However, I am not able to receive the order history (as ...
0
votes
1answer
556 views

Python source code for issuing a new altcoin?

I was wondering if anyone here know a python source code for making an altcoin? I found some tutorial on C++, but since I am not familiar with the language I cannot understand the code fully? And if ...
1
vote
2answers
1k views

Convert plaintext script into hex-encoded script in python

I'm creating a program (for an altcoin I'm developing) that should make it easy to create OP_RETURN transactions. Currently I'm having some trouble with actually creating the script pythonically (I ...
2
votes
1answer
1k views

getrawtransaction seems to only work for certain transactions

I am working through mastering bitcoin. I am confused by getrawtransaction. I would like to look at the first transaction in block 277316. from bitcoinrpc.authproxy import AuthServiceProxy, ...
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
1answer
6k views

binascii.Error: Odd-length string for Python Implementation of Bitcoin

https://gist.github.com/vivosmith/f0e692d9aedbc39ec8d3eb4651bc107c I was trying to implement this video in Python 3 But the issue is that, it was implemented in Python 2 So I tried to implement ...
6
votes
3answers
3k views

bitcoin.rpc python library problem

I am working through Master Bitcoin. I got the bitcoin client up and running. I am now trying to access the client from python. In the example, there is a line that says from bitcoin.rpc import ...
2
votes
2answers
7k views

How to produce a Hash160 bitcoin address?

tl;dr How should one perform Hash160, using most basic tools? ==================================================== Hi, I'm trying to figure out, how transactions work in bitcoin. When I choose ...
1
vote
1answer
675 views

merkle root 2 codes

While trying to calculate the merkle root in python from the data i got from the mining pool.... i found there are 2 different codes. code 1: def build_merkle_root(coinbase_hash_bin, merkle_branch):...
6
votes
2answers
2k views

Mining Block header bit reversing

While trying to understand the mining process and checking in python..... i am puzzled with which info from/to pool are in Little Endian, which one needs reversing in building the block header + ...
3
votes
4answers
3k 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?
2
votes
1answer
896 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 ...
5
votes
2answers
12k views

Convert WIF to private key

I am aware how to convert the private key into WIF format in python, now I am trying to reverse this process and convert a WIF formatted private key back into a 256-bit private key, following this ...
0
votes
1answer
524 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 ...
1
vote
1answer
440 views

When I call the blockchain.info API, I an error. What can i do to solve this problem?

A script that calls the blockchain.info API to find the UTXO related to an address # get unspent outputs from blockchain API import json import requests # example address address = '...
0
votes
1answer
909 views

Pybitcointools python 3.5 support

I am trying to run Vitalik Buterin's python bitcoin wrapper. I installed it from PyPi (pip install pybitcointools ). When I try to run: import bitcoin I get the following error: ImportError ...
2
votes
1answer
4k views

How to convert a WIF private key to a BIP32 extended private key

I am trying to recover the extended BIP32 master private key from its extended BIP32 public key (which I already know) and a WIF private key (which I obtained by decrypting a BIP38 seed with a ...
1
vote
1answer
525 views

ScriptSig field during P2PKH transaction signature

In P2PKH transactions, the content after signing the transaction contains: <signature(with hash_flag)><public_key>. However, since the signature can't sign itself, during the signature ...
3
votes
1answer
1k views

Chainstate LevelDB corruption after reading from the database

I've been working with the LevelDB for a few weeks, coding some tools to access the database and parse the data to be human readable. However, every single time I read from the chainstate the data ...
0
votes
1answer
184 views

How can I work out why a transaction isn't being included in any blocks? [duplicate]

I've crafted a testnet p2sh address using python-bitcoinlib. The script contents is 2-of-2 multisig: 2, key1, key2, 2, OP_CHECKMULTISIG Redeem script: ...
1
vote
1answer
2k views

How to start working with blk*.dat data?

I have the complete bitcoins block data (blk00000.dat, blk00001.dat.....). I want to convert it into some readable format like csv or json. Can it be done using python or any other software ?
1
vote
1answer
165 views

SIGHASH_SINGLE vbuterin/pybitcointools

Checking the implementation of Buterin's bitcoin tools I've noticed something strange. According to the Bitcoin developers guide, sighash_single signs only the outputs that match the input where the ...
1
vote
1answer
1k views

Stratum Server Exception "[coin] is not connected"

When i running 'twistd -ny launcher.tac' i getting the following Exception. The connection okay. Please help me to fix this issue. 2017-01-30 19:33:43,094 INFO bitcoin_rpc # Checking for submitblock ...
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
1answer
1k views

Sending transaction with Python + raw protocol

Two days ago I've found a few articles, about using raw bitcoin protocol, and now I'm still trying to send a transaction. My code is based on this class, and if I understand all of this bitcoin magic ...
2
votes
2answers
683 views

Unable to send 'version' message correctly

Few days ago I've found this article about using raw Bitcoin protocol and now I'm trying to make my own transaction with Python. But I'm already stuck on sending version message. I've tried to use ...
1
vote
3answers
2k views

Library for generating HD keys/addresses (ideally for python)

I require a library that I can create (and later import) a HD master key, which I will use to generate hundreds of addresses for both testnet and mainnet! Ideally, I need a python library (but had ...
2
votes
1answer
3k views

How to install Electrum wallet in an offline Linux computer?

So I want to play with the Electrum wallet, but as Cold Storage. Then what I plan to do is to install a raw Ubuntu 16.04 LTS into a computer "A" which I will never plug to the internet. So, with ...
2
votes
1answer
2k views

How to generate Bitcoin private - public keys with ECDSA module?

Pretty same question was asked here, but maybe there is a way to generate keys using ecdsa module in just a few lines of code?
2
votes
2answers
719 views

Type and Amount of Transaction in Blockchain API

I am building myself an alert program with which I want to send myself an alert via email if there are transactions ongoing at all (5) of my addresses. I have chosen the Blockchain API because I ...
5
votes
1answer
224 views

What is better, pre-existing Bitcoin-core API bindings for python or custom wrapper functions

How advisable is using the following code to query the bitcoin core as compared to using some python RPC library. import os btc_prefix = 'bitcoin-cli ' def getblockcount(btc_prefix): print("in ...
0
votes
1answer
361 views

What's the easiest way to hook into multiple BTC exchanges?

If you want to compare prices of BTC across multiple exchanges, is there a central mechanism or place to do so? I have been unable to find such a thing from my research