shirriff / bitcoin-code Goto Github PK
View Code? Open in Web Editor NEWPython example code for "Bitcoins the hard way: Using the raw Bitcoin protocol"
Python example code for "Bitcoins the hard way: Using the raw Bitcoin protocol"
bitcoin-code/txnUtils.py has the following function defined:
# Substitutes the scriptPubKey into the transaction, appends SIGN_ALL to make the version
# of the transaction that can be signed
def getSignableTxn(parsed):
first, sig, pub, rest = parsed
inputAddr = utils.base58CheckDecode(keyUtils.pubKeyToAddr(pub))
return first + "1976a914" + inputAddr.encode('hex') + "88ac" + rest + "01000000"
What is this magic number? -> "1976a914"
the functions for WIF and private key are wrong or out-of-date,
they generate a WIF of length 51, but actually we use WIF of length 52.
for example:
5K7T2qR7K5MUMDmkJvCEPbUeALuPyc6LFEnBiwWLuKCEVdBp8qV length 51
L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ length 52
File "C:\Python27\xxx.py", line 3, in
import txnUtils
File "C:\Python27\xxx.py", line 9, in
import keyUtils
ImportError: No module named keyUtils
Where can I download these modules or libraries?
Hey, would it be possible to update this tutorial for compliance with the latest core client?
Please update your tutorial on righto website as well.
Thanks
A update for python3 would be nice
is the code still valid and maintained ?
i mean does it gives correct output of
keyUtils.privateKeyToWif
keyUtils.keyToAddr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.