The Torram relayer encountered an error while attempting to broadcast a transaction to the Bitcoin blockchain. The process failed with the error message: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation). This issue occurred after multiple broadcast attempts, leading to the release of the selected UTXO and a retry with backoff.
Environment
Torram Version: 1.0
Bitcoin Core Version: 28.1
Operating System: Ubuntu 22.04
Steps to Reproduce
Run the Torram relayer (version 1.0) on Ubuntu 22.04 with Bitcoin Core 28.1.
Send some btc to another generated address and back to first wallet in same wallet via bitcoin-cli
I sent from tb1qttqwfvf59jymapp0767p6yfjcf3xuzhezlnxgm to tb1qpuy3p8lexgl275ehrsestp3dc93javhn5p7r2u. And then back, from tb1qpuy3p8lexgl275ehrsestp3dc93javhn5p7r2u to tb1qttqwfvf59jymapp0767p6yfjcf3xuzhezlnxgm.
Expected Behavior
The transaction should be successfully signed and broadcast to the Bitcoin network, with the batch processing completing without errors.
Actual Behavior
The transaction signing process completes, but the broadcast fails with the following RPC error after multiple attempts:
"error": {"code": -26, "message": "mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"}
The relayer retries up to 3 times (with a max of 50 retries configured) before releasing the UTXO and entering a backoff period.
Logs
2025/03/25 10:51:14 Processing batch of 15 items
2025/03/25 10:51:14 Extracted height: 7457
2025/03/25 10:51:14 Calculated merkle root: 6073572bdba01c8bf0da3961a7c516cc58aa4e8c2c4c457ce4c2ce5733718dad
2025/03/25 10:51:14 DEBUG: Starting transaction submission process
2025/03/25 10:51:14 DEBUG: Using source address: tb1qttqwfvf59jymapp0767p6yfjcf3xuzhezlnxgm
2025/03/25 10:51:14 DEBUG: WIF pubkey hash: 5ac0e4b1342c89be842ff6bc1d1132c2626e0af9
2025/03/25 10:51:14 DEBUG: Found 1 UTXOs
2025/03/25 10:51:19 DEBUG: Considering UTXO ce22827e0ce7625f782ac8d779017a6f7a6cf971c1cd3d561307f23125e1bad7:1 with amount 0.001022 BTC, script: 00145ac0e4b1342c89be842ff6bc1d1132c2626e0af9, confirmations: 1
2025/03/25 10:51:19 DEBUG: Selected UTXO: ce22827e0ce7625f782ac8d779017a6f7a6cf971c1cd3d561307f23125e1bad7:1 with amount 0.001022 BTC
2025/03/25 10:51:19 DEBUG: Combined data length: 36
2025/03/25 10:51:19 DEBUG: UTXO uses SegWit (P2WPKH)
2025/03/25 10:51:19 DEBUG: Signed TX hex: 01000000000101d7bae12531f20713563dcdc171f96c7a6f7a0179d7c82a785f62e70c7e8222ce0100000000ffffffff020000000000000000266a24ad8d713357cec2e47c454c2c8c4eaa58cc16c5a76139daf08b1ca0db2b577360373435374f8b0100000000001600145ac0e4b1342c89be842ff6bc1d1132c2626e0af902473044022077ef5eae5d72564062f90a0098d98f957ba07517c2ea994d5f239b1fd662c12602200f70a683a1fe55045261def5e01c29c4ac6b037a2ed3f2125deb0867e8b148a601210209445384fb41c56ed137e96ca2a5305e5dceb2153c586deefe04b5a63a46ffc800000000
2025/03/25 10:51:19 DEBUG: RPC Response: {"result":null,"error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"},"id":1}
2025/03/25 10:51:19 DEBUG: Broadcast attempt 1 failed: RPC error: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
2025/03/25 10:51:21 DEBUG: RPC Response: {"result":null,"error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"},"id":1}
2025/03/25 10:51:21 DEBUG: Broadcast attempt 2 failed: RPC error: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
2025/03/25 10:51:25 DEBUG: RPC Response: {"result":null,"error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"},"id":1}
2025/03/25 10:51:25 DEBUG: Broadcast attempt 3 failed: RPC error: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)
2025/03/25 10:51:31 DEBUG: Released UTXO ce22827e0ce7625f782ac8d779017a6f7a6cf971c1cd3d561307f23125e1bad7:1 due to broadcast failure
2025-03-25T10:51:31.393821Z error Failed to process and submit batch {"error": "failed to submit to blockchain: failed to broadcast transaction: RPC error: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)", "attempt": 3, "max_retries": 50}
2025-03-25T10:51:31.393850Z info Retrying after backoff {"backoff_duration": 60, "attempt": 3}
Additional Context
The UTXO used is a SegWit P2WPKH output with 1 confirmation.
The signed transaction hex is provided in the logs.
The error suggests a potential issue with the transaction signature or script validation, possibly related to Bitcoin Core 28.1's handling of SegWit transactions or a bug in the relayer's signing logic.
Possible Investigation Areas
Verify the signature generation process for SegWit (P2WPKH) transactions in the relayer.
Check compatibility between Torram 1.0 and Bitcoin Core 28.1.
Inspect the transaction script and signature for compliance with Bitcoin's consensus rules.
Test with a lower Bitcoin Core version (e.g., 27.x) to rule out version-specific issues.
Let me know if additional logs or details are needed!
The Torram relayer encountered an error while attempting to broadcast a transaction to the Bitcoin blockchain. The process failed with the error message: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation). This issue occurred after multiple broadcast attempts, leading to the release of the selected UTXO and a retry with backoff.
Environment
Torram Version: 1.0
Bitcoin Core Version: 28.1
Operating System: Ubuntu 22.04
Steps to Reproduce
Run the Torram relayer (version 1.0) on Ubuntu 22.04 with Bitcoin Core 28.1.
Send some btc to another generated address and back to first wallet in same wallet via bitcoin-cli
I sent from tb1qttqwfvf59jymapp0767p6yfjcf3xuzhezlnxgm to tb1qpuy3p8lexgl275ehrsestp3dc93javhn5p7r2u. And then back, from tb1qpuy3p8lexgl275ehrsestp3dc93javhn5p7r2u to tb1qttqwfvf59jymapp0767p6yfjcf3xuzhezlnxgm.
Expected Behavior
The transaction should be successfully signed and broadcast to the Bitcoin network, with the batch processing completing without errors.
Actual Behavior
The transaction signing process completes, but the broadcast fails with the following RPC error after multiple attempts:
"error": {"code": -26, "message": "mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)"}The relayer retries up to 3 times (with a max of 50 retries configured) before releasing the UTXO and entering a backoff period.
Logs
Additional Context
The UTXO used is a SegWit P2WPKH output with 1 confirmation.
The signed transaction hex is provided in the logs.
The error suggests a potential issue with the transaction signature or script validation, possibly related to Bitcoin Core 28.1's handling of SegWit transactions or a bug in the relayer's signing logic.
Possible Investigation Areas
Verify the signature generation process for SegWit (P2WPKH) transactions in the relayer.
Check compatibility between Torram 1.0 and Bitcoin Core 28.1.
Inspect the transaction script and signature for compliance with Bitcoin's consensus rules.
Test with a lower Bitcoin Core version (e.g., 27.x) to rule out version-specific issues.
Let me know if additional logs or details are needed!