1
I want to create a raw transaction with python and i found the script Makes a transaction from the inputsoutputs is a list of [redemptionSatoshis, outputScript]
def makeRawTransaction(outputTransactionHash, sourceIndex, scriptSig, outputs):
def makeOutput(data):redemptionSatoshis, outputScript = datareturn (struct.pack("<Q", redemptionSatoshis).encode('hex') +'%02x' % len(outputScript.decode('hex')) + outputScript)
formattedOutputs = ''.join(map(makeOutput, outputs))
return ( "01000000" + "01" + outputTransactionHash.decode('hex')[::-1].encode('hex') +
outputTransactionHash struct.pack('<L', sourceIndex).encode('hex') + '%02x' %
len(scriptSig.decode('hex')) + scriptSig + "ffffffff" + "%02x" % len(outputs) +formattedOutputs + "00000000")
1
welcome to bitcoin.SE! Your post is a bit unformatted, as such it is not really clear, what you are asking. Anyhow, the way to create a tx is well described by amaclin's answer here: https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required?rq=1 - hope this helps.
– pebwindkraft – 2018-02-25T19:52:45.617@pebwindkraft hope it's clear now! – Adam – 2018-02-26T02:58:56.827
Yup, one day I will learn as well, how to edit/correct the layout :-) – pebwindkraft – 2018-02-26T20:45:35.727
Even with the edits, I don't understand what the question is. – Mine – 2018-03-02T17:13:26.773