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 :
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