6
votes
Accepted
python-bitcoinlib | Create Private Keys, Public Keys and Addresses - How to Do It?
Sorry I am not familiar with python-bitcoinlib but if your goal is to just create keys/addresses you can use this library (disclosure: I wrote it) the following way:
Generating a private key
...
4
votes
Accepted
How can I sign transaction hex with Python library
There is pybitcointools, which allows you to do just that using the sign(tx, index, priv) function.
There are others but I at least found this one the easiest to work with.
EDIT: You have many ...
3
votes
python-bitcoinlib | Create Private Keys, Public Keys and Addresses - How to Do It?
Some usage examples are now available in the repository.
This example demonstrates how to generate a key pair, and create a transaction paying to the public key hash (P2WPKH).
There is also the ...
3
votes
Accepted
Should an offline address generated from private key send funds to wallet?
From what I understand, that address is created from my private key, so shouldn't the funds I send to it go straight back to my wallet?
Unless you told your wallet to expect transactions sent to that ...
2
votes
Accepted
Keep getting wrong bitcoin addresses
Some key points here:
The private key cannot reach 2**256 because you must respect the order of the curve, which is n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141. Set the ...
2
votes
Why do I have a socket.timeout with python-bitcoinlib?
Change the timeout inside the file bitcoin.conf or when you start the bitcoind,
This is an example
##
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
# On client-side, ...
2
votes
Accepted
How to get scriptPubKey from public key hash
Clarification on what is the difference between these things: public key hash, scriptPubKey, addresses.
Public key hash represents, as it name says, the hash of the public key. So you take the public ...
1
vote
I am trying to convert the 12 words into BTC addresses, but they do not match
For P2PKH, you've hashed the private key rather than the public key.
For P2SH, you've hashed the public key and used the P2SH version number, however that is not what a P2SH address should be. Rather ...
1
vote
Recreate Java code in python
I have a java code that I need to pass to python
Unless the same library has been ported to both languages, there will probably be no direct equivalent.
Instead it will probably be best to describe ...
1
vote
Accepted
Invalid transaction. Error: TX decode failed. Make sure the tx has at least one input
I figured it out, I simply was missing a step. I wasn't signing my transaction before sending.
>>> t.sign('my_private_key')
>>> res = srv.sendrawtransaction(t.raw_hex())
>>> ...
1
vote
Accepted
Does python-bitcoinlib and the Bitcoin Core functional test framework share code? Were changes ever pushed down/upstream?
script.py of the Bitcoin Core functional test framework contains a comment that it was initially modified from python-bitcoinlib.
There doesn't appear to have been any code sharing beyond that and ...
1
vote
What is the Best Way to Learn python-bitcoinlib?
Official documentations provides several examples.
https://github.com/petertodd/python-bitcoinlib/tree/master/examples
project1 of Stanford cs251 guide you through P2PKH, atomic swap, etc.
https://...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python-bitcoinlib × 28python × 20
bitcoin-core × 6
transactions × 5
private-key × 3
segregated-witness × 2
signature × 2
raw-transaction × 2
address-generation × 2
p2sh × 2
blockcypher × 2
blockchain × 1
json-rpc × 1
bitcoin-core-development × 1
hash × 1
public-key × 1
bitcoin-cli × 1
utxo × 1
mnemonic-seed × 1
ecdsa × 1
change × 1
raw-data × 1
javascript × 1
op-return × 1
locktime × 1