<p>NOTE: This applies only to <strong>LEGACY ADDRESSES</strong> that start with a &quot;1&quot;. Addresses starting with &quot;3&quot; have 0x0014 appended to the beginning and are Base58Check encoded, while addresses starting with &quot;bc1q&quot; have 0x0014 appended to the beginning but are encoded with <strong>Bech32 Encoding</strong>.</p>
<p>You will get Hex/binary after decoding from Base58Check. There should be 20 bytes after decoding the Address to get the public key's hash. If whatever process or function you're using to Base58Check decode doesn't remove the version byte and checksum, you will have 25 bytes instead: The first byte will be 0x00 (the version), and the last 4 bytes (the chscksum) will be the first 4 bytes of the double SHA256 hash of the other 21 bytes.</p>
<p>What you'd be converting to a large integer is the HASH160 of the Public Key; aka, the result of taking the public key in compressed format (33 bytes) and running it through SHA256 then running that hash through RIPEMD-160.</p>
<p>More information about legacy addresses can be found <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address" rel="nofollow noreferrer">here</a>. Additionally, I've written a breakdown on how addresses are created <a href="https://github.com/EAWF/BTC-Toolbox/blob/old-master/Address-Derivation.md#addresses" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2020-06-20T03:48:38.607Z
2020-12-14T22:00:02.700Z
2020-12-14T22:00:02.700Z
Septem151
<p>I need single integer converted from public BTC address. Is it enough to Base58Check decode the address and I will get hex/binary format of that integer or do I need to do something more?</p>
<p>What will be the format of Base58Check decoded data? Will there be any checksums, additional bytes?</p>
<p>I can write a script in Bash/Perl/Python if I would have instructions.</p>

<address>
Convert public address to large integer
pbies
# Convert public address to large integer

(Asked by: username_0 on 2020-06-19)

I need single integer converted from public BTC address. Is it enough to Base58Check decode the address and I will get hex/binary format of that integer or do I need to do something more?

What will be the format of Base58Check decoded data? Will there be any checksums, additional bytes?

I can write a script in Bash/Perl/Python if I would have instructions.

**Tags:** address


---

## 1 answers

### Answer by username_1 on 2020-06-20. Score: 1 | Accepted answer

NOTE: This applies only to **LEGACY ADDRESSES** that start with a "1". Addresses starting with "3" have 0x0014 appended to the beginning and are Base58Check encoded, while addresses starting with "bc1q" have 0x0014 appended to the beginning but are encoded with **Bech32 Encoding**.

You will get Hex/binary after decoding from Base58Check. There should be 20 bytes after decoding the Address to get the public key's hash. If whatever process or function you're using to Base58Check decode doesn't remove the version byte and checksum, you will have 25 bytes instead: The first byte will be 0x00 (the version), and the last 4 bytes (the chscksum) will be the first 4 bytes of the double SHA256 hash of the other 21 bytes.

What you'd be converting to a large integer is the HASH160 of the Public Key; aka, the result of taking the public key in compressed format (33 bytes) and running it through SHA256 then running that hash through RIPEMD-160.

More information about legacy addresses can be found [here](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address). Additionally, I've written a breakdown on how addresses are created [here](https://github.com/EAWF/BTC-Toolbox/blob/old-master/Address-Derivation.md#addresses).


---

