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
0 answers
15 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. ...
user avatar
  • 101
3 votes
0 answers
20 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 ...
user avatar
1 vote
0 answers
34 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 ...
user avatar
1 vote
0 answers
62 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 ...
user avatar
-1 votes
1 answer
59 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('...
user avatar
1 vote
1 answer
35 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 ...
user avatar
0 votes
1 answer
243 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.
user avatar
1 vote
2 answers
59 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 ...
user avatar
  • 113
1 vote
2 answers
99 views

Can't get the bip32masterkey from mnemonic seed (Python)

I'm trying to understandand implement the functioning of Hierarchical deterministic wallets. But I can't get the bip32masterkey based on this tutorial : https://medium.com/mycrypto/the-journey-from-...
user avatar
  • 11
3 votes
1 answer
86 views

What is the probability of an ECDSA signature being less than 71 bytes

Since DER requires R and s values being minimally encoded signed integers, they could be less than the expected 32 bytes. What is the probability that one or both of R and s are less than 32 bytes for ...
user avatar
  • 60.5k
0 votes
1 answer
51 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 ...
user avatar
1 vote
0 answers
148 views

Trying to get the Public key from Private key via secp256k1 [closed]

I have the private key in hex format like this: 9E524DE478970A9621C0E52890805D5F28E3620892BA6BFA701B026C6EE10A52 , now I am running the below python function to get the public key via ecdsa: def ...
user avatar
0 votes
0 answers
84 views

Using the Bitcoin python library to generate Private Key [Noob question]

I have done pip install bitcoin and then wrote the below code: from bitcoin import * private_key = random_key() print(private_key) Now I am getting this error: Traceback (most recent call last): ...
user avatar
1 vote
1 answer
54 views

BIP 32 CKDpriv not working in my python implementation

I have been working on implementing BIP 32 in Python. This is my code for deriving normal (not hardened) child keys as part of an HD_Key class: def CKDpriv(self, index): key = bytes.fromhex(self.c)...
user avatar
  • 13
0 votes
1 answer
67 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? ...
user avatar
  • 33
0 votes
3 answers
141 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 ...
user avatar
  • 1
0 votes
1 answer
181 views

How to calculate R, S, and Z from raw bitcoin transaction with witness?

How can I calculate the R, S, and Z values from a raw bitcoin transaction? I can extract them with rscan.py, but that doesn't work for new transactions.
user avatar
1 vote
3 answers
82 views

Trying to get all transactions between two specific dates

I am trying to make a python script for a research project that needs to get all the transactions that happened between point A and B in time, but I can't find any API, website or library where I can ...
user avatar
0 votes
0 answers
25 views

Are these equivalent: GetHash in src/primitives/transaction.cpp, and rehash in test/functional/test_framework/messages.py

Are these equivalent? rehash method of the Python Test Framework data structure CTransaction (link) GetHash method of CMutableTransaction (link, link) If not, is there an equivalent to rehash in Core?
user avatar
  • 1
0 votes
1 answer
28 views

Getting wrong version number of block from block index of Bitcoin Core

I am reading block index using plyvel python package. Following is the location of block indexes: export BLOCK_INDEX_DB=$BITCOIN_HOME/blocks/index Following is the method to decode b128 varint: def ...
user avatar
2 votes
3 answers
189 views

Why are there limitations between educational and real world usage?

This link looks very practical and "hands in the dirty". But in the example of Python code for node discovery and connections, it often gives warning about the fact it is of "...
user avatar
2 votes
1 answer
89 views

Having trouble creating a Python function that creates non-hardened HD wallet child keys

I am coding my own keys (not for use in production, strictly for learning). I am successfully creating 512 bit seeds from mnemonic phrases, however I am failing at the step of deriving child keys from ...
user avatar
  • 41
0 votes
2 answers
179 views

is there a way how to explore bitcoin blockchain

if I want to explore bitcoin blockchain for instance get address' information, transactions, and so on. what is the right place where I can grab this info. I tried https://blockchain.info but they ...
user avatar
0 votes
0 answers
156 views

Simple Python code miner which automatically mines and stops

I'm new at BTC mining and I'm still learning. I'm almost medium level in Python. I'm looking for a Python miner that automatically mines using the last block and stops when a new block is found and if ...
user avatar
  • 1
0 votes
1 answer
129 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/ ...
user avatar
0 votes
0 answers
70 views

What is the easyest python3 script to generate pubkey + addresses from 24 words + passphrase?

Coldcard can generate 24 words from dice, but then I still need to verify that applying my passphrase on top of the 24 words, give me the addresses that coldcard is showing me. What is the easyest ...
user avatar
0 votes
0 answers
45 views

Creating an OP_Return TX with Python bitcoinlib

How can I create an op_return TX with python bitcoinlib? The transaction should include the OP_RETURN HEX-Data and an address where I send my change money
user avatar
0 votes
2 answers
751 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 ...
user avatar
2 votes
2 answers
1k 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 ...
user avatar
1 vote
2 answers
565 views

Derive Segwit Addresses From xPub or zPub using PYTHON

Summary I'm pulling my hair out trying to understand a couple of concepts. I would like to use a Segwit wallet in my Ledger Nano S to derive unhardened(?) child public keys (and thus segwit addresses) ...
user avatar
  • 15
0 votes
1 answer
183 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 ...
user avatar
0 votes
0 answers
44 views

Blockchain Info BTC Hash-Rate API

I'd like to get the history of hash rate, Miners Revenue, Difficulty, Block Size of BTC (& other coins) since 2013 and preferably in different granularity (i.e., 1d, 1hr,...) with Python. I know ...
user avatar
0 votes
1 answer
235 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 ...
user avatar
  • 107
1 vote
1 answer
294 views

How can I retrieve all transactions for an address using the blockchain API?

Tell me how to interact with https://www.blockchain.com/. 1). I need to withdraw all transactions from the address, my code outputs transactions only for the last day? 2). How do I add additional ...
user avatar
  • 13
0 votes
0 answers
176 views

How do you Derive Addresses from a BIP49 Master Public Key using P2WPKH-P2SH?

I am trying to derive addresses from a master public key (aka extended public key) in python. I don't fully understand the math behind the key derivation, but have been able to decode the master ...
user avatar
  • 1
0 votes
3 answers
416 views

How to convert a single number into Private key in python

https://brainwalletx.github.io/#converter, 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf This private key is generated from 1 If i do this other way on this same site, It gives me different ...
user avatar
0 votes
0 answers
195 views

How to run simple python function on GPU using cuda and numba?

I have a simple code that I would like to run on GPU. I have seen many tutorial and it seems like I have to put @cuda.jit before my function to use it on gpu, but it is not working. For the moment, ...
user avatar
5 votes
1 answer
194 views

How can I access remote lightningd with pyln-client

I'm looking for a way to do python graph analytics on a local machine that can call a remote lightningd to get up to date nodes and edge data from the lightning node server. How do I need to configure ...
user avatar
  • 51
1 vote
1 answer
197 views

Get node 1 to mine another block, send it to node 2, and check that node 2 received it

I am trying to write a test with the bitcoin/test/functional/example_test.py to get node 1 to mine another block, send it to node 2, and check that node 2 received it. Any idea on how to go about/get ...
user avatar
0 votes
0 answers
31 views

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

I have this raw transaction : ...
user avatar
0 votes
1 answer
119 views

How many python bitcoin wallets are there? [closed]

Is there a list of legit Python Bitcoin wallets or even other cryptocurrencies? I did a Google search and got no clear results.
user avatar
  • 25
0 votes
0 answers
65 views

calculate transaction fee

I have been trying to write an application for transferring bitcoin programmatically using python and bit library. However, I'm currently stuck on how to calculate transaction fee. from bit import Key ...
user avatar
2 votes
1 answer
742 views

how to convert WIF key return to HEX format

any one knows how to convert WIF key return to hex format please also let me know if the private key is out side range of ecc then how to import it to some wallet ?
user avatar
2 votes
1 answer
109 views

Problem spending funds from P2WSH address: non-mandatory-script-verify-flag

I've tried to find an answer here and on BTT but without luck so far. I'm having issues creating a transaction to spend from a P2WSH address which I created and sent funds to. I based my code off of ...
user avatar
  • 21
1 vote
0 answers
45 views

Using RBF in python application

I'd like to create transactions within my python application, that support replace-by-fee RBF (BIP125). Apparently, if I want to be able to replace my transaction later on, I need to signal that ...
user avatar
2 votes
2 answers
105 views

The example signature in BIP143 doesn't validate?

In BIP143 the first example has a witness signature and it doesn't appear to validate/be correct?! I wrote a super simple python program to demonstrate import ecdsa import asn1 #Importing the 3 ...
user avatar
  • 412
1 vote
1 answer
76 views

Translate c++ function into python: sha256 hash mismatch [closed]

This is not related to bitcoin but it uses most of the bitcoin codebase. I would like to translate some c++ code into python but struggle really hard to get the hashes right. This is the function I ...
user avatar
  • 113
1 vote
1 answer
215 views

Python Code - import error : cannot import name "privtopub" from 'bitcoin'

Hello everyone when I start this code on PYCHARM looks like no problem. But when I turned this code from python to exe and exe don't start and it says: import error: cannot import name "...
user avatar
0 votes
0 answers
85 views

What's up with the block size of block# 295182?

I found an anomaly in the block size data: block 295182. This one seems to have a way higher payload. What happened there? Or is this there something wrong with my parsing? This file block does ...
user avatar
1 vote
0 answers
39 views

P2SH address as a product of public keys

Assuming the multisig 2 of 3, if I do have extended public keys (xpub) for all 3 cosigners (with proper derivations), can I somewhat get the result address (P2SH)? How to calculate the "script&...
user avatar
  • 1,564

1
2 3 4 5 6