In this article, we try to move one definition after another, so you can understand progressively more concepts.
Function transforming any input into a has, which is a string that looks random, and of finite size.
| Text input | MD5 Hash |
|---|---|
| Dog | c935d187f0b998ef720390f85014ed1e |
| dog | 06d80eb0c50b49a509b49f2424e8c805 |
| dogs | d28d2d3560fa76f0dbb1a452f8c38169 |
Several properties:
0123456789qbcdef)A decentralized network is a network which is not owned by a single entity. In the philosophy, it is open to anyone who want to respect the rules.
Blockchain is the name of the most famous network. The idea is to store transaction into “blocks”. A block contain a thousand of transaction. The history is linear, there is a single last block, there is a common history for all. This helps checking the balance of the accounts.
In the network, we have two kind of people:
In a decentralized network, you have no control on the participants joining. Some will play nice, some not. You need to ensure that people will act as expected, to guarantee the stability. The first thing is avoiding a fork. We want a single block history, there should not be branching, there should not be a choice of the branch to select.
To do that, there is the “game” of the proof of work, which is the choice of Bitcoin. A participant of the network can only publish a block if it is able to find a solution to the following problem:
Your goal is to find a string such as hash_x = SHA256(last_hast + guess_string) has at least d leading zeros (the difficulty).
This task is difficult, so participant needs to invest a lot of effort to get a solution. This will prevent people from publishing blocks too frequently.
The number of hash computed by seconds. This could be a spec for a device (GPU, ASIC), or the overall number of hash computed by all the Bitcoin participants.
How to compute the hash rate pf the network ? Bitcoin participants are not sending their electricity bill.
We can estimate it given the current difficulty of getting a valid proof.
At the date of writting, the hash rate was 620 Exa Hash/sec (10^18).
The difficulty is made in such a way a solution is found every 10 minutes.
So, if we want to find the number of leading zeros in the solution, this is easy:
difficulty = log2(hash rate x 60 x 10)
difficulty = log2(620 x 10^18 x 60 x 10) = 78 bits
78 bits corresponds to 19 zeros in hexadecimals. One recent solution was:
0000000000000000000256491fdd7cc579979b0b3f2397a73aac597ffebe8237
Bitcoin was the first “decentralized network”. Proof of work has its drawbacks: you need a lot of computing power to win a block, so there is an arm-race, leading to a high power demand.
Other networks have emerged after that, with alternative consensus mechanisms.
But in most, the more money you have, the better as some point, as you are able to control more of the fundamentals of the network.
Proof-of-stake: The more you own (and invest) in the network, the more power you have. This is equivalent to traditional exchanges where when you have shares in a company, you get coupons every X and you have a right to vote. This system is very similar to stocks and shares, where the more you own, the more you get as a reward, and the more power you have to vote changes in the network
Proof-of-authority:
Proof-of-space
Proof-of-location:
Proof-of-ownership:
End-user, real people doing transaction, needs to advertize the full network.
The MemPool is a kind of “decentralized” database storing the transaction that need to be processed. This is a kind of waiting list.
When building a block, miners take a look at it. They are incentived to take the one with the highest transaction fees (as miner collect them in their block).
Normally, when a transaction arrive in a mempool, we cannot rollback. Nevertheless, the beneficiaries will only receive the funds after the transaction is officially processed.
Traditional currencies like Euro, Dollar, Yen, etc.
They are issued by a government and not backed by a physical counterparty like gold or silver.
Money conversion direction:
Bitcoins are not stored in your pockets, as your saving are not stored under your bed.
A wallet is the place where the keys to your digital currency are stored. These keys help you to forge transactions. A wallet is just a secured software, and can handle multiple cryptocurrency at a time. Private keys for each network are recognizable, they often have an header.
https://strm.sh/posts/bitcoin-address-generation-in-pure-python/
TODO: illustration
There are several keys in a wallet
A hot wallet is like your bank: You log in with a password, they offer recovery methods. They (the entity managing the wallet) ensure the security of your private keys
A cold wallet is a private key stored by your own means, either on a file in a USB stick, either on a paper, or in a physical devide like Ledger.
YOU are responsible of the storage and the security.
A wallet is custodial if you do not manage the keys of your wallet. Most of the time, when you use an exchange, you do not have access to the private key, and everything is accessible thanks to your email and main password.
A non-custodial wallet is a wallet that you manage yourself.
This is similar to hot and cold at some point, but not completely. You can have your wallet online, but completely encrypted. You will need to manage the access key yourself.
With Bitcoin, we quickly discover that security has a price, which is network capacity. Because of the proof of work, we are limited in the number of transactions. This is why some other blockchains appeared, with other consensus mecanisms. Yet, there is still some limitation or other drawbacks. And Bitcoin has not been left, so people search for a way to improve network capacity. Here comes the layers.
Layer 1 is the “real” / low level blockchain with its “small” capacity but all the garantees.
Layer 2 is a set of protocols / other mecanisms working on top of layer 1, where transactions are done “off-chain”, i.e., they are not recorded in the blockchain’s blocks.
Layer 3 tries to increase the capacity of level 2 using other mechanisms.
Today (2024), we are talking about this 3 layers architecture. Nevertheless, layers 3 do not exists at all, and layer 2 are experimental / in progress but not democratized. The most known layer 2 is the Lightning network 1, which allows doing bitcoin transactions thanks to bitcoin smartcontract and peer-to-peer network.
It is good to have big numbers in mind
Number of transaction in a block: 6400 (when 1.4MB)
Exchanges are marketplaces where you can exchange cryptocurrency against something. In the regulated ones, you can buy crypto using fiat money or to sell them. You can also exchange one crypto currency (say ethereum) against another (for instance dodge coin). In some specialized exchanges, you can buy NFT
In decentralized exchanges, you cannot use fiat money, but
Decentralized exchange
Unless you are able to mine cryptocurrency, you ca
Private keys or wallet keys are a list of bits. They can be read thanks to hexadecimal formal (you look at 4 bits at a time and convert it as a alphanum charecter in 0123456789abcdef).
Nevertheless, this is quite difficult to remember, or to copy (in a paper notebook for instance).
In BIP39 has been introduced a way to convert the private keys into a list of human readable words. BIP39 wordlist
Each word represent 11 bits of the key.
This words are common, so their writing cannot be mistaken, and they have been choosen such as all four first letters are different.
In Bitcoin, a private key is 256 bits, so you would need 24 words to represent it.
TODO
## Hierarchical Deterministic Wallet
Rather than having many private keys to remember, another option is to have a master key and to derive all private key from it. TODO
For Know Your Customer.
The idea of bitcoin was to do transaction without sharing your identity. Anyone can create a cold wallet at no cost. However, it is empty. To get some coins, you need to exchange fiat money (€, $, £, …) against tokens/coins. To do that, you need to provide your identity (ID card).
Bitcoin Improvement Proposal
List of proposal (some are draft, other accepted or rejected) to improve the Bitcoin protocol.
As it exist for “normals” protocols with “RFC: Request for Comment”.
2048 words (one word represent 11 bits) which can represent your private key passphrase to get your private key / wallet unlocked. Words should be short and common. The four first letters are different for all words. From the wallet private key, you can issue several public key for different cryptocurrency. For a wallet: 12 words. Therefore, the key is 11 x 12 = 132 bits longEthereum Request for Comment
Same as BIP, but for Ethereum.
The most known are:
# Smart Contract
This is a piece of code which can be executed during a blockchain transaction.
Within a blockchain, it is useless to run for instance a code doing image segmentation as there is no value. As a blockchain is a set of addresses and currency with verifiable properties, the codes are “contract” which gives credentials / prove the ownership of something to someone.
Non-Fongible Tokens.2
This is a particular type of “digital object” created thanks to smartcontract.
Interaction are done with the smartcontract.
To a digital document (image, text, or anything else) is given a signature and the possiblity to be owned.
The Smartcontract defines:
Lyfecycle of a token.
>> You can subscribe to my mailing list here for a monthly update. <<