The Capital

Educating and empowering readers on all things crypto and blockchain. For business inquiries…

Follow publication

Blockchain Basics: Ledgers and Wallets — Part 3

0xNazu.sol
The Capital
Published in
11 min readFeb 18, 2025

In Part 2 (Trustless Systems) of our Blockchain Basics series, we covered the evolution of the internet from Web1 to Web3, their differences, and the basic definition of blockchain. Now, we’re gonna talk about ledgers, arguably the core of what makes blockchain work and the most important aspect of Web3: Wallets.

Ledgers are important to understand because, at its core, a blockchain is just a ledger. Though it’s much more than that, of course. The main idea behind blockchain is to keep track of all transactions happening on a specific network. In this section, I’ll break down how ledgers work, some security challenges they face, how blockchain solves those issues, and more.

Imagine this: Sammy and Nazu are friends who frequently loan each other money. Over time, it becomes hard to keep track of who lent what, and they sometimes forget the amounts, as a result, they face some confusion and even conflict. So, they decided to create a simple system to record all their transactions.

Their solution? A ledger! just a notebook or a piece of paper where they list every loan. To keep it simple, let’s give them identifiers: S for Sammy and N for Nazu.

For example, on 2024/11/10, Sammy lends Nazu 200 $. To track this, they write it down:
S > N: 200 $

The next day, Nazu pays back 150 $ to Sammy. So, they add another entry:
S < N: 150 $

At the end of the month, they check their ledger and see that Sammy has sent more money to Nazu overall. After doing the math, they realize that Nazu still owes Sammy 50 $, so he needs to pay that back to settle their accounts. This is the basic idea behind a ledger, it helps keep track of transactions in a clear and organized way.

The problem with this ledger, though, is that S and N have to trust each other completely. What if one day, Nazu thinks, “Sammy isn’t checking the ledger. I’ll just change the 50 $ I owe to 10 $ instead.” If Sammy doesn’t notice, he might believe it. That’s the first major issue: anyone can modify the ledger at any time, which makes it unreliable.

So how do we fix this? The first idea that comes to mind is introducing a third party to verify transactions. This third party would check and confirm that, yes, Sammy sent this amount, and yes, Nazu paid back that amount. Now, instead of managing the ledger themselves, S and N go through the third party, let’s call it a bank (B).

The bank now records, stores, and maintains the ledger, while Sammy and Nazu can only view it but can’t make changes themselves. This removes the need for trust between S and N, but now the trust is placed entirely on the bank. And here’s the problem: aren’t we trying to build a decentralized system?

At the end of the day, the bank could still modify, delete, or add transactions however it wants. Even worse, S and N have no way of knowing if the ledger is accurate. And here’s where things get political, what if one day, a new government comes into power and decides to change financial policies, manipulate banks, or even use the system as a weapon against opponents? Would you still trust the bank then? Probably not.

So, adding a third party seems like a solution, it just creates a new problem tho: centralized control over the ledger. Now, instead of trusting just one person, you’re trusting a whole system that can be influenced or even corrupted.

This is where blockchain comes in. This is exactly why blockchain was invented, to solve problems like this.

We don’t want a central entity.
We don’t want a bank.
We don’t want one person, one group, or one company controlling our data or our ledger.

What if the bank gets hacked? All the money could be lost. The ledger could be stolen, destroyed, or even manipulated. This is the biggest issue with storing important data in a centralized system, if that single point of failure gets compromised, everything falls apart.

Now, to be fair, it might not always be the bank’s fault if they get hacked. But at the end of the day, they are responsible for securing their system, and if they fail, it’s still their responsibility. So instead of relying on a system that can be attacked, manipulated, or controlled, we need a better way, a system where no single entity holds all the power. That’s exactly what blockchain offers.

In this context, ledger and blockchain are basically the same thing, but keep in mind our earlier definition of blockchain: A blockchain is a distributed, decentralized, publicly available ledger or transactions that are verified.

1. Distributed

Look at the first example (in the image above). That ledger isn’t distributed, it’s stored in one place. What happens if the bank shuts down? The ledger disappears with it.

Now, on the right-hand side, we have a blockchain ledger, which is distributed across multiple participants, or nodes (represented by the yellow dots storing copies of the ledger). If one or two nodes go offline, the ledger still exists because other nodes still have a copy. So, accessing the blockchain = accessing the ledger at any time.

2. Decentralized

Unlike a traditional ledger stored by a single entity (like a bank), a blockchain ledger is held by many different people. This means no single entity controls it, reducing the risk of manipulation or failure.

3. Publicly Available

Anyone can view the ledger from any of these different nodes. This transparency ensures that no one can secretly alter the records. And that’s the key difference. A blockchain ledger effectively solves the trust problem by being distributed, decentralized, and publicly verifiable.

Now, let’s talk about some key properties of blockchain. (1) One of the biggest features of blockchain is that it’s immutable, meaning it can’t be changed over time. Once something is recorded, it stays there forever. (2) We already know this: blockchains are public. That means anyone can view the data. No hidden records, no secrecy. (3 ) Instead of being controlled by one central authority (like a bank or government), blockchain is controlled by many different nodes. This prevents a single point of failure and ensures that no one has total control. (4) The data is spread out across multiple locations (nodes). No single entity owns it. Everyone shares the same version of the truth. (5) Everything on the blockchain is stored in order, from the earliest transactions to the most recent ones. If there were no order, the entire system would be a mess. The chronological structure ensures everything is properly recorded and traceable. (6) This is a big one. Once a transaction is recorded, it can’t be changed, reversed, or deleted. If I send you 200 $ in BTC, I can’t take it back. No refunds, no chargebacks. What’s on the blockchain stays on the blockchain: forever.

Wallets

A wallet is basically your bank account on a blockchain. It lets you send, receive, and store funds securely. In this section, I’ll break down how wallets work, how to create one, how to keep it secure, and a lot more. This is just the fundamentals, but everything we cover here applies to 99% of blockchain wallets, they all work in pretty much the same way. With that said, let’s get started. But before everything, you need to understand three important terms: (1) Private Key (2) Public Key (3) Address

All of these are deeply connected, and everything starts with the private key.

What is a Private Key?

A private key is essentially the password to your wallet. It’s the most important part of your wallet’s security. If you lose your private key, you lose access to your funds: forever!! You won’t be able to send transactions, check your balance, or recover your wallet. No one can help you get it back. There’s no support team, no “forgot password” option, nothing!!

So, protect your private key at all costs. Store it somewhere secure and offline, write it down on paper, save it on different devices, but never put it online or share it with anyone.

What is a Private Key, Technically?

A private key is just a 64-character hexadecimal string (random numbers and letters). It’s automatically generated when you create a wallet. You don’t need to memorize it or even fully understand it, just know that it acts as your wallet’s ultimate key.

Encrypted Private Keys (EPK)

Since a private key is so sensitive, it’s usually encrypted for extra protection. Here’s how it works:

  1. You create a private key (PK).
  2. You set a password (PWD), something you can remember, like a password for your Google or X account.
  3. The private key is encrypted using this password. The result is an Encrypted Private Key (EPK).

So, the encryption process looks like this:

PK + PWD → EPK (Encrypted Private Key)

To use your private key later, you need to decrypt it using the same password:

EPK + PWD → PK (Decryption)

This adds an extra layer of security. Even if someone steals your encrypted private key, they can’t use it without the password.

What is a Public Key?

As the name suggests, a public key is public, unlike your private key, which must remain secret. Your public key is a unique identifier for your wallet, and you can freely share it online.

Once a private key is created, we generate a public key by passing the private key through a hash function. This process converts the private key into a new, unique value that acts as your public key.

The process looks like this:

Private Key → (Hash Function) → Public Key

One key feature of this system is that you cannot reverse the process, meaning, someone cannot figure out your private key just by knowing your public key. This is an important part of the security model used in blockchain.

Wallet Address

Once we have the public key for our wallet, we use a hash function again to generate what’s called an address.

Public Key → (Hash Function) → Wallet Address

To recap, it all started with the private key (PK), which generated the public key (PUBK), and from that, we created the wallet address.

A wallet address is exactly what it sounds like. It’s the identifier that you give to people so they can send you something, like cryptocurrency.

“Hey, this is my wallet. Here’s my address, send me some BTC.”

You might wonder: “If we already have a public key, why do we need an address as well?”

Good question! In Web2, we usually just use the public key. It’s enough to identify us online, like using email addresses or domain names. But in Web3, we add an extra layer of security with the address. Why? Because it’s possible, though difficult, to try to guess the private key from the public key.

By adding the address, we make it harder for someone to guess the private key. They’d have to guess the public key first, then guess the private key, which makes it two layers of guessing. This is a fundamental security feature in Web3.

To make things even more secure, we could introduce an additional layer, similar to how IP addresses and domain names work. Humans struggle to remember long strings like IP addresses, so we use DNS (Domain Name System) to map domain names to IPs.

In the same way, we could create shorter wallet addresses. For example, instead of a long string like Bitcoin’s default address, we could have something like “sammy.btc” or “nazu.eth” for Ethereum. These are Address Domain Names (ADN), which act as shortcuts to your actual wallet address.

This would solve two problems:

  1. Better security: now, anyone trying to guess your private key would have to go through multiple layers of encryption and guessing, making it harder to crack.
  2. Better user experience: with ADNs, you won’t have to remember long strings or copy-paste addresses anymore.

Now that we understand the three core concepts: private key, public key, and wallet address, let’s talk about how hash functions work and why they’re crucial to the security of your wallet. Having these three components is important, but security also depends on how these elements are secured.

Hash Functions

This is basically how the security mechanism behind our wallets works. We take our private key (PK) and pass it through a hash function, which then outputs the public key (PUBK).

One of the key properties of a hash function is that it’s nearly impossible to trace the output back to its original input. This means that, from the output (the public key), you can’t figure out the original input (the private key). To illustrate this, here’s how the public key and private key interact with the hash function:

With a typical function, what you can do is find what’s called the inverse of that function. The inverse of a function is written like this: f⁻¹(x) = y. But if you know the original input, it would look like f⁻¹(y) = x.

What this means is that, given the output (Y) from a function, you can usually figure out what the input (X) was to generate that output. For example, if we have a function like f(x) = x + 2, and we pass x = 1 into it, we get the output f(1) = 3. It’s easy to figure out, given the output 3 and the function f(x), what the original input was (x = 1) to generate that output.

What we actually do is the inverse: y = x + 2. So, given Y, we can figure out what X is. It’s simple: y — 2 = x. So if you give me Y, which in this case is 3, I can plug it into my inverse function (y — 2 = x) to get x = 1.

Now, the property of a hash function is that there’s no inverse. It’s practically impossible, mathematically, it just can’t be done. The only way to get back to the original input is by guessing, which could take millions of years.

Next, hash functions produce an output that’s uniform. What I mean by that is the output always has certain properties, like, it will always be the same length.

Another property is that hash functions are deterministic. This means if I pass X into the hash function, it will always give me the same Y.

One more thing: hash collisions are extremely rare. What I mean by a collision is when two different inputs (x1 and x2) produce the same output (y). It’s practically impossible for that to happen due to the math behind the hash function, though I can’t guarantee it 100%.

Lastly, when we talk about a hash function, we pass an input (X) into it, and the result is called a digest, hash, or output.

That’s all I’ve got for wallets. Hope this section was helpful!

Want to get into DeFi yield and airdrop farming? Don’t have time? Don’t know where to start?

Join our newsletter and private group of 300+ DeFi farmers for simple, top 5-minute yield opportunities — plus get our 400+ airdrop database as a bonus!

The Capital
The Capital

Published in The Capital

Educating and empowering readers on all things crypto and blockchain. For business inquiries: business@thecapital.io

0xNazu.sol
0xNazu.sol

Written by 0xNazu.sol

I break stuff, I build stuff :/

No responses yet

Write a response