




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































Important rules of our basic blockchain
transazioni)
The problem with our current implementation ANYONE CAN ADD AN ENTRY TO THE LEDGER Solution -> add signatures -> Only signed transactions are valid Greedy Users What if a users accumulates a huge debt and then refuses to settle-up? Nothing is preventing a user from running away Solution -> No possibility for overspending The Trusted Central Entity Problem Il problema della Trusted Central Entity (Entità Centrale Fidata) riguarda la necessità di affidarsi a un’unica autorità per verificare e registrare le transazioni. ! Where is the central ledger stored? ! Can we really trust the (third) entity that manages the ledger? ! Do we really want to pay for the ledger administration (fee/commissions)? To make sure the system works, every user should receive a notification about the transaction. Can we Trust Ledgers? ! What if for some reason the notification failed? ! What if different ledgers receive the transaction in different orders? Entrambi i problemi si risolvono con protocolli robusti di consenso e sincronizzazione tra i nodi della rete. Solution: ! Control that each transaction is correctly registered (e.g., order) on each ledger ! Avoid contradictory information on different ledgers ! Trust in the single administrations Problems with Multiple Ledgers % Automatically manage the interaction between different systems, without manual operations. Quando più registri interagiscono (es. blockchain diverse o database tradizionali), possono sorgere problemi di coerenza e compatibilità. Soluzione: Creazione di protocolli standard (come interoperabilità tra blockchain via bridge o API). % Automatic procedures: requires synchronizing different applications, perhaps developed with different technologies Questi sistemi devono essere sincronizzati in modo affidabile e coerente. Soluzione: Uso di smart contracts cross-chain o middleware per collegare diversi sistemi. % Trust problems Un ledger potrebbe avere dati modificati o essere gestito da un’entità non affidabile. Soluzione: Tecnologie decentralizzate come blockchain per garantire che i dati siano verificabili da tutti senza bisogno di un’autorità centrale. % Auditing is complex Conciliare transazioni tra sistemi diversi richiede tempo e risorse. Soluzione: Creare registri pubblicamente verificabili, dove ogni transazione può essere tracciata facilmente senza alterazioni.
Agreeing on the List ! All transactions are appended to a list ! There are transaction users want to approve ! Any user can send transactions in random orders Consensus Design of a consensus mechanism ! Define what operations can be added (e.g., the consensus can forbidden to add a transaction that spend more money than the available money). ! Define the order Solution -> stabilire quali operazioni sono valide e in che ordine devono essere registrate. ! Il consenso è usato per determinare l’ordine dei blocchi nella blockchain. ! Non riguarda il contenuto delle transazioni, ma solo se un blocco può essere aggiunto alla catena. ! Garantisce che tutti i nodi della rete siano allineati sull’ordine dei blocchi, evitando conflitti o discrepanze.
Distributed Ledger Technology A DLT is a decentralized replicated record of data managed and maintained by multiple untrusted entities without the need of a regulator authority " Un DLT è una tecnologia di registro distribuito che consente a più entità non fidate di gestire e mantenere una copia dei dati in modo decentralizzato. " I DLT sono caratterizzati da trasparenza, sicurezza e resilienza grazie alla replicazione dei dati tra i nodi, e non richiedono un’autorità centrale. " Gli esempi più noti di DLT includono la blockchain e il DAG. Decentralized " Ogni nodo di un DLT mantiene una propria copia del registro. " Non c’è una autorità centrale a cui fare riferimento; la validità delle transazioni e dei blocchi è determinata dal consenso tra i nodi. " Ogni nodo lavora per mantenere e aggiornare il proprio registro seguendo le regole predefinite dal sistema. " La sincronizzazione e la sicurezza sono garantite dal meccanismo di consenso, che assicura che tutti i nodi abbiano la stessa versione del registro. Replicated Record of Data " DLTs are decentralized systems that replicate data across multiple nodes. " Data is organized as a list of records, where each record represents a transaction. " The last record defines the current state of the system. " DLTs are versatile and can store various types of data, such as financial transactions, smart contracts, sensor data, and intellectual property rights.
Managed and Maintained ! Each node has its own copy of the ledger ! Each node works to update its own copy ! Each node works for the benefit of the distributed ledger ! Copies may differ, so the majority hold the truth (if there are malicious user, or a blockchain fork) Untrusted Members ! Nodes do not trust other nodes in the network (every user can send a information that can be malevolus) ! Each node directly communicates with other peer nodes in the network (in general a subset of the network) N.B. a user can propose a modification previous blocks, but other users will refuse the modification, since they will all see a modification to previous blocks. Classification of DLTs ○ Permissionless^ Blockchain (Inherently Public) Every node in the network participate in consensus procedure ○ Permissioned^ Blockchain (Public or Private) Only selected nodes (validators, e.g., Government or trusted nodes) participate in consensus procedure $ Le blockchain permissive sono completamente aperte a chiunque, favorendo la decentralizzazione e la trasparenza ma con sfide come l’efficienza e il consumo energetico. $ Le blockchain permesse sono limitate a nodi selezionati, che possono garantire una maggiore scalabilità, velocità e privacy, ma sacrificano in parte la decentralizzazione. NUMBERS OF TRANSACTION ELABORATED PER SECOND TIME NEEDED TO VALIDATE A TRANSACTION
Blockchain ! Blocks are organized on a chain ! Each block is cryptographically linked to the previous one Only special nodes in the network can create blocks and add them to the blockchain. These nodes are called Miners: ! Everyone can be a miner. ! The miner proposes a block (remember a block is a list of transactions), which should then be confirmed ! Depending on the consensus protocol, miners execute different tasks
! A nonce is a 32-bit number used to generate a unique hash for each block ! The Merkle root contains a single hash that can validate every single transaction hash in the block. A nonce is a random or incremental number that miners change when trying to find a valid block hash in blockchain mining (ad es. ho bisogno di 10 0 al termine dell'hash, o comunque un n. di 0 che cambia sulla base della potenza della rete) N.B. le notifiche di aggiornamento del ledger per i vari nodes, generano una notifica anche ad alcuni miners, che lavorano per trovare il nonce corretto per generare l'hash del block (il block viene diffuso nella rete a tutti e il miner riceve il premio)
Monolithic Applications ! When executing a task (e.g, using social networks) the device need to execute multiple different tasks ! Backend server, messaging service, database… (many services taking care of deciding where to save, effectively storing, adding metadata, etc). ! We say that a system is monolithic when all the devices executing the different tasks are tightly coupled (i.e., on the same machine) Le applicazioni monolitiche sono un’architettura software in cui tutti i componenti e le funzionalità dell’applicazione sono combinati in un’unica unità. Questo significa che l’interfaccia utente, la logica di business e l’accesso ai dati sono tutti contenuti in un’unica base di codice e vengono distribuiti come un’unica applicazione. Problems with Monolithic A possible problem: $ If more and more users start using the system, it gets congested. The machine is not able to simultaneously reply to all users’ requests. $ The system start to consume the request and reply, but the response might take a long time. Solutions: $ One option may be to increase the machine’s power.
Cryptography Primer We have three fundamental topics we need to cover when dealing with blockchain a. Hash functions b. Cryptographic Keys c. Digital signatures Cryptography, or cryptology is the practice and study of techniques for secure communication in the presence of adversarial behavior. Generally, Cryptography is about constructing and analyzing protocols (rules) that prevent third parties or the public from reading private messages. Hash Function We use hash functions to create digital fingerprints s by providing data in input to a cryptographic hash function. U cant never generate the input from the output. Hash means something that is chopped into small pieces or mixed up. The output size is fixed, and depends on the hashing algorithm used. Different inputs provide different hashed outputs. A small change to the input creates a completely different output The length of the output is still the same, 32-byte Allow for integrity check -> garantisce che i dati siano intatti e autentici, proteggendoli da modifiche non autorizzate Properties
Simplified Model
Requirements
To compute MAC it is typical to use DES
Public Key Encryption Public Key Encryption is Asymmetric: use of two separate keys for encryption and decryption.
Steps 1⃣ Generazione delle Chiavi
Authentication/Data Integrity Vogliamo vedere se il sender è un trusted user e possiamo accettare l'invio Esempio alice vuole solo il messaggio da bob, nel mazzo di chiavi alice ha tutte le public key degli utenti, Bob per mandare il messaggio invia il messaggio come un input al algoritmo di ecncription e tramite la sua private key lo encripta Quindi se io encripto con public key decripto con private key (e viceversa), quindi se bob encripta co la private key e la trasmette con il ciphertext alice dovrà decriptare con la public key che possiede nel mazzo di chiavi e dovrà scegliere quella di bob per decriptarla, se no avrà un output che non corrisponde Spiegato meglio Bob firma il messaggio: Bob calcola un hash del messaggio e cifra l’hash con la sua chiave privata, creando una firma digitale. Alice verifica la firma: Alice riceve il messaggio e la firma, quindi usa la chiave pubblica di Bob per verificare la firma. Se la firma è valida, Alice sa che il messaggio è autentico e proviene effettivamente da Bob. Questo processo garantisce che il messaggio non è stato alterato (integrità) e che proviene effettivamente da Bob (autenticità). Requirements for Public Key
Asymmetric Encryption Algorithms