2 ms·
I've been trying to follow along with the article in Python and nothing is working. The article says that private key "KyTxSACvHPPDWnuE9cVi86kDgs59UFyVwx2Y3LPpA
by StavrosK 9y ago
I've been trying to follow along with the article in Python and nothing is working. The article says that private key "KyTxSACvHPPDWnuE9cVi86kDgs59UFyVwx2Y3LPpAs88TqEdCKvb" is "4300d94bef2ee84bd9d0781398fd96daf98e419e403adc41957fb679dfa1facd" in raw bytes, but decoding base58 and hexlifying gives me something completely different:
In [17]: hexlify(base58.b58decode("KyTxSACvHPPDWnuE9cVi86kDgs59UFyVwx2Y3LPpAs88TqEdCKvb"))
Out[17]: '804300d94bef2ee84bd9d0781398fd96daf98e419e403adc41957fb679dfa1facd012774e1c4'
Does anyone know what I'm doing wrong?
- jstanley 9y agoI used this tool and was able to follow along with the ones I checked: https://github.com/matja/bitcoin-tool https://github.com/matja/bitcoin-tool Most likely the discrepancy is that you're using raw base58 instead of base58check $ ./bitcoin-tool --input-type private-key --input-format hex --input 4300d94bef2ee84bd9d0781398fd96daf98e419e403adc41957fb679dfa1facd --output-format base58check --output-type private-key-wif --network bitcoin --public-key-compression compressed KyTxSACvHPPDWnuE9cVi86kDgs59UFyVwx2Y3LPpAs88TqEdCKvb
- StavrosK 9y agoActually, it looks like it's a combination of bitcoin-check and chopping off the first and last bytes. It matches then. Thanks for the bitcoin-tool hint, looks great!