© 2024 Kishan Kumar. All rights reserved.

Why do all transactions and addresses on the blockchain have the prefix 0x?

If you are new to the blockchain, you probably would have set up your Metamask and gotten your first address.

May 28, 2023


If you are new to the blockchain, you probably would have set up your Metamask and gotten your first address. If you haven't, why not we get you an address first? You can read the below article to get started.

How to get started with the Decentralized Web?

The web as we know it today is primarily controlled by a few powerful entities that host, manage and monetize our data and content. These centralized platforms have the power to censor, manipulate and exploit our online activities and expose us to security breaches, privacy violations, and identity theft.

To your surprise, it is a whopping 42-character address. I know what you might have thought of, some email address kind of notation, right? Yeah, me too; I thought I'd get some kishan@ethereum.com something.

Anyways, an address looks something like this : 0x71C7656EC8a208b098defB751B7401B5f6d8976F

Please do not send any tokens to this address; this is a randomly generated Ethereum address. Basically, this address is derived from the last 20 bytes of the public key controlling the account. The address has a prefix 0x.

The prefix “0x” is used to indicate that the following number or value is written in hexadecimal (base 16) format. Hexadecimal is a numbering system that uses 16 digits, ranging from 0 to 9 and A to F, to represent values.

For example, consider the hexadecimal value "2A". Without the "0x" prefix, it could be mistakenly interpreted as the decimal value "2" followed by the character "A." However, using the "0x" prefix, "0x2A" clearly indicates that it is the hexadecimal representation of 42 in decimal.

But why?

Makes sense, but why use Hexadecimal at all?

The short answer will be that it provides a convenient way to express binary values in a more compact and human-readable format.


I know you are not, so let's wear our tech glasses because I am gonna go into the depths of computer science.

I am cool

In computing, memory addresses and binary values are often represented using groups of bits. Each bit can have a value of 0 or 1, representing the two binary digits. However, working with long sequences of 0s and 1s can be cumbersome and error-prone for humans, and this is where Hexadecimal provides a more concise representation. If you want to know about bits and bytes of computer storage, I've also written an article on that.

How much data can we store in 1 byte, kilobyte, megabyte, gigabyte, etc.?

In this article, we'll try to visualize the storage system of a modern computer. After reading this article, you'll have an idea to compare how much storage is with day-to-day life.

Coming back, Hexadecimal is a base-16 numbering system that uses 16 different digits to represent values. These digits are 0–9 for the values 0–9 and A-F for the values 10–15.

Each digit in a hexadecimal number corresponds to a group of four bits, also known as a nibble.

Since each hexadecimal digit represents four bits, it aligns well with the 8-bit byte used in most computer systems. Two hexadecimal digits can precisely represent one byte of information, making it easier to read and understand memory addresses or binary values.

For example, the binary value 10100101 can be represented in Hexadecimal as A5 (1010 0101). This representation is much shorter and more manageable, especially with larger values.

Additionally, hexadecimal aligns well with computer systems' bitwise operations and memory addressing. It allows for easier manipulation of individual bits or groups of bits, making it useful in low-level programming and debugging.

If I were to use our normal decimal representation for the above Ethereum address 0x71C7656EC8a208b098defB751B7401B5f6d8976F. What do you think it would be? Will it be hard to remember? Let's be honest; no one is gonna remember the 42-character-long address.

But if 42 characters are tough (actually 40 since 0x is just a prefix), then how about 48 characters?

The decimal representation of the above address is649562641436227856830463694991988922426500618095

This is a huge blockchain issue; people came up with human-readable addresses to address it. Such as kishan.eth (not my address, though; I wish it were mine), etc. This human-readable addresses on the surface are your old address only; it is just mapped so that you can share them without any hassle.

If you are interested, you can go ahead and link your current address with a human-readable address using ENS (Ethereum Name Service). It is a subscription-based model, just like any .com domain.

Have you got your .eth domain yet?

There is a new trend in the blockchain community: users are grabbing their blockchain-specific domain. Some are going after the .crypto domain, and some are going after the .sol domain. Each blockchain offers a domain followed by its native token.

Thank You

Thank You

That should be it for this article. I thank you for taking your valuable time to read this article. Thank you.


    .   .   .

    The 0xkishan Newsletter

    Subscribe to the newsletter to learn more about the decentralized web, AI and technology.

    © 2024 Kishan Kumar. All rights reserved.