I've tried to find an answer here and on BTT but without luck so far.
I'm having issues creating a transaction to spend from a P2WSH
address which I created and sent funds to.
I based my code off of this example: https://github.com/petertodd/python-bitcoinlib/blob/master/examples/spend-p2wsh-txout.py
My code can be found here: https://gist.github.com/i0x0ff/b29b2307b4e9ce316a4d6533464cf7a1
P2WSH address with funds: tb1qhxy36055wje22qkxn4mtjl4k9vykcnq7avgtu3smnw6xpdxmw0qqjvywtn
I want to send funds to: tb1qffmyyg5v9atg3zzvlafzzu22ht6cexj7xt8sx4yl0f6c3zktzqrq8hempj
When broadcasting the transaction I get the following error:
{
"code": -26,
"message": "non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)",
}
One thing to note is that, I'm making this transaction on SIGNET and I've modified the code in the python-bitcoinlib to support SIGNET. I intend to make a PR for after I figure out this problem.
If there's any more information that I can provide in order to make it easier for anyone to help out, let me know what else would be useful. I'm just starting out with development on Bitcoin and will also document my process, finding and learnings.
0100000000010179ebc0d716496a2803828657074196c073bf9be23a43604530deec6a7f6ef6660100000000ffffffff011c250000000000002200204a7642228c2f5688884cff5221714abaf58c9a5e32cf03549f7a75888acb10060247304402203fb1c7b9d5c93716968ef7e010923f123b816a6ff255ff401b3dbf090c69f430022044509913f254e107d32696cd930c6ff6a4968fc84ed7417cb80f100c9562bcc5012321029bed8c78bc0f557742303db2fb3c48e8b5025cf11cdf1cdea764805f234a443cac00000000
I'm broadcasting using: explorer.bc-2.jp/tx/pushOP_CheckSig
is executed it pushesfalse
to the stack that is probably why you get that error message.