A collection of fragments of understanding in the pursuit of deeper questions.
What this course is about
What this course is not about
The Ledger A ledger is a container which gathers every business transaction occurring for a given account. It generally contains the date and amount of the transaction. There are several ledgers, most notably, the Accounts Receivable Ledger and the Accounts Payable Ledger. The concept of ledger goes back to 1494 when mathematician Luca Pacioli first invented the double-entry bookkeeping accounting system. Plenty of accounts: assets, liabilities, capital, income, expenses...
This system still functions today. The accounts are reported in the so called balance sheet and income statement (cash flows are reported in the CFS). There are several ledger formats, most notably the T-account and the three- or four-column ledger.
Two concepts are fundamental to understand the Blockchain:
Thinking in Layers
Thinking about Blockchain as software architecture.
The metaphor: do you have a mobile phone?
We use this approach all the time when we learn how to use a new technology. There is a problem though: these mental partitions are highly individual. This typically leads to problems in communication. Unifying the way of partitioning a system is the key point when discussing technology.
Application vs. Implementation Layers Separating the user's needs from the technical internals of a system leads to a clear separation of the application layer from the implementation layer. Everything that belongs to the application layer is concerned with the user's needs (e.g., listening to music, taking photos, or booking hotel rooms). Everything that belongs to the implementation layer is concerned with making these things happen (e.g., converting digital information into acoustic signals, recognizing the color of a pixel in a digital camera, or sending messages over the Internet to a booking system). Elements of the implementation layer are technical by nature and are considered a mean to an end.
Functional vs. Nonfunctional Layers Distinguishing between what a system does and how it does what is does leads to the separation of functional and nonfunctional aspects. Examples of functional aspects are sending data over a network, playing music, taking photos, and manipulating individual pixels of a picture. Examples of nonfunctional aspects are a beautiful graphical user interface, fast-running software, and an ability to keep user data private and safe. Other important nonfunctional aspects of a system are security and integrity. Integrity means that a system behaves as intended, and it involves many aspects such as security and correctness.
Let's layer the mobile phone...
Functional aspects of the application layer serve obvious needs of the users. These elements are typically the ones users learn about. On the other hand, the nonfunctional aspects of the implementation layer are rarely seen as major elements of the system.
Integrity Three components:
Everybody uses software everyday with great success. Everybody is pretty happy about it. We may change our feelings quite drastically the minute our interaction with the software fails or the software itself fails. On these occasions, we begin to realize that software integrity is a highly valuable commodity. Hence, it should not come as a surprise that software professionals spend a lot of their time working on this seemingly tiny nonfunctional aspect of their implementation layer.
Blockchain as a Software Architecture The metaphor: Have you ever bought a car? Cars are equipped with different types of engines (e.g., diesel, gasoline, or electric engine). This is an example of the process of modularization, which is the result of applying the idea of layering to cars. Two cars that look identical from the outside can differ dramatically with respect to the power of their engines and hence have very different driving performance. Additionally, your choice of the engine will have an impact on other characteristics of the car, like its price, its operational costs, the type of fuel consumed, the exhaust system, and the dimensions of the brakes.
Layering a Payment System
Why do we have a question mark? That's the "engine" of our system. In other words, it's the architecture of the system.
Hints on Software Architectures There exist dozens of ways to implement software systems. One of the fundamental decisions we must take regards its architecture. An architecture is the way components are organized and related to one another. There are three major approaches:
Centralized
Decentralized
Distributed
Pros of a Distributed System
Higher computing power: The computing power of a distributed system is the result of combining the computing power of all connected computers. Hence, distributed systems typically have more computing power than each individual computer. This has been proven true even when comparing distributed systems comprised of computers of relatively low computing power with isolated super computers.
Cost reduction: The price of mainstream computers, memory, disk space, and networking equipment has fallen dramatically during the past 20 years. Since distributed systems consist of many computers, the initial costs of distributed systems are higher than the initial costs of individual computers. However, the costs of creating, maintaining, and operating a super-computer are still much higher than the costs of creating, maintaining, and operating a distributed system. This is particularly true since replacing individual computers of a distributed system can be done with no significant overall system impact.
Higher reliability: The increased reliability of a distributed system is based on the fact that the whole network of computers can continue operating even when individual machines crash. A distributed system does not have a single point of failure. If one element fails, the remaining elements can take over. Hence, a single super-computer typically has a lower reliability than a distributed system.
Ability to grow naturally: The computing power of a distributed system is the result of the aggregated computing power of its constituents. One can increase the computing power of the whole system by connecting additional computers with the system. As a result, the computing power of the whole system can be increased incrementally on a fine-grained scale. This supports the way in which the demand for computing power increases in many organizations. The incremental growth of distributed systems is in contrast to the growth of the computing power of individual computers. Individual computers provide identical power until they are replaced by a more powerful computer. This results in a discontinuous growth of computing power, which is only rarely appreciated by the consumers of computing services.
Cons of a Distributed System
Coordination overhead: Distributed systems do not have central entities that coordinate their members. Hence, the coordination must be done by the members of the system themselves. Coordinating work among coworkers in a distributed system is challenging and costs effort and computing power that cannot be spent on the genuine computing task, hence, the term coordination overhead.
Communication overhead: Coordination requires communication. Hence, the computers that form a distributed system have to communicate with one another. This requires the existence of a communication protocol and the sending, receiving, and processing of messages, which in turn costs effort and computing power that cannot be spend on the genuine computing task, hence, the term communication overhead.
Dependency on networks: Any kind of communication requires a medium. The medium is responsible for transferring information between the entities communicating with one another. Computers in distributed systems communicate by means of messages passed through a network. Networks have their own challenges and adversities, which in turn impact the communication and coordination among computers that form a distributed system. However, without any network, there will be no distributed system, no communication, and therefore no coordination among the nodes, thus the dependency on networks.
Higher program complexity: Solving a computation problem involves writing programs and software. Due to the disadvantages mentioned previously, any software in a distributed system has to solve additional problems such as coordination, communication, and utilizing of networks. This increases the complexity of the software.
Security issues: Communication over a network means sending and sharing data that are critical for the genuine computing task. However, sending information through a network implies security concerns as untrustworthy entities may misuse the network in order to access and exploit information. Hence, any distributed system has to address security concerns. The less restricted the access to the network over which the distributed nodes communicate is, the higher the security concerns are for the distributed system.
Distributed Peer-to-Peer Systems (P2P) P2P networks are a special kind of distributed systems. Each node shares its computing power over the network so that other nodes can exploit it. Each and every node has the exact same rights and roles in the system. All the nodes are both suppliers and consumers of resources. Lots of applications: file sharing, content distribution, privacy protection.
What about hybrid architectures? There are pros and cons both for centralized and distributed networks. What if we combine them in an hybrid shape? These are just two examples of typical blockchain systems.
How can we identify a distributed system? The increasing diffusion of hybrid systems makes it hard to clearly and uniquely identify distributed systems. It is really hard to come up with a generally accepted definition of distributed system. Here is a trick: If you are in doubt whether or not a system is distributed, look for a single component (e.g., a database, a name or user registry, a login or logoff component, or an emergency switch-off button) that could terminate the whole system. If you find such a component, the system under consideration is not distributed.
Designing Distributed Systems - Google Case Study Google is a US-based internet company. Born as a research project at Stanford in 1998. Now it has a dominant share of the Internet search market. Capable of diversifying itself: cloud computing. Amazing case study from distributed systems perspective: extremely demanding requirements, particularly in terms of scalability, reliability, performance and openness.
Google Hetereogeneous Business
![]() |
![]() |
|---|
Overall System Architecture
Scalability, need to scale up to Ultra-Large Scale distributed system. Google views the problem in 3D:
Reliability, Google has stringent reliability requirements, especially with regard to availability of services. This demands both detecting failures and adopting strategies to mask or tolerate such failures. Such strategies rely heavily on the redundancy in the underlying physical architecture.
Performance, keen on achieving low latency of user interactions.
Openness, strong requirement for openness, particularly to support further development in the range of web applications on offer.
Google Infrastructure
Hints on distributed computing: MapReduce To complement the storage and coordination services, it is also important to support high-performance distributed computation over the large datasets. This is the main goal of the paradigm MapReduce. There are three key principles:
![]() |
![]() |
|---|---|
![]() |
![]() |
The Purpose of the Blockchain The metaphor: Can you remember the last time you bought a CD for yourself in a music store? Well, maybe not so much since nowadays people tend to download music or simply stream it (e.g., Spotify, Apple Music, ...). The real game changer was just a piece of software called Napster (released in 1999) which allowed to share music files among peers. "This system, what's most interesting about it is, you're interacting with peers, you're exchanging information with a person down the street". (Shawn Fanning, cofounder of Napster).
A Revolutionary Change - the Case of Music Industry The music industry has worked for a long time in the following way:
In early 2000s, lots of things changed:
Say bye bye to intermediaries The idea here is simple: a P2P system has the power to completely replace the middlemen with P2P interactions. In the case of the music industry, the studios and their marketing and distribution channels that acted as the middlemen between artists and consumers have been replaced by P2P file sharing systems. The major characteristics that made the music industry so vulnerable to being replaced by P2P systems are the immaterial nature of music and the low costs of copying and transferring data.
What is the potential of a P2P system? The power of peer-to-peer systems is not restricted to the music industry. Each industry that mainly acts as a middleman between producers and customers of immaterial or digital goods and services is vulnerable to being replaced by a peer-to-peer system. An example: the financial industry.
Towards the Full Digitalization? What is it that you have in your bank account or on your credit card?
The concept of digitalization has been around for a long time. Only a small amount of actual money and assets do exist as physical entities like banknotes and coins. All the rest is in the form of immaterial information, namely bits and bytes, in the centralized information technology systems. Actors like banks are just middlemen between procedures and consumers of those bits and bytes.
Each transaction being borrowing, lending or transferring money from one account to another is the transfer of an immaterial good. This is operated by middlemen or intermediaries. The world is full of intermediaries: a simple money transfer across countries involves several intermediaries with a long processing time. Of course, this increases the transaction costs.
So why choosing a P2P system? In a P2P system, the same transfer is much simpler, way faster and would cost less. The transaction is just a transfer of bits and bytes between two nodes, respectively. Again, no middlemen required: interactions occur between contractual partners. The replacement of intermediaries is called disintermediation. Note: disintermediation is considered a serious threat to many business.
Wrapping up the concept of P2P system P2P systems are distributed software systems which consist of nodes which make their computational resources directly available to other nodes. Each node has equal rights and roles even if nodes have different resources. Each node is both a supplier and a consumer of resources. P2P systems are generally distributed, but can come in the form of a hybrid architecture.
Linking P2P system with Blockchain Remember the concept of integrity? A system behaves as intended. Purely distributed P2P systems may use blockchain to achieve and to maintain system integrity. Here is the take out:
"Blockchain is the technology used to achieve and maintain integrity in purely distributed systems".
So why all this hype about blockchain? Purely distributed P2P systems have commercial potential (e.g., think about the music industry). Purely distribute P2P systems use blockchain to achieve and maintain integrity, which is a fundamental requirement for such systems. Plus: blockchain enables the disintermediation.
Integrity is not the only word... The main purpose of the blockchain is to maintain integrity. Why maintaining integrity in distributed systems and purely distributed P2P systems in particular is such a challenge? Here comes another keyword: trust. There exists a subtle relation between integrity and trust.
The metaphor: have you ever heard the expression "herding cats"? This illustrates the challenges of herding a group of obstinate and intractable animals (hums?) that do not accept or recognize a central authority. This is what happens in purely distributed P2P systems in which individual and independent nodes have no central control or coordination.
Trust and Integrity in P2P systems We know what integrity is: a nonfunctional aspect of a system to be safe, consistent, correct and free of corruption and errors. Trust is the human belief in the reliability and truth of someone or something without a proof or a further investigation. In a Bayesian flavor, trust is given a priori and then gets updated based on the results of interactions. In a P2P system, integrity is a necessary condition to fulfill the expectations of the users and thus reinforce their trust in the system. Whenever trust is not reinforced due to a lack of integrity, users will abandon the system. How do we achieve and maintain integrity in such systems? This depends on several factors like:
If both of theme are known, the chances of achieving integrity are higher. Note: running a P2P system over the Internet that is open and public is challenging because neither the number of nodes nor the trustworthiness of them are known.
Integrity Threats in P2P systems Two main categories:
There exist plenty of malicious attacks:
Blockchain as a problem solver When all the conditions are met, reaching integrity as well as trust and maintain them is easy. What if none of those conditions are met? What if we have to face the worst-case scenario?
The blockchain comes into play in this kind of situation. The blockchain plays a major role when we have an unknown number of peers with unknown reliability and trustworthiness. This is a well known problem in computer science called the Byzantine Generals' Problem.
Ok then, but what is a blockchain? At this point, it should be clear what is the purpose of a blockchain. Though, we still miss a formal definition of it. We can think of a blockchain in four different ways:
Blockchain as a Data Structure In computer science and software engineering, a data structure is a way to organize data regardless of their concrete informational content.
Blockchain refers to data put together into units called blocks. Think of these blocks much like pages in a book: they are connected to one another like a chain. In relation to a book, the words and sentences are the information to be stored. They are written on different pages instead of being written on a large spool. The pages are connected with one another via their position in the book and via the page numbers. You can determine if someone removed a page from the book by checking whether the page numbers continue without leaving out a number. The information on the pages as well as the pages within the book are ordered. The ordering is an important detail, which will be used extensively. The chaining of the data blocks in the data structure is achieved by using a very special numbering system (more on that later).
Blockchain as an Algorithm An algorithm is just a collection of information put together into a sequence which a computer can understand and execute. Instruction often involves data structures. When used as a name for an algorithm, blockchain refers to a sequence of instructions that negotiates the informational content of many blockchain-data-structures in a purely distributed peer-to-peer system.
Blockchain as a Technology and More Seeing the blockchain as a technology means to view it in the big picture. The technology involve data structures that contain information as well as the algorithms needed to make something with that information. The technology also involves cryptography and security tools. Combined together they can be used to achieve integrity and trust in a purely distributed P2P system.
Combining everything we know Let's try to come up with an intermediary definition of blockchain: "The blockchain is a purely distributed peer-to-peer system of ledgers that utilizes a software unit that consist of an algorithm, which negotiates the informational content of ordered and connected blocks of data together with cryptographic and security technologies in order to achieve and maintain its integrity". First proposed in 2008 under the pseudonym of Satoshi Nakamoto with the paper: Bitcoin: a peer-topper electronic cash system. The definition does not talk about Bitcoin or any cryptocurrency. The blockchain has a wide and diverse range of applications.
How do you know what you really own? The metaphor:
Who Records Ownership?
The old paper is not enough... Paper receipts are not unique!
A new hope?
Ownership and Witnesses
The mapping between owners and objects
Hints on Security We have introduced three major security concepts. Since we are in the context of software systems, let's provide definitions. The concepts are:
What is the link?
Identify and Authenticate The identification step involves a simple statement that can be used as an identifier. The identification step does not prove your real identity though: it is just a claim. But we want to prove you are not underage: so we require an authentication. In our simple example, an ID card will do the job since it is directly connected to a single individual (e.g., with a photograph). The employee now compares the face in the shop with the one on the ID card and accomplishes the authentication. He might request a two-steps verification by asking the driver license or another type of document.
Authorize Once the employee is convinced you are not underage, he grants access to specific resources or services (you get your bottle of wine). The authorization changes with the characteristics of the individual's identity (think about a Starfleet's captain vs. lieutenant). Remember: if you are too young but has shown a correct ID, both the identification and authentication processes went good. What failed was the authorization step because it did not comply with certain rules.
The proof of ownership and the ledger
Ownership and the Blockchain Assume you have a very good and trustworthy witness like a government ledger. What if this ledger is damaged or destroyed? What if the guys responsible for updating the ledger make an error or just throws it in on purpose? This is a disaster! The ledger does not reflect the reality anymore. It does not represent the truth. How do you solve the issue when you have just one ledger? Well, you just increase the number of independent witnesses. Having many witnesses who independently make their own observations free of mutual influences is the key for this approach to finding the truth. Here is the link: Through the use of a purely distributed P2P system of ledgers you get the proof of ownership based on that version of the reality on which the majority of peers agree on.
Let's build a blockchain We now know everything about the relation between trust, integrity, purely distributed P2P systems and the blockchain. We know what a blockchain is, why we need it, and what kind of problems it can solve. That's fancy, but seriously ... How does it work internally?
Key Points
Blockchain Structure
![]() |
![]() |
|---|
Path to Blockchain There are seven major tasks which are mandatory to design a blockchain system:
Describing ownership - defining the transaction
Protecting ownership - transaction authentication
Storing transaction data - block creation
Distributing ledgers in an untrustworthy environment - Block validation
Adding new transaction to the ledger - Block chaining
Deciding which ledgers represent the truth - Achieve consensus.
Potential Challenges
Advantages and Limitations
Advantages
Limitations
Potential Applications: Financial Services There is an increasing interest by financial services sector in blockchain. Pretty much as an alternative to the current transactional system. That's because of inefficiencies cause by third party organizations, processing time, costs. J.P. Morgan and Goldman Sachs created a partnership to invest in the technology. Santander bank estimated a saving of approx. $20bn by eliminating centralized trust agencies. Each financial institution maintains its own ledger. Reconciling ledgers is a costly process, particularly in big banks with hundreds of ledgers. Even worse when this process is carried out through primitive and unsecured tools such as VBA.
Adoption by Organizations Potential benefits across the different trading stages within the financial market.
Whenever a new technology comes up, developing real-life applications is vital to ensure investments. Though, developing the technology requires time.
Blockchain Governance and Contracts Using a blockchain provides services in a more efficient and decentralized way. Less dependence on state or government bureaucracy. You get a more distributed diffusion of authority. Contracts definition and management will improve. The ongoing legal system requires different statements to improve the enforceability of contracts. Some contracts need to be notarized to prove each party real intentions. Contracts must be registered in order for the transaction to be stored in the public record. With a blockchain, no need for human intermediation and easy way to provide provenance. Lawyers would just prepare self-executing legal documents. The ownership of intellectual property rights could be checked by referencing to time-stamped locations on blocks. We would move towards Automated Contractual Negotiation.
Preview on Smart Contracts. Blockchain has the potential to decrease the costs of contracting. Smart contracts would drastically reduce the friction in commerce and society by providing greater precision to transactions. A smart contract is just a source code which can be executed like any other programming language. In addition, smart contracts offer a significant advantage to existing contractual drafting practices by eliminating the inherent ambiguity of natural language. Legal parties could use vagueness and poor language to step back from contractual conditions they no longer want to honor. A smart contract offers an effective solution by incorporating legal provisions into the code. It comes with a zero-tolerance policy: parties are obliged to fulfill the contract. There is freedom to breach rules because legal enforcement takes place after the act. Judicial enforcement is less needed in a system controlled by self-executing smart contracts as the manner in which the rules have been defined in the code matches exactly the manner by which they are enforced. If you want to violate the rules, you have to break the code ... not that easy.
Towards a P2P economy? We all, as individuals, interact with the internet. Developers are trying to integrate Blockchain into web browsers. Websites would employ distributed data centers. Back to the music industry: authors and musicians could use this technology to collect royalties right after there's been a purchase. Think about piracy: self-executing contracts can track duplicates and related distribution of unoriginal work.
Synergy with banking sector Banks started to systematically become more active with blockchain in recent years. Main reason: since blockchain eliminates middlemen and is faster and more secure, banks are going to save billions. They explore the concept of decentralized systems as well as systems where only authorized users are accepted. They created innovation labs. Possible business uses: settling trades and issuing bonds, payments and settlements, securities issuance, transfers, clearing, anti-money laundering, asset registries.
Decentralization and some questions "There is an increasing risk that we will end up with a patchwork quilt of inconsistent privacy"- Leonard Cali, Senior VP of Global Public Policy, AT&T.
Sketching a Blockchain
]
Cryptography Can you read this document at all?
Well, it's...
Cryptography or Cryptology come from Ancient Greek: kryptós (hidden, secret) and gaphein (to write) or logia (study). The idea is to protect data from being accessed by unauthorized people. It provides a mechanism for securely encoding the set of rules in the system. Cryptography is a deep academic research field utilizing many advanced mathematical techniques. Computer science also has its own branch focusing on solving cryptography problems.
Symmetric vs Asymmetric Cryptography Definition: a key is random string consisting of hundreds or thousands of ones and zeroes (i.e. binary digits). The key is used by a cryptographic algorithm to transform plain text into cipher text or vice versa.
Symmetric vs Asymmetric keys:
The example Let's assume that two friends want to communicate securely over the Internet. How do you get shared keys? The framework: Diffie-Hellman key exchange protocol. Aragorn, Legolas, Gimli and other friends are facing the Uruks at the Helm's Deep. They are in desperate need of assistance in order to defeat Sauron's army. They decide to use cryptography to send a message to Gandalf the White who can arrive with the Rohirrim. Aragorn and Gandalf came up with this protocol:
![]() |
![]() |
|---|
We have the same secret key S, so problem solved! R and H* have been exchanged! They can be intercepted! And if so, it would be trivial to know what a and g are.
The Log and Discrete Log problems
With Discrete Log Problem, guessing is the way-to-go. Basis for Diffie-Hellman schemes. Exponentiation is easy, but it's very hard to know secret keys.
Moving to the discrete Modulus operation doesn't screw up exponentiation
So, what's the problem here? The problem is that with increasing computer power and new algorithms it's getting easier to solve the problem! We have a conflict: keys have to be larger, but keys have to be smaller at the same time.
Elliptic Curves for the good!
Elliptic curves pop up when solving elliptic functions over a given space. An elliptic curve is a curve that's also naturally a group. The group law is constructed geometrically. Elliptic curves have (almost) nothing to do with ellipses, so put ellipses and conic sections out of your thoughts. Elliptic curves appear in many diverse areas of mathematics, ranging from:
Property 1: Elliptic curves are symmetric over the X-axis (aka, known as horizontal symmetry). Property 2: Given two points A and B, if we draw a straight line between A and B, that line will intercept the elliptic curve in at most one more point.
![]() |
![]() |
![]() |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Some Properties of Addition Theorem, the addition law on E has the following properties:
Elliptic Curve Discrete Log Problem Let's represent this operation in: nA = E. Where nA does not represent standard multiplication. It's more of a ... "dot" operation which eventually yields to the generation of other points.
Turns out, it's super hard to find n event if we had the starting point A and the arriving point E. In other words, it's hard to find how many times the "dot" operation has been done.
Order Independence is preserved
Elliptic Curve Diffie-Hellman (ECDH) As we did with mod(p), with EC we have to limit the set of possible values.
Elliptic Curves solve the issue
Elliptic Curve Cryptography One method for implementing public key cryptography is the Elliptic Curve Cryptography (ECC).
![]() |
![]() |
|---|
Downsides of Elliptic Curves
Hash Functions The metaphor: What is a fingerprint?
We want to be able to identify the data by using its digital fingerprints. One way to achieve data identification is to use hash functions.
Has functions are small computer programs which transform any kind of data into a string of fixed length, regardless the size of input data. Remember: the number of possible inputs is larger than the number of possible outputs. A hash function is a many-to-one function. We focus on special cases called cryptographic hash functions.
Cryptographic Hash Functions A cryptographic hash function is defined as a hash function which has the following 3 main properties:
Let's add two more properties:
What are the requirements to be a "good" hash function? How large does n (output length in bits) need to be?
Having a large output length is not sufficient for a hash function to be considered cryptographic. The relation between the input bit string x and the output bit string y should be complicated to prevent easy recovery of x from y. When can an input-output relationship be considered complicated? Really hard to answer! An example could be SHA-256.
Secure Hash Algorithm The SHA-256 hash function was announced in 2001 by the National Institute of Standards and Technology (NIST). The number 256, we already know, indicates the output length in bits. The SHA-256 function specification restricts the input to be at most 2^64^ -- 1 bits long. Up to now, there is no formal proof that SHA-256 is in fact a cryptographic hash function. But it has no known weakness which make finding preimages, second presages and collisions computationally feasible. In other words, it would take an infinite amount of computational time to break it.
One hash value to rule them all... What if we have to provide one unique hash value for several independent data? Simply, you can't use a hash function directly. Blockchain data structure has to deal with multiple transactions at once and requires one single hash value.
So, how do we solve this issue?
Hashing Patterns The idea is to build structures made by hash functions. There exist different patterns:
Independent and Repeated Hashing
![]() |
![]() |
|---|
Combined Hashing

The goal is to compute a single hash value for more than one piece of data in one single step. The idea is to combine all the independent data into one and then apply the hash function. Combining data is computationally intensive: it costs time, memory allocation, storage. Be sure to apply this method when individual chunks of data are small. Also, we have no hash value associated with each chunk.
Sequential Hashing
With sequential hashing we incrementally update of a hash value as new data arrive. It is a mixture of the combined and repeated hashing methods in this order. We first combined the chunks and compute a single hash value (combined hashing), then we compute another hash value on the previous one (repeated hashing). This comes in handy if we want to have a single hash value over time with a well tracked updating process.
Hierarchical Hashing
Here we just want to have a single hash value which represents a given structure. It combines the independent hashing and the combined hashing. It's more efficient then combined hashing since here the chunks are simple hash values.
Digital Signatures A digital signature is supposed to be the digital analog to a handwritten signature on paper. We desire two properties from digital signatures that correspond well to the handwritten signature technology:
How can we build this in a digital form using cryptography? A digital signature scheme consists of 3 algorithms:
Two properties:
Digital Signatures: the unforgeability game In the unforgeability game, there is an adversary who claims that he can forge signatures and a challenger that will test this claim. The first thing we do is use generateKeys() to generate a secret signing key and a corresponding public verification key. We give the secret key to the challenger so he can make signatures. We give the public key both to the challenger and to the adversary. So the adversary only knows information that's public, and his mission is to try to forge a message. Intuitively, the setup of this game matches real world conditions. A real-life attacker would likely be able to see valid signatures from their would-be victim on a number of different documents. And maybe the attacker could even manipulate the victim into signing innocuous-looking documents if that's useful to the attacker.
Applying Hash Functions... for real Different applications:
Comparing data
Detecting changes in data
Referring to data in a change-sensitive way (very important!)
Storing data in a change-sensitive way
Causing time-consuming computations
Hashing to Compare Data The goal is to compare data without looking at their content. Also, the comparison should be fast and completely independent on the type of data and its size. So here is the idea: just compare hash values. How: if all the hash values are different, then all the data chunks are different as well. It works because hash functions are collision resistant.
Hashing to Detect Changes in Data If we can compare, we can also detect changes. We want to be able to say if data which should remain unchanged, has changed at a certain point in time. So we throw a comparison between two hash values belonging to the same chunk of data. If both hash values are identical it implies no change. Once again, detecting changes in data that are supposed to stay unchanged works due to collision resistance of cryptographic hash functions.
Having to Refer to Data in a Change-Sensitive Way Comparing and detecting changes are the basics. A more advanced approach is hash references and then ensure the data remain unchanged. To achieve this, we combine the hash value itself associated with stored data with information about where that data is located. The moment there is a change, both information will be no more consistent: the hash reference becomes invalid. Example: a cloakroom ticket is a hash reference to your jacket.
Computers use reference addresses to remember where they store things that we told them to store. Hash references refer to data and at the same time they verify the data has not changed since the reference was created. Example: the cloakroom ticket points at an empty cloaca hook.
We use hash references to protect users from retrieving wrong data (i.e. unintentionally or intentionally changed). The whole idea is properly based on the fact that hash values are encrypted: it is very unlikely that different chunks of data have identical hash values.
We can do the same with data and form a chain of data. If at any point in time either the data or the hash references are changed all the hash references are broken. But this is the warning that advises us that a change occurred after the initial reference was created. There exist two patterns that can be used to store data in a change-sensitive way:
Hash Pointers and Data Structures
Definition: a hash pointer is simply a pointer to where some information is stored together with a cryptographic hash of the information. Whereas Ed a regular pointer gives you a way to retrieve the information, a hash pointer also gives you a way to verify that the information hasn't changed.
The Chain Pattern
Here is an example of a blockchain with hash pointers. Each block tells us where the value of the previous block was and a digest of that value which allows us to verify that the value itself hasn't changed. This comes in handy when we know data will arrive step by step.
The Tree Pattern
This structure is called Merkle Tree and was proposed by the computer scientist Ralph Merkle in 1979. It is an important structure because it allows to group distinct pieces of data available at the same time and make them accessible via a single hash value.
The process of just trying all the combinations implies no knowledge nor reasoning of any sort. You just put hard work on this task. Hash puzzles (games) are computational games which can be considered as the equivalent of opening a lock.
Authorizing Transactions with Digital Signature We know a bit about cryptography. We know a bit about hash functions, how they work and how we could use them. Now, we need to understand how to rightfully transfer a property from one account to another. In other words, we need an authorization. We obtain authorization through digital signatures. Think about handwritten signatures: through them we state agreement. We accept them because we think they are unique. Now, we transfer this concept tot the digital world of the blockchain. Digital signatures is a crucial concept for the security of individual transactions in a blockchain.
The Importance of Ordering One of the fundamental problem with blockchain is that the order of blocks doesn't always reflect the one of transaction. Recognizing the order in which transactions occurred is key to achieve the same identical results. Changing the order of transaction data implies a change in the aggregation of them. Receiving a payment from a friend seems to be the trivial case.
Integrity of the Transaction History The history of transactions is really the core of the blockchain. Why? Because history is the way we reconstruct the state of the ownership. We want the history of data to be safe, complete, correct and consistent such that the integrity of the system is maintained. We need a system to validate transaction:
The Double-Spending Problem The idea: if we spend $1 to buy an apple, we can't use that same $1 to buy an orange. Why? Just because you have to give $1 to the vendor. With digital currencies, or assets, there is no such thing. We can spend the same currency for two or more transactions, in principle. Let's imagine we have a P2P system for managing ownership of real estate. Ledgers is maintained by individual computers so each peers has its own copy. The minute the ownership of a house is transferred from one account to another, all the ledgers must be updated to match the latest version of reality.
Issue: someone who already know the latest info could do something bad to someone else who is not up-to-date.
Example: Frodo is sick and tired of carrying the ring around. So he decides to sell it but before doing it, he hides the ring where no one can spot it. He then goes to one of his fellow hobbits telling him about the ring and closes the deal for a considerable amount of pipeweed. However, Frodo is very smart. He wants more pipeweed so he quickly goes to another hobbit and sells the same ring for another honest amount of pipeweed.
The term double-spending can be used to refer to different concepts:
Blockchain is a Distributed System Blockchain consists of different actors. Each actor acts depending on personal incentives and on available information. When a new transaction is broadcasted to the network, nodes can decide if they want to include it as a copy in their ledger or to ignore it. When the majority of the actors decides on a single defined state, the consensus is achieved.
What is the Consensus? The consensus is simply the common agreement on something. It is a fundamental problem in distributed computing. The problem is: how can we reach a consensus through computers? Well, we need an algorithm. Definition: a consensus algorithm is a process used to achieve agreement on a single data value among distributed processes or systems. Let's try to improve our definition ... more formally.
Distributed Consensus Protocol: There are n nodes that each have an input value. Some of these nodes are faulty or malicious. A distributed consensus protocol has the following two properties:
The context of Bitcoin Let's focus for a second on Bitcoin: a peer-to-peer system. What happens when Princess Leia wants to send the money that Han Solo deserves? Princess Leia has to broadcast the transaction to all the nodes within the network.
![]() |
![]() |
|---|
Ian's node might be in the network (not a requirement). Actually, he is running one of the nodes. He wants to be notified when the transaction did happen.
Distributed Consensus Several users are broadcasting this transaction. The nodes must agree on two things:
Also, some of the nodes might have not being informed ---> the network is not perfect.
How exactly do nodes come to consensus on a block? At regular intervals, say every 10 minutes, every node in the system proposes its own outstanding transaction pool to be the next block. Then the nodes execute some consensus protocol, where each node's input is its own proposed block. If the consensus protocol succeeds, a valid block will be selected as the output. There are a number of technical problems with this approach.
Issues with Distributed Consensus First: consensus in general is a hard problem
Second: the network is imperfect
Third: for real cases, latency is a real problem
Request: Fault Tolerance The goal is to achieved overall system reliability in the presence of a number of faulty processes. So, this requires to agree on some data value needed during computation. What happens when an actor decides to not follow the rules and to tamper with the state of the ledger? What happens when these actors are a large part of the network, but not the majority? In order to create a secure consensus protocol it must be fault tolerant.
Unsolvable Problems Focus on two well-known problems:
The Two Generals Problem (Akkoyunlu te al. 1975) The scenario: two generals are attacking a common enemy. General 1 is the leader, while General 2 should obey General 1's orders. Each general's army has not enough power to defeat the enemy. They need to cooperate and coordinate the attack. There is one big caveat though. Since they have to agree on the attack time, General 1 sends out a messenger to General 2's camp. There is a chance that the messenger can get caught by enemy. If the messenger does not get caught, then General 2 has to acknowledge the message by sending the messenger back to General 1's camp. Again, there is a chance that the messenger can get caught by enemy. There is no way to guarantee that each general be sure the other has agreed to the attack plan! Both generals will always be left wondering whether their last messenger got through.
The Byzantine Generals' Problem (Lamport et al. 1982) In this scenario, the authors generalize the Two Generals Problem. So, we have manifold of Generals who need to agree on the time to attack the enemy camp. There is a twist! One or more generals can be a traitor. A traitor is a liar, and he can lie about his choice. Each general has a certain number of lieutenants. To achieve consensus, both the general and all his lieutenants must agree on the same choice. For simplicity, the choice is binary: attack or retreat.
Even if the General is a traitor, consensus must be achieved anyway. Thus, all lieutenants take a majority vote. For any m, OM(m) (Oral Message) reaches the consensus if there are more than 3m generals and at most m traitors.
The algorithm can reach consensus as long as 2/3 of the actors are honest. If the traitors are more than 1/3, consensus is not reached, the armies do not coordinate their attack and the enemy wins.
Case 1
Case 2
A tree with n = 7 and m = 2:
Byzantine Fault Tolerance (BFT) Byzantine Fault Tolerance is the characteristic which defines a system that tolerates the class of failures that belong to the Byzantine Generals' Problem. Byzantine Failures are the most difficult class of failures. There are no restrictions and no assumptions on the kind of behavior and data a node can inject in the network. BFT is required in airplanes, nuclear power plants and even SpaceX. SpaceX requires it to handle situations where the computers do not agree (e.g., changing values in memory/registry due to radiation). In the context of Byzantine Generals Problem, this is indeed BFT as long as the number of traitors do not exceed 1/3 of the generals. Blockchains are distributed systems with no central authority. What is stored in the ledgers could be of high value so there are relevant economic incentives by malicious nodes to cause faults. With not BTF, a malicious node can transmit false transactions. This would then impede the achievement of integrity.
Proof-of-Work (PoW) Bitcoin solves the Byzantine Generals Problem... Under a probabilistic flavor. Here, the leader is the responsible for transmitting the block to the network so that the other peers can verify it. To be elected as a leader and choose the next block, the network has to solve a mathematical puzzle.
Given data X, find a number n such that the hash of n appended to X is a number less than Y.
Since hash() is a cryptographic hash function, we must use brute force to find a solution. In probability, the node that will solve the problem first is probably the one with more computing power. These nodes are called miners. It is a very popular algorithm, for which is very hard to find a solution. When the solution is found, it is very easy to verify it. When a miner finds a solution, it gets rewarded ---> incentive!
An attack to the whole network would cost a lot. Energy, computational power, hardware, potential missed rewards.
Each block is mined every 10mins. For a safe transaction, it can take up to 1 hour. Miners are rewarded 6.25 Bitcoins for mining each block. Remember how computational power increases the chances of breaching algorithms? Mining difficulty increases with time. The mining difficulty is adjusted every 2016 blocks. The difficulty can even go down if the supply of computational power decreases.
Proof-of-Stake (PoS) Let's start with an analogy, a probabilistic analogy
Similarly, under PoW if Alice had more computational power than Alice, she is more likely to be able to mine the next block. Similarly, under PoS if Alice had more stake than Bob, she is more likely to be able to mine the next block.
The big difference between PoW and PoS is that the latter replaces the computational power with the stake. We refer to the stake as a given amount of currency that a given wallet is willing to lock up and freeze for a certain amount of time. In return, you get a chance of mining the next block proportional to the stake you froze. Issue: nothing-at-stake ---> nodes are not disincentivized in mining forked chains. Some hybrid consensus algorithms PoS-PoW have been developed.
Consensus Algorithms We need robust consensus algorithms! These algorithms verify the validity of transactions:
"What is a Blockchain? Is it a Hype?" - New York Times
Blockchain Ecosystem evolved, but still early
Blockchain and its Impact on Accounting What we will discuss in the remainder of the course:
Single Entry Accounting A one-sided accounting entry for each transaction. Assets are entered and crossed off as they move in and out. Accounting ledger and the dollar amount is recorded once per transaction. Subject to serious limitations as errors cannot be detected and traced, providing ample opportunities for fraud.
Double Entry Accounting Each financial transaction requires at least two accounting entries (debit and credit). Preserves a verifiable audit trail: as dollar amounts are recorded twice for each transaction on both sides, the total of debits must equal the total of credits. Each debit and credit can be traced back to the original entry and transaction source document. Even if the debits equal the credits, it is possible to do so in a false or misleading manner. As a firm records transactions completed independently and privately, there is the potential for the creation of fabricated transactions. To confirm the integrity of a firm's accounting, shareholders and governments require auditing on a regular basis. Auditing: sampling, timing, costs.
A Payment Transaction in a Double-Entry System
Triple Entry Accounting by Ian Grigg Triple-entry accounting was a process introduced by financial cryptography expert Ian Grigg in December 2005. Companies should not be the sole recorders of business transactions. A third-party, cryptographically secured entry can be recorded at the same time for transactions between entities. In this third entry, the debit recorded by one entity is the credit recorded by the counterparty.
A Payment Transaction in a Triple-Entry System
"It's though to lie when everybody is watching"- Ian Grigg Unclear who would act as the trusted and neutral third party to control the third shared ledger. The emergence of Bitcoin and its underlying Blockchain protocol demonstrated that a trusted and neutral third-party is NOT required. The third public ledger in Grigg (2005) can be decentralized, immutable, secure and automated using blockchain.
Triple-Entry with a Smart Contract
Key Features of a Payment Record on Blockchain Ledger The payment is made in the form of tokens (cryptocurrency) which disintermediates the traditional bank. This payment transaction is recorded in chronological order and this record is permanent without change. If there is an amendment, a new record will be required. This record is not maintained by a centralized server, so security threats are reduced. This record creates a linkage between the internal records of Alice and Bob so it is less prone to errors and fraud. This record is verifiable, creating an easy audit trail.
LUCA by Ledgerium / BlockLedger & A Payment Transaction Using LUCA
![]() |
![]() |
|---|
Advantages of LUCA
Challenges of LUCA Privacy concerns
Scalability
zkLedger -- Privacy preserving auditing for distributed ledgers & A Record of the Transaction
![]() |
![]() |
|---|
Bank Care about Privacy
zKLedger -- A Private, Auditable Transaction Ledger
How to Audit the Ledger Content
![]() |
![]() |
|---|
Which Measurements does zkLedger Support
Advantages of zkLedger
Challenges of zkLedger
COSMOS Network It is a decentralized network of independent, scalable, and interoperable blockchains, creating the foundation.
Pacio Solution "Pacio will lead the world into the next advance in business record keeping - Triple Entry Accounting (TEA) - and associated systems and services to reduce the mid-decade $27 trillion per annum opportunity losses and costs resulting from current accounting and management deficiencies" - David Hartley, CEO of Pacio.
A blockchain ecosystem with triple-entry accounting.
Potential Benefits of Triple-Entry Accounting
Blockchain as an auditing Tool One of the main areas where blockchain can be applied in accounting is Auditing. The study of auditing is different from other accounting courses that you have taken in college because...
The Demand for Auditing and Assurance The development of the corporate form of business and the expanding world economy over the last 200 years have given rise to an explosion in the demand for assurance provided by auditors.
Principals and Agents A public company is a company that sells its stocks or bonds to the public, giving the public a valid interest in the proper use of the company's resources.
Principal-Agent Relationship and Demand for Auditing
Auditing Demands Logic, Reasoning and Resourcefulness An auditor needs to understand more than just the accounting concepts and techniques. Auditing is a fundamentally logical process of thinking and reasoning - so use your common sense and reasoning skills. Being a good auditor sometimes requires imagination and innovation. Understanding audit concepts is useful for all business professionals, consultants, etc.
Types of Auditors & Types of Audit Services
![]() |
![]() |
|---|
Many Regulators and Standard-Setters Affect Auditing
Society's Expectations and the Auditor's Responsibilities The auditor's responsibility is to provide reasonable assurance that the financial statements are free of material misstatement, whether caused by error, fraud, or illegal acts. Because of the nature of audit evidence and the characteristics of fraud, the auditor is able to obtain reasonable, but not absolute, assurance that material misstatements are detected.
Responsibility for the Financial Statements While auditors have important responsibilities, management is primarily responsible for maintaining effective internal control and for ensuring the fairness of the company's financial statements.
Management Assertions
![]() |
![]() |
|---|
Overview of Financial Statement Audit & Major Phases of an Audit
![]() |
![]() |
|---|
Fundamental Auditing Concepts
Knowledge Assessment Which of the following best describes the concept of audit risk? A. The risk of the auditor being sued because of association with an auditee. B. The risk that the auditor will provide an unqualified opinion on financial statements that are, in fact, materially misstated. C. The overall risk that a material misstatement exists in the financial statements. D. The risk that auditors use audit procedures that are inappropriate.
![]() |
![]() |
![]() |
|---|
Audit Evidence Regarding Management Assertions: Evidence that assists the auditor in evaluating management's financial statement assertions and consists of the underlying accounting data and any additional information available to the auditor, whether originating from the client or externally.
Sampling Inferences Based on Limited Observations: Auditors use a sampling approach to examine a subset of the transactions based on previous audits, an understanding of the company's internal control system, or knowledge of the company's industry.
Knowledge Assessment Why do auditors generally use a sampling approach to evidence gathering? A. Auditors are experts and do not need to look at much to know whether the financial statements are correct or not. B. Auditors must balance the cost of the audit with the need for precision. C. Auditors must limit their exposure to their auditee to maintain independence. D. The auditor's relationship with the auditee is generally adversarial, so the auditor will not have access to all of the financial information of the company. Which of the following sources of evidence are more reliable?
Examples of Audit Procedures to Collect Evidence
What Can Blockchain Change in Auditing
Governance, Transparency and Trust: A "truth machine"- unprecedented levels of trust and transparency - (Casey and Vigna, 2018)
Continuous Auditing
Smart Contracts
Transaction Verification "Just because a transacted record is computerized and "blockchained" does not necessarily imply that its physical world counterpart material of commerce has not been tampered with" - (Apte and Petrovsky, 2016).
Are Blockchains completely fraud-free?
What are the Auditing Challenges in Blockchain?
What Blockchain Offers to Auditors
What Can Blockchain Change in Auditing
Corporate Governance is Not New "The directors of companies, being the managers of other people's money rather than their own, cannot well be expected to watch over it with the same anxious vigilance with which (they) watch over their own" - Adam Smith, The Wealth of Nations, 1776.
Financial Scandals and Collapses Enron, Parmalat, Satyam, Olympus Corporation, ...
The Root Cause of Failures
Agency Theory
Corporate Governance Definition
In Other Words... Corporate governance is a set of principles and policies
Some Mechanisms of Corporate Governance
Blockchain: Transparency and Trust A "truth machine" - unprecedented levels of trust and transparency.
BD as a Ledger for Securities Transactions
Smart Contracts to Mitigate Conflicts in the Board of Directors
BC in Compensation Schemes
BC and Shareholder Activism
Governance as a Broader Concept
Blockchain-Based Governance
Some Principles of the BC-Based Governance
Decentralized Autonomous Organizations (DAO) "... a concept derived from AI. Here, a decentralized network of autonomous agents perform tasks, which can be conceived in the model of a corporation running without any human involvement under the control of a set of business rules. In a DAO, there are smart contracts as agents running on blockchains that execute ranges of prespecified or preapproved tasks based on events and changing conditions" - M. Swan.
The DAO
"The DAO's smart contract code governs the Creation of DAO tokens and supersedes any public statements about The DAO's Creation made by third parties or individuals associated with The DAO, past, present and future".
The DAO Hack
Potential Issues with BC Governance