标签: blockcypher

Blockcypher 错误 非规范签名:长度标记错误

我尝试使用 blockcypher 签署比特币测试网交易,但是当我发送交易时出现错误:

\n\n
Error building input: Error generating scriptsig when building transaction: Invalid signature: Non-canonical signature: wrong length marker\n
Run Code Online (Sandbox Code Playgroud)\n\n

下面是我用来创建和签署交易的完整代码

\n\n
var bitcoin = require("bitcoinjs-lib");\nvar buffer = require(\'buffer\');\nvar keys = new bitcoin.ECPair.fromWIF(\'cMvPQZiG5mLARSjxbBwMxKwzhTHaxgpTsXB6ymx7SGAeYUqF8HAT\', bitcoin.networks.testnet);\n\nvar newtx = {\n    inputs: [{ addresses: [\'ms9ySK54aEC2ykDviet9jo4GZE6GxEZMzf\'] }],\n    outputs: [{ addresses: [\'msWccFYm5PPCn6TNPbNEnprA4hydPGadBN\'], value: 1000 }]\n};\n\n// calling the new endpoint, same as above\n$.post(\'https://api.blockcypher.com/v1/btc/test3/txs/new\', JSON.stringify(newtx)).then(function (tmptx) {\n    console.log(tmptx);\n    // signing each of the hex-encoded string required to finalize the transaction\n    tmptx.pubkeys = [];\n    tmptx.signatures = tmptx.tosign.map(function (tosign, …
Run Code Online (Sandbox Code Playgroud)

javascript bitcoin blockchain bitcoin-testnet blockcypher

5
推荐指数
1
解决办法
551
查看次数