Hi, I’m hoyoung.
Our team make kasse(Hardware Wallet) in Hyundai-Pay.
We dicide to add btg in Kasse.
So while developing btg wallet, we faced last problem.
Our rawTransaction signature made this error.
Erroe code 16 : mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation):Code : 26
We did not find right signature.
We want to know rawTransaction hexcode logic before sign.
Before sign, I made this transaction just like this
Except SIGHASH value, what value must I change?
Thanks for coming here, @ho-young. This is beyond my technical depth, but I’ve tagged our developers in other channels; I expect someone will be able to spare some time to look at this soon.
Hey, looks like you are using a wrong sighash format. You have followed the regular Bitcoin signature hash format. However, as a part of our replay protection, we have adopted a new format, BIP143, for all the BTG transactions after the fork.
BIP143 is used by Bitcoin SegWit transactions and also all the transactions in Bitcoin Cash. BIP143 make it much more hardware wallet friendly.
Here you can find the exact code to serialize a transaction. Please be aware that the amount of the vin is also hashed. This solved the quadratic hash problem.
Please don’t hesitate to ask me if you need more assistance.
Hi~
As I saw btg rawtransaction in https://btgexp.com, vin amount did not show in rawtransactions.
So I did not try in bitcoincash style(include vin amount).
My thought is wrong.
I thought btg is mixed style bitcoin & bitcoincash format.