Navigate back to the homepage

The Basics of Cryptography

Tomasz Waszczyk
September 18th, 2022 · 1 min read

…seems like life gave me a call to action…

Creation of Bitcoin address from scratch

In order to create a Bitcoin address, a private key, which is a randomly generated number, is multiplied using an elliptic curve to produce a publik key. Generated public key is then put through both SHA-256 and RIPEMD-160 hashing algorithms.

1A = RIPEMD-160( SHA-256(K) )
5A - Encrypted public key
6K - Public key

The use of the SHA-256 and RIPEMD-160 hashing algorithms for the creation of a Bitcoin address gave one big advantage: shorter addresses. A public key is 256 bits long whereas, the hashed version of the Bitcoin address is 160 bits long.

As we can see, the SHA-256 hashing algorithm is a core part of the Bitcoin protocol, but it is not enough. Using additionally RIPEMD-160 is like psychopath vibe - so needed in this kind of systems.

The. World. Is. Crazy. LITERALLY.

But only the truth is interesting.

Random fact: The inventor of SHA-2 (Secure Hash Algorithm 2) is United States National Security Agency (NSA), their work was published publicly in 2001.

PS. In the header of the post is a picture of Marian Rejewski - the great Polish code breaker, the author of bombe decryption machine built in Bletchley Park. Marian Rejewski together with Jerzy Różycki and Henryk Zygalski developed techniques to decrypt the German machine ciphers during World War II.


  1. One time pad

  2. Wallet from private key

More articles from

Seria artykułów publikowana na łamach Stowarzyszenia Inwestorów Indywidualnych

Dzisiaj akcjonariusze, jutro tokenariusze

April 8th, 2022 · 1 min read

Raspberry Pi Recipes

Common issues and solutions while playing with Linux bare-metal

April 7th, 2022 · 1 min read
© 2020–2022
Link to $ to $ to $ to $