<p>Bitcoin address is generated as follows :</p>

<p>First 256 bits of Private key(k) is generated using underlying operating system's pseudo random number generating function (in wallet).</p>

<p>Then Public key (K) = G * k. , where G is constant on the elliptic curve. i.e. equivalent to k times addition of G and the resulting point K is on the curve which is 65 Bytes.</p>

<p>The address is calculated by performing SHA256 followed by RIPEMD160 on public key (K). so that would be of 160 bits = 20 Bytes of address. </p>

<p>Now, Add version prefix 00(in hex). Perform SHA256 twice on it. Take first 4 Bytes of result and append it to (prefix || address). </p>

<p>Resultant would be final address.</p>

CC BY-SA 3.0
2017-12-09T10:47:10.270Z
2017-12-09T10:47:10.270Z
DOLLY PATWA
<p>Here you can find a step-by-step description of how bitcoin address is generated: <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses</a></p>

<p>Short answer:
Bitcoin address consists of
<code>&lt;version_byte&gt;&lt;20 bytes of RIPEMD-160(SHA-256(PublicKey))&gt;&lt;4 bytes checksum&gt;</code> = 25 bytes in total</p>

<p>Checksum is just first 4 bytes of SHA(SHA()) of previous data</p>

CC BY-SA 3.0
2017-12-09T13:15:51.497Z
2017-12-09T13:15:51.497Z
Stepan Snigirev
<p>(I'm new to Bitcoin &amp; it's technology so correct me wherever u can) .Recently I was reading about Bitcoin and it's underlying technologies. I came to know that for generating addresses Bitcoin uses RIPEMD-160(SHA-256). But most of the Bitcoin Addresses are 25 to 34 Bytes(characters) long &amp; starts with 1 or 3. How is this possible? Is there any underlying Encryption algorithm is there along with Hashing functions like RIPEMD &amp; SHA?</p>

<bitcoin-core><address><address-generation>
Why Bitcoin address are 25-34 bytes long when RIPEMD 160 & SHA-256 are only 20 bytes and 32 bytes long respectively?
mnp343
# Why Bitcoin address are 25-34 bytes long when RIPEMD 160 & SHA-256 are only 20 bytes and 32 bytes long respectively?

(Asked by: username_0 on 2017-12-09)

(I'm new to Bitcoin & it's technology so correct me wherever u can) .Recently I was reading about Bitcoin and it's underlying technologies. I came to know that for generating addresses Bitcoin uses RIPEMD-160(SHA-256). But most of the Bitcoin Addresses are 25 to 34 Bytes(characters) long & starts with 1 or 3. How is this possible? Is there any underlying Encryption algorithm is there along with Hashing functions like RIPEMD & SHA?

**Tags:** bitcoin-core, address, address-generation


---

## 2 answers

### Answer by username_1 on 2017-12-09. Score: 1

Bitcoin address is generated as follows :

First 256 bits of Private key(k) is generated using underlying operating system's pseudo random number generating function (in wallet).

Then Public key (K) = G \* k. , where G is constant on the elliptic curve. i.e. equivalent to k times addition of G and the resulting point K is on the curve which is 65 Bytes.

The address is calculated by performing SHA256 followed by RIPEMD160 on public key (K). so that would be of 160 bits = 20 Bytes of address.

Now, Add version prefix 00(in hex). Perform SHA256 twice on it. Take first 4 Bytes of result and append it to (prefix || address).

Resultant would be final address.


---

### Answer by username_2 on 2017-12-09. Score: 1

Here you can find a step-by-step description of how bitcoin address is generated: <https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses>

Short answer:
Bitcoin address consists of
`<version_byte><20 bytes of RIPEMD-160(SHA-256(PublicKey))><4 bytes checksum>` = 25 bytes in total

Checksum is just first 4 bytes of SHA(SHA()) of previous data


---

