在blockcypher上签署比特币:"错误":"没有足够的签名:0表示1个输入"

时间:2017-06-11 17:51:34

标签: php api curl bitcoin ethereum

我使用blockcypher进行交易。我已经完成了所有必要的步骤,但是当我尝试发送交易时,我收到了一条错误消息,"错误:签名不够:0表示1个输入"。

签名者(托管和私钥)

go run signer.go 697817584637d858b16ceb4dbecddfb7afc2da67992263ccffa2891bf69bb229 8f16d5bae3c2e4b6923d5a7da8194088f1813f5b22900b9a648d7ef8a38d0be0

输出签名

3044022005b5ee7e4bac8a16a1ed59b4132a5ed51633718425b2813430bff0dbf238b35602203b3345c013f0f6555b029bed886ace99cbf416300d6007775d8a4772205e5a0b

比特币发件人信息

  private key:8f16d5bae3c2e4b6923d5a7da8194088f1813f5b22900b9a648d7ef8a38d0be0,  public key:029602113dd7851c8095434c4019258462aa30c16df6d146b9c4d039f1c5392f03,
address: mzrycPJMEjQ4WNv7rZVZepb6Lse63Xt4Ue,
  wif: cSNrA5tkpCpRLdXHrSy3mYdWRWPGFTYd53Z9tERz5DSprUx7JGZM

比特币接收者信息

private key:f392289723ef4a6dfef8fef7a76daea1cce8c572ed73d3b05e15271bfae70a01,   public key:020e3dc996e6cab4df26770b01b8f135322de2ef52c0b394e5c49dcf981d700db7,
 address: mmzsfMgMk4hejzv5ahuQULnMGQC4n7Wm3H,
 wif: cVkAus4uxWXhvcJVKovCj9Fpx2U2rftq7QVBU2vDsbQoZuwirtu9

发送交易

curl -d '{
  "tx": {
    "block_height": -1,
    "block_index": -1,
    "hash": "f54241d7525acba9d1a2ba270c9e1627810676a95909f0d1c7f800dde1b33adf",
    "addresses": [
      "mzrycPJMEjQ4WNv7rZVZepb6Lse63Xt4Ue",
      "mmzsfMgMk4hejzv5ahuQULnMGQC4n7Wm3H"
    ],
    "total": 300400,
    "fees": 99600,
    "size": 119,
    "preference": "high",
    "relayed_by": "158.223.165.35",
    "received": "2017-06-11T16:21:01.407862694Z",
    "ver": 1,
    "lock_time": 0,
    "double_spend": false,
    "vin_sz": 1,
    "vout_sz": 2,
    "confirmations": 0,
    "inputs": [
      {
        "prev_hash": "d2cb465b74e3f57d64b584962ee557d9a623d38befd570e14686438cc25279ee",
        "output_index": 0,
        "script": "",
        "output_value": 400000,
        "sequence": 4294967295,
        "addresses": [
          "mzrycPJMEjQ4WNv7rZVZepb6Lse63Xt4Ue"
        ],
        "script_type": ""
      }
    ],
    "outputs": [
      {
        "value": 10,
        "script": "76a914471888d19d0148ab072d3707712e8de8f4dc724788ac",
        "addresses": [
          "mmzsfMgMk4hejzv5ahuQULnMGQC4n7Wm3H"
        ],
        "script_type": "pay-to-pubkey-hash"
      },
      {
        "value": 300390,
        "script": "76a914d433cec679da5579b3fff61eefbb0ce70ae9221a88ac",
        "addresses": [
          "mzrycPJMEjQ4WNv7rZVZepb6Lse63Xt4Ue"
        ],
        "script_type": "pay-to-pubkey-hash"
      }
    ]
  },
  "tosign": [
    "697817584637d858b16ceb4dbecddfb7afc2da67992263ccffa2891bf69bb229"
  ]
}, "tosign": [ "697817584637d858b16ceb4dbecddfb7afc2da67992263ccffa2891bf69bb229" ], "signatures": ["3044022005b5ee7e4bac8a16a1ed59b4132a5ed51633718425b2813430bff0dbf238b35602203b3345c013f0f6555b029bed886ace99cbf416300d6007775d8a4772205e5a0b"], "pubkeys": ["029602113dd7851c8095434c4019258462aa30c16df6d146b9c4d039f1c5392f03" ] }' https://api.blockcypher.com/v1/btc/test3/txs/send?token=fcd13b49d1a4469e865707205e2022bc

我使用了自己的令牌,但我已经对此帖进行了审查。

如果有人能够帮助解决这个问题,我将非常感激。

2 个答案:

答案 0 :(得分:1)

您的JSON文档看起来有问题。签名和pubkeys数组应与" tosign"处于同一级别。我们回来。您发布的内容实际上是无效的JSON,还有另一个" tosign"使用主文档之外的签名和pubkeys。看起来你刚刚做了一个追加。应该是这样的:

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone.js"></script>
<div id="holder">
  <label>K: </label><input class="k" type="text"><br>
  <label>J: </label><input class="j" type="text"><br>
  <label>zoom: </label><input class="zoom" type="text"><br>
  <label>Number of times zoom changed: </label><input class="zoomchanged" type="text"><br>
  <div class="display">

  </div>
  <button class="button">
  Click
  </button>
</div>

答案 1 :(得分:0)

最后,您曾经使用过两次,而应该使用一次 只需使用一次