Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How is a bitcoin transaction serialised so that it is ready for signing?
by
BrewMaster
on 07/10/2018, 16:44:44 UTC
⭐ Merited by ETFbitcoin (1)
Why does the hex transaction need to be decoded?

wouldnt the whole process work just as fine as
Code:
tx_hash = double_sha256(HEX_TRANSACTION)
. Whats the reasoning for adding this extra step?

you have to go look at what "double_sha256" method is doing under the hood. that function only understands an array of bytes. it can not understand a "string" which happens to be a hexadecimal one in this case. so you first "translate" it by calling "decode"