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
2 votes
1 answer
47 views

Fail at coding my private to public key converter (Pyhon)

Fail at coding my private to public key converter script for Bitcoin (Secp256k1) Currently going through the book "Programming Bitcoin by Jimmy Song", got stuck on page 61 (Chapter 3), but ...
0 votes
1 answer
140 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
0 answers
13 views

i cant send funds with python bitcoinlib and my private key i cant find the error

I am trying to build a Bitcoin wallet that receives bitcoins and can transfer them to another wallet, I am using PYTHON. step 1 ( create private_key, public_key and public_ address ): from ...
0 votes
1 answer
48 views

Get bitcoin unconfirmed transactions real time

i'm new to bitcoin and was wondering, does anyone know how to get unconfirmed transactions with python? I've tried running my own node but my current hardware won't allow it. Is there a way to query ...
0 votes
1 answer
300 views

Struggling to Decode Raw Hex Data of a Block

I am trying to Decode the Raw hex data of a Coinbase Block to check my understanding of the DS but I am facing some difficulties in decoding marked by a ? below: Q1. Can someone please check the ...
0 votes
1 answer
202 views

Account Extended Public Key from mnemonic

tell me please, how we can receive Account Extended Public Key from mnemonic phrase via PHP or Python? Or possible in internet we have ready console scripts? I'm going to https://iancoleman.io/bip39/ ...
1 vote
0 answers
17 views

BlockCypher API signature bitcoin transaction Error

I'm trying to make a bitcoin transaction using the BlockCypher API and I'm getting an error when I try to sign the transaction. This function creates an unsigned transaction: def buildTransaction(...
0 votes
1 answer
561 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 ...
0 votes
0 answers
22 views

howto send bitcoin using python? I have my publickey and privatekey

I have a public key and a private key, how do I send funds to another wallet? I'm using PYTHON, I can't find information or examples on how to do it
0 votes
0 answers
21 views

Error creating transaction using Python bitcoinlib

I'm trying to create a transaction with the Bitcoinlib python library and I'm getting an error. I am trying to load an existing wallet using the private key and then send money from it to another ...
1 vote
1 answer
48 views

Generate Public Keys from Extended Public Key in python

I want to get a normal Public Key from an extended Public Key in Python. Actually I want to get the same result as here in the Extended Public Key Children section. I know I need this structure: ...
0 votes
1 answer
61 views

get extended public key from extended private key in python

Can anyone tell me how I can get the extended public key from an extended private key in python. I know that I need to get the public key from the private key and that the public key + chain key = ...
0 votes
1 answer
37 views

How to "Autoforward" incoming BTC using Electrum

We would like to generate multiple addresses in Electrum, receive BTC to these addresses on a daily basis and auto-forward them to another address automatically. So the flow would be this: BTC Sent ...
0 votes
0 answers
38 views

Python unable to install Bitcoinlib

I try install bitcoinlib python package and I get an error: Collecting bitcoinlib Using cached bitcoinlib-0.6.5-py3-none-any.whl (315 kB) Requirement already satisfied: numpy>=1.21.0 in ./venv/...
1 vote
2 answers
833 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
1 answer
5k 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 ...
0 votes
0 answers
8 views

Modifying Pygame Hitboxes with different object classes [migrated]

I'm trying to code a game through python using pygame. I have two types of graphics so far: 'grass' and 'objects'. In the grass objects, the hitbox for the character when the player is above should be ...
0 votes
1 answer
67 views

How do nodes fetch unconfirmed transactions?

I'm taking up a project to build a software in python to mine cryptocurrency (preferably bitcoin). I have an overview of the computation that needs to be done. I would like to know how nodes fetch ...
1 vote
1 answer
112 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 ...
1 vote
1 answer
231 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?
0 votes
0 answers
43 views

I can't find 3 words out of my 12 words recovery phrase that i saved. I hear i need to run a script I just need guidelines as a newbie on how to do it

So i can't find 3 words out of my 12 words recovery phrase that i saved. I just don't know how to go about the whole script thing. Really hoping someone could guide me step by step on it.
0 votes
2 answers
960 views

How to get correct address from BTC mnemonic phrase in Python

Faced a problem, I have a crypto wallet written in Python, there is a code that creates a wallet address from a mnemonic phrase (In this case, BTC address). But if I enter this mnemonic phrase into ...
0 votes
1 answer
80 views

Is there any web3.py equivalent for Bitcoin?

Is there a good python library to connect to my locally running bitcoin node and query it? Such as view data block by block, txs, network difficulty at the time of each block, and other parameters? ...
0 votes
1 answer
215 views

python - No module named 'bitcoin' on Ubuntu using WSL on Windows 10

Which version of python should I use? When running pip3 install python-bitcoinlib I get 'Requirement already satisfied'. I run on Ubuntu using WSL in Windows 10. I have this error: >>> from ...
0 votes
1 answer
1k views

How can I generate SegWit addresses from a mnemonic using python?

So, I have written a script that generates BIP39 mnemonics. I now want to generate N native SegWit public keys from this mnemonic. I have found this, but it generates legacy addresses. It uses the ...
0 votes
1 answer
155 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 ...
3 votes
2 answers
1k views

How to use python reference for encoding a bech32 address?

Could someone provide an example of how to use the python reference implementation for generating a bech32 address? For example, generating a mainnet bech32 address for this scriptPubKey: "...
1 vote
1 answer
61 views

Verifying the Pizza transaction in Python

A friend of mine and I are trying to learn how to read the bitcoin blockchain. We've gotten pretty much everything except the ECDSA verification that the coins spent actually belong to the person who ...
0 votes
0 answers
25 views

Generate list address bitcoin - python 3.9.6

i try to generate list address bitcoin by code below but not worked, please help. Thanks low = 0x2C45E9017ED4 #2^250 high = 0x2C45E9017fff #2^251 def prv(): while True: ran = (low,high,1) def ...
2 votes
1 answer
879 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 ...
0 votes
0 answers
35 views

how to get every inputs signature from a raw hex bitcoin transaction using python? [duplicate]

I have this raw transaction : ...
0 votes
1 answer
2k views

How to generate Hash160 from a private key with the Bitcoin module

I want to fix the script code. The script generates from a random private key Bitcoin Address by function (pubtoaddr) and works on the Bitcoin module: https://github.com/primal100/pybitcointools/blob/...
0 votes
1 answer
250 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
1 answer
319 views

Python library for Multisignature HD wallets

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

SPV client TCP connection in python

I am trying to implement an SPV client in python (for my own learning). I want to start by making a simple TCP connection to a full node, but I either cannot get a response to my version message, or ...
0 votes
0 answers
51 views

Create transaction without importing wallet using python bitcoinlib

I am trying to find a way to send bitcoins from one address to another, having only private key, without importing any wallets, just simply get txins, create a transaction and send it to some address. ...
3 votes
0 answers
42 views

Problems with multiple wallets on RPC in bitcoin-core

I have been playing around a bit with Bitcoin Core (version 23.0), more specifically connecting to different wallets in Bitcoin Core through RPC in Python. I have found this library and tried to ...
1 vote
0 answers
42 views

Bitcoin listreceivedbyaddress as REST API

I am currently looking for a REST API service which will allow me to implement a super simple deposit system. Currently I am generating bitcoin addresses (mainnet + testnet) via Python. In addition to ...
2 votes
0 answers
82 views

Parsing bitcoin blockchain, get input (vin)

I downloaded the bitcoin blockchain. I have a full node and I would like to do some parsing. I use RPC to send commands to bitcoin core from my Python program. When I get a block it works fine but the ...
0 votes
3 answers
230 views

Lost 3 words out of 12, and not sure of order, mnemonic seed

I lost 3 words out 12 and not sure of the order of the rest besides the first 3, and the last one. I wrote a Python script with mnemonic and the crypto.com wallet library, it works, to my knowledge ...
3 votes
2 answers
2k views

How do i properly encode and decode base58 in python?

I was following the tutorial here : https://hackernoon.com/how-to-generate-bitcoin-addresses-technical-address-generation-explanation-rus3z9e i imported base58 to my python project : import base58 I ...
0 votes
1 answer
318 views

How can I pull the "Candles" argument from the Huobi websocket data?

I've a problem with Huobi Websocket, I know my ways in REST API but new to asyncio and websockets, and Huobi only gives resonable amount of history through websocket request so I'm stuck with it. I'm ...
-1 votes
1 answer
107 views

entropy to mnemonic converter

how to make an entropy to mnemonic converter to read a file with an array line by line in python or javascript there var bip39 = require('bip39') var mnemonic = bip39.entropyToMnemonic('...
3 votes
1 answer
176 views

How to verify a lnurl-auth callback with python

I want to create a Python implementation of an lnurl-auth server. I started a quick HTTP server to be the callback url, and captured the signed callback sent by BLW on Android. ?tag=login &k1=...
0 votes
1 answer
164 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
1 answer
384 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": "...
1 vote
1 answer
45 views

Standard library for schnorr signature algorithm

I am trying to create a blockchain demonstration to get used to the technology. The thing is: I want to use Schnorr signatures, but I can't seem to find a library for that, and I want to make sure ...
0 votes
1 answer
928 views

What is the fastest way to check balance of multiple BTC address in python

I want to check multiple bitcoin addresses balance in python, can someone suggest a script that can do it fast and without getting api error.
1 vote
2 answers
64 views

How to calculate the version (eg. in Python)?

I'm working through this medium post that describes all header fields of a block. The explanation of the version field is a little unclear for me. For starters I'm trying to consider version = 1, as ...
1 vote
2 answers
333 views

Why do I have a socket.timeout with python-bitcoinlib?

I am using a small script and get a timeout from python. This is my script: import bitcoin import bitcoin.rpc from bitcoin.rpc import RawProxy p = RawProxy() hash = '...

1
2 3 4 5 6