为什么Blockcypher签署工具比bip32 dart软件包返回一些额外的字符?

问题描述 投票:1回答:1

我正在尝试签署交易框架Blockcypher返回,以便随同https://www.blockcypher.com/dev/bitcoin/#creating-transactions一起发送。

对于此示例,我将使用完全不安全的'raw raw raw raw raw raw raw raw raw raw raw raw'助记符,该助记符使用dart bip32包创建具有私钥的BIP32 < [[BTC testnet的地址[0x05a2716a8eb37eb2aaa72594573165349498aa6ca20c71346fb15d82c0cbbf7c和地址mpQfiFFq7SHvzS9ebxMRGVohwHTRJJf9ra。Blockcypher Tx骨架tosign

1cbbb4d229dcafe6dc3363daab8de99d6d38b043ce62b7129a8236e40053383e。] >>。使用Blockcypher signer tool$ ./signer 1cbbb4d229dcafe6dc3363daab8de99d6d38b043ce62b7129a8236e40053383e 05a2716a8eb37eb2aaa72594573165349498aa6ca20c71346fb15d82c0cbbf7c 304402202711792b72547d2a1730a319bd219854f0892451b8bc2ab8c17ec0c6cba4ecc4022058f675ca0af3db455913e59dadc7c5e0bd0bf1b8ef8c13e830a627a18ac375ab

另一方面,使用bip32我得到:

String toSign = txSkel['tosign'][0];
var uToSign = crypto.hexToBytes(toSign);
var signed = fromNode.sign(uToSign);
var signedHex = bufferToHex(signed);
var signedHexNo0x = signedHex.substring(2);

其中fromNode

bip32.BIP32节点。输出为signedHexNo0x = 2711792b72547d2a1730a319bd219854f0892451b8bc2ab8c17ec0c6cba4ecc458f675ca0af3db455913e59dadc7c5e0bd0bf1b8ef8c13e830a627a18ac375ab

乍看之下,它们似乎是完全不同的缓冲区,但是经过仔细研究之后,Blockcypher签名者输出仅包含了一些比

bip32

还要多的字符:Blockcypher signer output (I split it into several lines for you to see it clearly): 30440220 2711792b72547d2a1730a319bd219854f0892451b8bc2ab8c17ec0c6cba4ecc4 0220 58f675ca0af3db455913e59dadc7c5e0bd0bf1b8ef8c13e830a627a18ac375ab bip32 output (also intentionally split): 2711792b72547d2a1730a319bd219854f0892451b8bc2ab8c17ec0c6cba4ecc4 58f675ca0af3db455913e59dadc7c5e0bd0bf1b8ef8c13e830a627a18ac375ab
我希望两个64个字符的数字给出一个128个字符的签名,
bip32
输出可以完成。因此,

Blockcypher signer

输出具有140个字符,即比前者多12个字符,当按上述方式分成几行时很明显。
我真的很感谢任何对此问题有所了解的人,我需要理解和纠正。我需要在dart中实现该解决方案,除了测试以外,我不能使用签名者脚本。

我正尝试在https://www.blockcypher.com/dev/bitcoin/#creating-transactions之后按照交易框架Blockcypher返回的方式进行签名。在此示例中,我将使用...

flutter dart bitcoin bitcoin-testnet blockcypher
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.