Blockchain Systems Fundamentals (part 3).pptx
Document Details
Uploaded by CalmingAluminium
Tags
Full Transcript
Blockchain Systems Fundamentals Reference: Blockchain Basics – A non-technical introduction in 25 steps by Daniel Drescher Step 19: Choosing a transaction history Metaphor Have you noticed in some parks that there are created paths based on the architect’s plan and then there are beat...
Blockchain Systems Fundamentals Reference: Blockchain Basics – A non-technical introduction in 25 steps by Daniel Drescher Step 19: Choosing a transaction history Metaphor Have you noticed in some parks that there are created paths based on the architect’s plan and then there are beaten paths created by the deliberate choice of visitors (which fit the requirements of visitors more closely than the design of the architect) Goal: Maintain one unambiguous history of transaction data Challenge At all times, a node is either examining a block created by its peers or trying hard to create a new block itself No centralised clock to co-ordinate these activities – they are activated by the arrival of a newly created block in the inbox of the node Arrival of blocks depends on the network – messages may arrive in different orders, get delayed or worse, lost => nodes do not have the same information at their disposal Therefore, there is need to identify which history of transactions among the several versions is the correct one (without a central solution) Step 19: Choosing a transaction history The Idea Distributed consensus Allow the nodes to vote with their feet (just like visitors in a park) Decision reached among independently acting individuals without a central element of control or co-ordination A situation in which a swarm of independently acting individuals solves a collective problem has the following conditions: The group operates in an identical environment A collective decision-making problem exists The individuals independently strive to achieve an identical goal The individual actions performed to achieve one’s goal leave visible marks in the environment that help to decide the collective decision-making problem The individuals use identical criterion for evaluating the decision-making problem based on the alteration of their environment Step 19: Choosing a transaction history The Idea For the blockchain, the idea is to let all nodes independently choose one version of the transaction history and this is why it works: All nodes operate in an identical network, maintaining individual copies of the blockchain data structure and use the same blockchain algorithm to govern their behaviour The collective decision-making problem is to select one transaction history collectively All nodes strive to maximise their individual income earned as reward for adding new valid blocks to the blockchain data structure In order to achieve their goals, all nodes send their new blocks to all their peers to have them validated. As a result, each node leaves its individual footprint that is the collectively maintained blockchain data structure The criterion which could be used by the nodes to select transaction history would be the one with the highest aggregated computational effort – it would be like the natural path taken by visitors in the park This collectively selected version of the transaction history is called the authoritative history or chain Step 19: Choosing a transaction history How it works Two criteria are used for selecting the highest computational effort Longest chain criterion: the one which has the most blocks represents the highest computational effort (assumption: each block has the same difficulty) Heaviest chain criterion: when each block has different difficulty level, the longest chain does not necessarily represent the highest computational effort – we can have this by adding up the difficulty levels of each block The choice of the criteria will depend on whether the difficulty level is the same or not for different blocks Step 19: Choosing a transaction history Selecting one specific chain among the conflicting versions and establishing at the authoritative chain has the following consequences: Orphan blocks: these are blocks which are rejected out of the authoritative chain – these are abandoned Reclaimed reward: reward for the orphan blocks and all the subsequent blocks are withdrawn from the node that initially received it Clarifying ownership: Only transactions part of the authoritative chain are considered to have happened and are used to clarify ownership-related requests – the orphan blocks are treated as non-existent Step 19: Choosing a transaction history Selecting one specific chain among the conflicting versions and establishing at the authoritative chain has the following consequences: Reprocessing of transactions: Data that was part of orphan blocks are given another chance to become part of the transaction history by putting them in the node’s inbox again to be reprocessed A growing common trunk: The criteria mentioned before for selecting transaction history do not always yield unambiguous results – yet the common trunk is often less ambigious Step 19: Choosing a transaction history Selecting one specific chain among the conflicting versions and establishing at the authoritative chain has the following consequences: Eventual consistency In case of ambiguous results of authoritative chain, the decision is random in terms of which trunk the new block wants to extend Thus the deeper down the authoritative chain a block is located: The further in the past it was added The more time has passed since its inclusion in the blockchain data structure The more common effort has been spent on adding subsequent blocks The less it is affected by random changes of the blocks that belong to the longest chain The less likely it will be abandoned The more accepted it is by the nodes of the system The more anchored it is in the common history of the nodes The fact that certainty concerning the inclusion of blocks in the authoritative chain increases with time and as more blocks are added eventually is called eventual consistency Step 19: Choosing a transaction history Selecting one specific chain among the conflicting versions and establishing at the authoritative chain has the following consequences: Robustness against manipulations This rests on the fact that a majority of computational power of the whole system is needed to establish and maintain the authoritative chain As long as honest nodes own the majority of the computational resources of the whole system, the path maintained by them will grow fastest and outpace any competing paths Threats to the voting schema These require turning the actual authoritative chain into orphan blocks and building a new one Economically these try to change ownership rights by altering transaction data They also try to gain a majority of voting power to manipulate the collective decision- making process These threats of course compromise integrity in the system, but they always try to establish a new element of centrality – this is why they are called 51% attacks Step 19: Choosing a transaction history The role of the hash puzzle A new role of the hash puzzle is that it is the price that makes submitting a voting ballot costly and deters the dishonest from taking part in the vote Why it works The blockchain binds voting power on computational power – to gather voting power one must gain majority of the accumulated computational power of the whole blockchain system Next we look at the importance of reward and the instrument of payment Step 20: Paying for integrity The Metaphor Let’s say that you have a bakery, and you struggle to make both ends meet. It is difficult to pay your employees. Yet, you always have break left after the day’s sales. Therefore, you decide to pay them with bread instead of money. This will help in reducing wastage of bread and reduce your cash problems. Initially, this is not popular but soon, other companies imitate your strategy paying their employees with the goods they produce. The central bank is the only one paying with money in the end This is of course not practical in all cases though – there probably needs a set of conditions for the mode of payment to be practical Step 20: Paying for integrity Competition for reward and threat of punishment are the two forces that make the peers verify transactions orderly and select the transaction history that unites the most collective effort Rewards are based on transaction fees and proof of work This is immaterial of the application for which the blockchain is being used The choice of instrument of payment is not the same for all applications though Step 20: Paying for integrity The choice of a payment instrument needs to consider the following: Impact on the integrity of the system It has to be valuable, worthwhile and trustworthy for the peers to continue working for the integrity of the blockchain Impact on the openness of the system It has to be accessible everywhere and be free from restrictions such availability only in some countries or with restrictions on capital movement Impact on the distributed nature of the system It cannot be governed by a central authority otherwise it would lose its distributed nature Impact on the philosophy of the system Every blockchain that claims to be completely open and purely distributed must find a proper means of payment in line with the philosophy of the system Step 20: Paying for integrity Desirable properties of an instrument of payment for compensating peers: Be available in digital form to be included in the blockchain Be accepted as an instrument of payment in the real world as well to allow peers to use the compensation earned outside the blockchain as well Be accepted as payment in all countries around the world Not be subject to restrictions on capital movement Have a stable value (and not regularly lose value) Be trustworthy (otherwise the blockchain will not be trusted) Not be controlled by one single central organisation to maintain the distributed nature of the blockchain Step 20: Paying for integrity Answer to the mode of payment: cryptocurrency First attempt: Bitcoin Purely distributed peer-to-peer system that management ownership of a digital currency which is used to compensate the peers for verifying and adding new blocks to the blockchain data structure Uses cryptography => cryptographic money or cryptocurrency Definition of cryptocurrency Independent digital currency whose ownership is managed by a blockchain that uses it as an instrument of payment for compensating its peers for maintaining integrity of the system Step 21: Bringing the pieces together The following tasks were set to design a distributed peer-to-peer system for managing ownership: Describe ownership – history of transaction data Protecting ownership – digital signature Storing transaction data – blockchain data structure Preparing ledgers for being distributed – Immutability Distributing ledgers – Information forwarding in networks Adding new transactions – blockchain algorithm Deciding which ledger represents the truth – distributed consensus Step 21: Bringing the pieces together Concept Purpose Metaphor used Transaction Data Describe transfer of ownership Bank Transfer Form Transaction History Proving the current state of Course of a relay race ownership Cryptographic Hash Identifying any kind of data Human Fingerprints Value uniquely Asymmetric Encrypting and decrypting data Public mailbox with a lock Cryptography Digital Signature Stating agreement with the Handwritten signature content of transaction data Hash reference A reference that becomes invalid Cloakroom tickets that once the data being referred to utilises hash values for are changed identifying cloak hooks Change-sensitive data Storing data in a way that makes Jackets that carry cloakroom structures any manipulation stand out tickets in their pockets immediately Step 21: Bringing the pieces together Concept Purpose Metaphor used Hash puzzle Imposing a computationally expensive Opening a number lock by task trial and error Blockchain data Storing transaction data in a change- A library with a card catalog structure sensitive way and maintaining their order Immutability Making it impossible to change the Attempt to establish a fake history of transaction data family history Distributed peer-to- Sharing the transaction history among Groups of independent peer network all nodes of a network witnesses Message passing Ensure that all nodes of the system Gossip among people eventually receive all information Blockchain algorithm Ensure that only valid transaction data Carrot and stick approach to are added to the blockchain data ruling contractors structure Step 21: Bringing the pieces together Concept Purpose Metaphor used Distributed Consensus Ensure that all nodes of the Beaten path in a park as a system use the identical history result of visitors voting with of transaction data their feet Compensation Giving nodes an incentive to Bakery that pays maintain integrity The blockchain serves two purposes: Clarifying ownership: who owns what amount of what object at what time? Transferring ownership: Changing the current state of ownership by transferring ownership of their property to someone else Step 21: Bringing the pieces together The quality of a blockchain is described by its nonfunctional aspects: Highly available: 24x7 Censorship proof: no central power to control content Reliable: Fulfils its purpose consistently and with good quality e.g. clarifies and transfers ownership correctly Open: Does not exclude users or computers Pseudo anonymous: Identifies owners uniquely but neither maintains nor reveals their real-world identity Step 21: Bringing the pieces together The quality of a blockchain is described by its nonfunctional aspects: Secure Individual transactions ensure ownership is kept exclusive to the disposal of the lawful owner only On the overall level, it protects ownership from everyone from manipulation, forgery, counterfeiting, double spending and unauthorised access Resilient: It is able to clarify and transfer ownership even in difficult conditions (attacks) Eventually consistent The blockchain will not yield consistent results all the time Instead, the chance of getting consistent results will increase over time and will eventually reach full consistency throughout the whole system Keeping Integrity Behaviour is free of logical errors Step 21: Bringing the pieces together The internal functioning of the blockchain can be traced to the following major components: Ownership logic The storage logic maintains the whole history of transaction data A consensus logic ensure its consistency Transaction processing logic ensures only valid transaction data are added and transaction security ensures only the lawful owner can transfer his property to another account Transaction Security It relies on principles such as identification , authentication and authorisation which depend on digital signatures (which use cryptographic hash values) and asymmetric cryptography Step 21: Bringing the pieces together The internal functioning of the blockchain can be traced to the following major components: Transaction Processing Logic It depends on a collective validation of transaction data using a mixture of competition and peer control Storage Logic It depends on maintaining an immutable append-only data store based on proof of work and the blockchain data structure Its functioning depends on hash puzzles, hash references and change- sensitive data structures Step 21: Bringing the pieces together The internal functioning of the blockchain can be traced to the following major components: Peer to peer architecture It determines how the nodes are related and connected to one another via a network Each node maintains its own copy of the blockchain data structure Each node communicates in a gossip-style manner to ensure all nodes receive the necessary information Consensus logic All nodes can sometime have different histories of transactions due to delays and other network adversities They achieve consensus by choosing the version of transaction history that requires the most collective effort Characteristics of the blockchain are also the source of its limitations which are examined next