Ayms/bitcoin-transactions

check_p2sh_script code somewhat obfuscated.

9876691 opened this issue · 2 comments

Hi,

I've been reading through the code as I was trying to figure out how to do the FORK_ID implementation for Bitcoin Gold for another project.

I noticed your check_p2sh_script here https://github.com/Ayms/bitcoin-transactions/blob/master/tx.js#L786

Is this code compiled code from somewhere else? Basically when I format that code it's hard to read so I can't see exactly how the hash for each transaction input is created.

Thanks

Ayms commented

The code is from myself, it is obfuscated because unfortunately some people try to cheat with the dev fees, so sorry I can't provide it in clear

Now the implementation is not easy but not extremely difficult, you can adapt https://github.com/BTCGPU/BTCGPU/blob/master/src/script/interpreter.cpp#L1204-L1278 and follow BIP143

Thanks.