transactions – Can’t create signature to redeem P2SH output

0
59


Pay TX:

02000000000101324d370ae154899320ba315a48d4904664cab1fd35568dbf12635cb5cf8a1f490100000000000000000240420f000000000017a914b030803afe82d7cc67999e68c1e8776fbc6064c3870a2d2f3b00000000160014ba31c63dfda8011544817c1a1278bbd00f5010490247304402200372d680cdf8cc451632fd948813cd5f1ec261a22f4cfe77aebc8ca19ce74485022022ebb589ff996276cff6199eb778e4df3e01c2ea1102b85cc608466d3c6d03f801210362351823238b726ad8bdb14a168d20b0050078ddbde03dfed75e11d3747712ac00000000
{
    "addresses": [
        "3HkcxCzPMCEBKugktCu5gtZJEkqMe7qFeF",
        "bc1qhgcuv00a4qq323yp0sdpy79m6q84qyzf2lgt4j"
    ],
    "block_height": -1,
    "block_index": -1,
    "confirmations": 0,
    "double_spend": false,
    "charges": 0,
    "hash": "1a4d84fe267e27ae8f08964567c3d81eef4d25e8a4fbb2b8a650228ccf5409d5",
    "inputs": [
        {
            "age": 0,
            "output_index": 1,
            "prev_hash": "491f8acfb55c6312bf8d5635fdb1ca644690d4485a31ba20938954e10a374d32",
            "script_type": "empty",
            "sequence": 0
        }
    ],
    "opt_in_rbf": true,
    "outputs": [
        {
            "addresses": [
                "3HkcxCzPMCEBKugktCu5gtZJEkqMe7qFeF"
            ],
            "script": "a914b030803afe82d7cc67999e68c1e8776fbc6064c387",
            "script_type": "pay-to-script-hash",
            "worth": 1000000
        },
        {
            "addresses": [
                "bc1qhgcuv00a4qq323yp0sdpy79m6q84qyzf2lgt4j"
            ],
            "script": "0014ba31c63dfda8011544817c1a1278bbd00f501049",
            "script_type": "pay-to-witness-pubkey-hash",
            "worth": 992947466
        }
    ],
    "dimension": 223,
    "complete": 993947466,
    "ver": 2,
    "vin_sz": 1,
    "vout_sz": 2,
    "vsize": 142
}

Redeem TX:

0200000001d50954cf8c2250a6b8b2fba4e8254def1ed8c3674596088fae277e26fe844d1a000000008447304402206128ea40e6c16a9204b7737e39db01f57537b65d56378e09791b7f156845a868022068b33a02913f521072b65cbb30b6bba17a7ef9ccf977155c1b9db47c7f9c067a0121025f18a96004f26d16747c1670c056e801e04eb5633b45ce4919f2b188ce6870b91976a91411e4aff6f9dc16bc60a839ead318d72fe06e9d5a88ac0000000001b42e0f0000000000160014bb45633968fb1d1b9f96e4974409a4a6d802ab5600000000
{
    "addresses": [
        "bc1qhdzkxwtglvw3h8ukujt5gzdy5mvq926k48mpr8"
    ],
    "block_height": -1,
    "block_index": -1,
    "confirmations": 0,
    "double_spend": false,
    "charges": 0,
    "hash": "6fd2fa0a87dfdb08de86e6b9803becf0a5234dd94110d59c6a2830b851d4481e",
    "inputs": [
        {
            "age": 0,
            "output_index": 0,
            "prev_hash": "1a4d84fe267e27ae8f08964567c3d81eef4d25e8a4fbb2b8a650228ccf5409d5",
            "script": "47304402206128ea40e6c16a9204b7737e39db01f57537b65d56378e09791b7f156845a868022068b33a02913f521072b65cbb30b6bba17a7ef9ccf977155c1b9db47c7f9c067a0121025f18a96004f26d16747c1670c056e801e04eb5633b45ce4919f2b188ce6870b91976a91411e4aff6f9dc16bc60a839ead318d72fe06e9d5a88ac",
            "script_type": "empty",
            "sequence": 0
        }
    ],
    "opt_in_rbf": true,
    "outputs": [
        {
            "addresses": [
                "bc1qhdzkxwtglvw3h8ukujt5gzdy5mvq926k48mpr8"
            ],
            "script": "0014bb45633968fb1d1b9f96e4974409a4a6d802ab56",
            "script_type": "pay-to-witness-pubkey-hash",
            "worth": 994996
        }
    ],
    "dimension": 214,
    "complete": 994996,
    "ver": 2,
    "vin_sz": 1,
    "vout_sz": 1,
    "vsize": 214
}

signature preimage:

0200000001d50954cf8c2250a6b8b2fba4e8254def1ed8c3674596088fae277e26fe844d1a0000000017a914b030803afe82d7cc67999e68c1e8776fbc6064c3870000000001b42e0f0000000000160014bb45633968fb1d1b9f96e4974409a4a6d802ab560000000001000000
02000000 TX
01 #Inputs
d50954cf8c2250a6b8b2fba4e8254def1ed8c3674596088fae277e26fe844d1a spent TX
00000000 Vout of UTXO
17 Size of sigscript = 23 (or scriptsig?)
a914b030803afe82d7cc67999e68c1e8776fbc6064c387 sigscript or scriptsig
00000000 enter sequence
01 variety of outputs
b42e0f0000000000 quantity: 994996 satoshis
16 size of output script = 22
0014bb45633968fb1d1b9f96e4974409a4a6d802ab56 output script
0000000001000000 lock time of 0, sighash_all

Error:

NodeError: mandatory-script-verify-flag-failed (Signature should be zero for failed CHECK(MULTI)SIG operation) (code 16)

So the issue is within the preimage. Is it within the scriptsig?

By the way in which,

decodescript 47304402206128ea40e6c16a9204b7737e39db01f57537b65d56378e09791b7f156845a868022068b33a02913f521072b65cbb30b6bba17a7ef9ccf977155c1b9db47c7f9c067a0121025f18a96004f26d16747c1670c056e801e04eb5633b45ce4919f2b188ce6870b91976a91411e4aff6f9dc16bc60a839ead318d72fe06e9d5a88ac

returns

304402206128ea40e6c16a9204b7737e39db01f57537b65d56378e09791b7f156845a868022068b33a02913f521072b65cbb30b6bba17a7ef9ccf977155c1b9db47c7f9c067a01 025f18a96004f26d16747c1670c056e801e04eb5633b45ce4919f2b188ce6870b9 76a91411e4aff6f9dc16bc60a839ead318d72fe06e9d5a88ac

Is the issue that the scriptSig or sigScript ought to have been 76a91411e4aff6f9dc16bc60a839ead318d72fe06e9d5a88ac ??



Supply hyperlink

Leave a reply