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
2answers
74 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
25 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
votes
0answers
12 views

Ripple get_payments does not work for all currencies

Get_payments API call https://xrpl.org/data-api-v2-tool.html#get-payments says that if the currency field is left blank, up to 1000 payments of that day will be returned. However, the API returns 404 ...
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
35 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
58 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
1answer
33 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
0answers
18 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
45 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 ...
1
vote
2answers
40 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
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?!
0
votes
1answer
30 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' ...
0
votes
1answer
30 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 ...
0
votes
1answer
140 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
36 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
35 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
98 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
35 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
120 views

Decoding hex scriptsig in Python

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

How to create a Bitcoin Transaction With Protocoin

Please how do I create a btc transaction and broadcast it with protocoin library? I want to create a transaction that will relay to the node without validating inputs and outputs. Of course I know the ...
2
votes
1answer
77 views

How to Pay to Multisig Wallet Using python-bitcoinrpc?

How do I pay to a multisig wallet? I am using the Python API (based on python-bitcoinrpc) that ships with the bitcoin source code, in directory bitcoin/test/functional. I'm using regtest. I call ...
1
vote
1answer
71 views

In Python RPC Calls, How is vout Address Derived for P2PK transaction?

How is the vout address derived for a P2PK transaction? I am using the Python API that ships with the bitcoin source code, in directory bitcoin/test/functional. I'm using regtest. I have written a ...
2
votes
1answer
132 views

How do I sign a transaction in Python?

How do I sign a P2SH transaction in Python? I am using the Python API that ships with the bitcoin source code, in directory bitcoin/test/functional. I'm using regtest. Here is a fragment of my unit ...
2
votes
1answer
68 views

Python implementation for LND path finding algorithm

The most common Lightning nodes use GO, C or Scala for their implementation. Is there any publicly available Python implementation for the path finding algorithm any of the most known clients use (LND,...
0
votes
1answer
56 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 ...
2
votes
2answers
97 views

How can I interact with Eclair from Python?

I want to write some scripts for experiments with Lightning. Python is the language I'm most comfortable with. From the three major implementations, LND has python-grpc and c-lightning has pylightning,...
0
votes
1answer
45 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
102 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
0answers
15 views

Resource pool and bitcoin rpc (python)

Is it safe to use a resource pool (e.g. https://github.com/Bogdanp/resource_pool/blob/master/resource_pool.py) for: rpc_connection = AuthServiceProxy("http://%s:%s@%s:%s"%(user, password...)) What ...
0
votes
1answer
169 views

Strange re-connection problem with python-bitcoinrpc

I am using https://github.com/jgarzik/python-bitcoinrpc to access the bitcoin core rpc. I have found a very strange re-connection problem. from bitcoinrpc.authproxy import AuthServiceProxy, ...
0
votes
1answer
36 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
253 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
271 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
0answers
131 views

submitblock to btc-core fails to decode

I'm trying to create a little mining-script that connects over rpc to bitcoin core. I have problems following the documentation and all attempts to create a valid block (with dummy-nonce for testing) ...
0
votes
1answer
29 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
2answers
154 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
0answers
22 views

Blockchain.info block explorer help

Using the python blockchain.info client When I attempt to get blocks and print the result I get this output: <blockchain.blockexplorer.SimpleBlock object at 0x103c6b208> How can I access the ...
1
vote
1answer
217 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 ...
0
votes
1answer
65 views

Read an XPUB list of transactions to Python using my own node [closed]

Anyone familiar with a Python library that can get a list of all transactions under an XPUB but by connecting to a Bitcoin node through RPC?
2
votes
1answer
84 views

How to parse values in block index leveldb?

So I'm trying to read the block files with Python. From this link, What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?, it tells you how to access the files with ...
0
votes
1answer
50 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 ...
0
votes
1answer
157 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) ...
0
votes
1answer
115 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: ...
1
vote
2answers
45 views

Why getinfo() and listchannels() inactive channel count differs?

I have strange results comparing node information outputs between getinfo() and listchannels() calls. Maybe someone has thoughts what is wrong (with my trivial code or with c-lightning itself): chans ...
0
votes
2answers
104 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
253 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
63 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
240 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...

1
2 3 4 5