Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
23
votes
1answer
5k views

How is the whitepaper decoded from the blockchain (Tx with ~1000x m of n multisig outputs)

The whitepaper is apparently encoded at 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713, which is an m of n multisig Tx with 947 outputs (just under the scriptsig limit of 20kB!). ...
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 ...
7
votes
3answers
11k views

Is it possible to create a transaction in pure python without needing to run bitcoin locally?

Lets say I have a bitcoin address that has 10 BTC sent to it. I also have the private key for this address Using Python (2 or 3) is there a way to create a signed transaction (which I believe is a ...
7
votes
3answers
4k views

How can I test if a bitcoin address is compressed or not?

I have two bitcoin addresses: 1D8VSXHFAWNhAbruwUMbNp4hsXAnRNkYvX 12T15tvMGaymMX97X9KxVzyLF323r8v6Hg One is compressed, one is not. How can I test which is which? (Preferably using python 2.7) ...
6
votes
4answers
4k views

Is there bitcoin implementation in python or C#?

I want to play with the implementation to better understand the inner workings of Bitcoin. I'm familiar mostly with python and C# and found no clients in either of the languages. My C skills are rusty ...
6
votes
1answer
709 views

Does bitcoind accept batch RPC calls?

Am currently sending RPC calls to bitcoind in Python3 in series using JSON: import json, requests def pull(command, foo): headers = {'content-type': 'application/json'} payload = json.dumps({...
6
votes
1answer
3k views

Recovering a HD wallet from a partial seed phrase

I am attempting to help recover a wallet where the owner only wrote down 11 of the 12 words in the seed phrase. Initially, I thought the task would be a quick and well-defined, but it appears to be a ...
5
votes
2answers
1k views

Why is Python popular in Bitcoin projects?

When checking out open source projects related to Bitcoin, I see that many are written in, or make a large use of, Python language. I mostly use Ruby and have little experience in Python; so, I would ...
5
votes
2answers
672 views

The complement of s (when s < curve order / 2)

Bitcoinlib refers to the requirement that if s > ORDER / 2, then the complement of s should be used instead since it's one byte shorter This sounds like it's referring to the inverse or negative s ...
5
votes
2answers
2k views

bitcoin.rpc python library problem

I am working through Master Bitcoin. I got the bitcoin client up and running. I am now trying to access the client from python. In the example, there is a line that says from bitcoin.rpc import ...
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.
5
votes
3answers
2k views

Starting point for listening to bitcoin network transactions in Python

I would like to create a python script that listens to the bitcoin network and monitors some addresses, stored in a mysql db. As soon as a transaction is broadcast with one of these addresses as an ...
5
votes
1answer
168 views

What is better, pre-existing Bitcoin-core API bindings for python or custom wrapper functions

How advisable is using the following code to query the bitcoin core as compared to using some python RPC library. import os btc_prefix = 'bitcoin-cli ' def getblockcount(btc_prefix): print("in ...
5
votes
1answer
1k views

Best Python API for sending Bitcoins from a Multi-Sig wallet

I want to create a multi-sig wallet which I can broadcast transactions through an API. I would like a wallet with a permanent public address not one that changes every time I run the code. I was going ...
4
votes
4answers
5k views

Algorithmic trading python library?

I am starting to do Algorithmic trading in cryptocurrencies using Python libraries. Most exchanges have RESTful APIs that make it easy to write you own code and get started. However, I would like to ...
4
votes
1answer
4k views

Signing a raw transaction with Python ECDSA (or OpenSSL)

I'm looking for specifics of Step15-17 from Redeeming a raw Tx Step By Step, which is essentially the step where the concatenated raw Tx structure is double sha256 hashed, and then signed with an ...
4
votes
2answers
3k views

How can I run an Electrum console command from outside Electrum (in Linux)?

I want to use my electrum wallet balance in my another python application. How do I make a call to the getbalance() function?
4
votes
2answers
7k views

How to access market price from Python?

I am struggling to get access to the kind of information I have on cryptowat.ch. For example on Kraken there is an API, but I didn't find how to get the past history, the volume information, etc. Is ...
4
votes
1answer
3k views

Are there any blockchain inspection tools/libraries?

I am going to write software that gets information from the blockchain directly. Are there any tools or libraries to speed up that process? I am looking for things like decoding and encoding ...
4
votes
2answers
1k views

Mining Block header bit reversing

While trying to understand the mining process and checking in python..... i am puzzled with which info from/to pool are in Little Endian, which one needs reversing in building the block header + ...
4
votes
1answer
1k views

Making peer connection in Python

I'm trying to make a simple peer connection using Python. If I understand correctly communication begins by sending a "version" packet to the receiving node. The node then sends back a "verack" ...
4
votes
1answer
642 views

Clarification of BIP32 hierarchical deterministic multisig scripts

As everyone is aware, I'm a huge proponent of Vitalik Buterin's pybitcointools Python 2.7/3.x library. I am having a some trouble understanding the BIP32 concepts, which are coded in the deterministic/...
3
votes
1answer
2k views

How do I convert Public Key x value to y in Python and verify?

I have been using the BTC Address utility which enables me to type in something like: 020F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9 Then clicking a button the program can spit ...
3
votes
1answer
357 views

How does bitcoin functional test framework work?

Could someone explain how and where in the code the bitcoin test framework calls map to C++ bitcoin core code or RPC calls such that regression suite tests the bitcoin core functionality? Background ...
3
votes
2answers
2k views

When are multiple transactions spending the same output in the same block considered a double spend?

Here is an example of multiple transactions in the same block, all spending from the same output. I created these using the Electrum wallet, telling Electrum to spend a little bit of the BTC from the ...
3
votes
1answer
698 views

Chainstate LevelDB corruption after reading from the database

I've been working with the LevelDB for a few weeks, coding some tools to access the database and parse the data to be human readable. However, every single time I read from the chainstate the data ...
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 ...
3
votes
1answer
418 views

Coin selection algorithm in Python to optimally select UTXO

Does anyone know of a good coin selection algorithm in Python that's perhaps similar to the one in Bitcoin Core (currently this: github/bitcoin/src/wallet.cpp (per guidance from stackexchange/1077))? ...
3
votes
1answer
630 views

Best method for getting bulk address information (total sent, received, and final balance)

I need to go through a large list (about 100 000) of bitcoin addresses, and, if they have a final balance, find that as well as the total sent and recieved. I am working in python, and I have looked ...
3
votes
1answer
1k views

bitcoind JSON-RPC interface timeouts under unit tests

I am running unit tests against bitcoind which do JSON-RPC requests in high rate. Random failures are an issue. E.g. if you have something like this in printconsole logs: ThreadRPCServer method=...
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 ?
3
votes
1answer
327 views

Why does getNewAddress take so long? Often times out python-bitcoinrpc

Bitcoin 0.11 on a Raspberry Pi 2: https://github.com/jgarzik/python-bitcoinrpc I am using this RPC auth proxy to talk to bitcoind from Python. I have a script that requests getmempoolinfo every 1 ...
2
votes
4answers
2k views

pycoin command line transaction

Is there a quick way to do transactions knowing only the private key(secret exponent) and the destination address, preferably from a command line utility such as pycoin? I am using Debian/Ubuntu and ...
2
votes
2answers
6k views

Convert WIF to private key

I am aware how to convert the private key into WIF format in python, now I am trying to reverse this process and convert a WIF formatted private key back into a 256-bit private key, following this ...
2
votes
2answers
2k views

How does the bip32 version bytes convert to base58?

Converting the BIP32 version bytes - x04\x88\xad\xe4 - from base256 to base58 and base58Check returns 7irrX and 1kz713TZjju, respectively. I thought the version bytes represented xprv. What am I ...
2
votes
1answer
130 views

Extract lightning network funding transactions with python bitcoin blockchain parser lib

My ultimate goal is to parse funding transactions (as well as channel closes in a later step) from the blockchain. In order to do so I wanted to start with a funding transaction and disect it. ...
2
votes
1answer
2k views

How to convert a WIF private key to a BIP32 extended private key

I am trying to recover the extended BIP32 master private key from its extended BIP32 public key (which I already know) and a WIF private key (which I obtained by decrypting a BIP38 seed with a ...
2
votes
1answer
2k views

How to generate Bitcoin private - public keys with ECDSA module?

Pretty same question was asked here, but maybe there is a way to generate keys using ecdsa module in just a few lines of code?
2
votes
2answers
602 views

Type and Amount of Transaction in Blockchain API

I am building myself an alert program with which I want to send myself an alert via email if there are transactions ongoing at all (5) of my addresses. I have chosen the Blockchain API because I ...
2
votes
1answer
79 views

When I use the “send_many()” function in the blockchain.info api, have I to pay the fee only once or for each?

The blockchain.info api looks like this: The link is: https://github.com/blockchain/api-v1-client-python/blob/master/docs/wallet.md But when I give a fee like this: add={'address1':amount1,'...
2
votes
1answer
126 views

How to get the “BTC” abbreviation via command line?

I'm writing a module that connects to multiple wallets at once and I would like to have a way I can simply query the coin daemon for its coins abbreviation (not the "microcoins" as asked in a comment ...
2
votes
1answer
761 views

Constructing, signing, and pushing a Bitcoin transaction by using pybitcointools with Python

I'm utilizing the pybitcointools module in python 3.4 I've went through time and time again in the examples listed on the github page, but it isn't documented very well nor is the code. My situation ...
2
votes
1answer
2k views

Are there any Python modules that decode raw transaction data?

I'm currently doing RPC calls to bitcoin-cli within python to get raw block data: bitcoin-cli getblock BLOCKHASH False I've already written a function that cuts off the block header and splits the ...
2
votes
1answer
1k views

How can I check if a bip32 xpub key is valid using python?

I'm on the hunt for some python code that will tell me if a string is a valid bip32 xpub key but I'm having trouble finding any. I also would like to check if a string is a valid bitcoin address. ...
2
votes
1answer
63 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
31 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,...
2
votes
2answers
65 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,...
2
votes
1answer
2k views

How to generate mycelium addresses from the 12 words in python

I am trying to re-generate the receiving addresses (and change addresses, for that matter) my mycelium wallet has generated. So far I've used trezor's implementation of BIP39 to generate the entropy ...
2
votes
2answers
4k views

How to produce a Hash160 bitcoin address?

tl;dr How should one perform Hash160, using most basic tools? ==================================================== Hi, I'm trying to figure out, how transactions work in bitcoin. When I choose ...
2
votes
2answers
426 views

Unable to send 'version' message correctly

Few days ago I've found this article about using raw Bitcoin protocol and now I'm trying to make my own transaction with Python. But I'm already stuck on sending version message. I've tried to use ...