Talk:Base58Check encoding: Difference between revisions

 
(4 intermediate revisions by 2 users not shown)
Line 19:
This will now be converted to Base58: 8sWmykwPRCRjGtuBczJSJTysdzuaW<br /><br />
This is the whole Base58Check process. It actually works with any hex of any length.<br />
In case of Bitcoin, those hex strings are 32 bytes for private keys and 20 bytes for addresses (not public keys). Also, version bytes are 80 for private keys and 00 for P2PKH addresses (05 for P2SH and SegWit nested in P2SH). Every leading 00 must be denoted with an 1 in the Base58 string.<br />There can also be more then one version byte. Extended keys in Bitcoin (HD wallets) use 4 version bytes. -- [[User:Stl1988|Stl1988]] ([[User talk:Stl1988|talk]]) 07:28, 11 December 2018 (UTC)
:As I see it there are three tasks on rosettacode: this one, [[Bitcoin/address_validation]], and [[Bitcoin/public_point_to_address]] with the last one doing (almost) what you suggest. This one corresponds to the third option on (say) [[http://lenschulwitz.com/base58]] and should ''not'' be using sha256, or inserting a version byte. Either that or we should not have three quite-so-similar tasks. I agree that leading zeroes/"1"s are not properly handled by most entries though. [[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 11:05, 11 December 2018 (UTC)
::If this should only show the Base58 encoding, it should be called Base58, not Base58Check, because there's a difference between these two. Base58 is just the encoding while Base58Check is the process I described above.<br />
::It would be awesome to have a code that enables you to manually enter the version byte and doing the whole Base58Check for any hex string. We already have something doing this on [[https://brainwalletx.github.io/#converter]], but it doesn't allow you to manually enter a version byte. -- [[User:Stl1988|Stl1988]] ([[User talk:Stl1988|talk]]) 14:16, 11 December 2018 (UTC)
5

edits