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
2answers
341 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
57 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.
1
vote
3answers
52 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 ...
0
votes
1answer
227 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
265 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
158 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
0answers
19 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?
0
votes
1answer
20 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 ...
1
vote
1answer
52 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 ...
2
votes
2answers
156 views

Why are the limitations between educationnal 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 oftens gives warning about the fact it is of "...
0
votes
1answer
554 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
202 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 ...
3
votes
1answer
89 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
1answer
140 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
346 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
2answers
63 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 ...
0
votes
1answer
125 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
136 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
1answer
44 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/ ...
0
votes
1answer
524 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
0answers
77 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 ...
2
votes
1answer
94 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 ...
1
vote
2answers
716 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 ...
1
vote
1answer
123 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 "...
0
votes
1answer
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 ...
1
vote
2answers
259 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) ...
0
votes
1answer
293 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
1answer
115 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
0answers
49 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 ...
0
votes
0answers
24 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
0
votes
1answer
808 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
2answers
352 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
1answer
128 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
1answer
1k 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/...
4
votes
1answer
163 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 ...
1
vote
1answer
155 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 ...
0
votes
0answers
29 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 ...
1
vote
2answers
489 views

Is there any python library could be used to decodescript in output

For example decode the ScriptPubKey like 4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac to some data like ...
0
votes
0answers
125 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 ...
0
votes
3answers
236 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 ...
1
vote
1answer
295 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 ?
0
votes
0answers
147 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, ...
1
vote
1answer
144 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 ...
2
votes
1answer
1k views

How can I sign transaction hex with Python library

I have a unsigned transaction hex. Now I want to sign this transaction input with my private key in Python. Are there any Python libraries? Transaction Hex ...
0
votes
1answer
102 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.
0
votes
0answers
35 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 ...
0
votes
1answer
71 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 ...
1
vote
0answers
38 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 ...
2
votes
2answers
93 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 ...

1
2 3 4 5 6