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
67 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 ...
1
vote
1answer
31 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 ...
2
votes
2answers
62 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,...
1
vote
1answer
46 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 ...
0
votes
1answer
55 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
1answer
48 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 ...
0
votes
2answers
91 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 ...
2
votes
1answer
29 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
67 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
179 views

Python library for Multisignature HD wallets

Is there is any python library is available that allow creation of Multisignature HD wallets ?
0
votes
5answers
1k 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
29 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 ...
1
vote
1answer
291 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
38 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
120 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
137 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
97 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
1k views

Get Bitcoin Wallet balance with Python

On a tutorial in Youtube it uses pybitcointools. Upon searching it's github repository, I have found that it was not maintained anymore. Are there any alternative to this library which can get wallet ...
0
votes
1answer
23 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
11 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
248 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
50 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, ...
3
votes
1answer
74 views

What is “Rate” on crypto exchange?

I use bittrex api and python for trading. I am interesting about lowest Ask and highest Bid prices on the pair. In this example: I want to sell XRP on 0.00008215 price and on 0.00008245 What ...
0
votes
1answer
405 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
1answer
272 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 ...
2
votes
1answer
320 views

Python code to vb.net (2012) - help me to eliminate the errors

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
1answer
81 views

Is it possible to deploy a python script on Ethereum Virtual Network or NEO? [closed]

Is it possible to deploy a python script as a dApp on the Ethereum or NEO virtual network?
5
votes
1answer
7k views

Where can I learn how to build a blockchain from scratch? [closed]

I am a newby programmer, I am learning python and objective C and I want to learn how to build a blockchain from the beginning. Are there any resources that could help me.
0
votes
1answer
38 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
4k views

binascii.Error: Odd-length string for Python Implementation of Bitcoin

https://gist.github.com/vivosmith/f0e692d9aedbc39ec8d3eb4651bc107c I was trying to implement this video in Python 3 But the issue is that, it was implemented in Python 2 So I tried to implement ...
0
votes
1answer
21 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
31 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
68 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
50 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
84 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
27 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
0answers
20 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
58 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
38 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
28 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
0answers
72 views

How can I generate a bitcoin address offline in Python?

I am new to python and bitcoin so please bear with my question. I want to integrate bitcoin as a payment method in my platform, I want to use 3rd party api service for sending transactions to block-...
1
vote
2answers
36 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 ...
1
vote
1answer
44 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
1answer
329 views

Altcoin - genesis block - TypeError: __init__() takes exactly 2 arguments (3 given)

I'm trying to use the genesis script from innova to generate a genesis block of Xevan_hash https://github.com/innovacoin/GenesisH0/blob/master/genesis.py I'm using these parameters: python genesis....
1
vote
0answers
127 views

How to sign bitcoin raw transactions with Python offline

I have a raw bitcoin transaction created using createrawtransaction unsigned_tx = "...
0
votes
1answer
54 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 ...
0
votes
0answers
75 views

Bitcoin walletnotify doesn't pass the txid as %s

Thoroughly searched this online but haven't found an answer yet. Basically I'm using the below line in my conf file: walletnotify=C:\pathname\filename.py %s It is supposed to run my python file ...
1
vote
3answers
2k 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 ...
10
votes
4answers
15k 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 ...