15
votes
Accepted
Why is Bitcoin address encoded in base58?
Why base-58 instead of standard base-64 encoding?
Don't want 0OIl characters that look the same in some fonts and
could be used to create visually identical looking account numbers.
A string with ...
7
votes
Accepted
Why are P2WSH addresses larger than P2SH addresses?
Because P2SH addresses are too short to provide the typically desirable level of security we expect from Bitcoin, against certain attacks. On top of that, they use bech32 encoding rather than base58, ...
6
votes
Why are hashes base16 (hex) encoded rather than base58 encoded?
Mark H's answer is correct, but I think there is a more fundamental point: addresses are directly intended for human consumption. Transaction hashes (as well as public keys, block hashes, raw scripts, ...
5
votes
Accepted
Why P2SH seems to be never smaller than 34 characters, unlike P2PKH?
Because Base58 initial 1s carry 8 bits of data, but P2SH addresses cannot be represented with a string with initial 1s so it starts with 3 which, like all other cases & characters, encodes 5.86 ...
4
votes
Accepted
Java: Base58-encode String
Your output is correct given the input that you used.
However, If you are expecting to get an output address of 39YteymR86cG7V3Kijg8Gm2ST1r4nTeM1b, it looks like your input is incorrect. It's missing ...
4
votes
base58 cannot get 34 chars results (as Bitcoin address does) but 68 chars
When you use that site, you are encoding the hex as a hex string, not of the actual bytes that they should be. The base58 encoding for addresses operates on the bytes themselves which are represented ...
4
votes
ELI5: What is Base58Check encoding?
A Bitcoin address is a series of bits (on its simpler form is just a public key).
In order to make it human "readable" it is converted to a series of letters.
Base64 is a well known previous ...
4
votes
Accepted
ELI5: What is Base58Check encoding?
Can someone explain what it is and why it's called Base58Check encoding?
There are two parts to the name "Base58Check". The first part is "Base58". This is fairly self explanatory, the encoding uses ...
4
votes
What is the prefix number, in bytes, of a native segwit address?
Native segwit addresses are not encoded using base58, but using a different encoding system called bech32. The details can be found in BIP 173. For the segwit v1+ addresses that will be used for ...
4
votes
Accepted
Why doesn't bitcoin use bech32 encoding for transaction_id and block hash?
Bitcoin has used the same hex encoding for hashes since the very beginning. Any software written since then therefore also expects that same hex encoding. Bech32 was introduced nearly a decade into ...
3
votes
ELI5: is it true that Base58 doesn't prevent typo, but Base58check does, really because there is a checksum?
Yes. Every byte sequence corresponds to one Base58 string. Every byte sequence also corresponds to one Base58Check string, which contains a 4-byte redundancy, a checksum.
And this 4-byte-code's only ...
3
votes
Why are P2WSH addresses larger than P2SH addresses?
The encoding is bech32 not base58, which is slightly longer but vastly easier to type due to a lack of capital letters, and the inclusion of error correction rather than error detection.
SegWit ...
3
votes
encode/decode Base-58 C++
I used BIGNUM from openssl to encode hex with base58
#include <string>
#include <vector>
#include <openssl/bn.h>
string b58(const char *priv_hex)
{
char table[] = {'1','2','...
3
votes
Accepted
Can I know if a bitcoin private/public key or address was derived from another key in an HD wallet by its structure?
Individual address private keys begin with 5,L or K. What you're calling root private keys are actually called extended private keys and they begin with ?prv where ? is either x,z,y,Y,Z. You can see ...
3
votes
ELI5: What is Base58Check encoding?
Can someone explain what it is and why it's called Base58Check encoding?
Because of the name the function in the original Bitcoin codebase had.
The "Base58" refers to the fact that it is a base 58 ...
3
votes
Accepted
Why are hashes base16 (hex) encoded rather than base58 encoded?
SHA256 hashes are encoded in plain binary in bitcoin protocol and in block storage (32-bytes in little-endian byte order when treated as integers, which makes them effectively "base256"). The textual ...
3
votes
Accepted
Cashaddr (bech32) to legacy address format convertor for Bitcoin Cash
They should use those:
cashaddr.org
cashaddr.bitcoincash.org
cashaddress.github.io
Or, you can use the CashAddrJS library to convert between them (Here are the browser JS).
Unfortunately there's no ...
3
votes
Cashaddr (bech32) to legacy address format convertor for Bitcoin Cash
I've found this project:
https://github.com/oskyk/cashaddress , checked the accounts generated by it using validateaddress of my wallet, seems working fine!
3
votes
How do i properly encode and decode base58 in python?
You need to convert string hex to bytes hex format before feeding it to b58encode to produce C6t2iJ7AXA2X1KQVnqw3r7NKtKaERdLnaGmbDZNqxXjk.
import base58
privatekey_base58 = base58.b58encode(bytes....
3
votes
Accepted
Are the characters 0, O, I, l really not allowed in address?
There are two different encodings being used for Bitcoin addresses.
Native segwit addresses are encoded using the Bech32(m) encoding. Bech32 uses the 32 symbols 023456789acdefghjklmnpqrstuvwxyz to ...
2
votes
Is this how to generate a bitcoin address with python?
If the public key were correct (see Mark's answer), the code is not complete (lacks signature) and contains a hash of an ASCII hexdigest which is not correct.
I'd like to contribute with this ...
2
votes
How to convert xpub ypub and zpub in Ruby
I'm not sure about ruby, but here's what's happening in practice.
Take any xpub:
xpub6DBfkACRRWo6B9Fo31Ko6P7M92Yb3rdbuXb81Ls7aDCaZsMr1tyvZWHAHz1exRZuTBspafkPTynwoWL5o3i4WiJX4P3SyGQxNpxQLaUnB2c
...
2
votes
encode/decode Base-58 C++
Have added my own implementation, complete with a fuzz tester to ensure that it works properly. (The CodecMapping parameter is provided so that you can change the alphabet string as I've had to do ...
2
votes
Accepted
encode/decode Base-58 C++
I've used Base58 encoding/decoding many times. On the contrary, I hated using a BIGNUM library. So, I used Base-x's base conversion algorithm. (Make sure to respect the MIT license) It should be easy ...
2
votes
Why is this burn address starting to get confirmations?
Base58 addresses are case sensitive. With the correct capitalization, the address resolves fine: https://blockchain.com/btc/address/1111111111111111111114oLvT2.
Addresses do not get any confirmations. ...
2
votes
How much can be stripped of a base58 address in a recoverable way?
The checksum of Base58Check encoding is simply a truncated hash of the rest of the bytes. This means there is no recovery algorithm other than just brute-forcing until the hash matches.
That is one of ...
2
votes
Is there a Base58 encoder function that runs in pure javascript without node?
Here's a pure javascript base58 encoder fuction I helped put together. Included are some comments that helped me understand what is going on beyond the barebones functions you can find elsewhere.
...
2
votes
Accepted
Stuck dissecting a P2PKH Bitcoin transaction, what am I doing wrong?
The process of calculating a Bitcoin P2PKH address in base56check encoding format is as follows:
get a public key from the private key
hash the public key with the SHA256 hash function
hash the ...
1
vote
Keep getting non base-58 character error when trying to recover my old wallet. Any ideas on how to troubleshoot this?
There are a bunch of +'s and /'s.
That strongly suggests it is data in Base64 encoding. Note that, in this case encoding does not mean encryption, just a specific printable representation of binary ...
1
vote
Accepted
How to handle leading 0's (b58 1's) when base58check encoding
Iterate from the beginning until you reach a non-zero byte. Base58 encode the non-zero byte and the following, and add 1s before the base58 string you made for each initial one zero byte (0x00) you ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
base58 × 60address × 22
private-key × 12
public-key × 9
base58check × 9
address-generation × 7
bech32-address × 6
wallet-import-format × 5
encoding × 5
hash × 4
p2sh × 4
p2pkh × 4
transactions × 3
bip32-hd-wallets × 3
python × 3
java × 3
bitcoin-core × 2
blockchain × 2
wallet × 2
segregated-witness × 2
development × 2
wallet-recovery × 2
bitcoinj × 2
sha256 × 2
vanity-address × 2