I’m developping Bitcoin integration for Microsoft Dynamics Business Central to offer enterprise capability to apply Bitcoin receivable and payable to accounting.
To send a transaction, I’m using NBitcoin C# lib to prepare and sign raw transaction data before broadcasting but I keep having bellow error on Main Net.
It is the most basic transaction with one input and one output.
Both addresses are P2SH.
The transaction signature verification pass correctly in NBitcoin but the node keep returning the error “Code: -26, Error: non-mandatory-script-verify-flag (Witness requires empty scriptSig)”.
Raw Transaction Data :
01000000000101701c2bcfe6bc56becaf1c58a45f57de5558107a3f1fdd51bb4a0c1ce27dff30a0900000017160014e38512a037ee9199b5dd5e7af4b928453b523cc2ffffffff01701101000000000016001425ce1fbd74537b45319cb0553deec89f4289430102473044022012e3cee7d952acf046e3e282162d1cb4e6ff954a01b19fba8d3606b63256c9eb022079099799cb58d3b45ca85c678336c802889fe7d6c18012c5a1509d1b54441492012103220927928080eecf1af164e3413ed6733cfc27172174683aecb3bd2041d06a0000000000
When I decode the transaction I see the witness on input correctly and the output adress look fine too.
If I try to send the same transaction but using P2WPKH address I’m having a different error : ‘non-mandatory-script-verify-flag (Script failed an OP_EQUALVERIFY operation)”‘
Could someone know whats wrong in my transaction ? Anyhow I’m pretty sure I’m just not passing the right parameter to the library but idk wich