shirriff / bitcoin-code

Python example code for "Bitcoins the hard way: Using the raw Bitcoin protocol"
144 stars 89 forks source link

Why "1976a914" in txnUtils.py? #6

Open streamofstars opened 1 year ago

streamofstars commented 1 year ago

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"

jdlcdl commented 1 year ago

What is this magic number? -> "1976a914"

I suspect that this is a snippet of bitcoin script. If that is the case, these bytes, would mean:

Later on the same line, "88ac" would be:

I use https://en.bitcoin.it/wiki/Script as a reference.


But that's not why I'm here.

I'm here to ask if you'd consider giving Polish translations another attempt, like you did in pr206, over at krux. I believe that krux has made progress with a few missing diacritic-symbols that were needed in the font set (to be merged once there are translations which use them). As well, I will go out of my way to help you, if you need it, so that you're using the very latest translatable message-ids. Tracking krux has just gotten easier because v23.09.0 was released just last week, so if you were to do what you did over the summer, everything would work now that selfcustody's repo is up-to-date.

I hope to hear from you soon. If not, have a great week.