I am trying to recreate this complex transaction in my own project, but it seems my scriptSigs are off. My guess is that I am assembling the rawTX incorrectly, and my best explanation would probably come from my log:

I’m having some weird issues with the signature sometimes it works and other times it doesn’t. When I see ‘[ALL]’ in scriptSig that’s when I know it’s going to work. But I don’t always get it. Any help would be great and if I find a fix, I’ll send a pull request.

Here is a transaction that works: 0100000001dc4c6936943c073fca8164d8d18fdb6095ce46baff328b7e7c1230d82aaad69b010000008a473044022033f80a4c35013d5aab9d4f2763b5761188747eebb67fe15b0379f0c09b37c811022019de06d98d37da77c84bfb6f89ff2194b46a135fe8aa9677b285123b73407341014104e7919ecea9c7e9378aec49a055c532f8e0f9aea653e7c9cbe38ad2d2833a9d908f4d7bf771583f9d1e62574c42847e1aa00d506a32b9004b9b2051e3e53e2767ffffffff02803e0000000000001976a914826d9548ee793a060990bc39a01eca5521841a0988ac0000000000000000226a202c624232cdd221771294dfbb310aca000a0df6ac8b66b696d90ef06fdefb64a300000000

And here is one that doesn’t: 0100000001dc4c6936943c073fca8164d8d18fdb6095ce46baff328b7e7c1230d82aaad69b010000008a4730440220da574cbdac23291faf41d5bd94ae77fe166ab7daebf1a038efa549e441af4dad02206803cadd187e6e4c80c30af06c5d7cfad327fd4d03850a539639e42dea44e8e0014104e7919ecea9c7e9378aec49a055c532f8e0f9aea653e7c9cbe38ad2d2833a9d908f4d7bf771583f9d1e62574c42847e1aa00d506a32b9004b9b2051e3e53e2767ffffffff02803e0000000000001976a914826d9548ee793a060990bc39a01eca5521841a0988ac0000000000000000226a203f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea00000000

So I found out how to mitigate, I just have to keep changing the hash until it works. The way I’m currently doing it is by decrementing my transaction fee by one satoshi at a time. Now I need to actually fix the code. 😀

Why would only certain hash values be OK to sign, but others not? I was thinking it could be a random low s issue where r is XORd if low s.

First time on stackexchange to ask for help, sorry if i make mistakes (english is not my native language).

I try to create a valid raw transaction on C# with bouncycastle and i seems stuck, not able to find where is my mistake. I test on the testnet network and have used many sources to help myself, mainly this one. For start, i have the next address and private key