Series, volume 5

[Bitcoin Refresher Course]
Q&A format for easy understanding! (Part 2)

My name is Mirumi, and I run a blog called "Mirume" (https://mirumi.me). My main profession is software engineering, and I spend my days either programming or writing blog posts. For some time, I will be contributing articles on a wide range of topics, primarily focusing on IT technology. Please treat me kindly.

Following the previous issue, this time we will also explore Bitcoin through a Q&A format. In this issue, let's delve into the finer details and examine them from a technical perspective.

By the way, this is a small piece of information similar to an editor's note from the previous issue, but the price fluctuations of Bitcoin over the past 3 months have been truly historic. Specifically, it shattered the record for the highest price, which had remained unchanged since November 2021, and did so with unprecedented momentum.

In the previous issue, we mentioned something like "The current price of Bitcoin is around 7 million yen," but actually, when I finished writing the initial draft, it was 6 million yen. We deliberately increased the number just before submitting the article. However, by the time the publication came out, the price had already exceeded 10 million yen...

Behind this major event, as mentioned in the introduction of the previous issue, lies the existence of "U.S. Bitcoin spot ETFs." The amount invested in Bitcoin through these ETFs was extremely large. I am very excited to see what records Bitcoin will continue to set in the future.

Q: What is a Bitcoin address?

A: Bitcoin has a concept called an address, which is often compared to a bank account number. Strings like "35wXoEmtRjebRpF3TZHax2dJFjkeSmiRBQ" represent each individual address, and the balance of Bitcoin for each address is recorded separately. Of course, when sending Bitcoin, you need to specify the recipient's address.

However, a significant difference from regular bank accounts is that the contents of each address are constantly and publicly available to everyone worldwide. As mentioned in the previous issue, all "transactions" are recorded on a "blockchain." Since sending money is precisely a transaction, which address sent funds to which other address is always made public.

However, this only means that the balance and transaction history are publicly available; it doesn't mean that the assets themselves are actually located there. Otherwise, the money present here would disappear almost instantly. So, how can we reconcile these two elements: "securely managing one's assets" and "publicly visible addresses and balances"? This is where the core of the Bitcoin system lies. Let's continue exploring.

Q: Where does the actual existence of my assets lie?

A: Looking back at the elements that have appeared so far, blockchain only records transactions, and addresses only reveal the balance. Currently, I don't know where or how my actual Bitcoin is recorded.

To understand this, it's necessary to learn about Bitcoin's "UTXO model," and furthermore, a deeper look at the internal structure of transactions is required for a better understanding. Let's proceed step by step.

The internal structure of a transaction is largely divided into two groups: inputs and outputs. Inputs represent the valid assets used for the current payment, while outputs indicate where the paid assets are transferred to. An input is identical to an output that was previously created somewhere else. This can be intuitively understood by considering the principle that "you cannot pay money if you don't receive it."

1. This process involves using funds received from somewhere (input) and any remaining change to create the next payment (output)

You can use three 100-yen coins to buy something that costs 300 yen, but you can also pay using combinations like (100) + (50 x 3) + (10 x 4) + (5 x 2), or you might even pay with a 500-yen note and receive 200 yen in change. In Bitcoin, these individual coins or combinations are called UTXOs (Unspent Transaction Outputs), and the logic is that outputs from past transactions that have not yet been used (i.e., funds available to you) become inputs.

These are the "components that create the amount to be paid," and they represent the input itself. The total amount of the input must be greater than or equal to the desired payment amount, so the output (which is essentially a new UTXO) usually consists of "the originally intended payment amount" and "change."

Now, let's return to the title of this section. Although blockchain does not directly record the balance of any address, how can we manage the assets associated with each address? Now you should understand the answer. The Bitcoin balance of an address is completely identical to the sum of all UTXOs (Unspent Transaction Outputs) associated with that address. By examining all the data on the blockchain, it's immediately clear how many UTXOs a particular address holds, and therefore, the asset balance is automatically determined.

Q: Is it theft-proof? How do you put things "in the safe"?

Based on what we've learned so far, it seems we can say that "the ability to create new outputs from UTXOs means you can use your own Bitcoin." In other words, if we understand how to secure this capability, we might also be able to learn how to protect Bitcoin.

This is where public-key cryptography comes into play. Let's first clarify the characters involved.

2. Basic structure of public-key cryptography

A "public key," which can be used by others, is used for encrypting messages and verifying signatures, while a "private key," which only the owner must manage and keep secret, is used for decrypting messages and creating signatures. This allows one to prove that a sent message has not been tampered with and that it was indeed sent by the sender. Furthermore, it's possible to create a system where only the owner can retrieve (decrypt) specific data. Doesn't this sound somewhat similar to how Bitcoin works?

We would like to examine how public and private keys function within a transaction, but before that, let's also understand the relationship between each key and its corresponding address. I have created a diagram for this purpose.

3. The relationship between private keys, public keys, and addresses

The private key is generated using a random number generator, and based on this private key, a corresponding public key is generated through "elliptic curve cryptography." Because the keys are related, it allows for decryption of encrypted data or verification of someone's signature. Furthermore, the Bitcoin address is derived from the public key, and it is transformed by a hash function. Since it is a hash, this process is irreversible; therefore, while the sequence is "private key -> public key -> address," it is impossible to revert any step in the process.

Now, let's actually take a look inside the transaction.

4. Public-key cryptography within transactions

This diagram illustrates how public-key cryptography functions within a transaction. To summarize the process, ①the input includes a signature generated using the owner's private key to prove the right to use the previous output (meaning only the owner can spend their own funds), ②the output specifies which public key should be used as a condition for using this Bitcoin next (meaning that ownership of the assets associated with this address is proven to belong only to the holder of the corresponding private key), and ③surrounding nodes repeatedly verify the validity of this signature by actually using the public key.

Here's what we can understand: "Only your private key protects your assets." Even if a UTXO (Unspent Transaction Output) remains on the blockchain, if you lose the private key that unlocks it, those bitcoins will be permanently inaccessible. Your bitcoins are essentially your private key, and how you store this is the most important thing to consider.

Returning to the title of this section, it becomes clear that how to prevent Bitcoin from being stolen can be rephrased as a question of how to store the private key. While we do not need to manage our own private keys when buying, selling, or sending/receiving funds on cryptocurrency exchanges (as the exchange manages them securely), if we want to manage our own cryptocurrencies in our own wallets, we will inevitably have to consider methods for managing the private key.

Currently, the best practices for storing cryptocurrency include methods such as recording it in a hardware wallet, writing it down on paper or engraving it onto metal plates or stone tablets and storing them in a safe, or using other secure offline storage solutions. Absolutely avoid saving your assets on PCs or online platforms! Only you can protect your assets; remember the principle: "Don't trust, verify."

Q: How do I send money?

A: Now that we've come this far, we are actually in a position to almost fully explain the money transfer mechanism. Let's follow the flow together, while also reviewing and summarizing what we've covered.

First, a transaction representing the transfer is created. This creation is handled by the exchange's system if it's a transfer through an exchange, or by your personal wallet application if it's a transfer from your own wallet. In either case, you should possess the correct private key, which you use to select valid assets from previous UTXOs and sign the transaction. The completed transaction is then broadcast to other nodes, as described in the previous issue. These receiving nodes verify the validity of the transaction. If verification is successful and the transaction is included in the blockchain, the transfer is considered complete, and your Bitcoin is transferred to a different address.

When making a payment, it's also important to see how other nodes are verifying the transaction. The fact that the Bitcoin being used for the payment actually belongs to the owner is already proven by the public-key cryptography mentioned earlier. What remains is to check if there has been a double-spending attempt, but this issue is already resolved by the UTXO model. Since the Bitcoin that can be used for a payment is essentially a UTXO, nodes that maintain a complete copy of the blockchain (called full nodes) can quickly determine whether the input of the payment has been used in previous transactions.

When a transaction successfully passes validation, it is incorporated into the chain and becomes a new block. However, as mentioned in the previous issue, the chain has the potential to temporarily branch, so a single block confirmation does not mean that "the transfer is complete." If the chain does not become the official record, the transfers included within it will be considered invalid. Therefore, the question arises: "How many confirmations are necessary?" The answer is that this number is freely determined by each system that utilizes blockchain technology. Whether it's an exchange that processes a large volume of small transactions or a trust service focused on high-value transfers, there is a necessity for each use case to have its own value. For reference, it is common practice to use 6 block confirmations as a general guideline.

Q: I heard that actual money transfers often have high fees and are slow.

A: Finally, I would like to briefly introduce some of the challenges associated with Bitcoin, in hopes that it might spark an interest in other cryptocurrencies and blockchain technologies. While I have mainly discussed Bitcoin's transaction process so far, it is actually quite difficult for it to be conveniently used in everyday life.

Firstly, the fees are too high for simple money transfers. The amount varies considerably depending on the time, but recently it has been roughly in the range of a few hundred to a few thousand yen. Those who have used domestic cryptocurrency exchanges for sending and receiving funds may have seen even higher amounts (which include the exchange's fees as well).

Secondly, the time required for a transaction to complete is too long (for what are considered the main use cases). It takes approximately 10 minutes for a block to be confirmed, and having to stand at the checkout counter with the store clerk every time you make a purchase, staring each other down for 10 minutes, seems somewhat tedious. Moreover, this is based on the assumption that only 1 confirmation is needed per transaction; in reality, it could be several times higher.

To address this issue, I would like to conclude by introducing 2 main types of solutions that are currently being explored in the cryptography industry.

1. Layer-2 solutions, such as those exemplified by the Lightning Network

2. The emergence of new blockchains and cryptocurrencies that are not Bitcoin

One approach, if I were to explain it directly without worrying about misunderstandings, is something like: "For most small transactions, it might not be necessary to write them individually to the blockchain every time. Instead, we could process these transactions in batches outside of the chain and only record the final result on the blockchain." This is a very complex but interesting design, and it's considered an essential technology for the future of the cryptocurrency industry.

The second category refers to the numerous other cryptocurrencies that have emerged with the aim of solving the challenges associated with Bitcoin. In fact, some already exist that offer transaction fees of around 1 yen and transactions completed in just a few seconds. While I won't list specific currency names here, it can be enjoyable to explore these options and discover your own "favorite" cryptocurrency.

(Written by Miru)

(Featured in the Summer Issue of Up&Coming '24)



Previous page
    
Index
    
Next page

Up&Coming

LOADING