KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
103 stars 94 forks source link

BTG swap fails #488

Open cipig opened 5 years ago

cipig commented 5 years ago

sendrawtransaction with BTG fails (sighash)

            "data" : {
               "error" : "lp_swap:1030] utxo:759] utxo:483] utxo:480] rpc_clients:291] JsonRpcError { request: JsonRpcRequest { jsonrpc: \"1.0\", id: \"0\", method: \"sendrawtransaction\", params: [String(\"0100000001ab638549b103bbc27f0e2bbd17bf824741c2320e9363927c6c494777df4f7a2b000000006a473044022055893f502e4f59c73533f17d8c339da58613616664649160aeb32dc435a352a1022065fb3ba93df93bce7229f67c95ab9e3a1c28cdabe968eb9be495815bddd75e930121031bb83b58ec130e28e0a6d5d2acf2eb01b0d3f1670e021d47d31db8a858219da8ffffffff0240420f000000000017a91457275576bb14397a4eab7baf3f1bd53b7c91b3d58721a7f509000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac476b325d\")] }, error: Transport(\"rpc_clients:244] Rpc request JsonRpcRequest { jsonrpc: \\\"1.0\\\", id: \\\"0\\\", method: \\\"sendrawtransaction\\\", params: [String(\\\"0100000001ab638549b103bbc27f0e2bbd17bf824741c2320e9363927c6c494777df4f7a2b000000006a473044022055893f502e4f59c73533f17d8c339da58613616664649160aeb32dc435a352a1022065fb3ba93df93bce7229f67c95ab9e3a1c28cdabe968eb9be495815bddd75e930121031bb83b58ec130e28e0a6d5d2acf2eb01b0d3f1670e021d47d31db8a858219da8ffffffff0240420f000000000017a91457275576bb14397a4eab7baf3f1bd53b7c91b3d58721a7f509000000001976a914c3f710deb7320b0efa6edb14e3ebeeb9155fa90d88ac476b325d\\\")] } failed with HTTP status code 500 Internal Server Error, response body: {\\\"result\\\":null,\\\"error\\\":{\\\"code\\\":-26,\\\"message\\\":\\\"mandatory-script-verify-flag-failed (Signature hash type missing or not understood) (code 16)\\\"},\\\"id\\\":\\\"0\\\"}\\n\") }"
            },
            "type" : "MakerPaymentTransactionFailed"

it is the same as with BCH and needs special treatment in the code this special stuff was in mm1, maybe it can be simply ported

artemii235 commented 5 years ago

BTG uses sighash forkid AFAIK, should be easy to fix.

smk762 commented 1 year ago

@cipig is this still a problem or can we close this issue?

cipig commented 1 year ago

nothing changed, so i assume the problem is the same i can try again, we now have "sighash forkid" param

cipig commented 1 year ago

oh, i see in my docs that i already tried in the past with fork_id and signature_version

        {
                "coin": "BTG",
                "name": "bitcoingold",
                "fname": "Bitcoin Gold",
                "rpcport": 12332,
                "pubtype": 38,
                "p2shtype": 23,
                "wiftype": 128,
                "fork_id": "0x40",
                "signature_version": "witness_v0",
                "txfee": 10000,
                "segwit": true,
                "bech32_hrp": "btg",
                "mm2": 1,
                "required_confirmations": 1,
                "avg_blocktime": 10,
                "protocol": {
                        "type": "UTXO"
                }
        },

tried with all 3 possible signature_version and all 3 failed: witness_v0: mandatory-script-verify-flag-failed (Operation not valid with the current stack size) (code 16) fork_id: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16) base: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)