Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

0
votes
0answers
16 views

how to implement stack data structure using haskell? [closed]

i won't perform stuck function like this (push, pop) using Haskell that are special for functional programming
0
votes
1answer
17 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
50 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 ...
1
vote
1answer
28 views

Create a transaction spendable in a specific block height

I am new in Bitcoin and I try to create an address in Bitcoind and send a transaction that the amount will be spendable in a specific height of the blockchain. Here is what I have done: privateKey = ...
1
vote
0answers
33 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...
0
votes
1answer
40 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
0answers
40 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
16 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
26 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
37 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
1answer
33 views

Dogecoin Scrypt mining hashes python

I know making a miner in python is inefficient and unprofitable, however I would like to do it as an experiment. What exactly is the code to generate a Dogecoin Scrypt mining hash in python? For ...
0
votes
0answers
65 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
28 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
24 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 ...
1
vote
1answer
129 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
1answer
39 views

Mutlisig tansactions with trezor with multiple inputs and outputs not able to broadcast

I am trying to do a multisig here is my final hex ...
1
vote
1answer
36 views

Why is Target < Blockhash?

I am currently trying to validate a blocks hash against its target in python3: This is a block in the Blockcypher testnet, and I am using this formula from the Bitcoin Wiki. block_hash = '...
0
votes
1answer
78 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 : ...
2
votes
1answer
196 views

Python: How generate bitcoin addresses using electrum library

What am I doing wrong here? I'm trying to generate bitcoin addresses from the seed but they do not match with ones from electrum application. Did I miss something? And I also have trouble with ...
0
votes
1answer
53 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 ...
2
votes
0answers
121 views

Python library for Multisignature HD wallets

Is there is any python library is available that allow creation of Multisignature HD wallets ?
0
votes
1answer
623 views

Get Bitcoin Wallet balance with Python

On a tutorial in Youtube it uses pybitcointools. Upon searching it's github repository, I have found that it was not maintained anymore. Are there any alternative to this library which can get wallet ...
0
votes
1answer
311 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
55 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
55 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
0answers
22 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
1answer
42 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
269 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 ...
1
vote
2answers
53 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
1answer
72 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 ...
1
vote
1answer
64 views

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

Is it possible to deploy a python script as a dApp on the Ethereum or NEO virtual network?
1
vote
3answers
970 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 ...
0
votes
0answers
88 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
210 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 ...
2
votes
1answer
68 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
1answer
207 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'+...
1
vote
1answer
268 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....
1
vote
1answer
1k 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, ...
1
vote
1answer
160 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
1answer
668 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() # ...
3
votes
1answer
104 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
1answer
242 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 ...
2
votes
1answer
265 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
1answer
237 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
199 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
1answer
230 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
1answer
32 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
1answer
311 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
vote
1answer
141 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
1answer
274 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 ...