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.



How am I supposed to decode such string ?


1 Answer 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 you have read our privacy policy.

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