Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

A general, high-level programming language with the philosophy of preffering readability and the easy development to the running speed.

Pybitcointools is a Python library for Bitcoin signatures an transactions.

340 questions
31
votes
3 answers

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!). Using the Blocktrail Python SDK, I get a list of the…
Wizard Of Ozzie
  • 5,268
  • 4
  • 30
  • 63
16
votes
4 answers

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 fundamental issues with implementing a complete bitcoin…
user2277550
  • 856
  • 2
  • 9
  • 19
9
votes
3 answers

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 long string of hex digits) that can then be sent to…
priestc
  • 301
  • 1
  • 2
  • 8
8
votes
1 answer

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({"method": command, "params": [foo], "jsonrpc":…
SLee
  • 133
  • 1
  • 7
8
votes
4 answers

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) Thanks in advance :)
derrend
  • 696
  • 5
  • 16
7
votes
2 answers

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, code-wise, with the library, for the…
7
votes
1 answer

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 and more details I am writing a blockchain…
7
votes
3 answers

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 Rawproxy. I get the error message no module named rpc.…
user2242044
  • 207
  • 2
  • 6
7
votes
4 answers

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 because I haven't done any C in last decade.
Moonwalker
  • 211
  • 2
  • 5
6
votes
2 answers

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 + hashing and which one not. ?? For example ... Let's…
Santan
  • 75
  • 4
6
votes
1 answer

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 getblockcount") cmd = ' '.join([btc_prefix,…
6
votes
1 answer

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 bit more complex than I assumed, and reference…
6
votes
3 answers

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 output, the script should run a function. I do not…
DDecoene
  • 299
  • 3
  • 6
5
votes
3 answers

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 from bip32utils import Base58 import os,…
5
votes
4 answers

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 guide:…
Fabulous Job
  • 81
  • 1
  • 1
  • 5
1
2 3
22 23