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
1
vote
1answer
359 views

anyone attempted a multiple p2sh(multisig) send (ideally using python)?

I attempted to use pycoin to do a "create_signed_tx" in python, but had no joy: Do you think it might be technically possible to use spendables(UTXOs) from multiple source P2SH wallets in a single ...
1
vote
1answer
125 views

micropayment channels, n-m addresses, interoperability

I just read bitcoinJ's working with contracts tutorial and I am puzzled as: it seems to me that n-m addresses are implemented in Bitcoinj using plain multisig (as defined in this bit of the developer'...
1
vote
1answer
114 views

Making a Server?

Can anyone give me some advice? I'm looking to learn how to make an independent market for selling and buying CS:GO skins for BTC. I'm using Django and I want all BTC to be stored and processed ...
1
vote
1answer
501 views

Convert a list of 64 hex keys to private import format

Is there a python script that i could use to convert a list of private hex keys to there import format in bulk? How would I go about this.. Could this be adjusted to take a .txt list of hex ...
1
vote
1answer
184 views

question on Armory bitcoin wallet scripting

Has anyone built the Armory Bitcoin wallet successfully and created the wallet using python and Armory as a library instead of using the GUI?
1
vote
1answer
212 views

BIP39 Japanese Mnemonic vector unit test process

There is a json for unit tests of Japanese characters which I want to validate using Python, specifically with this fork of pybitcointools, which has bip39 functionality. Unit tests from Trezor's ...
1
vote
1answer
912 views

Sample programs written using python-bitcoinlib?

Where can I get source codes of programs written using the python-bitcoinlib?
1
vote
1answer
566 views

How do I print unspent transaction outputs of an address using pybitcointools

I am a beginner looking to write a simple program that takes an input (address) and prints the unspent amount in it. I copied some code from chapter 4 of Mastering Bitcoin to generate a random ...
1
vote
2answers
1k views

Running pybitcointools & python-bitcoinlib concurrently

This is somewhat Python-based, but I feel it is more a Bitcoin question than a Python question. The problem is running pybitcointools and python-bitcoinlib concurrently, as both packages use the name ...
1
vote
1answer
79 views

How exactly do I decode the block file info in leveldb?

Base on the links https://github.com/bitcoin/bitcoin/blob/fcbc8bfa6d10cac4f16699d6e6e68fb6eb98acd0/src/main.h#L392 and What are the keys used in the blockchain levelDB (ie what are the key:value ...
1
vote
0answers
146 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...
1
vote
1answer
320 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
1answer
81 views

Is it possible to deploy a python script on Ethereum Virtual Network or NEO? [closed]

Is it possible to deploy a python script as a dApp on the Ethereum or NEO virtual network?
1
vote
0answers
118 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
286 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
1answer
116 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
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
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 ...
1
vote
2answers
868 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 ...
1
vote
0answers
196 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
227 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
491 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):...
1
vote
1answer
144 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
0answers
747 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
416 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
1answer
931 views

How to verify ECDSA of a sample litecoin tx using pycoin?

I'm using the litecoin testnet network for testing. I have a UTXO at 053baee857adfdc16959e9dbc9618e0e935f0a1e51e226e651fcd67242f1f462 with a vout of 0. I make a raw transaction sending the coins to ...
1
vote
0answers
434 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
57 views

Why future Bitcoin Core release shouldn't be in python?

Python offers various advantages including simplified rules of coding and ease of readability. It offers OOP, cross platform compatibility and has numerous libraries that have been added over time. It ...
0
votes
1answer
1k views

Create raw transaction in python

I have a private key (raw + WIF) and I want to send all funds from that address - fee to another address. Is there a raw python function that can do that for me ? I will broadcast the tx manually. ...
0
votes
1answer
112 views

How to send user input data(Bitcoin address) from iPhone to server and then send Bitcoin back to user's Bitcoin address?

Background I just got started yesterday learning Python and I'm currently building my first iPhone game. What I'm trying to do is create a Bitcoin Pot Jar inside an iPhone app like Sarutobi:https://...
0
votes
1answer
84 views

Checking external bitcoin address balances via JSON-RPC API

I'm using bitcoin core json-rpc api in python and am wondering why... getreceivedbyaddress() ...doesn't allow me to specify an address that isn't in my local wallet? The whole blockchain is open, ...
0
votes
1answer
28 views

These testnet outputs are not making sense to me

Today I took some time to mess around with the bit Python library, which I find pretty easy to use. I have been wanting to do some Bitcoin programming for a while, so I decided to create a simple web ...
0
votes
1answer
47 views

getrawtransaction not working for 0th BTC block transaction

I am trying to insert BTC blocks and transactions in MONGODB collection from count 0 using Python3. getrawtransaction is giving output for block 1 but not for block 0. Can somebody help me why this ...
0
votes
1answer
483 views

bitcoin rpc api createrawtransaction with python returns -3: Expected type array, got object

experimenting with JSON RPC API using bitcoinrpc.authproxy for python. so far it works in all instances accept when i try to create a raw transaction. somewhere along the way im passing parameters in ...
0
votes
1answer
393 views

need advice for Python interaction with bitcoin-core wallet

I've read about a few Python libraries that performs JSON-RPC calls to bitcoind. However, not many are actively developed/maintained, nor are they widely used in production environment. Since bitcoind ...
0
votes
1answer
18 views

How to run a python script when occur incoming transaction in Bitcoin core 0.18?

I want to run a python script when occur an incoming transaction. I think set zapwallettxes flag in bitcoin.conf but I don't know where set the script path to execute. Is it possible to execute ...
0
votes
1answer
39 views

Source and (mis)handling of the private key for a basic tx

I'm looking to get "hands on" with signing, however when I adapt Runeks' thorough answer at https://bitcoin.stackexchange.com/a/5241/89798 my code invariably fails reporting that I've used the wrong ...
0
votes
1answer
28 views

How to convert a python example with getinfo to a usable function?

From Antonopoulos' book I try to use the example 3-3 on page 49 which uses a python skript called rpc_example.py to show the usage of the JSON-RPC API: from bitcoin.rpc import RawProxy p = ...
0
votes
1answer
22 views

Alternative to Python pip bitcoin

This Python pip package https://pypi.org/project/bitcoin/ was originally developed by Vitalik Buterin (that Ethereum guy) but is no longer maintained. Is there any alternative equivalent pip package ...
0
votes
1answer
95 views

Is there a Python or SageMath implementation for solving the ECDL problem for small secret multiplier?

I am looking for a Python script or SageMath code implementation for testing the Baby Step - Giant Stepand Pollard Rhoalgorithms on the secp256k1 curve. I have read that these algorithms are well ...
0
votes
1answer
85 views

Struggling to successfully broadcast a p2pkh transaction

I've been experimenting with sending bitcoin transactions with python for the past week. I successfully was able to send p2wpkh->ALL address types, p2sh-p2wpkh->ALL address types. What I am ...
0
votes
1answer
82 views

What could this Python Assertion error mean?

When I run the code below, sending a BTC transaction to the blockchain (using blockcypher api) I get an Assertion Error. I am not sure what an Assertion error means. The code: Btw the address had ...
0
votes
1answer
100 views

bitcoinrpc.authproxy.JSONRPCException: -26: 16: bad-txns-in-belowout

I am getting this exception, when I am using sendrawtransaction. And all I want to do is translate this docs to Python code, and I have searched for a while but both Can anyone shed any light on this ...
0
votes
1answer
248 views

python bitcoin public key to address code error

import hashlib b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' def hex_open_key_to_hex_hesh160(hex_open_key): h160 = hashlib.new('ripemd160') h160.update(hashlib.sha256(('04'+...
0
votes
1answer
1k views

ModuleNotFoundError: No module named 'bitcoin'

Here's my code: from bitcoin.rpc import RawProxy # Create a connection to local Bitcoin Core node p = RawProxy() # Run the getinfo command, store the resulting data in info info = p.getinfo() # ...
0
votes
1answer
342 views

How to set up a private chain/local testnet : reverse engineering the blockchain code

Long story short, I want to set up a private chain/a testnet blockchain that can run locally just to fiddle and play with it just to learn how it works. So I have a general understanding of how things ...
0
votes
1answer
332 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 ...
0
votes
1answer
313 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 ...