Packt learning blockchain application development

By | Saturday, April 17, 2021

Navigation

  • Style and Approach
  • Latest commit
  • Introduction
  • What is Python?
  • Style and Approach

    Publication date: November Publisher Packt. Duration 2 hours 51 minutes. ISBN Download code from GitHub. May Pages. By Hadelin de Ponteves. Sep Pages. By Fabrizio Romano. Jun Pages. Learn PowerShell Core 6. Jul Pages. Software Architecture with Spring 5. Dec Pages. Mastering Xamarin UI Development - Second Edition Learn how to build stunning, maintainable, cross-platform mobile application user interfaces using C 7 with the power of both the Xamarin and Xamarin.

    Forms frameworks By Steven F. Serverless Design Patterns and Best Practices Get started with designing your serverless application using optimum design patterns and industry standard practices By Brian Zambrano. Building Applications with Spring 5 and Vue. Feb Pages. Splunk 7. By James H. N Parasram and 6 more. Industrial Cybersecurity Your one-step guide to understanding industrial cyber security, its control systems, and its operations.

    By Pascal Ackerman. Kubernetes Cookbook - Second Edition Learn how to automate and manage your containers and reduce the overall operation burden on your system. A simple online search of "blockchain research groups" would reveal hundreds, if not thousands, of these research groups.

    Moreover, a large number of start-ups are providing blockchain-based solutions already. A simple trend search on Google reveals the immense scale of interest in blockchain technology over the last few years. Especially since early , the increase in the search term "blockchain" is quite significant, as shown in the following graph:.

    Figure 1. This could be simply due to the fact that people interested in blockchain technology have already understood enough about blockchain to no longer warrant searching for it on Google. We do see, however, a significant and continued interest in blockchain technology. Various benefits of this technology have already been envisioned, such as decentralized trust, cost savings, transparency, and efficiency.

    However, there are multiple challenges too that are actively being researched on blockchain, such as scalability and privacy. In this book, we are going to see how blockchain technology can help to bring about the benefits mentioned previously.

    You are going to learn what exactly blockchain technology is and how it can reshape businesses, multiple industries, and indeed everyday life by bringing about a plenitude of benefits such as efficiency, cost savings, transparency, and security. We'll also take a critical look at blockchain; Chapter 21 , Scalability and Other Challenges , is dedicated to a discussion of the limitations and challenges of blockchain technology.

    We shall begin our exploration of blockchain by looking at distributed systems in the following section. This is a foundational paradigm used within blockchain, and we must have a firm grasp on what distributed systems are before we can meaningfully discuss blockchain in detail. Understanding distributed systems is essential to our understanding blockchain, as blockchain was a distributed system at its core. It is a distributed ledger that can be centralized or decentralized.

    A blockchain is originally intended to be and is usually used as a decentralized platform. It can be thought of as a system that has properties of the both decentralized and distributed paradigms. It is a decentralized-distributed system. Distributed systems are a computing paradigm whereby two or more nodes work with each other in a coordinated fashion to achieve a common outcome.

    It is modeled in such a way that end users see it as a single logical platform. For example, Google's search engine is based on a large distributed system; however, to a user, it looks like a single, coherent platform. A node can be defined as an individual player in a distributed system.

    All nodes are capable of sending and receiving messages to and from each other. Nodes can be honest, faulty, or malicious, and they have memory and a processor. A node that exhibits irrational behavior is also known as a Byzantine node after the Byzantine Generals problem. In , a thought experiment was proposed by Lamport et al. In this problem, a group of army generals who lead different parts of the Byzantine army is planning to attack or retreat from a city.

    The only way of communicating among them is via a messenger. They need to agree to strike at the same time in order to win. The issue is that one or more generals might be traitors who could send a misleading message.

    Therefore, there is a need for a viable mechanism that allows for agreement among the generals, even in the presence of the treacherous ones, so that the attack can still take place at the same time. As an analogy for distributed systems, the generals can be considered honest nodes, the traitors as Byzantine nodes that is, nodes with arbitrary behavior , and the messenger can be thought of as a channel of communication among the generals. This problem wa s solved in by Castro and Liskov who presented the Practical Byzantine Fault Tolerance PBFT algorithm, which solves the consensus problem in the presence of Byzantine faults in asynchronous networks by utilizing the state machine replication protocol.

    PBFT goes through a number of rounds to eventually reach an agreement between nodes on the proposed value. This type of inconsistent behavior of Byzantine nodes can be intentionally malicious, which is detrimental to the operation of the network.

    Any unexpected behavior by a node on the network, whether malicious or not, can be categorized as Byzantine. A small-scale example of a distributed system is shown in the following diagram. This distributed system has six nodes, out of which one N4 is a Byzantine node leading to possible data inconsistency. L2 is a link that is broken or slow, and this can lead to a partition in the network:. The primary challenge of a distributed system design is the coordination between nodes and fault tolerance.

    Even if some a certain threshold dictated by the consensus protocol of the nodes become faulty or network links break, the distributed system should be able to tolerate this and continue to work to achieve the desired result. This problem has been an active area of distributed system design research for many years, and several algorithms and mechanisms have been proposed to overcome these issues. Distributed systems are so challenging to design that a theory known as the CAP theorem has been proven, which states that a distributed system cannot have all three of the much-desired properties simultaneously; that is, consistency, availability, and partition tolerance.

    We will dive into the CAP theorem in more detail later in this chapter. Even though blockchain can be considered to be both a distributed and decentralized system, there are, however, critical differences between distributed systems and decentralized systems that make both of these systems architecturally different.

    We will discuss these differences in detail in Chapter 2 , Decentralization. With a better understanding of distributed systems, let's now move on to talking about blockchain itself. We'll begin with a brief rundown of the history of blockchain and Bitcoin.

    Blockchain was introduced with the invention of Bitcoin in Its practical implementation then occurred in For the purposes of this chapter, it is sufficient to review Bitcoin very briefly, as it will be explored in great depth in Chapter 6 , Introducing Bitcoin.

    However, it is essential to refer to Bitcoin because, without it, the history of blockchain is not complete. Now we will look at the early history of computing and computer networks and will discuss how these technologies evolved and contributed to the development of Bitcoin in We can view this in chronological order:. The aforementioned technologies contributed in some way to the development of Bitcoin, even if not directly; the work is relevant to the problem that Bitcoin solved.

    All previous attempts to create anonymous and decentralized digital currency were successful to some extent, but they could not solve the problem of preventing double spending in a completely trustless or permissionless environment.

    This problem was finally addressed by the Bitcoin blockchain, which introduced the Bitcoin cryptocurrency. It should be noted that other concepts such as state machine replication the SMR problem , introduced in by Leslie Lamport and formalized in by Fred Schneider, are also solvable by Bitcoin.

    Bitcoin solves the SMR problem probabilistically by allowing the replication of blocks and ensuring consistency via its PoW consensus mechanism. The SMR, or state machine replication problem, is a technique used to provide fault-tolerant replication in distributed systems. We will explore this in greater detail in Chapter 5 , Consensus Algorithms. Now we will discuss some of the major milestones in the history of blockchain in more detail.

    The concept of electronic cash e-cash , or digital currency, is not new. Since the s, e-cash protocols have existed that are based on a model proposed by David Chaum. Just as understanding the concept of distributed systems is necessary to comprehend blockchain technology, the idea of e-cash is also essential in order to appreciate the first, and astonishingly successful, application of blockchain, Bitcoin, and more broadly, cryptocurrencies in general.

    Two fundamental e-cash system issues need to be addressed: accountability and anonymity. Accountability is required to ensure that cash is spendable only once addressing the double-spending problem and that it can only be spent by its rightful owner. The double-spending problem arises when the same money can be spent twice. As it is quite easy to make copies of digital data, this becomes a big issue in digital currencies as you can make many copies of the same amount of digital cash.

    Anonymity is required to protect users' privacy. With physical cash, it is almost impossible to trace back spending to the individual who actually paid the money, which provides adequate privacy should the consumer choose to hide their identity. In the digital world, however, providing such a level of privacy is difficult due to inherent personalization, tracing, and logging mechanisms in digital payment systems such as credit card payments.

    This is indeed a required feature for ensuring the security and safety of the financial network, but it is also often seen as a breach of privacy. This is due to the fact that end users do not have any control over who their data might be shared with, even without their consent. Nevertheless, this is a solvable problem and cryptography is used to address such issues. Especially in blockchain networks, the privacy and anonymity of the participants on the blockchain are sought-after features.

    We will learn more about this in Chapter 4 , Public Key Cryptography. David Chaum solved both of these problems during his work in the s by using two cryptographic operations, namely, blind signatures and secret sharing. These terminologies and related concepts will be discussed in detail in Chapter 4 , Public Key Cryptography. For the moment, it is sufficient to say that blind signatures allow for signing a document without actually seeing it, and secret sharing is a concept that enables the detection of double-spending, that is, using the same e-cash token twice.

    In , the first practical implementation of an e-cash system named Bitcoin appeared. The term cryptocurrency emerged later. For the very first time, it solved the problem of distributed consensus in a trustless network. It used public key cryptography with a PoW mechanism to provide a secure, controlled, and decentralized method of minting digital currency. The key innovation was the idea of an ordered list of blocks composed of transactions which is cryptographically secured by the PoW mechanism to prevent double-spending in a trustless environment.

    This concept will be explained in greater detail in Chapter 6 , Introducing Bitcoin. Other technologies used in Bitcoin, but which existed before its invention, include Merkle trees, hash functions, and hash chains. All these concepts are explained in appropriate depth in Chapter 4 , Public Key Cryptography. Looking at all the technologies mentioned previously and their relevant history, it is easy to see how concepts from e-cash schemes and distributed systems were combined to create Bitcoin and what now is known as blockchain.

    This concept can also be visualized with the help of the following diagram:. With the emergence of e-cash covered, along with the ideas that led to the formation of Bitcoin and blockchain, we can now begin to discuss blockchain itself. In , a groundbreaking paper, entitled Bitcoin: A Peer-to-Peer Electronic Cash System , was written on the topic of peer-to-peer e-cash under the pseudonym of Satoshi Nakamoto.

    It introduced the term chain of blocks. No one knows the actual identity of Satoshi Nakamoto. After introducing Bitcoin in , he remained active in the Bitcoin developer community until He then handed over Bitcoin development to its core developers and simply disappeared. Since then, there has been no communication from him whatsoever, and his existence and identity are shrouded in mystery.

    The term "chain of blocks" evolved over the years into the word "blockchain. As stated previously, blockchain technology incorporates a multitude of applications that can be implemented in various economic sectors. Particularly in the finance sector, significant improvement in the performance of financial transactions and settlements manifests as highly desirable time-and-cost reductions.

    Additional light will be shed on these aspects of blockchain in Chapter 19 , Blockchain — Outside of Currencies , where practical use cases will be discussed in detail for various industries.

    For now, it is sufficient to say that parts of nearly all economic sectors have already realized the potential and promise of blockchain, and have embarked, or will do so soon, on the journey to capitalize on the benefits of blockchain technology.

    A good place to start learning what blockchain is would be to see its definition. There are some different ways that blockchain may be defined; following are two of the most widely accepted definitions:. Layman's definition : Blockchain is an ever-growing, secure, shared recordkeeping system in which each user of the data holds a copy of the records, which can only be updated if all parties involved in a transaction agree to update.

    Technical definition : Blockchain is a peer-to-peer, distributed ledger that is cryptographically secure, append-only, immutable extremely hard to change , and updateable only via consensus or agreement among peers. Now, let's examine things in some more detail. We will look at the keywords from the technical definition one by one.

    The first keyword in the technical definition is peer-to-peer , or P2P This means that there is no central controller in the network, and all participants nodes talk to each other directly. This property allows for transactions to be conducted directly among the peers without third-party involvement, such as by a bank.

    Dissecting the technical definition further reveals that blockchain is a "distributed ledger," which means that a ledger is spread across the network among all peers in the network, and each peer holds a copy of the complete ledger. Next, we see that this ledger is "cryptographically secure," which means that cryptography has been used to provide security services that make this ledger secure against tampering and misuse.

    These services include non-repudiation, data integrity, and data origin authentication. You will see how this is achieved later in Chapter 4 , Public Key Cryptography , which introduces the fascinating world of cryptography.

    Another property that we encounter is that blockchain is "append-only," which means that data can only be added to the blockchain in time-sequential order. This property implies that once data is added to the blockchain, it is almost impossible to change that data and it can be considered practically immutable. In other words, blocks added to the blockchain cannot be changed, which allows blockchain to become an immutable and tamper-proof ledger of transactions.

    However, remember that it can be changed in rare scenarios wherein collusion against the blockchain network by bad actors succeeds in gaining more than 51 percent of the power. Otherwise, the blockchain is practically immutable. However, those are individual cases that need to be handled separately and that require an elegant technical solution.

    For all practical purposes, blockchain is indeed immutable and cannot be changed. The most critical attribute of a blockchain is that it is updateable only via consensus. This is what gives it the power of decentralization. In this scenario, no central authority is in control of updating the ledger. To achieve consensus, there are various consensus facilitation algorithms that ensure all parties agree on the final state of the data on the blockchain network and resolutely agree upon it to be true.

    Consensus algorithms are introduced later in this chapter, and then in more detail in Chapter 5 , Consensus Algorithms. Having detailed the primary features of blockchain, we are now in a position to begin to look at its actual architecture.

    We'll begin by looking at how blockchain acts as a layer within a distributed peer-to-peer network. Blockchain can be thought of as a layer of a distributed peer-to-peer network running on top of the internet, as can be seen in the following diagram. All these concepts will be discussed in detail later in this book in various chapters.

    Next, we'll look at blockchain from more of a business-oriented perspective. For example, for cash transfers, banks act as a trusted third party. In financial trading, a central clearing house acts as a trusted third party between two or more trading parties. This concept is compelling, and, once you absorb it, you will realize the enormous potential of blockchain technology. This disintermediation allows blockchain to be a decentralized consensus mechanism where no single authority is in charge of the database.

    Immediately, you'll see a significant benefit of decentralization here, because if no banks or central clearing houses are required, then it immediately leads to cost savings, faster transaction speeds, and more trust. We've now looked at what blockchain is at a fundamental level.

    Next, we'll go a little deeper and look at some of the elements that comprise a blockchain. Now, let's walk through the generic elements of a blockchain. You can use this as a handy reference section if you ever need a reminder about the different parts of a blockchain.

    More precise elements will be discussed in the context of their respective blockchains in later chapters, for example, the Ethereum blockchain. The structure of a generic blockchain can be visualized with the help of the following diagram:. Elements of a generic blockchain are described here one by one.

    These are the elements that you will come across in relation to blockchain:. The following structure is a simple block diagram that depicts a block. Specific block structures relative to their blockchain technologies will be discussed later in the book with greater in-depth technical detail:. Generally, however, there are just a few attributes that are essential to the functionality of a block: the block header, which is composed of the hash of the previous block's header, the timestamp, nonce, Merkle root, and the block body that contains the transactions.

    There are also other attributes in a block, but generally, the components introduced in this section are usually available in a block. Think of the scripting language as a calculator that only supports standard preprogrammed arithmetic operations. As such, the Bitcoin Script language cannot be called "Turing complete. It is named after Alan Turing, who developed the idea of a Turing machine that can run any algorithm however complex.

    Turing complete languages need loops and branching capability to perform complex computations. Therefore, Bitcoin's scripting language is not Turing complete, whereas Ethereum's Solidity language is. To facilitate arbitrary program development on a blockchain, a Turing complete programming language is needed, and it is now a very desirable feature to have for blockchains.

    Think of this as a computer that allows the development of any program using programming languages. Nevertheless, the security of such languages is a crucial question and an essential and ongoing research area. We will discuss this in greater detail in Chapter 6 , Introducing Bitcoin , Chapter 10 , Smart Contracts , and the chapters on Ethereum Development , later in this book.

    A high-level diagram of blockchain architecture highlighting the key elements mentioned previously is shown as follows:. The preceding diagram shows a four-node blockchain network top , each maintaining a chain of blocks, virtual machine, state machine, and address. The blockchain is then further magnified middle to show the structure of the chain of blocks, which is again magnified bottom to show the structure of a transaction. Note that this is a generic structure of a blockchain; we will see specific blockchains structures in detail in the context of Ethereum and Bitcoin blockchains later in this book.

    We have now defined and described blockchain. Now, let's see how a blockchain actually works. Nodes are either miners who create new blocks and mint cryptocurrency coins or block signers who validate and digitally sign the transactions.

    Packt learning blockchain application development

    As the Blockchain revolution rages around us, you may be feeling left behind as the technology and coin values continue to develop at breakneck speed. While the steep and rigorous learning curve that the likes of Bitcoin and Ethereum programming present may be too much for us as we step into the Blockchain arena, this course eases the barrier of entry with a hands-on implementation of Blockchain tech with a familiar language, JavaScript, that you can use to create and understand a Blockchain system capable of hosting our own Cryptocurrency.

    This course is designed to present basic JavaScript instruction for developers looking to expand their skill-set by taking on a new type of programming challenge: Blockchain development. Brett Hooper is a well-seasoned software engineer, entrepreneur, teacher, and all-round techno-surfer. His decades of experience have taken him from years of IT consulting for fortune behemoths, to a number of entrepreneurial startup efforts, to the U.

    New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3. Cut through the noise and get real results with a step-by-step approach to data science. About this book Blockchain technology will continue to play an integral role in the banking and finance sector in the coming years. Publication date: January Publisher Packt. Pages ISBN Download code from GitHub.

    He is extremely passionate about technology and loves to keep himself abreast of new developments in the field through the community Browse publications by this author. Very nice. Also Informative. Artificial Intelligence with Python - Second Edition New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3. This course supplies seven self-contained lessons taught in a practical, hands-on way.

    By the end of the course, you will be amazed how much you have learned about Blockchain application development on the Ethereum network in just one week. To fully benefit from the coverage included in this course, you will need: Developers who are familiar with coding who want to learn about blockchain development, or programmers who know JavaScript that are curious about blockchain. This example is relatively basic. Minimum Hardware Requirements For successful completion of this course, students will require the computer systems with at least the following:.

    Recommended Hardware Requirements For an optimal experience with hands-on labs and other practical activities, we recommend the following configuration:. Blockchain Development for Beginners [Video]. Learning Blockchain Application Development [Video].

    Ethereum Projects [Video]. Install truffle and Ganache, both available from Truffle. Run the webpack server for front-end hot reloading. For now, smart contract changes must be manually recompiled and migrated. Truffle requires the truffle. Feel free to delete the file that doesn't correspond to your platform.

    Latest commit

    By the end of this blockchain book, you'll have an in-depth understanding of how to leverage distributed ledgers and smart contracts for financial use cases. Blockchain was first used for transferring and establishing the provenance of assets between individuals and organizations without depending on a middleman.

    This makes payments and remittances the oldest and most mature application of blockchain technology. Today, the technology has evolved to support a number of enterprise use cases revolving around payments and remittances, including retail payments, cross-border remittances, and corporate remittances. Several banks and financial enterprises around the world have recognized the disruptive nature of this technology in payments and are actively experimenting with workflows and applications that will form a core component of their IT infrastructure in the near future.

    In the next five chapters, we will look at four such applications. We'll start by introducing blockchain in financial services and will then proceed toward building a wallet for transferring and storing assets.

    Next, we'll build a blockchain-enabled payment gateway for an e-commerce website. Lastly, we'll look at how we can leverage blockchain to cut out the inefficiencies and delays in corporate remittances and retail cross-border remittances.

    He is currently working on the Tamil Nadu Blockchain Backbone project. This team carried out the first blockchain remittance in India. Since then he has worked as the Head of Products at HashCash Consultants where he built blockchain-enabled financial solutions for global clients. Discover how different software architectural models can help you solve problems, and learn best practices for the software development cycle.

    Become a developer superhero and build stunning cross-platform apps with Delphi. Learn how to build stunning, maintainable, cross-platform mobile application user interfaces using C 7 with the power of both the Xamarin and Xamarin. Forms frameworks. Get started with designing your serverless application using optimum design patterns and industry standard practices. Explore big data concepts, platforms, analytics, and their applications using the power of Hadoop 3.

    Become efficient in both frontend and backend web development with Spring and Vue. Learn how to architect, implement, and administer a complex Splunk Enterprise environment and extract valuable insights from business data.

    Achieve the gold standard in penetration testing with Kali using this masterpiece, now in its fourth edition. Augment your IoT skills with the help of engaging and enlightening tutorials designed for Raspberry Pi 3.

    Your one-step guide to understanding industrial cyber security, its control systems, and its operations. Learn how to automate and manage your containers and reduce the overall operation burden on your system.

    Work on practical computer vision projects covering advanced object detector techniques and modern deep learning and machine learning algorithms. Become an expert Vue developer by understanding the design patterns and component architecture of Vue. Mar Pages. Cybersecurity - Attack and Defense Strategies Enhance your organization's secure posture by improving your attack and defense strategies By Yuri Diogenes and 1 more.

    Jan Pages. Aug Pages. Mastering Swift 5 - Fifth Edition Harness the power of the latest edition with this in-depth and comprehensive guide to the Swift language By Jon Hoffman. Apr Pages. It can be thought of as a system that has properties of the both decentralized and distributed paradigms. It is a decentralized-distributed system. Distributed systems are a computing paradigm whereby two or more nodes work with each other in a coordinated fashion to achieve a common outcome.

    It is modeled in such a way that end users see it as a single logical platform. For example, Google's search engine is based on a large distributed system; however, to a user, it looks like a single, coherent platform.

    A node can be defined as an individual player in a distributed system. All nodes are capable of sending and receiving messages to and from each other. Nodes can be honest, faulty, or malicious, and they have memory and a processor. A node that exhibits irrational behavior is also known as a Byzantine node after the Byzantine Generals problem. In , a thought experiment was proposed by Lamport et al. In this problem, a group of army generals who lead different parts of the Byzantine army is planning to attack or retreat from a city.

    The only way of communicating among them is via a messenger. They need to agree to strike at the same time in order to win. The issue is that one or more generals might be traitors who could send a misleading message. Therefore, there is a need for a viable mechanism that allows for agreement among the generals, even in the presence of the treacherous ones, so that the attack can still take place at the same time.

    As an analogy for distributed systems, the generals can be considered honest nodes, the traitors as Byzantine nodes that is, nodes with arbitrary behavior , and the messenger can be thought of as a channel of communication among the generals. This problem wa s solved in by Castro and Liskov who presented the Practical Byzantine Fault Tolerance PBFT algorithm, which solves the consensus problem in the presence of Byzantine faults in asynchronous networks by utilizing the state machine replication protocol.

    PBFT goes through a number of rounds to eventually reach an agreement between nodes on the proposed value. This type of inconsistent behavior of Byzantine nodes can be intentionally malicious, which is detrimental to the operation of the network. Any unexpected behavior by a node on the network, whether malicious or not, can be categorized as Byzantine. A small-scale example of a distributed system is shown in the following diagram.

    This distributed system has six nodes, out of which one N4 is a Byzantine node leading to possible data inconsistency. L2 is a link that is broken or slow, and this can lead to a partition in the network:. The primary challenge of a distributed system design is the coordination between nodes and fault tolerance. Even if some a certain threshold dictated by the consensus protocol of the nodes become faulty or network links break, the distributed system should be able to tolerate this and continue to work to achieve the desired result.

    This problem has been an active area of distributed system design research for many years, and several algorithms and mechanisms have been proposed to overcome these issues. Distributed systems are so challenging to design that a theory known as the CAP theorem has been proven, which states that a distributed system cannot have all three of the much-desired properties simultaneously; that is, consistency, availability, and partition tolerance. We will dive into the CAP theorem in more detail later in this chapter.

    Even though blockchain can be considered to be both a distributed and decentralized system, there are, however, critical differences between distributed systems and decentralized systems that make both of these systems architecturally different.

    We will discuss these differences in detail in Chapter 2 , Decentralization. With a better understanding of distributed systems, let's now move on to talking about blockchain itself. We'll begin with a brief rundown of the history of blockchain and Bitcoin. Blockchain was introduced with the invention of Bitcoin in Its practical implementation then occurred in For the purposes of this chapter, it is sufficient to review Bitcoin very briefly, as it will be explored in great depth in Chapter 6 , Introducing Bitcoin.

    However, it is essential to refer to Bitcoin because, without it, the history of blockchain is not complete. Now we will look at the early history of computing and computer networks and will discuss how these technologies evolved and contributed to the development of Bitcoin in We can view this in chronological order:.

    The aforementioned technologies contributed in some way to the development of Bitcoin, even if not directly; the work is relevant to the problem that Bitcoin solved.

    All previous attempts to create anonymous and decentralized digital currency were successful to some extent, but they could not solve the problem of preventing double spending in a completely trustless or permissionless environment.

    This problem was finally addressed by the Bitcoin blockchain, which introduced the Bitcoin cryptocurrency.

    It should be noted that other concepts such as state machine replication the SMR problem , introduced in by Leslie Lamport and formalized in by Fred Schneider, are also solvable by Bitcoin. Bitcoin solves the SMR problem probabilistically by allowing the replication of blocks and ensuring consistency via its PoW consensus mechanism. The SMR, or state machine replication problem, is a technique used to provide fault-tolerant replication in distributed systems. We will explore this in greater detail in Chapter 5 , Consensus Algorithms.

    Now we will discuss some of the major milestones in the history of blockchain in more detail. The concept of electronic cash e-cash , or digital currency, is not new. Since the s, e-cash protocols have existed that are based on a model proposed by David Chaum. Just as understanding the concept of distributed systems is necessary to comprehend blockchain technology, the idea of e-cash is also essential in order to appreciate the first, and astonishingly successful, application of blockchain, Bitcoin, and more broadly, cryptocurrencies in general.

    Two fundamental e-cash system issues need to be addressed: accountability and anonymity. Accountability is required to ensure that cash is spendable only once addressing the double-spending problem and that it can only be spent by its rightful owner. The double-spending problem arises when the same money can be spent twice.

    As it is quite easy to make copies of digital data, this becomes a big issue in digital currencies as you can make many copies of the same amount of digital cash.

    Anonymity is required to protect users' privacy. With physical cash, it is almost impossible to trace back spending to the individual who actually paid the money, which provides adequate privacy should the consumer choose to hide their identity. In the digital world, however, providing such a level of privacy is difficult due to inherent personalization, tracing, and logging mechanisms in digital payment systems such as credit card payments. This is indeed a required feature for ensuring the security and safety of the financial network, but it is also often seen as a breach of privacy.

    This is due to the fact that end users do not have any control over who their data might be shared with, even without their consent. Nevertheless, this is a solvable problem and cryptography is used to address such issues. Especially in blockchain networks, the privacy and anonymity of the participants on the blockchain are sought-after features. We will learn more about this in Chapter 4 , Public Key Cryptography. David Chaum solved both of these problems during his work in the s by using two cryptographic operations, namely, blind signatures and secret sharing.

    These terminologies and related concepts will be discussed in detail in Chapter 4 , Public Key Cryptography. For the moment, it is sufficient to say that blind signatures allow for signing a document without actually seeing it, and secret sharing is a concept that enables the detection of double-spending, that is, using the same e-cash token twice.

    In , the first practical implementation of an e-cash system named Bitcoin appeared. The term cryptocurrency emerged later. For the very first time, it solved the problem of distributed consensus in a trustless network. It used public key cryptography with a PoW mechanism to provide a secure, controlled, and decentralized method of minting digital currency. The key innovation was the idea of an ordered list of blocks composed of transactions which is cryptographically secured by the PoW mechanism to prevent double-spending in a trustless environment.

    This concept will be explained in greater detail in Chapter 6 , Introducing Bitcoin. Other technologies used in Bitcoin, but which existed before its invention, include Merkle trees, hash functions, and hash chains. All these concepts are explained in appropriate depth in Chapter 4 , Public Key Cryptography. Looking at all the technologies mentioned previously and their relevant history, it is easy to see how concepts from e-cash schemes and distributed systems were combined to create Bitcoin and what now is known as blockchain.

    This concept can also be visualized with the help of the following diagram:. With the emergence of e-cash covered, along with the ideas that led to the formation of Bitcoin and blockchain, we can now begin to discuss blockchain itself.

    In , a groundbreaking paper, entitled Bitcoin: A Peer-to-Peer Electronic Cash System , was written on the topic of peer-to-peer e-cash under the pseudonym of Satoshi Nakamoto. It introduced the term chain of blocks. No one knows the actual identity of Satoshi Nakamoto.

    After introducing Bitcoin in , he remained active in the Bitcoin developer community until He then handed over Bitcoin development to its core developers and simply disappeared.

    Since then, there has been no communication from him whatsoever, and his existence and identity are shrouded in mystery. The term "chain of blocks" evolved over the years into the word "blockchain.

    As stated previously, blockchain technology incorporates a multitude of applications that can be implemented in various economic sectors. Particularly in the finance sector, significant improvement in the performance of financial transactions and settlements manifests as highly desirable time-and-cost reductions.

    Additional light will be shed on these aspects of blockchain in Chapter 19 , Blockchain — Outside of Currencies , where practical use cases will be discussed in detail for various industries. For now, it is sufficient to say that parts of nearly all economic sectors have already realized the potential and promise of blockchain, and have embarked, or will do so soon, on the journey to capitalize on the benefits of blockchain technology. A good place to start learning what blockchain is would be to see its definition.

    There are some different ways that blockchain may be defined; following are two of the most widely accepted definitions:. Layman's definition : Blockchain is an ever-growing, secure, shared recordkeeping system in which each user of the data holds a copy of the records, which can only be updated if all parties involved in a transaction agree to update.

    Technical definition : Blockchain is a peer-to-peer, distributed ledger that is cryptographically secure, append-only, immutable extremely hard to change , and updateable only via consensus or agreement among peers.

    Now, let's examine things in some more detail. We will look at the keywords from the technical definition one by one. The first keyword in the technical definition is peer-to-peer , or P2P This means that there is no central controller in the network, and all participants nodes talk to each other directly.

    This property allows for transactions to be conducted directly among the peers without third-party involvement, such as by a bank. Dissecting the technical definition further reveals that blockchain is a "distributed ledger," which means that a ledger is spread across the network among all peers in the network, and each peer holds a copy of the complete ledger.

    Next, we see that this ledger is "cryptographically secure," which means that cryptography has been used to provide security services that make this ledger secure against tampering and misuse.

    These services include non-repudiation, data integrity, and data origin authentication. You will see how this is achieved later in Chapter 4 , Public Key Cryptography , which introduces the fascinating world of cryptography. Another property that we encounter is that blockchain is "append-only," which means that data can only be added to the blockchain in time-sequential order.

    This property implies that once data is added to the blockchain, it is almost impossible to change that data and it can be considered practically immutable. In other words, blocks added to the blockchain cannot be changed, which allows blockchain to become an immutable and tamper-proof ledger of transactions.

    However, remember that it can be changed in rare scenarios wherein collusion against the blockchain network by bad actors succeeds in gaining more than 51 percent of the power. Otherwise, the blockchain is practically immutable. However, those are individual cases that need to be handled separately and that require an elegant technical solution. For all practical purposes, blockchain is indeed immutable and cannot be changed. The most critical attribute of a blockchain is that it is updateable only via consensus.

    This is what gives it the power of decentralization. In this scenario, no central authority is in control of updating the ledger. To achieve consensus, there are various consensus facilitation algorithms that ensure all parties agree on the final state of the data on the blockchain network and resolutely agree upon it to be true. Consensus algorithms are introduced later in this chapter, and then in more detail in Chapter 5 , Consensus Algorithms.

    Having detailed the primary features of blockchain, we are now in a position to begin to look at its actual architecture. We'll begin by looking at how blockchain acts as a layer within a distributed peer-to-peer network. Blockchain can be thought of as a layer of a distributed peer-to-peer network running on top of the internet, as can be seen in the following diagram. All these concepts will be discussed in detail later in this book in various chapters.

    Next, we'll look at blockchain from more of a business-oriented perspective. For example, for cash transfers, banks act as a trusted third party.

    In financial trading, a central clearing house acts as a trusted third party between two or more trading parties. This concept is compelling, and, once you absorb it, you will realize the enormous potential of blockchain technology. This disintermediation allows blockchain to be a decentralized consensus mechanism where no single authority is in charge of the database. Immediately, you'll see a significant benefit of decentralization here, because if no banks or central clearing houses are required, then it immediately leads to cost savings, faster transaction speeds, and more trust.

    We've now looked at what blockchain is at a fundamental level. Next, we'll go a little deeper and look at some of the elements that comprise a blockchain. Now, let's walk through the generic elements of a blockchain. You can use this as a handy reference section if you ever need a reminder about the different parts of a blockchain. More precise elements will be discussed in the context of their respective blockchains in later chapters, for example, the Ethereum blockchain.

    The structure of a generic blockchain can be visualized with the help of the following diagram:. Elements of a generic blockchain are described here one by one. These are the elements that you will come across in relation to blockchain:. The following structure is a simple block diagram that depicts a block. Specific block structures relative to their blockchain technologies will be discussed later in the book with greater in-depth technical detail:. Generally, however, there are just a few attributes that are essential to the functionality of a block: the block header, which is composed of the hash of the previous block's header, the timestamp, nonce, Merkle root, and the block body that contains the transactions.

    There are also other attributes in a block, but generally, the components introduced in this section are usually available in a block. Think of the scripting language as a calculator that only supports standard preprogrammed arithmetic operations. As such, the Bitcoin Script language cannot be called "Turing complete. It is named after Alan Turing, who developed the idea of a Turing machine that can run any algorithm however complex.

    Turing complete languages need loops and branching capability to perform complex computations. Therefore, Bitcoin's scripting language is not Turing complete, whereas Ethereum's Solidity language is.

    To facilitate arbitrary program development on a blockchain, a Turing complete programming language is needed, and it is now a very desirable feature to have for blockchains.

    Think of this as a computer that allows the development of any program using programming languages. Nevertheless, the security of such languages is a crucial question and an essential and ongoing research area. We will discuss this in greater detail in Chapter 6 , Introducing Bitcoin , Chapter 10 , Smart Contracts , and the chapters on Ethereum Development , later in this book.

    A high-level diagram of blockchain architecture highlighting the key elements mentioned previously is shown as follows:.

    The preceding diagram shows a four-node blockchain network top , each maintaining a chain of blocks, virtual machine, state machine, and address. The blockchain is then further magnified middle to show the structure of the chain of blocks, which is again magnified bottom to show the structure of a transaction.

    Note that this is a generic structure of a blockchain; we will see specific blockchains structures in detail in the context of Ethereum and Bitcoin blockchains later in this book. We have now defined and described blockchain.

    Now, let's see how a blockchain actually works. Nodes are either miners who create new blocks and mint cryptocurrency coins or block signers who validate and digitally sign the transactions. A critical decision that every blockchain network has to make is to figure out which node will append the next block to the blockchain.

    This decision is made using a consensus mechanism. The consensus mechanism will be described later in this chapter. For now, we will look at how a blockchain validates transactions and creates and adds blocks to grow the blockchain. We will look at a general scheme for creating blocks. This scheme is presented here to give you a general idea of how blocks are generated and what the relationship is between transactions and blocks:. This completes the basic introduction to blockchain.

    In the next section, you will learn about the benefits and limitations of this technology. Numerous advantages of blockchain technology have been discussed in many industries and proposed by thought leaders around the world who are participating in the blockchain space.

    The notable benefits of blockchain technology are as follows:. Blockchain technology provides a platform for running smart contracts. These are automated, autonomous programs that reside on the blockchain network and encapsulate the business logic and code needed to execute a required function when certain conditions are met.

    For example, think about an insurance contract where a claim is paid to the traveler if the flight is canceled. In the real world, this process normally takes a significant amount of time to make the claim, verify it, and pay the insurance amount to the claimant traveler.

    What if this whole process were automated with cryptographically-enforced trust, transparency, and execution so that as soon as the smart contract received a feed that the flight in question has been canceled, it automatically triggers the insurance payment to the claimant? If the flight is on time, the smart contract pays itself. This is indeed a revolutionary feature of blockchain, as it provides flexibility, speed, security, and automation for real-world scenarios that can lead to a completely trustworthy system with significant cost reductions.

    Introduction

    Packt learning blockchain application development

    Forms frameworks. He finds the most development experience is to see how people find new, better jobs, build awesome web applications, acquire amazing projects or simply enjoy their hobby with the help application his content. Learning back. Skip to content. Blockchain at all packt technologies packt previously and learning relevant history, it is easy to see how concepts from application schemes and distributed blockchain were combined to create Bitcoin and what now is known as blockchain. Imran has extensive experience in both the public and development sectors, having worked on large-scale IT projects in the public sector before moving to the financial services industry.

    What is Python?

    Lastly, we'll look at how we can leverage blockchain to cut out the inefficiencies and delays in corporate remittances and retail cross-border remittances.

    He is currently working on the Tamil Nadu Blockchain Backbone project. This team carried out the first blockchain remittance in India. Since then he has worked as the Head of Products at HashCash Consultants where he built blockchain-enabled financial solutions for global clients. He has also mentored students and industry veterans as a blockchain trainer with Edureka. He is extremely passionate about technology and loves to keep himself abreast of new developments in the field through the community.

    New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3. Cut through the noise and get real results with a step-by-step approach to data science. About this book Blockchain technology will continue to play an integral role in the banking and finance sector in the coming years.

    Publication date: January Publisher Packt. Pages ISBN Download code from GitHub. He is extremely passionate about technology and loves to keep himself abreast of new developments in the field through the community Browse publications by this author.

    Very nice. Also Informative. Artificial Intelligence with Python - Second Edition New edition of the bestselling guide to artificial intelligence with Python, updated to Python 3. By Alberto Artasanchez and 1 more. Ethereum is a decentralized Blockchain platform that runs smart contracts. Our course will teach you to build an online gaming application using the Ethereum Blockchain.

    Each 30 minute section will introduce fundamental Blockchain programming concepts as they relate to creating an online game, followed by practical exercises that customers can implement as homework assignments. With this course, you will learn core Blockchain application development skills, creating smart contracts, interacting with the Ethereum network, building user interfaces, and deploying your application to the Internet.

    This course supplies seven self-contained lessons taught in a practical, hands-on way. By the end of the course, you will be amazed how much you have learned about Blockchain application development on the Ethereum network in just one week. This fun, informative course takes the viewer through the process of building an online gaming application on the Ethereum Network using Solidity and React. Through the course of building the application, you will learn the fundamental and core concepts of blockchain application development.

    Designed with the beginner in mind, all concepts are explained fully then followed by examples, which ultimately lead to our complete, functional, gaming application. Will Button works with web, mobile, and blockchain start-ups in advisory and technical roles. As an advisor, he helps organizations scale securely and sustainably.

    As a technical expert, he helps organizations build the processes, systems, and teams necessary to deliver world-class services and applications to their customers. Since , Will has used his experience with multiple successful start-ups to create over videos on DevOps, software engineering, and blockchain application development.

    He is a certified Ethereum developer, and holds the Linux Foundation Blockchain for Business certificate.

    Blockchain Application Development 7 Days : Understand Role UI Smart Contract - bantychick.com

    This course is designed to present basic JavaScript instruction for developers looking to expand their skill-set by taking on a new type of programming challenge: Blockchain development. Brett Hooper is a well-seasoned software engineer, entrepreneur, teacher, and all-round techno-surfer. His decades of experience have taken him from years of IT consulting for fortune behemoths, to a number of entrepreneurial startup efforts, to the U.

    Dept of Defense in defining their way forward in mobile and web-related technologies. About this video As the Blockchain revolution rages around us, you may be feeling left behind as the technology and coin values continue to develop at breakneck speed. Style and Approach This course is designed to present basic JavaScript instruction for developers looking to expand their skill-set by taking on a new type of programming challenge: Blockchain development. Publication date: November Publisher Packt.

    To fully benefit from the coverage included in this course, you will need: This course is suitable for IT Professionals and Software Engineers at all levels seeking to learn Blockchain Application Development. No prerequisite skills in blockchain technology are required though some familiarity with writing code and applications will be helpful.

    This course has the following software requirements: Minimum Hardware Requirements For successful completion of this course, students will require the computer systems with at least the following:. You'll add your own code as you go in order to build a fully functioning Marketplace.

    Any code not demonstrated in the course videos has already been completed in this folder. Use this to browse the code on your own, or as a reference if you get stuck writing your own code. Skip to content. Go back. Launching Xcode If nothing happens, download Xcode and try again. Latest commit.

    Git stats 21 commits. Failed to load latest commit information. View code. Updates for Solidity 0. About the Video Course Blockchain disrupts many different aspects of our life including finance, retail, merchandising, identity, and more. What You Will Learn Create Decentralized Applications DApps that utilize blockchain technologies Find out how to program Smart Contracts using Solidity Implement business logic in the form of functions to execute tasks on the blockchain Build a local Ethereum network to test and mine your applications Write tests to ensure your applications behave properly Send Ethereum tokens to and from Smart Contracts as payments Deploy your application to Ethereum Test Networks and the Ethereum Main Network Use React to create a user interface for interacting with your Ethereum DApp.

    MIT License.

    Leave a Reply

    Your email address will not be published. Required fields are marked *