0

Bitcoin enthusiast here. Learning "the hard way" how bitcoin works (andreas books, looking in js/python implementations), I'm writing (as an hobby) some code here and there to understand things and to test it, I'm using the tests available on the bitcoin github repo. But now, I'm struggling with the ones on the sighash.json file.

What is the encoding format used for the raw transactions ? (first element on each array).

I understand the traditional format which looks like 0100000000010280e688...000ffffffffe9b54...39da98ac00000000. But here I'm honestly lost. On the tests file, it doesn't look like a regular transaction.

Example:

907c2bc503ade11cc3b04eb2918b6f547b0630ab569273824748c87ea14b0696526c66ba74020000004ab65ababfd1f9bdd4ef073c7afc4ae00da8a66f429c917a0081ad1e1dabce28d373eab81d8628de802000000096aab5253ab52000052ad042b5f25efb33beec9f3364e8a9139e8439d9d7e26529c3c30b6c3fd89f8684cfd68ea0200000009ab53526500636a52ab599ac2fe02a526ed040000000008535300516352515164370e010000000003006300ab2ec229

How am I supposed to decode such string ?

Thanks.

1 Answer 1

1

You decode them in exactly the same way that you decode a transaction. They are perfectly valid transactions and a decoder should be able to decode them properly and get meaningful data out of them. The reason they look weird is because every part of the transaction is randomly generated so the fields do not necessarily contain data that you expect (e.g. the version number is randomly generated instead of the standard 01000000 or 02000000).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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