01 - Intro
Overview
- Description:: introduction
Blockchain
- it is not the invisible technology that’s changing the world
- open ledger that can record transactions between two parties efficiently
- transactions: blocks
- a copy of blockchain is distributed to every node
- consensus is achieved through dedicated algorithms
- executing user-defined scripts (smart contacts)
THE BLOCKCHAIN IS NOT A DATABASE: it is a TRANSACTION LIST
Databases vs. Blockchain
- database are used to store data, blockchain are used to store transactions
Transactions
-
transfer of assets from account A to B
-
accounts are numbers: we don’t care about people or characteristics!
- but to make sure to verify the person, we could use some methods: the account
- signature: proof that someone is authorized to do and to do this they have a special private key they only have that identify himself
- but to make sure to verify the person, we could use some methods: the account
-
EOA Accounts: they are external: bots, systems… whatever
EVERY TRANSACTION IS UNIQUE
Ledger
Totally order: every transaction is up or above another The order matters!
- this is done to avoid Double spending problem
- 🔼 Revise the Double spending problem 📅 2023-09-27 ✅ 2023-10-14
Blocks
- Blocks group and collate transactions → they are time units → as far as transactions grow as long as block are produced
- the order matters as well!
- the blocks are regularly updated: the head contains meta-information about the other blocks
- a wallet is a lightweight client that fetches only blocks it’s interested to
Blockchain IS DECENTRALIZED: there is not any “official” server, it is just a protocol.
- every single node has the history of each node? NOPE!
The time of transactions doesn’t determine the order of the transactions!
We don’t decide if it’s true or false → the network decides! The blockchain saves data in a permanent way.
Eventual consistency
- Before doing any transaction, the network needs to confirm this transaction.
- For this reason, transactions are slow.
- A transaction has more probability to enter into a block if it promises more fee!
- BTC: also free
- ETH: it’s not
Proof of Work
- if you want to be a book publisher fair, but prove me you care about books
- crypto-puzzle: if you win, you’re entitled to distribute new blocks
- you will be rewarded!
There is a new amount of BTC circulating on every new block
The minining pool is a cluster of nodes that solves crypto puzzles together. PoW is a protocol that dictates if you win or not.
Smart contracts
Smart Contracts are pieces of code.
Smart Contracts are mere pieces of code.
They have no random function, and are turing-complete (deterministic). They can do whatever because they are codes!
They live in the ETH layer.
They execute a function when called!
They are mainly used for GAMBLING!
An account can invoke Smart Contracts. Not the other way!