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
389 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 ...
0
votes
2answers
40 views

library for validating bitcoin private and public keys

I am building a python script that gets a string and determines if it is a valid bitcoin private key or public key, and if so it returns its type/format (base58, BIP32, HexaDecimal etc.) and its ...
2
votes
1answer
356 views

Mining algorithm in vb.net

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 ...
1
vote
2answers
92 views

How to use python rpc bitcoin to get the historical transaction record of a wallet address

How to use python rpc bitcoin to get the historical transaction record of a wallet address?My computer has synchronized all btc blocks, and txindex=1 has been configured. I want to try to get all the ...
0
votes
1answer
31 views

Help needed with PyWallet and wallet dump using MacOS

Could anyone please give me some guidance on how to perform a wallet dump using PyWallet on a MacBook (macOS 10.12 Sierra)? I’m not very savvy with this stuff at all. Have an old wallet.dat file from ...
1
vote
1answer
28 views

Address generator error with python

I had created a script that creates a bitcoin private key, public key and address, for checking if all works fine I create one and check the private key on https://walletgenerator.net/, and it outputs ...
0
votes
2answers
172 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
1answer
55 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 ...
2
votes
2answers
614 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 ...
0
votes
0answers
39 views

How do I get bip32 public key and address from private key in python?

I have checked related questions and did not find answer. I also tried to use "secp256k1", "bip-0032", "seedrecover" and did not succeed. When my input is a private key ...
0
votes
0answers
22 views

Parsing transaction hash from rawblock data

I got block raw data next url https://blockchain.info/rawblock/00000000000000000002447735c7723ee9188322c0938e6587866a4458b9135f?format=hex Can I find transaction hash in url used python?
2
votes
2answers
8k 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
59 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
16 views

Can I get all block header data like the SPV node?

It hasn't been long since I studied Blockchain. I only need header data, not all block data, for study purposes. As far as I know, the SPV node stores only the block's header information. Can i get ...
2
votes
1answer
54 views

Cannot import python-bitcoinrpc

I am unable to import the package bitcoinrpc. I have installed it in python2 and python3 using python3 -m pip install python-bitcoinrpc/python -m pip install python-bitcoinrpc AND by cloning the repo ...
0
votes
2answers
114 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
180 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) ...
2
votes
2answers
126 views

convert private key to bitcoin address using python or php

I have private key like this 5JYJWrRd7sbqEzL9KR9dYTGrxyLqZEhPtnCtcvhC5t8ZvWgS9iC how to convert to bicoin address using python or php? example bitcoin address 18V7u8YNHKwG944TCkzYYj32hb6fdFPvQf
0
votes
1answer
126 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: ...
3
votes
1answer
214 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
32 views

How can bitinfocharts.com know the changes in BTC deposited to Binance?

I find this page here, which tells me how much BTC is deposited to Binance. How does this (or a similar) page work? When I deposit BTC to Binance, I am given an address, which I am fairly sure it's ...
1
vote
1answer
449 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, ...
0
votes
1answer
276 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
1answer
37 views

I need a few lines of python to make WIF addresses

I have code which generates WIF keys from hex keys. It just need a few more lines to generate WIF addresses. ------------------------ import binascii, hashlib, base58, sys def convert(z): ...
0
votes
1answer
32 views

Calculate BitcoinGold Block Header Hash [closed]

I am trying to calculate block hash # 632295 { 'version': 536870912, 'prev_block_hash': '000000017590609fd72cadc5fd05732cfa1760bd882213afbb7b788c42e115c8', 'merkle_root': '...
1
vote
0answers
53 views

Connection refused when using bitcoinrpc on Linux

I am new to python-bitcoinrpc(also new to VM Linux actually) and I want to use the blockchain parser from alecalve to get ordered blocks. I used Windows to download the blockchain data into an ...
0
votes
1answer
107 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
273 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
78 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 ...
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, ...
0
votes
1answer
451 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
2answers
43 views

How can I execute `getnewaddress` at my full node from a remote server?

I have a full node running on a digital ocean droplet. I have an app running at heroku, and I want to execute getnewaddress from this app. I'm trying to generate BTC addresses to which users can send ...
0
votes
1answer
62 views

Is there such a service as an unlimited Bitcoin wallet with an API?

Well, I did tons of research and currently I'm using bitcoinlib for python to have a wallet which should be able to hold over one million addresses and occassionally broadcast transactions. It has ...
0
votes
0answers
55 views

How to construct and redeem a bip199 htlc with python-bitcoinlib

Playing with this script, I'd like to understand how to construct a bip199 htlc and redeem it, however this script fails on the OP_EQUALVERIFY and I can't seem to understand why. I'd like an ...
0
votes
0answers
20 views

Blockcypher make_tx_signatures “Bad Signature” error

I am having trouble to sign a transaction on Blockcypher Test Network (using python): import requests from blockcypher ( import send_faucet_coins, create_unsigned_tx, make_tx_signatures, ...
0
votes
0answers
24 views

How can I ask for reward after mining? [duplicate]

Let's assume that I found the nonce for the block the world try to mine now. How can I say in python that this is the nonce and this is my wallet address so transfer the reward to it?! Note: This ...
0
votes
0answers
14 views

How can I ask for prize after mining? [duplicate]

Let's assume that I found the nonce for the block the world try to mine now. How can I say in python that this is the nonce and this is my wallet address so transfer the reward to it?!
11
votes
4answers
16k views

A complete bitcoin implementation in Python?

I recently became aware that python-bitcoinlib is not a full bitcoin node implementation, but rather a set of tools to work with bitcoin-core cpp. I would like to know whether there are some ...
0
votes
1answer
32 views

bip39 converting from entropy to seed failing tests with entropy “00000000000000000000000000000000”

Trying to convert hexadecimal string of entropy to seed sentence with the below snippet. Failing the first test with 16 zero bytes. It seems that my function came to conclusion that checksum is '1011' ...
2
votes
3answers
4k 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
1answer
31 views

Why downloaded Block Size doesn't match with actual block size mentioned on network?

I am trying to download a block(Height:474044) using an API from here in python. Block is obviously downloaded in JSON format. But when I store it in a file on my system it shows very weird size ...
1
vote
4answers
2k 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?
0
votes
1answer
175 views

How to get uncompressed BTC address and private key from bit module for Python?

I am new in programming and BTC. I want to make some BTC address with private keys. Till now I learn that we have compressed and uncompressed private keys. But I get only compressed private keys and ...
0
votes
1answer
214 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
37 views

How to Construct a Ping Message

I am struggling greatly trying to figure out how to send a basic "PING" message, and receive back a "PONG" response. import random import hashlib import socket PEER_IP = "35.187.200.6" PEER_PORT = ...
0
votes
1answer
47 views

How to verify locking and unlocking scripts?

I've selected an arbitrary transaction id and retrieved its associated transaction details using the blockcypher explorer as follows: from blockcypher import get_transaction_details ...
0
votes
0answers
125 views

Issue generating private Key and segwit address with python

I used the following script to generate my private key and the corresponding segwit address. Then to test it, i sent funds to the address and imported the private key on blockchain wallet; RESULT: ...
2
votes
0answers
36 views

How to generate unspendable testnet bitcoin address with python?

I'm trying to generate a testnet address. However, I tried to write this python program (using help of various online code places), and I created this program. The program is designed to take a 20 ...
1
vote
1answer
163 views

Decoding hex scriptsig in Python

Running decodescript on d1a076722d11ddfd0fadb96d6d960b8b2ad6c6369570cd00df70a801a6be9e44 is returning: { "asm": "0 ...
1
vote
1answer
85 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 ...

1
2 3 4 5