DLC Funding Transaction Error: non-mandatory-script-verify-flag (witness program hash mismatch) (code 64)


I’m trying to build a fundraising deal for a DLC. So far I have created the following transaction which encodes the entry of a bet for a local / remote guarantee of 1000/1000 sats and an all or nothing win / lose binary outcome.

As far as I know the transactions are correct in terms of I / O addresses etc, and the signatures were provided (see below), but I get this error:

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

when attempting to broadcast the transaction. hexadecimal:

0200000000010200a0b70a017629c13aed255241ca37714c6cbf6632a8234288038bfa4b1510960100000000ffffffffc7e0e2abdf4f31b1aab013695eb4e0d35a9580de7fc36033a4a730da45bf74f10100000000ffffffff03240900000000000022002002349639c02aee43f4474e269bc03860d0290f7f3fc15f0bcea54b2025dffae82a060000000000001600147bd21f276fa2e6a81a69a1d89c4217876810bf9842020000000000001600148e0892c30b293a2ae1fa90988cc6004f03eadc1c000247304402207bb9cffa80ee109758b6c0c74ac2d5745cb42bb06c76b0cf7a86e64cc4159bba0220351f1ae477c5703c2990336a2888a4ff1c52e3d01897931ba3b48fce694797c10121022b89efbabb2ab7f712912c399ef161216b07d101fa95a3ffbb4ce675548b64e100000000

I also tried streaming with another service, which had a more descriptive error, so I’ll post this here as well:

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 don’t really know how to interpret this error and I also don’t know how to debug, so any pointer would be really appreciated. Searching for these errors on StackExchange does not seem to provide any relevant results, with the possible exception of this answer. Is it possible that incorrect private keys used to sign transactions could cause the hash mismatch of the witness program? (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

Please follow and like us: