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
1 answer
167 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 ...
1 vote
0 answers
32 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...
0 votes
1 answer
144 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 ...
1 vote
1 answer
1k views

How to fetch the latest unspent transaction by an address using bitcoind?

I want to build a server, which provide following APIs: 1.Get balance by address. 2.Get latest unspent transaction. 3.broadcast the transaction. First by first, I know I can do above stuffes by ...
  • 141
1 vote
2 answers
116 views

Why are my Signature Scripts Different from my professors?

bob_addr = "1NWzVg38ggPoVGAG2VWt6ktdWMaV6S1pJk"#"1FMb8Jnn1jSh7yjDFfonC8xCCH3ittoEzB" bob_hashed_pubkey = base58check.b58decode(bob_addr)[1:] bob2_hashed_pubkey = b'\xec\x06\xb2\xbf\x18\xc8\x97\x06\...
0 votes
1 answer
412 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 ...
  • 141
1 vote
1 answer
101 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?
5 votes
3 answers
13k views

How to generate public and private key pairs from the 12 seed words in python

I basically followed the instructions here How to generate mycelium addresses from the 12 words in python So my code is similar: from bip32utils import BIP32Key from bip32utils import BIP32_HARDEN ...
1 vote
0 answers
198 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
2 answers
850 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 ...
  • 113
3 votes
1 answer
83 views

What is "Rate" on crypto exchange?

I use bittrex api and python for trading. I am interesting about lowest Ask and highest Bid prices on the pair. In this example: I want to sell XRP on 0.00008215 price and on 0.00008245 What ...
0 votes
1 answer
388 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'+...
  • 321
1 vote
1 answer
528 views

Altcoin - genesis block - TypeError: __init__() takes exactly 2 arguments (3 given)

I'm trying to use the genesis script from innova to generate a genesis block of Xevan_hash https://github.com/innovacoin/GenesisH0/blob/master/genesis.py I'm using these parameters: python genesis....
  • 111
7 votes
2 answers
5k 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
1 answer
395 views

bitcoin chainstate database parsing in python giving wrong value

I am trying to decode chainstate db for a specific out index for a transaction in python just for learning. Transaction ID: 4d4a4c6ca4f3c91e69563199943336d3279fad71c9e8d9c1708ef9dc6ac16000 out index = ...
0 votes
1 answer
4k 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() # ...
  • 123
2 votes
1 answer
241 views

Extract lightning network funding transactions with python bitcoin blockchain parser lib

My ultimate goal is to parse funding transactions (as well as channel closes in a later step) from the blockchain. In order to do so I wanted to start with a funding transaction and disect it. ...
0 votes
1 answer
622 views

Electrum Gap Limit from CLI

Is there any way to change wallet gap limit in Electrum from command line? If yes, how? If not, could it be bypassed using some kind of external script? I really need to avoid GUI. Thank you in ...
7 votes
1 answer
650 views

How does bitcoin functional test framework work?

Could someone explain how and where in the code the bitcoin test framework calls map to C++ bitcoin core code or RPC calls such that regression suite tests the bitcoin core functionality? Background ...
0 votes
1 answer
734 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 ...
  • 368
2 votes
1 answer
885 views

How to create a p2sh transaction with a scriptsig of OP_true?

How can I create a p2sh transaction with a scriptsig containing OP_TRUE only, removing the need for a digital signature, which will be broadcasted and mined? Also could some one provide an example of ...
  • 117
1 vote
1 answer
395 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
1 answer
435 views

Pycoin: How to send transaction?

There is a problem in making and sending transaction. I got UTXOS by using API(GreenAddress), and from utxos I made a transaction. But calculated fee is always larger than one in original GA service. ...
0 votes
1 answer
42 views

GreenAddress: Noticfication of receiving transaction

I'm developing python project using greenaddress API. I use pycoin package. I almost completed, but I can't resolve notification problem. Using greenaddress API, the notification received is as follow....
0 votes
1 answer
414 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 ...
  • 1
1 vote
1 answer
186 views

Project on modelling Bitcoin blockchain data

I am doing a thesis project on modelling Bitcoin blockchain data, but atm I am having trouble getting data from the Bitcoin blockchain into a format that is easy to deal with in e.g. Python. I have ...
0 votes
1 answer
538 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,406
1 vote
1 answer
236 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
1 answer
643 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
1 answer
995 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? ...
  • 124
1 vote
0 answers
383 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', #...
  • 131
0 votes
0 answers
130 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 ...
  • 131
0 votes
0 answers
268 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-...
2 votes
1 answer
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
1 answer
477 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
0 answers
39 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 ...
  • 11
3 votes
1 answer
347 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 ...
  • 133
0 votes
1 answer
244 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 ...
  • 1,406
2 votes
1 answer
389 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
1 answer
445 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
3 answers
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 ...
  • 121
4 votes
1 answer
4k 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 ...
  • 115
4 votes
2 answers
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 ...
  • 227
0 votes
1 answer
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
1 answer
560 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 ...
  • 103
1 vote
2 answers
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
1 answer
2k 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
1 answer
233 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
0 answers
413 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 ...
  • 11
1 vote
1 answer
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 ...