1

Embedded in this transaction, there is a blockchain file upload tool written in Python.

I'm trying to convert the hex of the output scripts to ASCII, so I can assemble it all into an actual runnable Python script. However doing a direct hex to ASCII conversion generates some unexpected characters.

For example, the third output script has the following hex:

51412c756e6865786c6966790a66726f6d20646563696d616c20696d706f727420446563696d616c0a0a6966206c656e287379732e6172677629203c20353a0a20202041207072696e74285c0a2222225c0a55736167653a202573203c66696c653e203c6465737420616464723e203c6465737420616d6f756e743e207b3c6665652d706541722d6b623e7d0a0a5365742042544352504355524c3d687474703a2f2f757365723a70617373406c6f63616c686f73743a706f72746e756d22222220252073797353ae

Using a hex to ASCII converter, it becomes this Python code:

QA,unhexlify
from decimal import Decimal

if len(sys.argv) < 5:
   A print(\
"""\
Usage: %s <file> <dest addr> <dest amount> {<fee-peAr-kb>}

Set BTCRPCURL=http://user:pass@localhost:portnum""" % sysS.

Why is the character A preceding print for no reason? As well as QA and S at the beginning and ends, respectively?

From what I've seen referenced on the Web, the third output script is meant to look like this:

,unhexlify
from decimal import Decimal

if len(sys.argv) < 5:
    print(\
"""\
Usage: %s <file> <dest addr> <dest amount> {<fee-per-kb>}
Set BTCRPCURL=http://user:pass@localhost:portnum""" % sys.

What am I missing here? I'm completely new to Bitcoin, so I'm guessing it's something obvious.

1

Apparently, the ASCII text is split between multiple TX output scripts, and each one is actually a multisig script with the data bytes inserted in place of the public keys.

The letters actually correspond to ASCII symbols which are the opcodes forming a multi signature script, see https://blockchain.info/tx/4b72a223007eab8a951d43edc171befeabc7b5dca4213770c88e09ba5b936e17 "Output Scripts".

Only the data between the opcodes should be treated as text if you want to decode it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.