Ethereum: Got 64: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) when submitting segwit transaction
Ethereum transaction error: Non-Mandator script check the flag issuance
As an Ethereum developer, you will probably face an unexpected problem with your transactions. Error Message «Gon 64: Non-Mandator-writer-Verify-Flag (Signature must be zero for failed operations of check (multi) SIG)» indicates a problem with a script check that is used in Segwit transactions.
What is Segwit?
Segwit is an upgrade of a soft jaw that Ethereum introduced to improve the efficiency and safety of transactions. It allows for more advanced scripting options, such as a more signature wallet, without the need for an additional block.
Explained Error Message
Error message suggests that the script check flag is set to «irregular» when checking surgery with multiple signatures (check (Multi) SIG). This implies that the transaction script has a conditional statement (probably using if
orSwitch
) that requires a non-null signature for the passage of validation. However, in Segwit transactions, this condition should be fulfilled with zero signature.
Possible causes of error
Several factors may contribute to this error:
- Incorrect flag checks of scripts : The script verification flag can be misleading, which leads to the «non-mandatory» problem.
- Script bargains
: A conditional statement used in the script may not be properly coded or confirmed, causing an error.
3
Solution
To solve this error, ensure that:
- Script check flag is correctly set : Make sure the script checks are really «non-mandate» (ie «TRUE
) when checking surgery with multiple signatures.
- Conditional statements are correctly coded : twice check that any conditional statements used in the script have appropriate encoding and validation to ensure that they meet the necessary conditions for zero or zero signature.
3
Example uses the case
To show a potential solution, consider an example of a simple conditional statement:
strength
Pragma Solidity ^0.8.0;
An example of a contract {
Function testCondational () public payment {{
bool state = truth; // Define a variable of conditions
If (condition) {
demand (msg.value> 10, «invalid value»);
} Else {
demand (false, «the condition failed»);
Iche
Iche
Iche
`
In this example, the functionTestConditional ‘uses the statementIF
to test the conditions. To correct the error, you would set a flag to check the scripts on " True "
(indicating that zero signatures were allowed), ensuring proper encoding and validation of conditional statements.
Conclusion
When submitting a segwit transaction, it is crucial to examine carefully and confirm the flags to check the scripts and conditional statements to avoid unexpected errors like this. Following the best practices for scripting and signatures, developers can ensure that their transactions are properly confirmed and executed on the Ethereum network.