1

I'm trying to check the following simple MULTISIG P2SH script on bitcoin testnet (using python-bitcoinlib):

Redeem = CScript([2, J1_public_key, J2_public_key, J3_public_key, 3, OP_CHECKMULTISIG])
ex31a_txout_scriptPubKey = Redeem.to_p2sh_scriptPubKey()

My first transaction got mined. Here is the link. It is verified by the python library python-bitcoinlib that the following scriptSig can redeem the coin.

J2_signature = create_OP_CHECKSIG_signature(txin, txout, Redeem,
                                          J2_private_key)
J3_signature = create_OP_CHECKSIG_signature(txin, txout, Redeem,
                                          J3_private_key)

dummy = 123
txin_scriptSig = CScript([dummy, J2_signature, J3_signature, Redeem])   

However my redeeming transaction don't get mined on the testnet. I don't know why!


Edit

A minimal example is replaced instead of the previous one.

The new script uses P2SH.

Here is the API code of the transaction:

{
  "block_height": -1,
  "block_index": -1,
  "hash": "6371461a476ae87dd31b89e7deb9ff59b9679306b23ff86036dc3d7851a76a3c",
  "hex": "01000000019d8e6c705ba87c12f785542ea6253478585a24d871624036c3cfa30b1c0bfbe400000000fddb01017b483045022100dc369db54ceaa7b182969f23a176ae21d14272dff8d941360a5140d17f196e24022044ed2a8c05c5eff115fd5536478027b74a8aeea8f8e393377fcf7c8c232b352201483045022100c227a4fa63b5040bc85a5e7b15c0b081aadd4c538223fa9d8c90cadbc04e649702205a72760687a8c9e74202bfd11b6661f44f093e51a7a4eb4d89876303a9bc94d8014730440220586615cbc74089d7ab4aaf96dc857c0d523df77260159dced512f72c9d3d88b30220177c6f3eb5622ed263c28052ffcda89062a1bda74fdf8e398fba76dd85942bbd014cfd6e51210245aef9640296f238a04b0ee9af1e8dc62a6fe51214af7d3c5bfe518a9cd5afaf2103482de8ad8bf744318b97063544d2fc59322f63baad3d1054ea57609cdb059b6452af6e52210245aef9640296f238a04b0ee9af1e8dc62a6fe51214af7d3c5bfe518a9cd5afaf2103482de8ad8bf744318b97063544d2fc59322f63baad3d1054ea57609cdb059b6452ae635167522102e1183cefc9b3fb15e15bfc53703a6d2e626ccf42cc017f84ec41486114d8cefe210200139f5a548a7cebce4be1308a0262fbb04ec2ea6fc5b38bb3c4ac140ccb5d852102259a3b4527adf82a32e06fb177f27e0606c10f329a22ba7b206ea3eef0e5aa2853ae68ffffffff01a0860100000000001976a9149f9a7abd600c0caa03983a77c8c3df8e062cb2fa88ac00000000",
  "addresses": [
    "2Mz66CzbFYADatUbwXWqHxayRrMHoTCAqXn",
    "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB"
  ],
  "total": 100000,
  "fees": 400000,
  "size": 562,
  "preference": "high",
  "relayed_by": "194.225.46.158",
  "received": "2018-11-18T21:19:22.298Z",
  "ver": 1,
  "double_spend": false,
  "vin_sz": 1,
  "vout_sz": 1,
  "confirmations": 0,
  "inputs": [
    {
      "prev_hash": "e4fb0b1c0ba3cfc336406271d8245a58783425a62e5485f7127ca85b706c8e9d",
      "output_index": 0,
      "script": "017b483045022100dc369db54ceaa7b182969f23a176ae21d14272dff8d941360a5140d17f196e24022044ed2a8c05c5eff115fd5536478027b74a8aeea8f8e393377fcf7c8c232b352201483045022100c227a4fa63b5040bc85a5e7b15c0b081aadd4c538223fa9d8c90cadbc04e649702205a72760687a8c9e74202bfd11b6661f44f093e51a7a4eb4d89876303a9bc94d8014730440220586615cbc74089d7ab4aaf96dc857c0d523df77260159dced512f72c9d3d88b30220177c6f3eb5622ed263c28052ffcda89062a1bda74fdf8e398fba76dd85942bbd014cfd6e51210245aef9640296f238a04b0ee9af1e8dc62a6fe51214af7d3c5bfe518a9cd5afaf2103482de8ad8bf744318b97063544d2fc59322f63baad3d1054ea57609cdb059b6452af6e52210245aef9640296f238a04b0ee9af1e8dc62a6fe51214af7d3c5bfe518a9cd5afaf2103482de8ad8bf744318b97063544d2fc59322f63baad3d1054ea57609cdb059b6452ae635167522102e1183cefc9b3fb15e15bfc53703a6d2e626ccf42cc017f84ec41486114d8cefe210200139f5a548a7cebce4be1308a0262fbb04ec2ea6fc5b38bb3c4ac140ccb5d852102259a3b4527adf82a32e06fb177f27e0606c10f329a22ba7b206ea3eef0e5aa2853ae68",
      "output_value": 500000,
      "sequence": 4294967295,
      "addresses": [
        "2Mz66CzbFYADatUbwXWqHxayRrMHoTCAqXn"
      ],
      "script_type": "pay-to-script-hash",
      "age": 0
    }
  ],
  "outputs": [
    {
      "value": 100000,
      "script": "76a9149f9a7abd600c0caa03983a77c8c3df8e062cb2fa88ac",
      "addresses": [
        "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB"
      ],
      "script_type": "pay-to-pubkey-hash"
    }
  ]
}
2
  • According to your link there is "no transaction found with the hash 42af7..." Nov 18, 2018 at 12:18
  • @RedGrittyBrick Since the transaction didn't get mined it has been removed after a couple of hours
    – SMA.D
    Nov 18, 2018 at 13:13

1 Answer 1

0

It seems that the problem is related to the testnet itself. Since the fees in the testnet aren't real the minors don't have the incentive to mine complicated scripts. Hence scripts such as MULTISIG might not get mined (for me with a high probability approaching one!).

To see this you may add a big number at the beginning of the scriptSig.

For the case of MULTISIG it is enough not to use P2SH method. i.e.

 ex32a_txout_scriptPubKey = CScript([2, J1_public_key, J2_public_key, J3_public_key, 3, OP_CHECKMULTISIG])

and the scriptSig can be:

CScript([dummy, dummy, J2_signature, J3_signature])

This transaction gets recognized as pay-to-multi-pubkey-hash and get mined.

However this will not resolve the problem with more complicated scripts on testnet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.