The bitcoin addresses or bitcoin address is a unique chain of number and letters that allow us to send and receive our coins safely on the Bitcoin network. But how is a bitcoin address generated? What is your secret? Well here we tell you everything about this process.

ABefore starting, it is essential to mention that this article is aimed at those users who possess certain knowledge about Bitcoin and the crypto world. So we recommend that you first review certain topics of this world in order for you to understand them. With this you will be very clear about the relationship they have with Bitcoin and the creation of addresses. Among these articles are the asymmetric cryptography, hash function, SHA-256 algorithms y ECDSA.

Now let's take a brief look at what a Bitcoin address is. You can take a look in our article What is a Bitcoin address? to expand your knowledge.

Well, in the world of cryptocurrencies, an address is an identifier, the place to which a certain amount of cryptocurrencies is associated and destined. Therefore, anyone who wants to send or receive cryptocurrencies will always need to have an address. For example, in Bitcoin public addresses generally look like this: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. As we can see they are a set of alternate letters and numbers whose length varies between 26 and 32 characters.

To create an address, a total of 9 steps are required, which we will explain in detail below.

Process to create a Bitcoin address

The process to create a Bitcoin address first starts with the generation of a private key. This will provide us with the exclusive use of the funds. From this, a public key is generated, which will allow us to share information with other people without putting our funds at risk. Obtaining the public key through the private key is due to the application of the algorithm ECDSA. A very efficient implementation of elliptic curve cryptography, where the curve is used as a generator point secp256k1 to get the public key.

Then, once this key pair is generated, the process of generating the public addresses of Bitcoin begins.

1.- Select the public key obtained from the previous process. That is, from the application of the algorithm ECDSA a the private key. Which should have an appearance similar to this one:

0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352

2.- Apply a hashing to the public key by implementing the algorithm SHA-256. This algorithm allows to generate outputs (outputs) of fixed extension from inputs (inputs) of variable extension, which are irreversible. So they are unidirectional and it is not possible to deduce the private key through the public one.

After applying the hashing function we will obtain a 256-bit stream:

0b7c28c9b7290c98d7438e70b3d3f7c848fbd7d1dc194ff83f4f7cc9b1378e98

3.- Hashear again the previously obtained output, applying in this case the algorithm RIPEMD-160. With which it produces we will obtain a 160-bit stream:

f54a5851e9372b87810a8e60cdd2e7cfd80b6e31

4.- Add the version byte used for Bitcoin's core network (0x00) in front of the output obtained from the RIPEMD-160 hashing algorithm application. With this we will obtain a Bitcoin address in hexadecimal format, which will look like this:

00f54a5851e9372b87810a8e60cdd2e7cfd80b6e31

And by adding this byte it also allows to identify and distinguish Bitcoin addresses from other cryptocurrencies that also use the protocol.

5.- Perform the hash with the SHA-256 algorithm to the result obtained from RIPEMD-160. This step is necessary as a verification mechanism to verify that the Bitcoin address is spelled correctly.

ad3c854da227c7e99c4abfad4ea41d71311160df2e415e713318c70d67c6b41c

6.- Apply the hash with the SHA-256 algorithm to the result of the previous hash. This step concatenates the address obtained. As already mentioned, the SHA-256 algorithm is applied twice as a verification mechanism.

c7f18fe8fcbed6396741e58ad259b5cb16b7fd7f041904147ba1dcffabf747fd

7.- Choose the first 4 bytes of the last SHA-256 hash, which represent the Bitcoin address checksum. In this example they would be:

c7f18fe8

8.- Add the 4 bytes of the checksum of the previous point, to the extended hash RIPEMD-160 of point 4. This is a 25 byte Bitcoin binary address:

00f54a5851e9372b87810a8e60cdd2e7cfd80b6e31c7f18fe8

9.- Convert the result of the byte string using Base58Check encoding, used to encode Bitcoin addresses. So the byte string will be transformed into a string base58.

1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs

This is the most widely used format for Bitcoin addresses. So the encoding Base58Check converts the byte string to a set of uppercase and lowercase letters and numbers. This in order to make them easier to distinguish. Although as a whole they are still illegible characters and at first glance they are not cryptic.

This is the whole process whose term is to create a bitcoin address so that we can use it as we wish. All this process is also carried out with the Vanity Address, they are what this last case we do a generation by brute force in order to find a personalized address. Well, learn more about these types of addresses from our excellent article about Vanity Addres.

How much do you know, cryptonuta?

Does address generation in Bitcoin have the ability to generate unique addresses at all times?

TRUE!

One of the most powerful characteristics of the generation process in Bitcoin is that it is capable of creating unique and unrepeatable addresses for Bitcoin for all its users at all times.

Overview of Bitcoin addresses

  1. Each public Bitcoin address weighs approximately 25 bytes.
  2. They are made up of a length of between 26 and 32 characters.
  3. They can start with number 1, for standard addresses (P2PKH) or number 3, for multi-signature addresses (P2SH). Likewise, the addresses followed start with bc1 (bech32). On the other hand, the directions Bitcoin testnet they start with m o 2.
  4. The implementation of Base58Check among its many functions, prevents the use of characters such as O, I (in uppercase), and l (in lowercase) in order to avoid that they are confused with the number 0 or number 1.