DLC funding transaction error: non-mandatory-script-verify-flag (Witness program hash mismatch) (code 64)

0
6


I’m attempting to construct a funding transaction for a DLC. So far I have created the following transaction which encodes entry of a bet for local/remote collateral of 1000/1000 sats and binary win/lose all or nothing outcome.

As far as I can tell, the transactions are accurate in terms of inputs/outputs addresses etc, and the signatures were provided (see below), but I’m getting this error:

non-mandatory-script-verify-flag (Witness program hash mismatch) (code 64)

when attempting to broadcast the transaction.
hex:

0200000000010200a0b70a017629c13aed255241ca37714c6cbf6632a8234288038bfa4b1510960100000000ffffffffc7e0e2abdf4f31b1aab013695eb4e0d35a9580de7fc36033a4a730da45bf74f10100000000ffffffff03240900000000000022002002349639c02aee43f4474e269bc03860d0290f7f3fc15f0bcea54b2025dffae82a060000000000001600147bd21f276fa2e6a81a69a1d89c4217876810bf9842020000000000001600148e0892c30b293a2ae1fa90988cc6004f03eadc1c000247304402207bb9cffa80ee109758b6c0c74ac2d5745cb42bb06c76b0cf7a86e64cc4159bba0220351f1ae477c5703c2990336a2888a4ff1c52e3d01897931ba3b48fce694797c10121022b89efbabb2ab7f712912c399ef161216b07d101fa95a3ffbb4ce675548b64e100000000

I also attempted broadcasting with another service, which had a more descriptive error so I’ll also post this here:

Error validating transaction: Error running script for input 0 referencing 9610154bfa8b03884223a83266bf6c4c7137ca415225ed3ac12976010ab7a000 at 1: incorrect number of witness items for version 0 witness program of length 20.

I’m not really sure how to interpret this error and also unsure of how to go about debugging, so any pointers would be really appreciated.
Searching for these errors on StackExchange doesn’t seem to provide any relevant hits except maybe this answer. Is it possible that incorrect private keys used to sign the transactions could lead to the witness program hash mismatch? (as suggested by Andrew Chow).

{
    "addresses": [
        "bc1q0qafvh30pp49wcmuawrxyc9wm8pudt98ukqgyg",
        "bc1qqg6fvwwq9thy8az8fcnfhspcvrgzjrml8lq47z7w549jqfwllt5q57lat4",
        "bc1q00fp7fm05tn2sxnf58vfcsshsa5pp0ucewu8sy",
        "bc1q3cyf9sct9yaz4c06jzvge3sqfup74hqu34927s",
        "bc1qsq2edk379zzcxkhy6lkfjv5mfd7ckml482z5sc"
    ],
    "block_height": -1,
    "block_index": -1,
    "confirmations": 0,
    "double_spend": false,
    "fees": 504,
    "hash": "d6c6069357ed571c91294d736f44db57a22b1e422ebd6947cc912ef8f498f8ca",
    "inputs": [
        {
            "addresses": [
                "bc1qsq2edk379zzcxkhy6lkfjv5mfd7ckml482z5sc"
            ],
            "age": 704058,
            "output_index": 1,
            "output_value": 3000,
            "prev_hash": "9610154bfa8b03884223a83266bf6c4c7137ca415225ed3ac12976010ab7a000",
            "script_type": "pay-to-witness-pubkey-hash",
            "sequence": 4294967295
        },
        {
            "addresses": [
                "bc1q0qafvh30pp49wcmuawrxyc9wm8pudt98ukqgyg"
            ],
            "age": 704058,
            "output_index": 1,
            "output_value": 2000,
            "prev_hash": "f174bf45da30a7a43360c37fde80955ad3e0b45e6913b0aab1314fdfabe2e0c7",
            "script_type": "pay-to-witness-pubkey-hash",
            "sequence": 4294967295,
            "witness": [
                "304402207bb9cffa80ee109758b6c0c74ac2d5745cb42bb06c76b0cf7a86e64cc4159bba0220351f1ae477c5703c2990336a2888a4ff1c52e3d01897931ba3b48fce694797c101",
                "022b89efbabb2ab7f712912c399ef161216b07d101fa95a3ffbb4ce675548b64e1"
            ]
        }
    ],
    "outputs": [
        {
            "addresses": [
                "bc1qqg6fvwwq9thy8az8fcnfhspcvrgzjrml8lq47z7w549jqfwllt5q57lat4"
            ],
            "script": "002002349639c02aee43f4474e269bc03860d0290f7f3fc15f0bcea54b2025dffae8",
            "script_type": "pay-to-witness-script-hash",
            "value": 2340
        },
        {
            "addresses": [
                "bc1q00fp7fm05tn2sxnf58vfcsshsa5pp0ucewu8sy"
            ],
            "script": "00147bd21f276fa2e6a81a69a1d89c4217876810bf98",
            "script_type": "pay-to-witness-pubkey-hash",
            "value": 1578
        },
        {
            "addresses": [
                "bc1q3cyf9sct9yaz4c06jzvge3sqfup74hqu34927s"
            ],
            "script": "00148e0892c30b293a2ae1fa90988cc6004f03eadc1c",
            "script_type": "pay-to-witness-pubkey-hash",
            "value": 578
        }
    ],
    "preference": "low",
    "received": "2021-10-14T16:06:06.457862963Z",
    "relayed_by": "18.234.101.166",
    "size": 307,
    "total": 4496,
    "ver": 2,
    "vin_sz": 2,
    "vout_sz": 3,
    "vsize": 225
}



Source link

Leave a reply