diff --git a/LFS171x/README.md b/LFS171x/README.md
index 10a8abd8..0f80edf2 100644
--- a/LFS171x/README.md
+++ b/LFS171x/README.md
@@ -1,7 +1,37 @@
-## LFS171x: Blockchain for Business - An Introduction to Hyperledger Technologies
+The source code and documentation in this directory is for the [Blockchain for Business - An Introduction to Hyperledger Technologies](https://www.edx.org/course/blockchain-business-introduction-linuxfoundationx-lfs171x) course on edX. This course is a primer to blockchain and distributed ledger technologies. Learn how to start building blockchain applications with Hyperledger frameworks. The course is free and open to the public.
-The source code and documentation in this directory is for the Introduction to Hyperledger Technologies course on edX. This course is a primer to blockchain and distributed ledger technologies. Learn how to start building blockchain applications with Hyperledger frameworks.
-The course is free and open to the public and you can find it and sign up here:
+## About this course
-(https://www.edx.org/course/blockchain-business-introduction-linuxfoundationx-lfs171x)
\ No newline at end of file
+Discover the power of business blockchains and distributed ledger technologies with an overview of Hyperledger and introductions to its key frameworks. All over the global market there are ledgers that organizations and individuals alike must trust. Blockchain technologies record promises, trades, transactions or simply items we never want to disappear, allowing everyone in an ecosystem to keep a copy of the common system of record.
+
+This introductory course is carefully curated for both nontechnical and technical audiences. It examines blockchains for the enterprise and a number of pertinent use cases from Hyperledger, a global cross-industry community of communities hosted by The Linux Foundation and advancing business blockchain technologies. Hyperledger is incubating and promoting enterprise grade, open source business blockchain software, on top of which anyone can set up apps to meet cross-industry needs.
+
+The course covers key features of blockchain technologies and the differentiators between various types of Hyperledger projects. We'll start with ‘what is blockchain’ and open the discussion to identifying suitable blockchain use cases for your business requirements. We will then take a deep dive into the enterprise-ready Hyperledger blockchain frameworks by guiding students through implementation of various blockchains.
+
+Students with a technical background will learn how to perform clean installations of Hyperledger Sawtooth and Hyperledger Fabric, as well as develop simple applications on top of these frameworks.
+
+Students with a business background will gain an understanding of how blockchains work and how they can create value for their business through cost-savings and efficiencies, in terms of speed and simplicity. They will view how information is generated, stored, and shared in various blockchains, as well as gain tools to evaluate whether or not a blockchain solution would be suitable for their particular business case.
+
+Industries today are using blockchain technologies to increase efficiency and solve business problems associated with data privacy, security, information sharing, and inclusion. Be on the cutting edge; learn about these innovative technologies and bring unique value to your business.
+
+## What you'll learn
+* Describe Business Blockchain and Distributed Ledger Technologies
+* Gain familiarity with current Hyperledger projects and cross-industry use cases
+* Perform clean installations of the Hyperledger Sawtooth and Hyperledger Fabric frameworks
+* Explore a sample use case/application in the context of the Hyperledger Sawtooth and Hyperledger Fabric frameworks
+* Build simple applications on top of Hyperledger Sawtooth and Hyperledger Fabric
+* Become involved in and contribute to the open source Hyperledger projects
+
+## Syllabus
+
+* Welcome & Introduction
+* [Discovering Blockchain Technologies](docs/discovering-blockchain-technologies.md)
+* [Introduction to Hyperledger](docs/introduction-to-hyperledger.md)
+* [The Promise of Business Blockchain Technologies](docs/the-promise-of-business-blockchain-technologies.md)
+* [Technical Requirements](docs/technical-requirements.md)
+* [Introduction to Hyperledger Iroha](docs/introduction-to-hyperledger-iroha.md)
+* [Introduction to Hyperledger Sawtooth](docs/introduction-to-hyperledger-sawtooth.md)
+* [Introduction to Hyperledger Fabric](docs/introduction-to-hyperledger-fabric.md)
+* [What's Next?](docs/whats-next.md)
+* [Final Exam](docs/final-exam.md)
diff --git a/LFS171x/docs/discovering-blockchain-technologies.md b/LFS171x/docs/discovering-blockchain-technologies.md
new file mode 100644
index 00000000..05a60b89
--- /dev/null
+++ b/LFS171x/docs/discovering-blockchain-technologies.md
@@ -0,0 +1,563 @@
+
+
+- [Introduction and Learning Objectives](#introduction-and-learning-objectives)
+ - [Introduction](#introduction)
+ - [Learning Objectives](#learning-objectives)
+- [Distributed Ledger Technology (DLT)](#distributed-ledger-technology-dlt)
+ - [Background - The Rising Interest in Distributed Ledger Technologies](#background-the-rising-interest-in-distributed-ledger-technologies)
+ - [Distributed Ledger Technology (DLT)](#distributed-ledger-technology-dlt)
+ - [Video: Blockchain Technology (Robert Schwentker)](#video-blockchain-technology-robert-schwentker)
+ - [Blockchains](#blockchains)
+ - [Video: The Difference between DLT and Blockchains (Brian Behlendorf)](#video-the-difference-between-dlt-and-blockchains-brian-behlendorf)
+ - [Blockchains (Continued)](#blockchains-continued)
+ - [Merkle Tree](#merkle-tree)
+ - [Video: What Is a Blockchain? (Dave Huseby)](#video-what-is-a-blockchain-dave-huseby)
+ - [Transactions](#transactions)
+ - [Differences between Blockchains and Databases](#differences-between-blockchains-and-databases)
+ - [Types of Blockchains](#types-of-blockchains)
+ - [Peer-to-Peer Network Architecture](#peer-to-peer-network-architecture)
+ - [Video: Peer-to-Peer Networks (Robert Schwentker)](#video-peer-to-peer-networks-robert-schwentker)
+ - [Immutability of Data](#immutability-of-data)
+ - [Blockchain Applications](#blockchain-applications)
+ - [Smart Contracts](#smart-contracts)
+ - [Video: Smart Contracts (Robert Schwentker)](#video-smart-contracts-robert-schwentker)
+- [Bitcoin and Ethereum Blockchains](#bitcoin-and-ethereum-blockchains)
+ - [Bitcoin - A Popular Blockchain Deployment](#bitcoin-a-popular-blockchain-deployment)
+ - [Video: Bitcoin and Ethereum (Robert Schwentker)](#video-bitcoin-and-ethereum-robert-schwentker)
+ - [Bitcoin and Cryptoeconomics](#bitcoin-and-cryptoeconomics)
+ - [Ethereum - An Alternative to Bitcoin](#ethereum-an-alternative-to-bitcoin)
+ - [Video: Ethereum (Robert Schwentker)](#video-ethereum-robert-schwentker)
+ - [Dapps](#dapps)
+ - [Ethereum Smart Contracts](#ethereum-smart-contracts)
+- [Exploring Permissionless Blockchains](#exploring-permissionless-blockchains)
+ - [Video: Exploring Bitcoin and Ethereum Blockchains](#video-exploring-bitcoin-and-ethereum-blockchains)
+ - ['Certifying' a Document](#certifying-a-document)
+ - [Video: 'Certifying' a Document onto Blockchains Using stamp.io](#video-certifying-a-document-onto-blockchains-using-stampio)
+- [Consensus Algorithms](#consensus-algorithms)
+ - [Proof of Work (PoW)](#proof-of-work-pow)
+ - [Proof of Stake (PoS)](#proof-of-stake-pos)
+ - [Proof of Elapsed Time (PoET)](#proof-of-elapsed-time-poet)
+ - [Simplified Byzantine Fault Tolerance (SBFT)](#simplified-byzantine-fault-tolerance-sbft)
+ - [Proof of Authority (PoA)](#proof-of-authority-poa)
+ - [Comparing Permissioned Consensus Approaches and Standard PoW](#comparing-permissioned-consensus-approaches-and-standard-pow)
+- [Hyperledger](#hyperledger)
+ - [Video: Hyperledger (Robert Schwentker)](#video-hyperledger-robert-schwentker)
+ - [Hyperledger Blockchains: Permissioned or Permissionless?](#hyperledger-blockchains-permissioned-or-permissionless)
+ - [Advantages of Using a Permissioned Blockchain over a Permissionless Blockchain](#advantages-of-using-a-permissioned-blockchain-over-a-permissionless-blockchain)
+ - [Video: Hyperledger vs. Other Permissioned Ledgers (Brian Behlendorf)](#video-hyperledger-vs-other-permissioned-ledgers-brian-behlendorf)
+- [Other Open Source Permissioned Distributed Ledgers](#other-open-source-permissioned-distributed-ledgers)
+ - [Video: Other Distributed Ledger Technologies (Robert Schwentker)](#video-other-distributed-ledger-technologies-robert-schwentker)
+ - [Chain Core](#chain-core)
+ - [Corda](#corda)
+ - [Quorum](#quorum)
+ - [IOTA](#iota)
+- [Challenges in the Adoption/Deployment of Distributed Ledger Technologies](#challenges-in-the-adoptiondeployment-of-distributed-ledger-technologies)
+ - [Standards](#standards)
+ - [Regulation](#regulation)
+ - [Lack of Know-How](#lack-of-know-how)
+- [Knowledge Check](#knowledge-check)
+ - [Knowledge Check 1.1](#knowledge-check-11)
+ - [Knowledge Check 1.2](#knowledge-check-12)
+ - [Knowledge Check 1.3](#knowledge-check-13)
+ - [Knowledge Check 1.4](#knowledge-check-14)
+ - [Knowledge Check 1.5](#knowledge-check-15)
+- [Conclusions & Learning Objectives (Review)](#conclusions-learning-objectives-review)
+ - [Learning Objectives (Review)](#learning-objectives-review)
+ - [Conclusions](#conclusions)
+
+
+
+# Introduction and Learning Objectives
+
+## Introduction
+Chapter 1 introduces the building blocks of distributed ledger technologies, including blockchains. It lays the foundation for an in-depth understanding of the content that follows in the course. You should engage with the content in this chapter both to learn, as well as brush up your blockchain knowledge.
+
+## Learning Objectives
+By the end of this chapter you should be able to:
+
+* Discuss blockchain and distributed ledger technologies (DLT).
+* Explore permissioned and permissionless blockchains and their key characteristics.
+* Discuss various components of distributed ledger technologies, including consensus algorithms and smart contracts.
+* Provide a high-level explanation of what Hyperledger is.
+
+# Distributed Ledger Technology (DLT)
+
+## Background - The Rising Interest in Distributed Ledger Technologies
+
+Looking back to the last half century of computer technologies and architectures, one may observe a trend of fluctuation between the centralization and subsequent decentralization of computing power, storage, infrastructure, protocols, and code.
+
+Mainframe computers are largely centralized. They typically house all computing power, memory, data storage, and code. Access to mainframes is mainly by 'dumb terminals', which only take inputs and outputs, and do not store or process data.
+
+With the advent of personal computers and private networks, similar computational capabilities were now housed both on the clients, as well as the servers. This, in part, gave rise to the 'client-server' architecture, which supported the development of relational database systems. Massive data sets, which are housed on mainframes, could move onto a distributed architecture. This data could replicate from server to server, and subsets of the data could be accessed and processed on clients, and then, synced back to the server.
+
+Over time, Internet and cloud computing architectures enabled global access from a variety of computing devices; whereas mainframes were largely designed to address the needs of large corporations and governments. Even though this 'cloud architecture' is decentralized in terms of hardware, it has given rise to application-level centralization (e.g. Facebook, Twitter, Google, etc).
+
+Currently, we are witnessing the transition from centralized computing, storage, and processing to decentralized architectures and systems. According to [Muneeb Ali](https://medium.com/@muneeb/the-next-wave-of-computing-743295b4bc73), these systems aim to
+
+> "give explicit control of digital assets to end-users and remove the need to trust any third-party servers and infrastructure".
+
+Distributed ledger technology is one of the key innovations making this shift possible.
+
+## Distributed Ledger Technology (DLT)
+
+A **distributed ledger** is a type of data structure which resides across multiple computer devices, generally spread across locations or regions.
+
+**Distributed Ledger Technology** includes blockchain technologies and smart contracts. While distributed ledgers existed prior to Bitcoin, the Bitcoin blockchain marks the convergence of a host of technologies, including timestamping of transactions, Peer-to-Peer (P2P) networks, cryptography, and shared computational power, along with a new consensus algorithm.
+
+In summary, distributed ledger technology generally consists of [three basic components](https://intelledger.github.io/introduction.html):
+
+* A **data model** that captures the current state of the ledger
+* A **language of transactions** that changes the ledger state
+* A **protocol** used to build consensus among participants around which transactions will be accepted, and in what order, by the ledger.
+
+## Video: Blockchain Technology (Robert Schwentker)
+
+[](https://youtu.be/wphKFa62pho)
+
+## Blockchains
+According to [hyperledger.org](https://www.hyperledger.org),
+
+> "A blockchain is a peer-to-peer distributed ledger forged by consensus, combined with a system for "smart contracts" and other assistive technologies."
+
+**Smart contracts** are simply computer programs that execute predefined actions when certain conditions within the system are met.
+
+**Consensus** refers to a system of ensuring that parties agree to a certain state of the system as the true state.
+
+## Video: The Difference between DLT and Blockchains (Brian Behlendorf)
+
+[](https://youtu.be/02IAHzvCh34)
+
+## Blockchains (Continued)
+
+**Blockchain** is a specific form or subset of distributed ledger technologies, which constructs a chronological chain of blocks, hence the name 'block-chain'. A **block** refers to a set of transactions that are bundled together and added to the chain at the same time. In the Bitcoin blockchain, the miner nodes bundle unconfirmed and valid transactions into a block. Each block contains a given number of transactions. In the Bitcoin network, miners must solve a cryptographic challenge to propose the next block. This process is known as '**proof of work**', and requires significant computing power. We shall discuss proof of work in more detail in the Consensus Algorithms section. For a brief history of blockchain technology, please click here.
+
+Timestamping is another key feature of blockchain technology. Each block is timestamped, with each new block referring to the previous block. Combined with **cryptographic hashes**, this timestamped chain of blocks provides an immutable record of all transactions in the network, from the very first (or genesis) block.
+
+A block commonly consists of four pieces of metadata:
+
+* The reference to the previous block
+* The proof of work, also known as a nonce
+* The timestamp
+* The Merkle tree root for the transactions included in this block.
+
+## Merkle Tree
+
+The Merkle tree, also known as a binary hash tree, is a data structure that is used to store hashes of the individual data in large datasets in a way to make the verification of the dataset efficient. It is an anti-tamper mechanism to ensure that the large dataset has not been changed. The word 'tree' is used to refer to a branching data structure in computer science, as seen in the image below. According to Andreas M. Antonopoulos, in the Bitcoin protocol,
+
+> "Merkle trees are used to summarize all the transactions in a block, producing an overall digital fingerprint of the entire set of transactions, providing a very efficient process to verify whether a transaction is included in a block."
+
+||
+|:--:|
+| *Bitcoin Block Data (licensed under [Creative Commons Attribution-Share-Alike 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/deed.en), retrieved from [Wikipedia](https://commons.wikimedia.org/wiki/File:Bitcoin_Block_Data.png)* |
+
+For an in-depth discussion on Merkle trees, see: http://chimera.labs.oreilly.com/books/1234000001802/ch07.html#_structure_of_a_block.
+
+## Video: What Is a Blockchain? (Dave Huseby)
+
+[](https://youtu.be/31Uyf0uKFK8)
+
+To learn more about blockchain, you can watch Bettina Warburg's video, [How the Blockchain will radically transform the economy](https://www.ted.com/talks/bettina_warburg_how_the_blockchain_will_radically_transform_the_economy).
+
+## Transactions
+The record of an event, cryptographically secured with a digital signature, that is verified, ordered, and bundled together into blocks, form the **transactions** in the blockchain. In the Bitcoin blockchain, transactions involve the transfer of bitcoins, while in other blockchains, transactions may involve the transfer of any asset or a record of some service being rendered. Furthermore, a smart contract within the blockchain may allow automatic execution of transactions upon meeting predefined criteria.
+
+**Cryptography** has a key role to play both in the security, as well as in the immutability of the transactions recorded on blockchains. Cryptography is the study of the techniques used to allow secure communication between different parties and to ensure the authenticity and immutability of the data being communicated. For blockchain technologies, cryptography is used to prove that a transaction was created by the right person. It is also used to link transactions into a block in a tamper-proof way, as well as create the links between blocks, to form a blockchain.
+
+## Differences between Blockchains and Databases
+
+Blockchain technology has some key differentiators from databases.
+
+A blockchain is a write-only data structure, where new entries get appended onto the end of the ledger. Every new block gets appended to the block chain by linking to the previous block's 'hash' (you can check the Glossary tab for a refresher on hash functions). There are no administrator permissions within a blockchain that allow editing or deleting of data.
+
+In a relational database, data can be easily modified or deleted. Typically, there are database administrators who may make changes to any part of the data and/or its structure. Additionally, blockchains were designed for decentralized applications, whereas relational databases, in general, were originally designed for centralized applications, where a single entity controls the data.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## Types of Blockchains
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+A blockchain can be both **permissionless** (like Bitcoin or Ethereum) or **permissioned** (like the different Hyperledger blockchain frameworks). A permissionless blockchain is also known as a public blockchain, because anyone can join the network. A permissioned blockchain, or private blockchain, requires pre-verification of the participating parties within the network, and these parties are usually known to each other.
+
+The choice between permissionless versus permissioned blockchains should be driven by the particular application at hand (or use case). Most enterprise use cases involve extensive vetting before parties agree to do business with each other. An example where a number of businesses exchange information is the supply chain management. The supply chain management is an ideal use case for permissioned blockchains. You would not want non-vetted companies participating in the network. Each participant that is involved in the supply chain would require permissions to execute transactions on the blockchain. These transactions would allow other companies to understand where in the supply chain a particular item is.
+
+On the contrary, when a network can 'commoditize' trust, facilitating parties to transact without necessarily having to verify each other's identity, like the Bitcoin blockchain, a permissionless blockchain is more suitable. Many of these instances involve the sale or distribution to the public. Cryptocurrencies and Initial Coin Offerings (which are not backed by national governments) usually involve implementations of permissionless blockchains.
+
+You will learn about a variety of use cases in *Chapter 3, The Promise of Business Blockchain Technologies*.
+
+## Peer-to-Peer Network Architecture
+
+Historically, most applications utilize a central server (or servers). For one user/client to send a message to another user/client in the network, the request has to be sent to the hub or a central server, which then directs it to the right computer.
+
+**Peer-to-peer** (P2P) networks were first made popular by Napster (and later BitTorrent) and consist of computer systems which are directly connected to each other via the Internet, without a central server. Peers contribute to the computing power and storage that is required for the upkeep of the network. P2P networks are generally considered to be more secure than centralized networks, as they do not have a single point of attack, as in the case of a server-based network, where the security of the entire network can be compromised if the central server is successfully attacked. As a result, large corporations invest significant amounts of financial resources to fortify their central servers, and yet, a total cost of $445 billion to the global economy in cyberspace crimes was estimated by the World Economic Forum's 2016 Global Risk Report.
+
+Permissionless P2P systems do not require a set amount of peers to be online and are generally slower. Permissioned P2P networks have to guarantee uptime and require a high level of quality of service on the communication links.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## Video: Peer-to-Peer Networks (Robert Schwentker)
+
+[](https://youtu.be/Yv8YWmKEBlk)
+
+## Immutability of Data
+
+The immutability of the data which sits on the blockchain is perhaps the most powerful and convincing reason to deploy blockchain-based solutions for a variety of socio-economic processes which are currently recorded on centralized servers. This **immutability**, or '**unchanging over time**' feature makes the blockchain useful for accounting, financial transactions, identity management, and asset ownership, management and transfer, just to name a few examples. Once a transaction is written onto the blockchain, no one can change it, or, at least, it would be extremely difficult to change it.
+
+According to [Antony Lewis](https://www.linkedin.com/pulse/gentle-introduction-immutability-blockchains-antony-lewis/), the Director of Research at R3,
+
+> "When people say that blockchains are immutable, they don't mean that the data can't be changed, they mean it is extremely hard to change without collusion, and if you try, it's extremely easy to detect the attempt."
+
+Let's dig into this statement a bit further. It is extremely hard to change the transactions in a blockchain, because each block is linked to the previous block by including the previous block's hash. This hash includes the Merkle root hash of all the transactions in the previous block. If a single transaction were to change, not only would the Merkle root hash change, but so too would the hash contained in the changed block. In addition, each subsequent block would need to be updated to reflect this change. In the case of proof of work, the amount of energy required to recalculate the nonce for this block and each subsequent block would be prohibitive. On the other hand, if someone did modify a transaction in a block without going through the necessary steps to update the subsequent blocks, it would be easy to recalculate the hashes used in the blocks and determine that something is amiss.
+
+Let's look at an example of how this works. In the following diagram, we see the original blocks and the transactions for Block 11. Specifically, we see that the Merkle root for the transactions in Block 11 is `Hash #ABCD`, which is the combined hash for the four transactions in this block. Now, let's say that someone comes in and attempts to change Transaction A to Transaction A'. This, in turn, modifies the hashes that are stored in the Merkle tree, and the Merkle root changes to `Hash #A'BCD`. In addition, the Previous Block hash stored in Block 12 also needs to be modified to reflect the overall change in the hash for Block 11.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+
+## Blockchain Applications
+
+Since blockchain is a new form of digital infrastructure, applications built on top of a blockchain provide a gateway to accessing information that sits on that blockchain. In other words, clients/users interact with the blockchain through applications. Starting from the simple wallets that hold bitcoins, sophisticated applications which encompass applications addressing digital identity (e.g. UPort, KYC-Chain, Netki, etc.), and complex financial transactions are being built on the blockchain.
+
+A more exhaustive list of companies using blockchain technology for identity management and authentication can be found [here](https://letstalkpayments.com/22-companies-leveraging-blockchain-for-identity-management-and-authentication/).
+
+For more details about blockchain applications, you can refer to Daniel Palmer's article at [coindesk.com](https://www.coindesk.com/7-cool-decentralized-apps-built-ethereum/).
+
+## Smart Contracts
+
+**Smart contracts** are simply computer programs that execute predefined actions when certain conditions within the system are met. Smart contracts provide the **language of transactions** that allow the ledger state to be modified. They can facilitate the exchange and transfer of anything of value (e.g. shares, money, content, property).
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## Video: Smart Contracts (Robert Schwentker)
+
+[](https://youtu.be/hz_yy9N3Eh0)
+
+# Bitcoin and Ethereum Blockchains
+
+## Bitcoin - A Popular Blockchain Deployment
+
+With the invention of the peer-to-peer (P2P) cash system known as Bitcoin in 2008, we have an example of a global decentralized payment network with a distributed and publicly-owned infrastructure, operating as a 'permissionless' system. There is a persuasive case that Bitcoin is the first 'killer application' of decentralized computing. One can send and receive bitcoins anywhere in the world in a completely P2P manner, *without having to intermediate through a trusted third party, such as a bank*.
+
+According to the [Coin Market Capitalizations website](https://coinmarketcap.com/currencies/bitcoin/), as of October 2017, bitcoin's market capitalization (market cap) was nearly $100 billion.
+
+||
+|:--:|
+| *Bitcoin Charts (Source: https://coinmarketcap.com/currencies/bitcoin/)* |
+
+According to [AngelList](https://angel.co/blockchains), more than one thousand startups have been created to leverage Bitcoin and blockchain-related technologies since the inception of the Bitcoin payment system. Hundreds of large companies, and dozens of governments and universities have become actively involved in researching, testing, and prototyping blockchain protocols, platforms, and applications. In particular, the financial services sector has been actively investing in exploring wider applications of distributed ledger technologies (of which, blockchain is a subset) since late 2015.
+
+## Video: Bitcoin and Ethereum (Robert Schwentker)
+
+[](https://youtu.be/6AulVTv2hlo)
+
+## Bitcoin and Cryptoeconomics
+
+Bitcoin has also ushered in tremendous academic and research interest in the area of Cryptoeconomics and Cryptoeconomic security.
+
+According to [Vitalik Buterin](https://www.youtube.com/watch?v=pKqdjaH1dRo),
+
+> "Cryptoeconomics is about building systems that have certain desired properties using cryptography to prove properties about messages that happened in the past while using economic incentives defined inside the system to encourage desired properties to hold into the future."
+
+In other words, the field of Cryptoeconomics explores the intersection of cryptography and economic incentives. While cryptography is used for ensuring network security at various levels and functions, the built-in economic incentives provided to the participating nodes in the network ensures that, at any given point, the majority of players in the network operate in a desirable way.
+
+Rather than imposing barriers to entry, permissionless blockchains are public and open for anyone to join. Since such networks can reasonably expect all kind of agents - including malicious actors - the key lies in incentivizing good behavior in a critical majority of the network, such that:
+* The malicious actors cannot take over the network through an **escalated attack**.
+* The malicious actors cannot **collude** to undertake an organized majority attack on the network.
+* The **payoffs** of securing the network are consistently higher than the cost of attacking the network.
+* The **cost** of attacking the network is prohibitively high.
+You can find more about Cryptoeceonomics [here](https://medium.com/@cryptoeconomics/the-blockchain-economy-a-beginners-guide-to-institutional-cryptoeconomics-64bf2f2beec4).
+
+## Ethereum - An Alternative to Bitcoin
+
+According to [Ethereum's official documentation](http://ethdocs.org/en/latest/introduction/what-is-ethereum.html),
+
+> "Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology".
+
+The Ethereum blockchain platform facilitates **scripting functionality**, or '**smart contracts**', which are run through the nodes in the network. As a result, unlike the Bitcoin blockchain, it does not just track transactions, it also programs them. Technically, Ethereum is a Turing-complete virtual machine with its native cryptocurrency called 'ether'. The platform was proposed in 2013 in a white paper by the then 19-year old Vitalik Buterin.
+
+As of October 2017, Ethereum had a [market cap](https://coinmarketcap.com/currencies/ethereum/) of over $28 billion, making ether the second most valuable cryptocurrency after Bitcoin.
+
+||
+|:--:|
+| *Ether Historical Market Capitalization Chart (Source: https://etherscan.io/chart/marketcap)* |
+
+As the second best known public blockchain after the Bitcoin blockchain, Ethereum has ushered in an era of unprecedented activity around blockchain and distributed ledger technology.
+
+## Video: Ethereum (Robert Schwentker)
+
+[](https://youtu.be/zuc3AIcDEok)
+
+## Dapps
+
+As [Stephan Tual](https://www.youtube.com/watch?v=Clw-qf1sUZg) explains, Ethereum applications do not have a middleman; instead, users interact in a P2P fashion with other users through a variety of interfaces - social, financial, gaming, etc. Since the applications are developed on the decentralized consensus-based network itself, third-party censorship is virtually impossible. Malicious actors cannot secretly tamper with the application by changing the code and compromise all application users (or nodes that are actively interacting with it). These Decentralized Applications have come to be known as **Dapps**.
+
+Since they are cryptographically secured, Dapps are referred to as 'secure applications'. Some of the [high profile Dapps](http://www.ethdocs.org/en/latest/introduction/web3.html) built on the Ethereum platform include:
+* **Augur**, which is a Decentralized Prediction Market. Learn more at https://augur.net/.
+* **Digix**, which tokenizes gold on Ethereum. Learn more at: https://digix.global/.
+* **Maker**, which is a Decentralized Autonomous Organization (DAO). Learn more at: https://makerdao.com/.
+
+The Ethereum network is a distributed global public network, which means it is not run on central servers in a certain geographical location. Instead, the computing power that runs the network is contributed by nodes that are spread across the globe. In other words, Dapps have 'zero downtime' - they never go down and, in general, cannot be switched off.
+
+## Ethereum Smart Contracts
+
+A hypothetical example of an Ethereum-based smart contract may involve the following transaction: in an equity raise, transfer amount X from the investor to the company upon receiving the given shares from the company. The monetary amount X, which was pre-validated by the company for the transaction (much like in a credit card purchase), is held in escrow by the smart contract, until the shares have been received by the investor. Any kind of arbitrary sophisticated business logic can be committed to the blockchain. The Ethereum blockchain only encodes these 'rules of the games'. The actual payoffs occur by interacting with the blockchain.
+
+The illustration below describes this process. The smart contract encodes the agreement between the company raising funds and its investors (Panel 1). The smart contract sits on the Ethereum public blockchain, and is run on the Ethereum Virtual Machine (EVM). Once hitting a triggering event, like an expiration date or a strike price that has been pre-coded, the smart contract automatically executes as per the business logic (Panel 2). As an added benefit, regulators are able to scrutinize the market activity on an ongoing basis, without compromising the identity of specific players in a permissionless public blockchain, as Ethereum (Panel 3).
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+**Note**: With the advent of the Ethereum blockchain platform and the scripting functionality or smart contracts that it enables, there are ongoing attempts to do the same for the Bitcoin blockchain, which does not allow for this, due to security reasons. [RSK](http://www.rsk.co/) is one such smart contract platform that seeks to achieve this "*with a 2-way peg to Bitcoin*". The added functionality can go a long way in making the Bitcoin blockchain useful for use cases other than cash transfers.
+
+# Exploring Permissionless Blockchains
+
+Let's start by examining the Bitcoin and Ethereum blockchains, both of which are permissionless, public blockchains. We will examine several large transactions, and the genesis block for each blockchain. We will look at block heights, transaction times, mining pools, timestamps, and block rewards.
+
+## Video: Exploring Bitcoin and Ethereum Blockchains
+
+[](https://youtu.be/v6FY9jqj3XE)
+
+## 'Certifying' a Document
+
+We have just examined the Bitcoin and Ethereum blockchains, and the key variables to pay attention to. Next, let's examine how we can 'certify' a document on both the Bitcoin and Ethereum blockchains simultaneously, using Stamp.io, which is a certification tool. We will show you how to easily certify various types of files on Stamp.io, obtaining a 'Stampery Certificate'. We will also show you how to cross-check the hash of the transactions on the Bitcoin and the Ethereum blockchains.
+
+## Video: 'Certifying' a Document onto Blockchains Using stamp.io
+
+[](https://youtu.be/GkmHnc-5OyY)
+
+# Consensus Algorithms
+
+**Consensus** in the network refers to the process of achieving agreement among the network participants as to the correct state of data on the system. Consensus leads to all nodes sharing the exact same data. A **consensus algorithm**, hence, does two things: it ensures that the data on the ledger is the same for all the nodes in the network, and, in turn, prevents malicious actors from manipulating the data. The consensus algorithm varies with different blockchain implementations.
+
+While the Bitcoin blockchain uses Proof of Work as the consensus algorithm, other blockchains and distributed ledgers are deploying a variety of consensus algorithms, like the Proof of Stake, Proof of Burn, Proof of Capacity, Proof of Elapsed Time, and many others, depending on their unique requirements.
+
+Next, we will briefly explain some of these algorithms.
+
+## Proof of Work (PoW)
+
+The Proof of Work consensus algorithm involves solving a computational challenging puzzle in order to create new blocks in the Bitcoin blockchain. Colloquially, the process is known as 'mining', and the nodes in the network that engage in mining are known as 'miners'. The incentive for mining transactions lies in economic payoffs, where competing miners are rewarded with 12.5 bitcoins and a small transaction fee.
+
+As described in the [2016 Kudelski Security report](https://www.kudelskisecurity.com/sites/default/files/files/kudelski_Security_blockchain_20161213.pdf),
+
+> "Proof-of-work (PoW) is the outcome of a successful mining process and, although the proof is hard to create, [it] is easy to verify."
+
+For better understanding, please consider the following example provided by [Ofir Beigel](https://99bitcoins.com/proof-of-work-proof-of-stake/):
+
+> "(...) guessing a combination to a lock is a proof to a challenge. It is very hard to produce this since you will need to guess many different combinations; but once produced, it is easy to validate. Just enter the combination and see if the lock opens".
+
+Multiple criticisms exist for the PoW consensus algorithm. PoW requires a huge amount of energy to be expended, given the computationally heavy algorithm. In addition, PoW has a high latency of transaction validation, and the concentration of mining power is located in countries where electricity is cheap. In terms of the network security, PoW is susceptible to the '51% attack', which refers to an attack on a blockchain by a group of miners controlling more than 50% of the network's computing power.
+
+## Proof of Stake (PoS)
+
+The Proof of Stake algorithm is a generalization of the Proof of Work algorithm. In PoS, the nodes are known as the 'validators' and, rather than mining the blockchain, they validate the transactions to earn a transaction fee. There is no mining to be done, as all coins exist from day one. Simply put, nodes are randomly selected to validate blocks, and the probability of this random selection depends on the amount of stake held. So, if node X owns 2 coins and node Y owns 1 coin, node X is twice as likely to be called upon to validate a block of transactions. The specific implementation of PoS can vary, depending on the use case, or as a matter of software design. Instances include [Proof of Deposit](https://www.linkedin.com/pulse/blockchain-consensus-algorithm-proof-of-work-satyakam-chakravarty/) and [Proof of Burn](https://en.bitcoin.it/wiki/Proof_of_burn). The PoS algorithm saves expensive computational resources that are spent in mining under a PoW consensus regime.
+
+## Proof of Elapsed Time (PoET)
+
+Developed by Intel, the Proof of Elapsed Time consensus algorithm emulates the Bitcoin-style Proof of Work. Hyperledger's Sawtooth implementation is an example of PoET at work. Instead of competing to solve the cryptographic challenge and mine the next block, as in the Bitcoin blockchain, the PoET consensus algorithm is a hybrid of a random lottery and first-come-first-serve basis. In PoET, each validator is given a random wait time.
+
+> "The validator with the shortest wait time for a particular transaction block is elected the leader."
+
+-[sawtooth.hyperledger.org](sawtooth.hyperledger.org)
+
+This "leader" gets to create the next block on the chain.
+
+## Simplified Byzantine Fault Tolerance (SBFT)
+
+The Simplified Byzantine Fault Tolerant consensus algorithm implements an adopted version of the [Practical Byzantine Fault Tolerant](https://blog.acolyer.org/2015/05/18/practical-byzantine-fault-tolerance/) (PBFT) algorithm, and seeks to provide significant improvements over Bitcoin's Proof of Work consensus protocol. The basic idea involves a single validator who bundles proposed transactions and forms a new block. Note that, unlike the Bitcoin blockchain, the validator is a known party, given the permissioned nature of the ledger. Consensus is achieved as a result of a minimum number of *other nodes* in the network ratifying the new block. In order to be tolerant of a Byzantine fault, the number of nodes that must reach consensus is `2f+1` in a system containing `3f+1` nodes, where `f` is the number of faults in the system. For example, if we have 7 nodes in the system, then 5 of those nodes must agree if 2 of the nodes are acting in a faulty manner.
+
+The practical example would be that of [ByzCoin](http://hackingdistributed.com/2016/08/04/byzcoin/), which seeks to make key improvements over the original Bitcoin protocol. Addressing the challenge around scalability due to high latency, ByzCoin transactions are irreversibly committed to the blockchain within seconds. The added advantage is the communication trees to "*(...) optimize transaction commitments and verification under normal operations.*" ([2016 Kudelski Security report](https://www.kudelskisecurity.com/sites/default/files/files/kudelski_Security_blockchain_20161213.pdf)).
+
+## Proof of Authority (PoA)
+
+Proof-of-Authority (PoA) is a consensus algorithm which can be used for permissioned ledgers. It uses a set of 'authorities', which are designated nodes that are allowed to create new blocks and secure the ledger. Ledgers using PoA require sign-off by a majority of authorities in order for a block to be created.
+
+## Comparing Permissioned Consensus Approaches and Standard PoW
+
+[Consensus](https://www.hyperledger.org/wp-content/uploads/2017/08/HyperLedger_Arch_WG_Paper_1_Consensus.pdf) can be implemented in different ways, such as through the use of lottery-based algorithms (PoET or PoW), or through the use of voting-based methods (SBFT), each targeting different network requirements and fault tolerance models.
+
+Lottery-based algorithms are advantageous in that they can scale to a large number of nodes. Voting-based algorithms provide low-latency finality.
+
+The following table offers an at-a-glance view of the main considerations and pros and cons of different business blockchain approaches to reaching consensus.
+
+| | Permissioned Lottery-Based | Permissioned Voting-Based | Standard Proof of Work (Bitcoin) |
+|-------------|----------------------------|---------------------------|------------------------|
+| Speed | `*****`
GOOD | `*****`
GOOD | `*`
POOR |
+| Scalability | `*****`
GOOD | `***`
MODERATE | `*****`
GOOD |
+| Finality | `***`
MODERATE | `*****`
GOOD | `*`
POOR |
+
+# Hyperledger
+
+Hyperledger is an open source effort created to advance cross-industry blockchain technologies. Hosted by The Linux Foundation, it is a global collaboration of members from various industries and organizations. Hyperledger boasts a host of enterprise-ready solutions. Hyperledger is about communities of software developers building blockchain frameworks and platforms. We will take a closer look at some of the current Hyperledger projects in the coming chapters.
+
+## Video: Hyperledger (Robert Schwentker)
+
+[](https://youtu.be/EW272QItIE8)
+
+## Hyperledger Blockchains: Permissioned or Permissionless?
+
+Hyperledger blockchains are generally permissioned blockchains, which means that the parties that join the network are authenticated and authorized to participate on the network. Hyperledger’s main goal is to create enterprise grade, open source, distributed ledger frameworks and code bases to support business use cases.
+
+## Advantages of Using a Permissioned Blockchain over a Permissionless Blockchain
+
+If you look at permissionless blockchains, like the Bitcoin blockchain or the Ethereum blockchain, anyone can join the network, as well as write and read transactions. The actors in the system are not known, which means there could be some malicious actors within the network.
+
+Hyperledger reduces these security risks and ensures that only the parties that want to transact are the ones that are part of the transaction and, rather than displaying the record of the transactions to the whole network, they remain visible only to the parties involved. So, Hyperledger provides all the capabilities of the blockchain architecture - data privacy, information sharing, immutability, with a full stack of security protocols - all for the enterprise.
+
+## Video: Hyperledger vs. Other Permissioned Ledgers (Brian Behlendorf)
+
+[](https://youtu.be/GQJDsEd8DcU)
+
+# Other Open Source Permissioned Distributed Ledgers
+
+## Video: Other Distributed Ledger Technologies (Robert Schwentker)
+
+[](https://youtu.be/cCow5ljs-f8)
+
+## Chain Core
+
+Chain Core is an enterprise permissioned blockchain system that is mostly focused on financial services, like currencies, securities, derivatives, gift cards, and loyalty points. The company partners with clients to launch and operate a network under the client's brand. Thanks to its strategic partnerships with companies such as Capital One, Citigroup, Fiserv, Nasdaq, Orange, Visa, etc., the company raised over $40 million in funding since 2014.
+
+Within the Chain Core network, the creation and transfer of assets is decentralized. However, as stated in the [2016 Kudelski Security report](https://www.kudelskisecurity.com/sites/default/files/files/kudelski_Security_blockchain_20161213.pdf),
+
+> "the operation of the network is governed by a designated set of entities known as a federation".
+
+The platform features the Chain Testnet, which allows decentralized application development on Chain Core, operated by Chain, Microsoft, and the Initiative for Cryptocurrencies and Contracts (IC3).
+
+For more information, please refer to https://chain.com/technology/.
+
+## Corda
+
+As of September 2017, R3 is a consortium of over one hundred large global financial institutions, that seeks to leverage distributed ledger technologies to record, manage, and automate legal agreements between businesses through its software solution, called Corda.
+
+Corda is a distributed ledger platform, which features a blockchain-style P2P network; however, it is not a blockchain platform. Unlike blockchains, which involve global availability of data across the network and third party validators, Corda only allows information access and validation functions to parties actually involved in the transaction. Featuring a different software architecture, "*Corda achieves consensus between firms at the level of individual deals, not the level of the system*" ([Richard Gendal Brown](http://www.r3cev.com/blog/2016/4/4/introducing-r3-corda-a-distributed-ledger-designed-for-financial-services), 2016), while supporting a variety of consensus mechanisms.
+
+For more information, please refer to https://www.corda.net/.
+
+## Quorum
+
+Created by JPMorgan, Quorum is, in fact, a fork of the Ethereum public blockchain, which uses a voting-based consensus algorithm to facilitate an enterprise-focused distributed ledger and smart contract platform. Data privacy is achieved within the network by allowing data visibility on a need-to-know basis. The platform is designed to support "*both transaction-level privacy and network-wide transparency*" ([jpmorgan.com](https://www.jpmorgan.com/country/US/EN/Quorum)). The network validates all smart contracts and overall system state through the involvement of all running nodes. As with other permissioned ledgers, regulatory compliance is front and center in the Quorum platform.
+
+## IOTA
+
+The cryptocurrency IOTA has been around since 2015. According to [Martin Rosulek](https://medium.com/@MartinRosulek/how-iota-makes-future-for-internet-of-things-af14fd77d2a3), "*It is the first cryptocurrency that provides the whole ecosystem based on blockless blockchain*" to enable machine-to-machine (M2M) transactions.
+
+IOTA, however, is more than just a cryptocurrency. Essentially, the platform entails a generalization of the blockchain protocol (the technology called Tangle) that sits at the backend of the IOTA platform.
+
+Instead of paying miners to validate the transactions, the architecture of the network involves peer-based validation. We can think of a simple analogy, that of a teacher grading students' homework: the students are the clients/users in the Bitcoin protocol, and the teacher is the miner/validator. Tangle technology asks students (users) to grade each other's homework, making the need for a teacher (external validator) redundant, and avoiding expenses related to the teacher's/validator's work. This allows the platform to be completely free of cost, without facing the scaling challenges that are inherent in the first generation of blockchains.
+
+Additionally, the use of the platform with connected devices or the Internet of Things
+
+> "enables companies to explore new business-to-business models by making every technological resource a potential service to be traded on an open market in real time, with no fees".
+
+-[Roger Aitken](https://www.forbes.com/sites/rogeraitken/2017/06/15/iotas-bitfinex-listing-surges-to-1-5b-record-breaking-crypto-capitalization-on-market-debut/#7e4170e275a5), 2017
+
+# Challenges in the Adoption/Deployment of Distributed Ledger Technologies
+
+There are a number of challenges to the widespread use of permissioned distributed ledger technologies. Key among them are challenges around the lack of standards, regulatory challenges, and the lack of knowledge about distributed ledger technologies. These challenges are inherent to any new technological infrastructure that replaces an older infrastructure.
+
+We hope you go on to address some of these challenges and contribute to building a secure digital future!
+
+## Standards
+
+Since we are still witnessing the early days of blockchain technology, there is no agreement on standards in the developer and business community, as of yet. Standards are key in ensuring interoperability and avoiding risks associated with a fragmented ecosystem. Standards are critical not just for the distributed ledger itself, but also for supporting services, like identity, privacy, and data governance. Furthermore, the management of keys, as well as protocols and standards around key loss and theft, will be critical ([Deshpande, Stewart, Lepetit, & Gunashekar](https://www.bsigroup.com/PageFiles/508003/BSI_Blockchain_DLT_Web.pdf), 2017).
+
+As a result, the International Organization for Standardization for Blockchain and Distributed Ledger Technologies was established in 2016 and has defined areas for future standardization work ([Clare Naden](https://www.iso.org/news/Ref2188.htm), 2017). More about the ISO/TC 307 technical committee can be found at https://www.iso.org/committee/6266604.html.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+
+## Regulation
+
+The lack of regulation around transactions on the blockchain creates an environment of uncertainty for all players. Highly regulated industries like financial services are treading carefully in the DLT space. The Securities and Exchange Commission of the United States has recently clarified its stance ([sec.gov](https://www.sec.gov/oiea/investor-alerts-and-bulletins/ib_coinofferings)) on Initial Coin Offerings (ICOs). The Chinese government has, in fact, banned all ICOs, while 60 major ICO platforms are being investigated ([Saheli Roy Choudhury](https://www.cnbc.com/2017/09/04/chinese-icos-china-bans-fundraising-through-initial-coin-offerings-report-says.html), 2017).
+
+Similarly, there are no regulatory guidelines governing smart contracts, causing much anxiety among various players like lawyers, regulators, programmers, and businesses. The lack of regulatory guidelines, along with a lack of industry standards, exacerbates hindrances to rapid adoption of DLT.
+
+## Lack of Know-How
+
+The lack of know-how (and know-whom and know-where) around distributed ledger technologies and the availability of experts in the area is a major challenge in the adoption of distributed ledger technologies. While there has been an exponential increase in the interest around 'blockchain', as indicated in the figure below, there is a huge lag of technical talent in the space. In fact, the origin of this course stems from the need to address this gap in know-how, both for the business and technical audiences.
+
+||
+|:--:|
+| *Source: https://coin.dance/stats/blockchain Retrieved: October 9, 2017 (updated weekly)* |
+
+# Knowledge Check
+
+## Knowledge Check 1.1
+
+What is a blockchain?
+
+
+ - A distributed ledger
+ - A system that is maintained on a peer-to-peer network
+ - A system that uses cryptography to secure transactions
+ - All of the above
+
+
+## Knowledge Check 1.2
+
+Hyperledger is a blockchain. True or False?
+
+
+ - True
+ - False
+
+
+## Knowledge Check 1.3
+
+What is a key characteristic of blockchain technology?
+
+
+ - Blockchains have a native identity system
+ - Blockchains have a set of existing international standards
+ - Blockchains are synonymous with bitcoin
+ - Blockchains are peer-to-peer distributed ledgers forged by consensus, combined with a system for 'smart contracts'
+
+
+## Knowledge Check 1.4
+
+What is a smart contract?
+
+
+ - Smart contracts specify legal agreements that are built into blockchain protocols
+ - Smart contracts allow developers to adjust DLT protocols within applications
+ - Smart contracts are computer programs that execute predefined actions when certain conditions within the system are met
+ - Smart contracts combine program logic with legal prose to create new blockchains
+
+
+## Knowledge Check 1.5
+
+What are consensus algorithms?
+
+
+ - Consensus algorithms are a key function of DLTs to form agreement as to the state of the network
+ - Proof of Elapsed Time is the only consensus algorithm supported by Hyperledger
+ - Consensus algorithms like Proof of Work measure for how long a blockchain application will run
+ - All of the above
+
+
+# Conclusions & Learning Objectives (Review)
+
+## Learning Objectives (Review)
+You should now be able to:
+* Discuss blockchain and distributed ledger technologies (DLT).
+* Explore permissioned and permissionless blockchains and their key characteristics.
+* Discuss various components of distributed ledger technologies, including consensus algorithms and smart contracts.
+* Provide a high-level explanation of what Hyperledger is.
+
+## Conclusions
+
+For a new technology to realize its full potential, a lot of pieces need to exist before network effects can be realized. Moreover, in order for the technology to bring in systemic efficiencies, a critical mass needs to be attained. As an infrastructure technology, all major players in the market need to collaborate to define standards in a democratic manner. The blockchain community is indeed witnessing unprecedented levels of industry collaboration between players who are otherwise competitors in the space. Because of the cost of moving from one infrastructure technology to the next, an open source collaborative approach is the most promising way forward. As you will learn in *Chapter 2, Introduction to Hyperledger*, Hyperledger's mandate is to develop and nurture this ecosystem to develop the future of business blockchain technologies.
diff --git a/LFS171x/docs/final-exam.md b/LFS171x/docs/final-exam.md
new file mode 100644
index 00000000..0fd4ece0
--- /dev/null
+++ b/LFS171x/docs/final-exam.md
@@ -0,0 +1,324 @@
+# Final Exam
+## Question 1
+
+What is the consensus algorithm currently used for Hyperledger Iroha?
+
+
+- Proof of Work
+- Yet Another Consensus (YAC)
+- Proof of Elapsed Time
+- Proof of Stake
+
+
+## Question 2
+
+What is the best way to create an asset in Hyperledger Fabric?
+
+
+- By relying on an application interface
+- By using the Fabric-specific REST API
+- By using chaincode and membership service
+- By using a channel
+
+
+## Question 3
+
+A distributed ledger includes:
+
+
+- A consensus protocol
+- A transaction language that changes the ledger state
+- A data model that reflects the current state of the ledger
+- All of the above
+
+
+## Question 4
+
+Which of the following represent different nodes within a Hyperledger Sawtooth network?
+
+
+- Validators
+- Ledgers
+- PoET
+- Endorsing Peers
+
+
+## Question 5
+
+Which of the following best describes Hyperledger?
+
+
+- A permissionless blockchain
+- A permissioned blockchain
+- An open source, collaborative effort of software developer communities developing business blockchain frameworks and modules
+- A permissioned blockchain that implements smart contracts in chaincode
+
+
+## Question 6
+
+Hyperledger Iroha is focused primarily on user facing applications, while other Hyperledger frameworks are focused on enterprise systems. True or False?
+
+
+- True
+- False
+
+
+## Question 7
+
+Which one of the following characteristics are well-suited for blockchain deployment? Select all answers that apply.
+
+
+- There are multiple parties involved
+- There are escrow services involved
+- Large files must be stored
+- There is a need for a shared common database
+
+
+## Question 8
+
+Which of the following are examples of permissioned ledgers?
+
+
+- Bitcoin and Ethereum
+- Hyperledger
+- R3, Ethereum, and Hyperledger
+- Corda and Quorum
+
+
+## Question 9
+
+In terms of Hyperledger Sawtooth, what functions do transaction batches offer?
+
+
+- All-or-none approach to committing transactions
+- Allow for quicker consensus
+- Simplify the need to have explicit transaction dependencies
+- Increased trust in the endorsement of transactions
+
+
+## Question 10
+
+Cryptography does not facilitate:
+
+
+- Data privacy
+- Non-repudiation
+- Data replication
+- Data integrity
+
+
+## Question 11
+
+Which of the following are characteristics of distributed ledgers?
+
+
+- Distributed ledgers may be centralized
+- Distributed ledgers are relational
+- All distributed ledgers have encrypted data
+- None of the above
+
+
+## Question 12
+
+Which one of the following Hyperledger Iroha components interacts with clients?
+
+
+- Torii
+- Ametsuchi
+- YAC
+- Ordering service
+
+
+## Question 13
+
+Which of the following Hyperledger frameworks allow for the most scalability?
+
+
+- Hyperledger Iroha
+- Hyperledger Sawtooth
+- Hyperledger Fabric
+
+
+## Question 14
+
+What consensus algorithms do the Hyperledger frameworks support?
+
+
+- Kafka, RBFT, PoW, and YAC
+- Proof of Work, Proof of Stake, and Proof of Elapsed Time
+- Proof of Stake, Proof of Work, RBFT, and Proof of Elapsed Time
+- RBFT, YAC, Proof of Elapsed Time, and Kafka
+
+
+## Question 15
+
+What is the default database used in Hyperledger Fabric?
+
+
+- CouchDB
+- LevelDB
+- MongoDB
+- SQL
+
+
+## Question 16
+
+Blockchain technology is suitable for supply chain management because it can:
+
+
+- Facilitate enterprise resource management
+- Verify authenticity
+- Share data across organizations
+- All of the above
+
+
+## Question 17
+
+What is the current state of Blockchain Standards?
+
+
+- Blockchain Standards are relatively mature
+- Blockchain Standards do not exist
+- ISO 509 defines Blockchain Standards
+- ISO/TC 307 works on standardization of blockchain and distributed ledger technologies
+
+
+## Question 18
+
+Which of the following components are modular in Hyperledger Fabric? Select all answers that apply.
+
+
+- Certificate Authority
+- Consensus Mechanism
+- Membership Service Provider
+- Peers
+
+
+## Question 19
+
+What is the most common consensus algorithm for Hyperledger Sawtooth?
+
+
+- Proof of Work
+- Pluggable
+- Proof of Elapsed Time
+- Proof of Stake
+
+
+## Question 20
+
+How does identity function as a part of blockchains?
+
+
+- Public Blockchains have strong identity components for privacy preservation
+- Permissioned ledgers require secure ways to verify the identity of users
+- Hyperledger Indy is a required module by all Hyperledger frameworks for identity
+- Blockchains are pseudo-anonymous
+
+
+## Question 21
+
+Hyperledger Iroha was created with the intention to have ______________ .
+
+
+- Simple construction
+- Emphasis on mobile application development
+- Allow for C++ design and development
+- All of the above
+
+
+## Question 22
+
+What is the role of an Ordering Node in a Hyperledger Fabric network?
+
+
+- Orders queries being made to the global state as they are sent to committing peers
+- Orders transactions as they are being sent back to the client application
+- Orders transactions into a block
+
+
+## Question 23
+
+What is Hyperledger Explorer?
+
+
+- A kind of browser used to examine cryptographic proofs
+- A tool for visualizing blockchain operations
+- A Chrome extension used for exploring blockchains
+- A tool to visualize distributed ledger architectures
+
+
+## Question 24
+
+What are the three main roles within a Hyperledger Iroha network? Select all answers that apply.
+
+
+- Client
+- Simulator
+- Ordering Service
+- Peer
+
+
+## Queston 25
+
+What is true about transaction endorsement in Hyperledger Fabric? Select all answers that apply.
+
+
+- It is a signed response for the results of a transaction
+- Nodes decide whether a block contains sequential transactions
+- Endorsement policies are specified when chaincode is deployed
+- Verifies that a network allows the creation of transactions
+
+
+## Question 26
+
+Which Hyperledger project comprises a suite of tools for building blockchain business networks?
+
+
+- Hyperledger Composer
+- Hyperledger Sawtooth
+- Hyperledger Burrows
+- Hyperledger Cello
+
+
+## Question 27
+
+What are the components within a Sawtooth node? Select all answers that apply.
+
+
+- REST service
+- Validator
+- Transaction families
+- Transaction processor(s)
+
+
+## Question 28
+
+Which of the following best describes Chaincode in Hyperledger Fabric?
+
+
+- Is a key/value state database
+- Maintains the state of the network and a copy of the ledger
+- Accepts endorsed transactions, orders them into a block, and delivers the blocks to the committing peers
+- Is the smart contract that runs on the peers and creates transactions
+
+
+## Question 29
+
+Transaction families consist of a group of operations or transaction types that are allowed on the shared ledgers. True or False?
+
+
+- True
+- False
+
+
+## Question 30
+
+Which of the following industries has shown the most initial interest in distributed ledger technologies?
+
+
+- Insurance
+- Finance
+- Agriculture
+- Manufacturing
+
diff --git a/LFS171x/docs/glossary.md b/LFS171x/docs/glossary.md
new file mode 100644
index 00000000..386de099
--- /dev/null
+++ b/LFS171x/docs/glossary.md
@@ -0,0 +1,47 @@
+# Glossary
+
+On this page, we will have a list of the key concepts that are used in this course, and their definitions, that will help you when going through the course content. These definitions will be quickly accessible from anywhere within the course, just click on the **Glossary** tab.
+
+**Block** - A set of transactions that are bundled together and added to the chain at the same time.
+
+**Byzantine Fault Tolerance Algorithm** - A consensus algorithm designed to defend against failures in the system caused by forged or malicious messages. In order to be fault tolerant of a Byzantine fault, the number of nodes that must reach consensus is ***2f+1*** in a system containing ***3f+1***, where ***f*** is the number of faults in the system.
+
+**Chaincode** - Smart contracts in Hyperledger Fabric. They encapsulate both the asset definitions and the business logic (or transactions) for modifying those assets.
+
+**Consensus Algorithm** - Refers to a system of ensuring that parties agree to a certain state of the system as the true state.
+
+**Cryptocurrency** - is a digital asset that is used as a medium of exchange. A cryptocurrency is exchanged by using digital signatures to transfer ownership from one cryptographic key pair to another key pair. Since this digital asset has characteristics of money (like store of value and medium of exchange), it is generally referred to as currency. Note: It should not be confused with digital currency or virtual currency.
+
+**Cryptoeconomics** - A field of study that explores the intersection of cryptography and economic incentives. While cryptography is used for ensuring network security at various levels and functions, the built-in economic incentives provided to the participating nodes in the network ensure that, at any given point, the majority of players in the network operate in a desirable way.
+
+**Cryptography** - The study of the techniques used to allow secure communication between different parties, and to ensure the authenticity and immutability of the data being communicated.
+
+**Distributed Ledger** - A type of data structure which resides across multiple computer devices, generally spread across locations and regions.
+
+**Hash Function** - It is used to map data of any size to a fixed length. The output of a hash function is referred to as a hash, hash value, or digest. One important characteristic of a hash function is that, when given a specific input, the hash function will always produce the exact same output.
+
+**Key/Value Pair** - It consists of two parts, one designated as a 'key', and another as a 'value'. The 'key' is an identifier that allows you to look up the 'value'. The 'value' is the data that is stored for a given 'key'.
+
+**Mining** - The process of solving computational challenging puzzles in order to create new blocks in the Bitcoin blockchain.
+
+**Node** - Computer device attached to a blockchain network. Types of nodes include: mining nodes, validator nodes, committer nodes, and endorser nodes. Nodes are sometimes also called 'peers' because they make up the devices within a peer-to-peer network.
+
+**Peer-to-Peer Network** - A network which consists of computer systems directly connected to each other via the Internet without a central server.
+
+**Private/Public Keys** - Private keys are used to derive a public key. While private keys remain confidential, public keys are available to everyone in the network (similar to an email address). Anything encrypted with a public key can only be decrypted using its corresponding private key, and vice versa.
+
+**Proof of Elapsed Time (PoET)** - Consensus algorithm used by Hyperledger Sawtooth that utilizes a lottery function in which the node with the shortest wait time creates the next block.
+
+**Proof of Stake (PoS)** - Consensus algorithm where nodes are randomly selected to validate blocks, and the probability of this random selection depends on the amount of stake held.
+
+**Proof of Work (PoW)** - Consensus algorithm first utilized by Bitcoin that involves solving a computational challenging puzzle in order to create a new block.
+
+**Smart Contract** - Computer program that executes predefined actions when certain conditions within the system are met. Smart contracts were first proposed by Nick Szabo in 1996 (http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html).
+
+**State** - Contains up-to-date data that represents the latest values for all keys included in the network's ledger. The state of a network encompasses all past transactions in the network, from the genesis block to the present time.
+
+**Transaction** - A record of an event, cryptographically secured with a digital signature, that is verified, ordered, and bundled with other such records into blocks.
+
+**Transaction Families** - Smart contracts in Hyperledger Sawtooth. They define the operations that can be applied to transactions. Transaction families consist of both transaction processors (the server-side logic) and clients (for use from web or mobile applications).
+
+**Turing-Complete** - Named after Alan Turing, an English mathematician and computer scientist, it refers to a computer that can solve any problem that a Turing Machine can. A Turing Machine is a machine that can simulate any computer algorithm, no matter how complicated. Bitcoin scripting language is not Turing-Complete, as there are no looping and branching types of computing sequences. Ethereum's Solidity language is considered Turing-Complete, as it does have looping and branching.
diff --git a/LFS171x/docs/introduction-to-hyperledger-fabric.md b/LFS171x/docs/introduction-to-hyperledger-fabric.md
new file mode 100644
index 00000000..b8b997b8
--- /dev/null
+++ b/LFS171x/docs/introduction-to-hyperledger-fabric.md
@@ -0,0 +1 @@
+# Introduction and Learning Objectives
diff --git a/LFS171x/docs/introduction-to-hyperledger-iroha.md b/LFS171x/docs/introduction-to-hyperledger-iroha.md
new file mode 100644
index 00000000..07bb99d0
--- /dev/null
+++ b/LFS171x/docs/introduction-to-hyperledger-iroha.md
@@ -0,0 +1,351 @@
+# Introduction and Learning Objectives
+
+
+- [Introduction and Learning Objectives](#introduction-and-learning-objectives)
+ - [Video: Introduction to Hyperledger Iroha (Alexandra & Arianna Groetsema)](#video-introduction-to-hyperledger-iroha-alexandra-arianna-groetsema)
+ - [Learning Objectives](#learning-objectives)
+- [Key Components](#key-components)
+ - [Hyperledger Iroha](#hyperledger-iroha)
+ - [Video: Hyperledger Iroha Key Components (Alexandra & Arianna Groetsema)](#video-hyperledger-iroha-key-components-alexandra-arianna-groetsema)
+ - [Architecture Overview](#architecture-overview)
+ - [Participants within the Network](#participants-within-the-network)
+ - [Transaction Flow Basics (Part I)](#transaction-flow-basics-part-i)
+ - [Transaction Flow Basics (Part II)](#transaction-flow-basics-part-ii)
+ - [YAC (Yet Another Consensus) - Consensus Functions](#yac-yet-another-consensus-consensus-functions)
+ - [YAC - Steps to Successful Consensus](#yac-steps-to-successful-consensus)
+ - [YAC - Failure to Reach Consensus](#yac-failure-to-reach-consensus)
+ - [Mobile Libraries](#mobile-libraries)
+ - [Relationship to Hyperledger Fabric and Hyperledger Sawtooth](#relationship-to-hyperledger-fabric-and-hyperledger-sawtooth)
+ - [Video: Discussing Hyperledger Iroha with Makoto Takemiya](#video-discussing-hyperledger-iroha-with-makoto-takemiya)
+- [Joining the Hyperledger Iroha Community](#joining-the-hyperledger-iroha-community)
+ - [Joining the Hyperledger Iroha Community on GitHub](#joining-the-hyperledger-iroha-community-on-github)
+ - [Joining the Hyperledger Iroha Community via Rocket.Chat and Mailing Lists](#joining-the-hyperledger-iroha-community-via-rocketchat-and-mailing-lists)
+- [Knowledge Check](#knowledge-check)
+ - [Knowledge Check 5.1](#knowledge-check-51)
+ - [Knowledge Check 5.2](#knowledge-check-52)
+ - [Knowledge Check 5.3](#knowledge-check-53)
+ - [Knowledge Check 5.4](#knowledge-check-54)
+ - [Knowledge Check 5.5](#knowledge-check-55)
+ - [Knowledge Check 5.6](#knowledge-check-56)
+ - [Knowledge Check 5.7](#knowledge-check-57)
+ - [Knowledge Check 5.8](#knowledge-check-58)
+ - [Knowledge Check 5.9](#knowledge-check-59)
+ - [Knowledge Check 5.10](#knowledge-check-510)
+- [Conclusions & Learning Objectives (Review)](#conclusions-learning-objectives-review)
+ - [Learning Objectives (Review)](#learning-objectives-review)
+ - [Iroha API Documentation](#iroha-api-documentation)
+ - [Video: Conclusions (Alexandra Groetsema)](#video-conclusions-alexandra-groetsema)
+
+
+
+## Video: Introduction to Hyperledger Iroha (Alexandra & Arianna Groetsema)
+
+[](https://youtu.be/rJUqTkExuCo)
+
+## Learning Objectives
+
+By the end of this chapter you should be able to:
+
+* Understand the basics of Hyperledger Iroha v0.95.
+* Discuss crucial components of the Hyperledger Iroha architecture, including the consensus algorithm YAC (Yet Another Consensus), peers, clients and the ledger block storage *Ametsuchi*.
+* Join the Hyperledger Iroha framework discussion and development.
+
+# Key Components
+
+## Hyperledger Iroha
+
+Hyperledger Iroha is a blockchain framework, and one of the Hyperledger projects hosted by The Linux Foundation. Hyperledger Iroha was initially contributed by Soramitsu, Hitachi, NTT Data, and Colu. Hyperledger Iroha is designed to be simple and easy to incorporate into infrastructure projects requiring distributed ledger technology. Hyperledger Iroha features a simple construction, modern, domain-driven C++ design, emphasis on mobile application development, and the YAC consensus algorithm.
+
+
+
+## Video: Hyperledger Iroha Key Components (Alexandra & Arianna Groetsema)
+
+[](https://youtu.be/yfOFSgRLhz4)
+
+## Architecture Overview
+
+Before diving into the key components of Hyperledger Iroha, it is important to get an overarching look at this framework. The diagram below shows a layered architectural view of the different components that make up Hyperledger Iroha. The four layers are: API, Peer Interaction, Chain Business Logic, and Storage.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+The components are:
+
+* **Model** classes are system entities.
+* **Torii** (gate) provides the input and output interfaces for clients. It is a single [gRPC](https://grpc.io/) server that is used by clients to interact with peers through the network. The client's RPC call is non-blocking, making Torii an asynchronous server. Both commands (transactions) and queries (read access) are performed through this interface.
+* **Network** encompasses interaction with the network of peers.
+* **Consensus** is in charge of peers agreeing on chain content in the network. The consensus mechanism used by Iroha is YAC (Yet Another Consensus), which is a practical byzantine fault-tolerant algorithm based on voting for block hash.
+* **Simulator** generates a temporary snapshot of storage to validate transactions by executing them against this snapshot and forming a verified proposal, which consists only of valid transactions.
+* **Validator** classes check business rules and validity (correct format) of transactions or queries. There are two distinct types of validation that occur in Hyperledger Iroha:
+ * **Stateless validation** is a quicker form of validation, that performs schema and signature checks of the transaction.
+ * **Stateful validation** is a slower form of validation, that checks the permissions and the current world state view, which is the latest and most actual state of the chain, to see if desired business rules and policies are possible. For example, does an account have enough funds to transfer?
+* **Synchronizer** helps to synchronize new peers in the system or temporarily disconnected peers.
+* **Ametsuchi** is the ledger block storage which consists of a block index (currently Redis), block store (currently flat files), and a world state view component (currently PostgreSQL).
+
+## Participants within the Network
+
+There are three main participants within a Hyperledger Iroha network:
+
+* **Clients** are able to:
+ 1. Query data that they have access/permission to
+ 2. Perform a state-changing action, 'transaction', which consists of atomic operations, called 'commands'. For example, in a single transaction, a user can transfer funds to three people (three separate commands). But, if he/she does not have enough funds to cover for all, the whole transaction will be rejected.
+* **Peers** maintain the current state and their own copy of the shared ledger. A peer is a single entity in the network, and has an address, identity, and trust. Hyperledger Iroha is designed so that a single peer may be a single computer or scaled for a cluster, meaning different computers are used for ledger storage, indices, validation, and peer-to-peer logic.
+* **Ordering service** orders transactions into a known order. There are a few options for the algorithm used by the ordering service. Kafka is considered a good candidate. It is important to mention that if Kafka, or any other distributed solution is used, that it be clustered; otherwise, this will result in a single point of failure.
+
+## Transaction Flow Basics (Part I)
+
+**Step 1:** A client creates and sends a transaction to the **Torii** gate, which routes the transaction to a peer that is responsible for performing stateless validation.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+**Step 2:** After the peer performs stateless validation, the transaction is first sent to the ordering gate, which is responsible for choosing the right strategy of connection to the **ordering service.**
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+**Step 3:** The ordering service puts transactions into order and forwards them to peers in the consensus network in the form of **proposals**. A proposal is an unsigned block shared by the ordering service, that contains a batch of ordered transactions. Proposals are only forwarded when the ordering service has accumulated enough transactions, or a certain amount of time has elapsed since the last proposal. This prevents the ordering service from sending empty proposals.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## Transaction Flow Basics (Part II)
+
+**Step 4:** Each peer verifies the proposal’s contents *(stateful validation)* in the *Simulator* and creates a block which consists only of verified transactions. This block is then sent to the *consensus gate* which performs YAC consensus logic.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+**Step 5:** An ordered list of peers is determined, and a leader is elected based on the YAC consensus logic. Each peer casts a vote by signing and sending their proposed block to the leader.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+**Step 6:** If the leader receives enough signed proposed blocks (i.e. more than two thirds of the peers), then it starts to send a **commit message**, indicating that this block should be applied to the chain of each peer participating in the consensus. Once the commit message has been sent, the proposed block becomes the next block in the chain of every peer via the *synchronizer*.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## YAC (Yet Another Consensus) - Consensus Functions
+
+Hyperledger Iroha currently implements a consensus algorithm called **YAC** (Yet Another Consensus), which is based on voting for block hash. Consensus involves taking blocks after they have been validated, collaborating with other blocks to decide on commit, and propagating commits between peers. The YAC consensus performs two functions: ordering and consensus.
+
+Ordering is responsible for ordering all transactions, packaging them into proposals, and sending them to peers in the network. The ordering service is an endpoint for setting an order of transactions and their broadcast (in a form of proposal). Ordering is not responsible for performing stateful validation of transactions.
+
+**Note:** Currently, the ordering service is a single point of failure that does the ordering, and, therefore, Hyperledger Iroha is neither crash fault-tolerant, nor byzantine fault-tolerant.
+
+Consensus is responsible for agreement on blocks based on the same proposal.
+
+Validation is an important part of the transaction flow, however it is separate from the consensus process.
+
+## YAC - Steps to Successful Consensus
+
+**Step 1:** The ordering service shares a **proposal** to all peers. A proposal is an unsigned block created and shared to peers in the network by the ordering service. It contains a batch of ordered transactions.
+
+**Step 2:** Peers calculate the hash of a verified proposal and sign it. The resulting **** tuple is called a **vote.**
+
+**Step 3:** Based on the hashes created in the previous step, each peer computes an ordering list or order of peers. To do this, the ordering function will need to have knowledge of all the peers voting in the network, and is based on the hash of the proposed block. The first peer in the list is called the **leader.** The leader is responsible for collecting votes from other peers and sending the commit message.
+
+**Step 4:** Each peer votes. The leader collects all the votes and determines the supermajority of votes for a certain hash. The leader sends a commit message that contains the votes of the committing block. This response is called a **commit.**
+
+**Step 5:** After receiving the commit, the peers verify the commit and apply the block to the ledger. At this point, consensus is complete.
+
+## YAC - Failure to Reach Consensus
+
+We have just covered the steps needed to reach successful consensus, but there are also points in which failure may occur. Next, we will cover a couple of the failure cases: broken leader and bad transactions from the ordering service.
+
+In the case of a broken leader, the leader may act unfairly in the collection of votes, or it takes the leader too long to respond with a commit. In such situations, other peers set a time for receiving a commit message from the leader. If the timer expires, the next peer in the order list becomes the new leader.
+
+In the case of bad transactions from the ordering service, the ordering service may forward transactions that do not pass stateless validation. To rectify this, peers should remove those transactions from the proposal, and further compute the hash from the rest of the transactions in the proposal.
+
+## Mobile Libraries
+
+One of the most defining characteristics of Hyperledger Iroha is its focus on providing mobile libraries.
+
+A major goal with Hyperledger Iroha is creating a distributed ledger system that can be easily utilized by applications. In order to accomplish this, Hyperledger Iroha offers open source software libraries for **iOS, Android,** and **Javascript.** These libraries allow for simple compatibility with not only Hyperledger Iroha, but also, potentially, with other networks through flexible API functions.
+
+If you would like to take a look, these libraries are all open source, and available on Github:
+
+* Android: https://github.com/hyperledger/iroha-android
+* iOS: https://github.com/hyperledger/iroha-ios.
+
+## Relationship to Hyperledger Fabric and Hyperledger Sawtooth
+
+One of the main goals at Hyperledger in the future is to have less disjointed projects, and more libraries that can be used together as components. With that vision in mind, Hyperledger Iroha wants to eventually provide the following C++ components that can be used by other Hyperledger projects:
+
+* YAC consensus library
+* Ed25519 digital signature library
+* SHA-3 hashing library
+* Iroha transaction serialization library
+* P2P communication library
+* iOS library
+* Android library
+* JavaScript library
+* Blockchain explorer/data visualization suite.
+
+## Video: Discussing Hyperledger Iroha with Makoto Takemiya
+
+[](https://youtu.be/8kFSadbumXQ)
+
+# Joining the Hyperledger Iroha Community
+
+## Joining the Hyperledger Iroha Community on GitHub
+
+Hyperledger Iroha is an open source project where ideas and code can be publicly discussed, created, and reviewed. There are many ways to join the Hyperledger Iroha community, and we will share with you some of the ways to get involved, either from a technical standpoint, or from an ideas/issues creation perspective.
+
+You can get involved with the Hyperledger Iroha community on GitHub. All code available on GitHub is forkable and viewable:
+
+* https://github.com/hyperledger/iroha
+* https://github.com/hyperledger/iroha-ios
+* https://github.com/hyperledger/iroha-android
+* https://github.com/hyperledger/iroha-javascript
+* https://github.com/hyperledger/iroha-python
+* https://github.com/hyperledger/iroha-scala
+* https://github.com/hyperledger/iroha-dotnet
+* https://github.com/hyperledger/iroha-api.
+
+
+
+## Joining the Hyperledger Iroha Community via Rocket.Chat and Mailing Lists
+
+You can join the live conversations on Rocket.Chat (which is an alternative to Slack), using your Linux Foundation ID:
+
+* https://chat.hyperledger.org/channel/iroha
+* https://chat.hyperledger.org/channel/iroha-smartcontracts.
+
+Another option is to join the mailing list(s) for technical discussions and announcements: https://lists.hyperledger.org/mailman/listinfo/hyperledger-iroha.
+
+
+
+# Knowledge Check
+
+## Knowledge Check 5.1
+
+Which of the following classes of consensus is currently used by Hyperledger Iroha?
+
+
+- Proof of Work
+- Proof of Stake
+- BFT (YAC)
+- Proof of Elapsed Time
+
+
+## Knowledge Check 5.2
+
+Which of the following features did developers have in mind when they created Hyperledger Iroha?
+
+
+- Simple construction
+- Emphasis on mobile application development
+- Allow for C++ design and development
+- All of the above
+- None of the above
+
+
+## Knowledge Check 5.3
+
+Which of the following functions are performed by the YAC algorithm in Hyperledger Iroha? Select all answers that apply.
+
+
+- Validation
+- Ordering
+- Consensus
+- Voting
+
+
+## Knowledge Check 5.4
+
+
+Which of the following did Makoto Takemiya point out to be the main goal for Hyperledger Iroha in the future?
+
+
+- Scalability
+- Media coverage
+- Interoperability
+
+
+## Knowledge Check 5.5
+
+Which of the following components is NOT part of the peer interaction level?
+
+
+- Torii
+- Network
+- Consensus
+
+
+## Knowledge Check 5.6
+
+It is the responsibility of the leader to collect votes from other peers and forward commit messages to peers. True or False?
+
+
+- True
+- False
+
+
+## Knowledge Check 5.7
+
+The main difference between stateless validation and stateful validation is that stateless validation is faster and does not require access to the data on the chain. True or False?
+
+
+- True
+- False
+
+
+## Knowledge Check 5.8
+
+What happens in consensus if a leader fails to respond with a commit message in a timely manner?
+
+
+- Another peer is appointed to be leader
+- Consensus fails
+- Votes are submitted again to the leader
+- The proposed block is committed by the ordering service
+
+
+## Knowledge Check 5.9
+
+Which of the following best describes the role of the ordering service?
+
+
+- Performs stateless validation and ordering of transactions
+- Orders peers into an ordering list to select a leader
+- Orders transactions into proposals which are sent to peers
+- Orders votes and determines supermajority
+
+
+## Knowledge Check 5.10
+
+What is the a leader's responsibility in Hyperledger Iroha?
+
+
+- Determines whether votes are valid
+- Orders transactions into a proposal block
+- Collects votes from other peers and forwards commit messages to peers
+- Collects transactions from the ordering service and creates commit messages
+
+
+# Conclusions & Learning Objectives (Review)
+
+## Learning Objectives (Review)
+
+You should now be able to:
+
+* Understand the basics of Hyperledger Iroha v0.95.
+* Discuss crucial components of the Hyperledger Iroha architecture, including the consensus algorithm YAC (Yet Another Consensus), peers, clients and the ledger block storage *Ametsuchi*.
+* Join the Hyperledger Iroha framework discussion and development.
+
+## Iroha API Documentation
+
+The Hyperledger Iroha team has been actively working on creating API documents. If you are interested in taking a look and testing for yourself, you can visit https://hyperledger.github.io/iroha-api/#overview.
+
+## Video: Conclusions (Alexandra Groetsema)
+
+[](https://youtu.be/oG6cwWHC-QA)
diff --git a/LFS171x/docs/introduction-to-hyperledger-sawtooth.md b/LFS171x/docs/introduction-to-hyperledger-sawtooth.md
new file mode 100644
index 00000000..b8b997b8
--- /dev/null
+++ b/LFS171x/docs/introduction-to-hyperledger-sawtooth.md
@@ -0,0 +1 @@
+# Introduction and Learning Objectives
diff --git a/LFS171x/docs/introduction-to-hyperledger.md b/LFS171x/docs/introduction-to-hyperledger.md
new file mode 100644
index 00000000..4fc1ab12
--- /dev/null
+++ b/LFS171x/docs/introduction-to-hyperledger.md
@@ -0,0 +1,376 @@
+
+
+- [Introduction and Learning Objectives](#introduction-and-learning-objectives)
+ - [Introduction](#introduction)
+ - [Learning Objectives](#learning-objectives)
+- [Hyperledger](#hyperledger)
+ - [Hyperledger (Navroop Sahdev)](#hyperledger-navroop-sahdev)
+ - [Hyperledger](#hyperledger)
+ - [The Birth of Hyperledger (Brian Behlendorf)](#the-birth-of-hyperledger-brian-behlendorf)
+ - [Comparing Hyperledger with Bitcoin and Ethereum](#comparing-hyperledger-with-bitcoin-and-ethereum)
+ - [Hyperledger Goals](#hyperledger-goals)
+ - [Open Standards](#open-standards)
+ - [The Importance of Open Source (Brian Behlendorf)](#the-importance-of-open-source-brian-behlendorf)
+ - [Open Source and Open Governance](#open-source-and-open-governance)
+ - [Software Governance of the Hyperledger Projects (Brian Behlendorf)](#software-governance-of-the-hyperledger-projects-brian-behlendorf)
+ - [Blockchain for Business](#blockchain-for-business)
+ - [Why Businesses Choose to Use Hyperledger? (Brian Behlendorf)](#why-businesses-choose-to-use-hyperledger-brian-behlendorf)
+- [Hyperledger Frameworks](#hyperledger-frameworks)
+ - [Incubated Hyperledger Projects (Brian Behlendorf)](#incubated-hyperledger-projects-brian-behlendorf)
+ - [Components of Hyperledger Frameworks](#components-of-hyperledger-frameworks)
+ - [Hyperledger Iroha v0.95](#hyperledger-iroha-v095)
+ - [Introduction to Hyperledger Sawtooth (Courtesy of Sawtooth)](#introduction-to-hyperledger-sawtooth-courtesy-of-sawtooth)
+ - [Hyperledger Sawtooth v1.0](#hyperledger-sawtooth-v10)
+ - [Unique Characteristics of Hyperledger Sawtooth (Dan Middleton)](#unique-characteristics-of-hyperledger-sawtooth-dan-middleton)
+ - [Hyperledger Sawtooth Characteristics Relative to Use Cases (Dan Middleton)](#hyperledger-sawtooth-characteristics-relative-to-use-cases-dan-middleton)
+ - [Hyperledger Fabric v1.0](#hyperledger-fabric-v10)
+ - [What Is Unique about Hyperledger Fabric? (Chris Ferris)](#what-is-unique-about-hyperledger-fabric-chris-ferris)
+ - [Hyperledger Indy (Nathan George)](#hyperledger-indy-nathan-george)
+ - [Hyperledger Indy](#hyperledger-indy)
+ - [Hyperledger Burrow v0.16.1](#hyperledger-burrow-v0161)
+- [Hyperledger Modules](#hyperledger-modules)
+ - [Hyperledger Modules](#hyperledger-modules)
+ - [Hyperledger Cello](#hyperledger-cello)
+ - [Hyperledger Explorer](#hyperledger-explorer)
+ - [Hyperledger Composer](#hyperledger-composer)
+ - [Hyperledger Composer (Simon Stone & Kathryn Harrison)](#hyperledger-composer-simon-stone-kathryn-harrison)
+ - [Hyperledger Composer (Continued)](#hyperledger-composer-continued)
+- [Q/A with Brian Behlendorf, Executive Director of Hyperledger](#qa-with-brian-behlendorf-executive-director-of-hyperledger)
+ - [Q/A with Brian Behlendorf, Executive Director of Hyperledger](#qa-with-brian-behlendorf-executive-director-of-hyperledger)
+ - [Reasons Why Developers Would Become Interested in Open Source Software](#reasons-why-developers-would-become-interested-in-open-source-software)
+ - [Hyperledger vs. Apache](#hyperledger-vs-apache)
+ - [A Key Feature of Hyperledger Fabric, Hyperledger Sawtooth, and Hyperledger Iroha](#a-key-feature-of-hyperledger-fabric-hyperledger-sawtooth-and-hyperledger-iroha)
+ - [Interoperability between Hyperledger Frameworks](#interoperability-between-hyperledger-frameworks)
+- [Knowledge Check](#knowledge-check)
+ - [Knowledge Check 2.1](#knowledge-check-21)
+ - [Knowledge Check 2.2](#knowledge-check-22)
+ - [Knowledge Check 2.3](#knowledge-check-23)
+ - [Knowledge Check 2.4](#knowledge-check-24)
+- [Conclusions & Learning Objectives (Review)](#conclusions-learning-objectives-review)
+ - [Learning Objectives (Review)](#learning-objectives-review)
+ - [Blockchain Security at Hyperledger (David Huseby)](#blockchain-security-at-hyperledger-david-huseby)
+ - [How Will Hyperledger Change the Blockchain Ecosystem? (Brian Behlendorf)](#how-will-hyperledger-change-the-blockchain-ecosystem-brian-behlendorf)
+
+
+
+
+# Introduction and Learning Objectives
+
+## Introduction
+This chapter provides an overview of Hyperledger, a collaborative project hosted by The Linux Foundation that is focused on business blockchain technologies. It also introduces the current Hyperledger frameworks and modules, as of October 2017.
+
+## Learning Objectives
+By the end of this chapter you should be able to:
+
+* Explain the differences between Hyperledger and permisionless blockchain technologies.
+* Discuss how Hyperledger leverages open standards and open governance to support business solutions.
+* Discuss Hyperledger frameworks (Iroha, Sawtooth, Fabric, Indy, and Burrow) and modules (Cello, Explorer, and Composer).
+
+# Hyperledger
+
+## Hyperledger (Navroop Sahdev)
+[](https://youtu.be/sE5eMx7TTWM)
+
+## Hyperledger
+Hyperledger is a group of open source projects focused around cross-industry distributed ledger technologies. Hosted by The Linux Foundation, collaborators include industry leaders in technology, finance, banking, supply chain management, manufacturing, and IoT.
+
+As of October 2017, Hyperledger consists of eight projects, five of which are distributed ledger frameworks. The other three projects are modules that support these frameworks.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+As [Arnaud Le Hors](https://www.hyperledger.org/blog/2017/09/12/3431), member of the Hyperledger Technical Steering Committee, emphasized,
+
+>"these projects show how broadly applicable blockchain technology really is. This goes way beyond cryptocurrencies".
+
+[Hyperledger](https://www.hyperledger.org/about) provides an alternative to the cryptocurrency-based blockchain model, and focuses on developing blockchain frameworks and modules to support global enterprise solutions. The focus of Hyperledger is to provide a transparent and collaborative approach to blockchain development.
+
+## The Birth of Hyperledger (Brian Behlendorf)
+[](https://youtu.be/iNVT2Pdy--k)
+
+## Comparing Hyperledger with Bitcoin and Ethereum
+The following table explores the differences between Hyperledger's permissioned distributed ledgers and the Bitcoin and Ethereum permissionless blockchains. If you are considering blockchain solutions for your business requirements, it is important to pay attention to all these elements and weigh in on those that are most important for your use case.
+
+ |Bitcoin|Ethereum|Hyperledger Frameworks
+--|-------|--------|----------------------
+**Cryptocurrency based** |Yes|Yes|No
+**Permissioned** |No|No|Yes (in general)\*
+**Pseudo-anonymous** |Yes|No|No
+**Auditable** |Yes|Yes|Yes
+**Immutable ledger** |Yes|Yes|Yes
+**Modularity** |No|No|Yes
+**Smart contracts** |No|Yes|Yes
+**Consensus protocol** |PoW|PoW|Various\*\*
+
+\* Sawtooth can be configured to be permissionless
+
+\*\* Key Hyperledger consensus protocols are Apache Kafka in Hyperledger Fabric, PoET in Hyperledger Sawtooth, RBFT in Hyperledger Indy, Tendermint in Hyperledger Burrow, and Yet Another Consensus (YAC) in Hyperledger Iroha. For more details, see the [Hyperledger Architecture, Volume 1](https://www.hyperledger.org/wp-content/uploads/2017/08/HyperLedger_Arch_WG_Paper_1_Consensus.pdf) paper.
+
+## Hyperledger Goals
+Hyperledger has taken a leadership role to develop cross-industry standards and provide a neutral space for software collaboration. The financial services industry, in particular, is witnessing an unprecedented level of collaboration between institutions that have traditionally been competitors. The advent of a new foundational or infrastructural technology like the blockchain - much like the Internet - requires collaboration of various actors in order to realize the full benefits of the technology. Unless all actors use a certain standard, the pace of technological dissemination will continue to be slow. Technological adoption is characterized by network effects, where the costs decrease with the increase in use of a certain technology. Since shifting to distributed ledger technology involves significant costs, open source software, communities and ecosystems that develop around these have a significant part to play.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+## Open Standards
+>"Only an Open Source, collaborative software development approach can ensure the transparency, longevity, interoperability and support required to bring blockchain technologies forward to mainstream commercial adoption. That is what Hyperledger is about - communities of software developers building blockchain frameworks and platforms."
+
+\- [hyperledger.org](https://www.hyperledger.org/about)
+
+As we learned in *Chapter 1: Discovering Blockchain Technologies*, the non-availability of standards in distributed ledger technologies is one of the major hurdles in scaling them. One of Hyperledger's key goals is to facilitate the process of standards formation, not by promoting its own distributed ledger(s), but by providing a space for a variety of standards to co-exist simultaneously:
+
+>"Rather than declaring a single blockchain standard, it encourages a collaborative approach to developing blockchain technologies via a community process, with intellectual property rights that encourage open development and the adoption of key standards over time."
+
+\- [hyperledger-fabric.readthedocs.io](https://hyperledger-fabric.readthedocs.io/en/latest/)
+
+Hyperledger aims to adhere to '**open standards**', which means they are
+
+>"(...) interoperable through open published interfaces and services."
+
+\- John Palfreyman, [ibm.com](https://www.ibm.com/blogs/insights-on-business/government/open-innovation-blockchain-hyperledger/)
+
+## The Importance of Open Source (Brian Behlendorf)
+[](https://youtu.be/BX1o-N9ggHI)
+
+## Open Source and Open Governance
+
+>"Today, most people understand the concept of **Open Source**. What many people don't get, and something we here at Hyperledger and The Linux Foundation pride ourselves on doing well, is **Open Governance**."
+
+\- [hyperledger.org](https://hyperledger.org/blog/2017/09/06/abcs-of-open-governance)
+
+Open source software is software that is made freely available and may be redistributed and modified. In other words, anyone has the ability to view the code, use the code, copy the code, change the code, and, depending on the open source license, contribute back changes.
+
+Open governance means that technical decisions for an open source project are made by a group of community-elected developers drawn from a pool of active participants. These decisions include things such as which features to add, how, and when to add them.
+
+Learn more about the specifics of Hyperledger's open governance at https://hyperledger.org/blog/2017/09/06/abcs-of-open-governance.
+
+## Software Governance of the Hyperledger Projects (Brian Behlendorf)
+[](https://youtu.be/8wEPxJS5csc)
+
+## Blockchain for Business
+The cryptocurrency-based blockchain model, popularized by public blockchains like Bitcoin and Ethereum, currently falls short of fulfilling a host of requirements that many types of organizations would have to fulfill in order to be compliant when using blockchain and distributed ledger technologies - for instance, in the areas of financial services, healthcare, and government.
+
+Hyperledger is a unique platform that is developing permissioned distributed ledger frameworks specifically designed for enterprises, including those in industries with strong compliance requirements. Enterprise use cases require capabilities such as scalability and throughput, built-in or interoperable identity modules for the parties involved in a transaction or a network, or even access to regulators who can access all data in the ledger as read-only to ensure compliance. The latter is particularly important because, regardless of the innovation, it has to operate within the current regulatory framework, as well as comply with any new rules that come into place specifically targeted at blockchain technologies.
+
+The enterprise continues to be at the heart of this course.
+
+## Why Businesses Choose to Use Hyperledger? (Brian Behlendorf)
+[](https://youtu.be/KX54mejdaOo)
+
+# Hyperledger Frameworks
+
+## Incubated Hyperledger Projects (Brian Behlendorf)
+In the following video, Brian Behlendorf covers the projects that are part of Hyperledger (as of October 2017). These include the Hyperledger frameworks, which are detailed in this section, as well as the Hyperledger modules, which are covered in the next section.
+
+[](https://youtu.be/eeZzxcdYNh8)
+
+## Components of Hyperledger Frameworks
+Hyperledger business blockchain frameworks are used to build enterprise blockchains for a consortium of organizations. They are different than public ledgers like the Bitcoin blockchain and Ethereum. The Hyperledger frameworks include:
+
+* An append-only distributed **ledger**
+* A **consensus algorithm** for agreeing to changes in the ledger
+* **Privacy** of transactions through permissioned access
+* **Smart contracts** to process transaction requests.
+
+||
+|:--:|
+|*Licensed under [CC By 4.0](https://creativecommons.org/licenses/by/4.0/)*|
+
+Now, let's explore the five Hyperledger frameworks (as of October 2017)!
+
+## Hyperledger Iroha v0.95
+[Hyperledger Iroha](https://hyperledger.org/projects/iroha) is a blockchain framework contributed by Soramitsu, Hitachi, NTT Data, and Colu. Hyperledger Iroha is designed to be simple and easy to incorporate into infrastructure projects requiring distributed ledger technology. Hyperledger Iroha emphasizes mobile application development with client libraries for Android and iOS, making it distinct from other Hyperledger frameworks. Inspired by Hyperledger Fabric, Hyperledger Iroha seeks to complement Hyperledger Fabric and Hyperledger Sawtooth, while providing a development environment for C++ developers to contribute to Hyperledger.
+
+In conclusion, Hyperledger Iroha features a simple construction, modern, domain-driven C++ design, along with the consensus algorithm [YAC](https://www.overleaf.com/read/wzhwjzbjvrzn#/40115559/).
+
+## Introduction to Hyperledger Sawtooth (Courtesy of Sawtooth)
+[](https://youtu.be/Buw3g8oNG74)
+
+## Hyperledger Sawtooth v1.0
+[Hyperledger Sawtooth](https://www.hyperledger.org/projects/sawtooth), contributed by Intel, is a blockchain framework that utilizes a modular platform for building, deploying, and running distributed ledgers. Distributed ledger solutions built with Hyperledger Sawtooth can utilize various consensus algorithms based on the size of the network. It includes the Proof of Elapsed Time (PoET) consensus algorithm, which provides the scalability of the Bitcoin blockchain without the high energy consumption. PoET allows for a highly scalable network of validator nodes. Hyperledger Sawtooth is designed for versatility, with support for both permissioned and permissionless deployments.
+
+## Unique Characteristics of Hyperledger Sawtooth (Dan Middleton)
+[](https://youtu.be/v4iotcvhdc8)
+
+## Hyperledger Sawtooth Characteristics Relative to Use Cases (Dan Middleton)
+[](https://youtu.be/fFFjAt3Ct3c)
+
+## Hyperledger Fabric v1.0
+[Hyperledger Fabric](https://www.hyperledger.org/projects/fabric) was the first proposal for a codebase, combining previous work done by Digital Asset Holdings, Blockstream's libconsensus, and IBM's OpenBlockchain. Hyperledger Fabric provides a modular architecture, which allows components such as consensus and membership services to be plug-and-play. Hyperledger Fabric is revolutionary in allowing entities to conduct confidential transactions without passing information through a central authority. This is accomplished through different channels that run within the network, as well as the division of labor that characterizes the different nodes within the network. Lastly, it is important to remember that, unlike Bitcoin, which is a public chain, Hyperledger Fabric supports permissioned deployments.
+
+>"If you have a large blockchain network and you want to share data with only certain parties, you can create a private channel with just those participants. It is the most distinctive thing about Fabric right now."
+
+\- Brian Behlendorf, Executive Director of Hyperledger, The Linux Foundation
+
+## What Is Unique about Hyperledger Fabric? (Chris Ferris)
+[](https://youtu.be/WqwrrE0_JXo)
+
+## Hyperledger Indy (Nathan George)
+[](https://youtu.be/nNo5MzgkWxE)
+
+## Hyperledger Indy
+[Hyperledger Indy](https://www.hyperledger.org/projects) is a distributed ledger purpose-built for decentralized identity. Hyperledger Indy's goal is to achieve this by developing a set of
+
+>"(...) decentralized identity specs and artifacts that are independent of any particular ledger and will enable **interoperability** across any DLT that supports them."
+
+Contributed by the Sovrin Foundation, Hyperledger Indy allows individuals to manage and control their digital identities. Rather than having businesses store huge amounts of personal data of individuals, Hyperledger Indy allows businesses to store pointers to identity. Once the company verifies the other party's identity, it throws it away.
+
+According to Brian Behlendorf,
+
+>"(...) identity is a toxic asset that could present a liability to organizations."
+
+Indeed, since 2013, over 9 billion data records were lost or stolen. What is striking is that, out of these, only 4% were encrypted, and hence, rendered useless after being stolen (also called 'secure breaches'). You can find detailed statistics at http://breachlevelindex.com/.
+
+One of the key principles of Hyperledger Indy is its '[Privacy by Design](https://en.wikipedia.org/wiki/Privacy_by_design)' approach. Given the immutable nature of the DLT, it is all the more important that digital identities be handled with the utmost care, keeping human values front and center.
+
+>"Hyperledger Indy lets users authenticate identity based on the attributes they are willing to store and share themselves. This can reduce the amount of liability contained within a business because the data can be kept with the user and presented to you again in a way that you can trust and validate that what has been said really was said and is trusted by the other parties you do business with."
+
+\- Nathan George, Maintainer, Hyperledger Indy
+
+Further information about the history of the project can be found at https://sovrin.org/.
+
+## Hyperledger Burrow v0.16.1
+Formally known as eris-db, [Hyperledger Burrow](https://www.hyperledger.org/projects/hyperledger-burrow) was released in December 2014. Currently under incubation, Hyperledger Burrow is a permissionable smart contract machine that provides a modular blockchain client with a permissioned smart contract interpreter built- in part to the specification of the Ethereum Virtual Machine (EVM). It is the only available Apache-licensed EVM implementation.
+
+Following are the major components of Burrow:
+
+* The **Gateway** provides interfaces for systems integration and user interfaces
+* The **Smart contract application engine** facilitates integration of complex business logic
+* The **Consensus Engine** serves the dual purpose of:
+ 1. Maintaining the networking stack between the nodes, and,
+ 2. Ordering transactions
+* The **Application Blockchain Interface** (ABCI) provides interface specification for the consensus engine and smart contract application engine to connect.
+
+You can go online to learn more about [Hyperledger Burrow](https://www.hyperledger.org/projects/hyperledger-burrow).
+
+# Hyperledger Modules
+
+## Hyperledger Modules
+The Hyperledger frameworks which we examined in the previous section are used to build blockchains and distributed ledgers. The Hyperledger modules, which we will look at next, are auxiliary softwares used for things like deploying and maintaining blockchains, examining the data on the ledgers, as well as tools to design, prototype, and extend blockchain networks.
+
+## Hyperledger Cello
+For businesses that want to deploy Blockchain-as-a-Service, [Hyperledger Cello](https://www.hyperledger.org/projects/cello) provides a toolkit that fulfills this need. Particularly for lean businesses and small enterprises, who want to reduce or eliminate the effort required in creating, managing, and terminating blockchains, Hyperledger Cello allows blockchains deployment to the cloud. Operators can create and manage such blockchains through a dashboard, and users (typically, chaincode developers) can obtain a blockchain instance immediately.
+
+As a Hyperledger module, *"Cello aims to bring the on-demand 'as-a-service' deployment model to the blockchain ecosystem"*, thus helping in furthering the development and deployment of Hyperledger's frameworks. Hyperledger Cello was initially contributed by IBM, with sponsors from Soramitsu, Huawei, and Intel.
+
+Application developers and system administrators using Cello can provision and maintain Hyperledger networks. For instance, you can create a group of distributed ledger networks in virtual clouds known as 'container clusters', and then, manage and monitor those networks with a configurable dashboard. Additionally, you can build a Blockchain-as-a-Service (BaaS) platform.
+
+||
+|:--:|
+|*Hyperledger Cello (Source: https://www.hyperledger.org/blog/2017/01/17/hyperledger-says-hello-to-cello)*|
+
+## Hyperledger Explorer
+[Hyperledger Explorer](https://www.hyperledger.org/projects/explorer) is a tool for visualizing blockchain operations. It is the first ever blockchain explorer for permissioned ledgers, allowing anyone to explore the distributed ledger projects being created by Hyperledger's members from the inside, without compromising their privacy. The project was contributed by DTCC, Intel, and IBM.
+
+Designed to create a user-friendly web application, Hyperledger Explorer can view, invoke, deploy, or query:
+
+* Blocks
+* Transactions and associated data
+* Network information (name, status, list of nodes)
+* Smart contracts (chain codes and transaction families)
+* Other relevant information stored in the ledger.
+
+The ability to visualize data is of critical importance, in order to extract business value from it. Hyperledger Explorer provides this much needed functionality. Key components include a web server, a web UI, web sockets, a database, a security repository, and a blockchain implementation.
+
+## Hyperledger Composer
+[Hyperledger Composer](https://www.hyperledger.org/projects/composer) provides a suite of tools for building blockchain business networks. These tools allow you to:
+
+* Model your business blockchain network
+* Generate REST APIs for interacting with your blockchain network
+* Generate a skeleton Angular application.
+
+Built in Javascript, Hyperledger Composer provides an easy-to-use set of components that developers can quickly learn and implement. The project was contributed by Oxchains and IBM.
+
+## Hyperledger Composer (Simon Stone & Kathryn Harrison)
+[](https://youtu.be/91qtaojB9oI)
+
+## Hyperledger Composer (Continued)
+Hyperledger Composer has created a modelling language that allows you to define the assets, participants, and transactions that make up your business network using business vocabulary. In addition, the transaction logic is then written by developers using Javascript. This simple interface allows business people and technologists to work together on defining their business network.
+
+The [benefits](https://www.hyperledger.org/wp-content/uploads/2017/05/Hyperledger-Composer-Overview.pdf) of Hyperledger Composer are:
+
+* **Faster creation of blockchain applications**, eliminating the massive effort required to build blockchain applications from scratch
+* **Reduced risk with well-tested**, efficient design that aligns understanding across business and technical analysts
+* **Greater flexibility** as the higher-level abstractions make it far simpler to iterate.
+
+You can watch an introduction to Hyperledger Composer [here](https://www.youtube.com/watch?v=cNvOQp8r0xo).
+
+# Q/A with Brian Behlendorf, Executive Director of Hyperledger
+
+## Q/A with Brian Behlendorf, Executive Director of Hyperledger
+Before diving into Hyperledger Iroha, Hyperledger Sawtooth, and Hyperledger Fabric, we asked Brian Behlendorf, Executive Director of Hyperledger at The Linux Foundation, some questions. We hope these questions will give you a better perspective of the Hyperledger technologies for the upcoming technical chapters.
+
+## Reasons Why Developers Would Become Interested in Open Source Software
+[](https://youtu.be/oDsXhqqsYZM)
+
+## Hyperledger vs. Apache
+[](https://youtu.be/LNfHx3DP1eE)
+
+## A Key Feature of Hyperledger Fabric, Hyperledger Sawtooth, and Hyperledger Iroha
+[](https://youtu.be/hbIl1UQNws8)
+
+## Interoperability between Hyperledger Frameworks
+[](https://youtu.be/psGcqCfplMI)
+
+# Knowledge Check
+
+## Knowledge Check 2.1
+
+Which consensus algorithms do Hyperledger frameworks support?
+
+
+ - Kafka, RBFT, PoW and YAC
+ - Proof of Work, Proof of Stake, Proof of Elapsed Time
+ - YAC, Kafka, RBFT, Proof of Stake
+ - RBFT, YAC, Proof of Elapsed Time and Kafka
+
+
+## Knowledge Check 2.2
+
+Which of the following are Hyperledger frameworks?
+
+
+ - Cello, Ethereum, Indy, Burrow, Fabric
+ - Fabric, Sawtooth, Indy, Burrow, Iroha
+ - Sawtooth, Indy, Fabric, Cello, Composer
+ - Burrow, Iroha, Fabric, Sawtooth, Cello
+
+
+## Knowledge Check 2.3
+
+Which of the following best defines Hyperledger Sawtooth?
+
+
+ - A production distributed ledger
+ - A blockchain framework for building, deploying, and running Docker containers
+ - A modular blockchain framework that implements the PoET consensus algorithm
+ - A distributed ledger platform designed for supply chain solutions
+
+
+## Knowledge Check 2.4
+
+What is Indy?
+
+
+ - A business blockchain framework for supporting independent identity on distributed ledgers
+ - A Hyperledger project that allows digital identities to be interoperable across administrative domains, applications, and any other silo
+ - A Hyperledger project that provides tools, libraries, and reusable components for providing digital identities rooted on blockchains or other distributed ledgers
+ - All of the above
+
+
+# Conclusions & Learning Objectives (Review)
+
+## Learning Objectives (Review)
+You should now be able to:
+
+* Explain the differences between Hyperledger and permisionless blockchain technologies.
+* Discuss how Hyperledger leverages open standards and open governance to support business solutions.
+* Discuss Hyperledger frameworks (Iroha, Sawtooth, Fabric, Indy, and Burrow) and modules (Cello, Explorer, and Composer).
+
+## Blockchain Security at Hyperledger (David Huseby)
+[](https://youtu.be/BOLNop07nTU)
+
+## How Will Hyperledger Change the Blockchain Ecosystem? (Brian Behlendorf)
+[](https://youtu.be/_pxGcCnYVlk)
diff --git a/LFS171x/docs/technical-requirements.md b/LFS171x/docs/technical-requirements.md
new file mode 100644
index 00000000..b8b997b8
--- /dev/null
+++ b/LFS171x/docs/technical-requirements.md
@@ -0,0 +1 @@
+# Introduction and Learning Objectives
diff --git a/LFS171x/docs/the-promise-of-business-blockchain-technologies.md b/LFS171x/docs/the-promise-of-business-blockchain-technologies.md
new file mode 100644
index 00000000..b8b997b8
--- /dev/null
+++ b/LFS171x/docs/the-promise-of-business-blockchain-technologies.md
@@ -0,0 +1 @@
+# Introduction and Learning Objectives
diff --git a/LFS171x/docs/whats-next.md b/LFS171x/docs/whats-next.md
new file mode 100644
index 00000000..5de89c98
--- /dev/null
+++ b/LFS171x/docs/whats-next.md
@@ -0,0 +1 @@
+# What's Next?
diff --git a/LFS171x/images/GitHub.png b/LFS171x/images/GitHub.png
new file mode 100644
index 00000000..d718aaf5
Binary files /dev/null and b/LFS171x/images/GitHub.png differ
diff --git a/LFS171x/images/RocketChat_Logo.png b/LFS171x/images/RocketChat_Logo.png
new file mode 100644
index 00000000..59a2c34f
Binary files /dev/null and b/LFS171x/images/RocketChat_Logo.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/bitcoin-market-capitalization.png b/LFS171x/images/discovering-blockchain-technologies/bitcoin-market-capitalization.png
new file mode 100644
index 00000000..f9720540
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/bitcoin-market-capitalization.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/blockchain-immutability.png b/LFS171x/images/discovering-blockchain-technologies/blockchain-immutability.png
new file mode 100644
index 00000000..195b68fe
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/blockchain-immutability.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/blockchain-search-volume.jpg b/LFS171x/images/discovering-blockchain-technologies/blockchain-search-volume.jpg
new file mode 100644
index 00000000..49a5541a
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/blockchain-search-volume.jpg differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/blockchains-and-smart-contracts-flow-diagram.png b/LFS171x/images/discovering-blockchain-technologies/blockchains-and-smart-contracts-flow-diagram.png
new file mode 100644
index 00000000..eb22ec74
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/blockchains-and-smart-contracts-flow-diagram.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/centralized-databases-vs-blockchains.png b/LFS171x/images/discovering-blockchain-technologies/centralized-databases-vs-blockchains.png
new file mode 100644
index 00000000..fa1a9f23
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/centralized-databases-vs-blockchains.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/ethereum-market-capitalization.jpg b/LFS171x/images/discovering-blockchain-technologies/ethereum-market-capitalization.jpg
new file mode 100644
index 00000000..322cb1ac
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/ethereum-market-capitalization.jpg differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/ethereum-smart-contracts.png b/LFS171x/images/discovering-blockchain-technologies/ethereum-smart-contracts.png
new file mode 100644
index 00000000..971ddeac
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/ethereum-smart-contracts.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/network-architectures.png b/LFS171x/images/discovering-blockchain-technologies/network-architectures.png
new file mode 100644
index 00000000..1b16ffea
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/network-architectures.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/standards-role-in-supporting-blockchain-dlt.png b/LFS171x/images/discovering-blockchain-technologies/standards-role-in-supporting-blockchain-dlt.png
new file mode 100644
index 00000000..4a746034
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/standards-role-in-supporting-blockchain-dlt.png differ
diff --git a/LFS171x/images/discovering-blockchain-technologies/types-of-blockchains.png b/LFS171x/images/discovering-blockchain-technologies/types-of-blockchains.png
new file mode 100644
index 00000000..4a53458c
Binary files /dev/null and b/LFS171x/images/discovering-blockchain-technologies/types-of-blockchains.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Iroha-architecture.png b/LFS171x/images/introduction-to-hyperledger-iroha/Iroha-architecture.png
new file mode 100644
index 00000000..d4a2d3b0
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Iroha-architecture.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Iroha_3_sm.png b/LFS171x/images/introduction-to-hyperledger-iroha/Iroha_3_sm.png
new file mode 100644
index 00000000..9b931746
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Iroha_3_sm.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_1_of_Iroha_Transaction_Flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_1_of_Iroha_Transaction_Flow.png
new file mode 100644
index 00000000..c934a17e
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_1_of_Iroha_Transaction_Flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_2_of_Iroha_Transaction_Flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_2_of_Iroha_Transaction_Flow.png
new file mode 100644
index 00000000..a4e629dd
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_2_of_Iroha_Transaction_Flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_3_of_Iroha_Transaction_Flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_3_of_Iroha_Transaction_Flow.png
new file mode 100644
index 00000000..89545144
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_3_of_Iroha_Transaction_Flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_4_of_Iroha_transaction_flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_4_of_Iroha_transaction_flow.png
new file mode 100644
index 00000000..384a7834
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_4_of_Iroha_transaction_flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_5_of_Iroha_transaction_flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_5_of_Iroha_transaction_flow.png
new file mode 100644
index 00000000..4775d6c1
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_5_of_Iroha_transaction_flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger-iroha/Step_6_of_Iroha_Transaction_flow.png b/LFS171x/images/introduction-to-hyperledger-iroha/Step_6_of_Iroha_Transaction_flow.png
new file mode 100644
index 00000000..12586d64
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger-iroha/Step_6_of_Iroha_Transaction_flow.png differ
diff --git a/LFS171x/images/introduction-to-hyperledger/Components_of_blockchain.jpg b/LFS171x/images/introduction-to-hyperledger/Components_of_blockchain.jpg
new file mode 100644
index 00000000..5af56699
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger/Components_of_blockchain.jpg differ
diff --git a/LFS171x/images/introduction-to-hyperledger/Hyperledger_Goals.jpg b/LFS171x/images/introduction-to-hyperledger/Hyperledger_Goals.jpg
new file mode 100644
index 00000000..6368f6b4
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger/Hyperledger_Goals.jpg differ
diff --git a/LFS171x/images/introduction-to-hyperledger/cello.jpg b/LFS171x/images/introduction-to-hyperledger/cello.jpg
new file mode 100644
index 00000000..4e607ea8
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger/cello.jpg differ
diff --git a/LFS171x/images/introduction-to-hyperledger/modular_umbrella.jpg b/LFS171x/images/introduction-to-hyperledger/modular_umbrella.jpg
new file mode 100644
index 00000000..f441bd6a
Binary files /dev/null and b/LFS171x/images/introduction-to-hyperledger/modular_umbrella.jpg differ
diff --git a/LFS171x/images/video-image.png b/LFS171x/images/video-image.png
new file mode 100644
index 00000000..e9241443
Binary files /dev/null and b/LFS171x/images/video-image.png differ
diff --git a/LFS171x/sawtooth-material/sawtooth-default.yaml b/LFS171x/sawtooth-material/sawtooth-default.yaml
index 908e50c7..959325f8 100644
--- a/LFS171x/sawtooth-material/sawtooth-default.yaml
+++ b/LFS171x/sawtooth-material/sawtooth-default.yaml
@@ -18,34 +18,28 @@ version: "2.1"
services:
settings-tp:
- image: hyperledger/sawtooth-tp_settings:0.8
+ image: hyperledger/sawtooth-settings-tp:1.0
container_name: sawtooth-settings-tp-default
- expose:
- - 4004
depends_on:
- validator
- entrypoint: settings-tp -vv tcp://validator:4004
+ entrypoint: settings-tp -vv -C tcp://validator:4004
intkey-tp-python:
- image: hyperledger/sawtooth-tp_intkey_python:0.8
+ image: hyperledger/sawtooth-intkey-tp-python:1.0
container_name: sawtooth-intkey-tp-python-default
- expose:
- - 4004
depends_on:
- validator
- entrypoint: intkey-tp-python -vv tcp://validator:4004
+ entrypoint: intkey-tp-python -vv -C tcp://validator:4004
xo-tp-python:
- image: hyperledger/sawtooth-tp_xo_python:0.8
+ image: hyperledger/sawtooth-xo-tp-python:1.0
container_name: sawtooth-xo-tp-python-default
- expose:
- - 4004
depends_on:
- validator
- entrypoint: xo-tp-python -vv tcp://validator:4004
+ entrypoint: xo-tp-python -vv -C tcp://validator:4004
validator:
- image: hyperledger/sawtooth-validator:0.8
+ image: hyperledger/sawtooth-validator:1.0
container_name: sawtooth-validator-default
expose:
- 4004
@@ -53,10 +47,10 @@ services:
- "4004:4004"
# start the validator with an empty genesis batch
entrypoint: "bash -c \"\
- sawtooth admin keygen && \
+ sawadm keygen && \
sawtooth keygen my_key && \
- sawtooth config genesis -k /root/.sawtooth/keys/my_key.priv && \
- sawtooth admin genesis config-genesis.batch && \
+ sawset genesis -k /root/.sawtooth/keys/my_key.priv && \
+ sawadm genesis config-genesis.batch && \
sawtooth-validator -vv \
--endpoint tcp://validator:8800 \
--bind component:tcp://eth0:4004 \
@@ -64,23 +58,17 @@ services:
\""
rest-api:
- image: hyperledger/sawtooth-rest_api:0.8
+ image: hyperledger/sawtooth-rest-api:1.0
container_name: sawtooth-rest-api-default
- expose:
- - 4004
- - 8080
ports:
- - "8080:8080"
+ - "8008:8008"
depends_on:
- validator
- entrypoint: sawtooth-rest-api --connect tcp://validator:4004 --bind rest-api:8080
+ entrypoint: sawtooth-rest-api -C tcp://validator:4004 --bind rest-api:8008
- client:
- image: hyperledger/sawtooth-all:0.8
- container_name: sawtooth-client-default
- expose:
- - 8080
- - 4004
+ shell:
+ image: hyperledger/sawtooth-all:1.0
+ container_name: sawtooth-shell-default
depends_on:
- rest-api
entrypoint: "bash -c \"\
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/.pylintrc b/LFS171x/sawtooth-material/sawtooth-tuna/.pylintrc
new file mode 100644
index 00000000..0c71dc2b
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/.pylintrc
@@ -0,0 +1,540 @@
+[MASTER]
+
+# A comma-separated list of package or module names from where C extensions may
+# be loaded. Extensions are loading into the active Python interpreter and may
+# run arbitrary code
+extension-pkg-whitelist=
+
+# Add files or directories to the blacklist. They should be base names, not
+# paths.
+ignore=CVS
+
+# Add files or directories matching the regex patterns to the blacklist. The
+# regex matches against base names, not paths.
+ignore-patterns=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Use multiple processes to speed up Pylint.
+jobs=1
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Specify a configuration file.
+#rcfile=
+
+# When enabled, pylint would attempt to guess common misconfiguration and emit
+# user-friendly hints instead of false-positive error messages
+suggestion-mode=yes
+
+# Allow loading of arbitrary C extensions. Extensions are imported into the
+# active Python interpreter and may run arbitrary code.
+unsafe-load-any-extension=no
+
+
+[MESSAGES CONTROL]
+
+# Only show warnings with the listed confidence levels. Leave empty to show
+# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
+confidence=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once).You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use"--disable=all --enable=classes
+# --disable=W"
+disable=print-statement,
+ parameter-unpacking,
+ unpacking-in-except,
+ old-raise-syntax,
+ backtick,
+ long-suffix,
+ old-ne-operator,
+ old-octal-literal,
+ import-star-module-level,
+ non-ascii-bytes-literal,
+ raw-checker-failed,
+ bad-inline-option,
+ locally-disabled,
+ locally-enabled,
+ file-ignored,
+ suppressed-message,
+ useless-suppression,
+ deprecated-pragma,
+ apply-builtin,
+ basestring-builtin,
+ buffer-builtin,
+ cmp-builtin,
+ coerce-builtin,
+ execfile-builtin,
+ file-builtin,
+ long-builtin,
+ raw_input-builtin,
+ reduce-builtin,
+ standarderror-builtin,
+ unicode-builtin,
+ xrange-builtin,
+ coerce-method,
+ delslice-method,
+ getslice-method,
+ setslice-method,
+ no-absolute-import,
+ old-division,
+ dict-iter-method,
+ dict-view-method,
+ next-method-called,
+ metaclass-assignment,
+ indexing-exception,
+ raising-string,
+ reload-builtin,
+ oct-method,
+ hex-method,
+ nonzero-method,
+ cmp-method,
+ input-builtin,
+ round-builtin,
+ intern-builtin,
+ unichr-builtin,
+ map-builtin-not-iterating,
+ zip-builtin-not-iterating,
+ range-builtin-not-iterating,
+ filter-builtin-not-iterating,
+ using-cmp-argument,
+ eq-without-hash,
+ div-method,
+ idiv-method,
+ rdiv-method,
+ exception-message-attribute,
+ invalid-str-codec,
+ sys-max-int,
+ bad-python3-import,
+ deprecated-string-function,
+ deprecated-str-translate-call,
+ deprecated-itertools-function,
+ deprecated-types-field,
+ next-method-defined,
+ dict-items-not-iterating,
+ dict-keys-not-iterating,
+ dict-values-not-iterating,
+ missing-docstring
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time (only on the command line, not in the configuration file where
+# it should appear only once). See also the "--disable" option for examples.
+enable=c-extension-no-member
+
+
+[REPORTS]
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (RP0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Template used to display messages. This is a python new-style format string
+# used to format the message information. See doc for all details
+#msg-template=
+
+# Set the output format. Available formats are text, parseable, colorized, json
+# and msvs (visual studio).You can also give a reporter class, eg
+# mypackage.mymodule.MyReporterClass.
+output-format=text
+
+# Tells whether to display a full report or only the messages
+reports=no
+
+# Activate the evaluation score.
+score=yes
+
+
+[REFACTORING]
+
+# Maximum number of nested blocks for function / method body
+max-nested-blocks=5
+
+# Complete name of functions that never returns. When checking for
+# inconsistent-return-statements if a never returning function is called then
+# it will be considered as an explicit return statement and no message will be
+# printed.
+never-returning-functions=optparse.Values,sys.exit
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,
+ XXX,
+ TODO
+
+
+[SIMILARITIES]
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+# Ignore imports when computing similarities.
+ignore-imports=no
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+
+[LOGGING]
+
+# Logging modules to check that the string format arguments are in logging
+# function parameter format
+logging-modules=logging
+
+
+[SPELLING]
+
+# Limits count of emitted suggestions for spelling mistakes
+max-spelling-suggestions=4
+
+# Spelling dictionary name. Available dictionaries: none. To make it working
+# install python-enchant package.
+spelling-dict=
+
+# List of comma separated words that should not be checked.
+spelling-ignore-words=
+
+# A path to a file that contains private dictionary; one word per line.
+spelling-private-dict-file=
+
+# Tells whether to store unknown words to indicated private dictionary in
+# --spelling-private-dict-file option instead of raising a message.
+spelling-store-unknown-words=no
+
+
+[TYPECHECK]
+
+# List of decorators that produce context managers, such as
+# contextlib.contextmanager. Add to this list to register other decorators that
+# produce valid context managers.
+contextmanager-decorators=contextlib.contextmanager
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E1101 when accessed. Python regular
+# expressions are accepted.
+generated-members=
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# This flag controls whether pylint should warn about no-member and similar
+# checks whenever an opaque object is returned when inferring. The inference
+# can return multiple potential results while evaluating a Python object, but
+# some branches might not be evaluated, which results in partial inference. In
+# that case, it might be useful to still emit no-member and other checks for
+# the rest of the inferred objects.
+ignore-on-opaque-inference=yes
+
+# List of class names for which member attributes should not be checked (useful
+# for classes with dynamically set attributes). This supports the use of
+# qualified names.
+ignored-classes=optparse.Values,thread._local,_thread._local
+
+# List of module names for which member attributes should not be checked
+# (useful for modules/projects where namespaces are manipulated during runtime
+# and thus existing member attributes cannot be deduced by static analysis. It
+# supports qualified module names, as well as Unix pattern matching.
+ignored-modules=
+
+# Show a hint with possible names when a member name was not found. The aspect
+# of finding the hint is based on edit distance.
+missing-member-hint=yes
+
+# The minimum edit distance a name should have in order to be considered a
+# similar match for a missing member name.
+missing-member-hint-distance=1
+
+# The total number of similar names that should be taken in consideration when
+# showing a hint for a missing member.
+missing-member-max-choices=1
+
+
+[BASIC]
+
+# Naming style matching correct argument names
+argument-naming-style=snake_case
+
+# Regular expression matching correct argument names. Overrides argument-
+# naming-style
+#argument-rgx=
+
+# Naming style matching correct attribute names
+attr-naming-style=snake_case
+
+# Regular expression matching correct attribute names. Overrides attr-naming-
+# style
+#attr-rgx=
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,
+ bar,
+ baz,
+ toto,
+ tutu,
+ tata
+
+# Naming style matching correct class attribute names
+class-attribute-naming-style=any
+
+# Regular expression matching correct class attribute names. Overrides class-
+# attribute-naming-style
+#class-attribute-rgx=
+
+# Naming style matching correct class names
+class-naming-style=PascalCase
+
+# Regular expression matching correct class names. Overrides class-naming-style
+#class-rgx=
+
+# Naming style matching correct constant names
+const-naming-style=UPPER_CASE
+
+# Regular expression matching correct constant names. Overrides const-naming-
+# style
+#const-rgx=
+
+# Minimum line length for functions/classes that require docstrings, shorter
+# ones are exempt.
+docstring-min-length=-1
+
+# Naming style matching correct function names
+function-naming-style=snake_case
+
+# Regular expression matching correct function names. Overrides function-
+# naming-style
+#function-rgx=
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,
+ j,
+ k,
+ ex,
+ Run,
+ _
+
+# Include a hint for the correct naming format with invalid-name
+include-naming-hint=no
+
+# Naming style matching correct inline iteration names
+inlinevar-naming-style=any
+
+# Regular expression matching correct inline iteration names. Overrides
+# inlinevar-naming-style
+#inlinevar-rgx=
+
+# Naming style matching correct method names
+method-naming-style=snake_case
+
+# Regular expression matching correct method names. Overrides method-naming-
+# style
+#method-rgx=
+
+# Naming style matching correct module names
+module-naming-style=snake_case
+
+# Regular expression matching correct module names. Overrides module-naming-
+# style
+#module-rgx=
+
+# Colon-delimited sets of names that determine each other's naming style when
+# the name regexes allow several styles.
+name-group=
+
+# Regular expression which should only match function or class names that do
+# not require a docstring.
+no-docstring-rgx=^_
+
+# List of decorators that produce properties, such as abc.abstractproperty. Add
+# to this list to register other decorators that produce valid properties.
+property-classes=abc.abstractproperty
+
+# Naming style matching correct variable names
+variable-naming-style=snake_case
+
+# Regular expression matching correct variable names. Overrides variable-
+# naming-style
+#variable-rgx=
+
+
+[FORMAT]
+
+# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
+expected-line-ending-format=
+
+# Regexp for a line that is allowed to be longer than the limit.
+ignore-long-lines=^\s*(# )??$
+
+# Number of spaces of indent required inside a hanging or continued line.
+indent-after-paren=4
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string=' '
+
+# Maximum number of characters on a single line.
+max-line-length=100
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# List of optional constructs for which whitespace checking is disabled. `dict-
+# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
+# `trailing-comma` allows a space between comma and closing bracket: (a, ).
+# `empty-line` allows space-only lines.
+no-space-check=trailing-comma,
+ dict-separator
+
+# Allow the body of a class to be on the same line as the declaration if body
+# contains single statement.
+single-line-class-stmt=no
+
+# Allow the body of an if to be on the same line as the test if there is no
+# else.
+single-line-if-stmt=no
+
+
+[VARIABLES]
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+# Tells whether unused global variables should be treated as a violation.
+allow-global-unused-variables=yes
+
+# List of strings which can identify a callback function by name. A callback
+# name must start or end with one of those strings.
+callbacks=cb_,
+ _cb
+
+# A regular expression matching the name of dummy variables (i.e. expectedly
+# not used).
+dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
+
+# Argument names that match this expression will be ignored. Default to name
+# with leading underscore
+ignored-argument-names=_.*|^ignored_|^unused_
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# List of qualified module names which can have objects that can redefine
+# builtins.
+redefining-builtins-modules=six.moves,past.builtins,future.builtins
+
+
+[CLASSES]
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,
+ __new__,
+ setUp
+
+# List of member names, which should be excluded from the protected access
+# warning.
+exclude-protected=_asdict,
+ _fields,
+ _replace,
+ _source,
+ _make
+
+# List of valid names for the first argument in a class method.
+valid-classmethod-first-arg=cls
+
+# List of valid names for the first argument in a metaclass class method.
+valid-metaclass-classmethod-first-arg=mcs
+
+
+[IMPORTS]
+
+# Allow wildcard imports from modules that define __all__.
+allow-wildcard-with-all=no
+
+# Analyse import fallback blocks. This can be used to support both Python 2 and
+# 3 compatible code, which means that the block might have code that exists
+# only in one or another interpreter, leading to false positives when analysed.
+analyse-fallback-blocks=no
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=optparse,tkinter.tix
+
+# Create a graph of external dependencies in the given file (report RP0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report RP0402 must not be disabled)
+import-graph=
+
+# Create a graph of internal dependencies in the given file (report RP0402 must
+# not be disabled)
+int-import-graph=
+
+# Force import order to recognize a module as part of the standard
+# compatibility libraries.
+known-standard-library=
+
+# Force import order to recognize a module as part of a third party library.
+known-third-party=enchant
+
+
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Maximum number of boolean expressions in a if statement
+max-bool-expr=5
+
+# Maximum number of branch for function / method body
+max-branches=12
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+
+[EXCEPTIONS]
+
+# Exceptions that will emit a warning when being caught. Defaults to
+# "Exception"
+overgeneral-exceptions=Exception
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/bin/run-lint b/LFS171x/sawtooth-material/sawtooth-tuna/bin/run-lint
new file mode 100755
index 00000000..b2e253c6
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/bin/run-lint
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+set -e
+
+TOP_DIR=$(cd $(dirname $(dirname $0)) && pwd)
+
+
+lint() {
+
+ files="`find $1 -name \*.py | grep -v protobuf`"
+ echo "$1"
+ pycodestyle $files || error=1
+ python3 -m pylint --rcfile .pylintrc $files || error=1
+ return $error
+
+}
+
+ret_val=0
+
+export PYTHONPATH=$PYTHONPATH:$TOP_DIR/processor
+lint processor/tunachain_processor || ret_val=1
+
+exit $ret_val
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/bin/tunachain-tp b/LFS171x/sawtooth-material/sawtooth-tuna/bin/tunachain-tp
new file mode 100755
index 00000000..55012ad8
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/bin/tunachain-tp
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+#
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+import os
+import sys
+
+sys.path.insert(0, os.path.join(
+ os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
+ 'processor'))
+
+from tunachain_processor.main import main
+
+if __name__ == '__main__':
+ main()
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/client/Dockerfile b/LFS171x/sawtooth-material/sawtooth-tuna/client/Dockerfile
new file mode 100644
index 00000000..51230f02
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/client/Dockerfile
@@ -0,0 +1,23 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ------------------------------------------------------------------------------
+
+FROM httpd:2.4
+
+RUN echo "\
+LoadModule proxy_module modules/mod_proxy.so\n\
+LoadModule proxy_http_module modules/mod_proxy_http.so\n\
+ProxyPass /api http://rest-api:8008\n\
+ProxyPassReverse /api http://rest-api:8008\n\
+" >>/usr/local/apache2/conf/httpd.conf
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/client/package.json b/LFS171x/sawtooth-material/sawtooth-tuna/client/package.json
index 1f773e72..148e1cac 100644
--- a/LFS171x/sawtooth-material/sawtooth-tuna/client/package.json
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/client/package.json
@@ -13,7 +13,7 @@
"license": "Apache-2.0",
"dependencies": {
"jquery": "^3.2.1",
- "sawtooth-sdk": "^0.8.1"
+ "sawtooth-sdk": "^1.0.2"
},
"devDependencies": {
"webpack": "^3.5.4"
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/client/src/state.js b/LFS171x/sawtooth-material/sawtooth-tuna/client/src/state.js
index 2bf7eeff..2bd13f52 100644
--- a/LFS171x/sawtooth-material/sawtooth-tuna/client/src/state.js
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/client/src/state.js
@@ -1,22 +1,24 @@
// SPDX-License-Identifier: Apache-2.0
-/*
+/*
This code was written by Zac Delventhal @delventhalz.
Original source code can be found here: https://github.com/delventhalz/transfer-chain-js/blob/master/client/src/state.js
*/
-
+
'use strict'
const $ = require('jquery')
+const {createHash} = require('crypto')
+const protobuf = require('sawtooth-sdk/protobuf')
const {
- signer,
- BatchEncoder,
- TransactionEncoder
-} = require('sawtooth-sdk/client')
+ createContext,
+ Signer
+} = require('sawtooth-sdk/signing')
+const secp256k1 = require('sawtooth-sdk/signing/secp256k1')
// Config variables
const KEY_NAME = 'transfer-chain.keys'
-const API_URL = 'http://localhost:8080'
+const API_URL = 'http://localhost:8000/api'
const FAMILY = 'transfer-chain'
const VERSION = '0.0'
@@ -38,10 +40,11 @@ const getKeys = () => {
// Create new key-pair
const makeKeyPair = () => {
- const privateKey = signer.makePrivateKey()
+ const context = createContext('secp256k1')
+ const privateKey = context.newRandomPrivateKey()
return {
- public: signer.getPublicKey(privateKey),
- private: privateKey
+ public: context.getPublicKey(privateKey).asHex(),
+ private: privateKey.asHex()
}
}
@@ -66,25 +69,64 @@ const getState = cb => {
}
// Submit signed Transaction to validator
-const submitUpdate = (payload, privateKey, cb) => {
- const transaction = new TransactionEncoder(privateKey, {
- inputs: [PREFIX],
- outputs: [PREFIX],
+const submitUpdate = (payload, privateKeyHex, cb) => {
+ // Create signer
+ const context = createContext('secp256k1')
+ const privateKey = secp256k1.Secp256k1PrivateKey.fromHex(privateKeyHex)
+ const signer = new Signer(context, privateKey)
+
+ // Create the TransactionHeader
+ const payloadBytes = Buffer.from(JSON.stringify(payload))
+ const transactionHeaderBytes = protobuf.TransactionHeader.encode({
familyName: FAMILY,
familyVersion: VERSION,
- payloadEncoding: 'application/json',
- payloadEncoder: p => Buffer.from(JSON.stringify(p))
- }).create(payload)
+ inputs: [PREFIX],
+ outputs: [PREFIX],
+ signerPublicKey: signer.getPublicKey().asHex(),
+ batcherPublicKey: signer.getPublicKey().asHex(),
+ dependencies: [],
+ payloadSha512: createHash('sha512').update(payloadBytes).digest('hex')
+ }).finish()
+
+ // Create the Transaction
+ const transactionHeaderSignature = signer.sign(transactionHeaderBytes)
+
+ const transaction = protobuf.Transaction.create({
+ header: transactionHeaderBytes,
+ headerSignature: transactionHeaderSignature,
+ payload: payloadBytes
+ })
+
+ // Create the BatchHeader
+ const batchHeaderBytes = protobuf.BatchHeader.encode({
+ signerPublicKey: signer.getPublicKey().asHex(),
+ transactionIds: [transaction.headerSignature]
+ }).finish()
+
+ // Create the Batch
+ const batchHeaderSignature = signer.sign(batchHeaderBytes)
+
+ const batch = protobuf.Batch.create({
+ header: batchHeaderBytes,
+ headerSignature: batchHeaderSignature,
+ transactions: [transaction]
+ })
- const batchBytes = new BatchEncoder(privateKey).createEncoded(transaction)
+ // Encode the Batch in a BatchList
+ const batchListBytes = protobuf.BatchList.encode({
+ batches: [batch]
+ }).finish()
+ // Submit BatchList to Validator
$.post({
- url: `${API_URL}/batches?wait`,
- data: batchBytes,
+ url: `${API_URL}/batches`,
+ data: batchListBytes,
headers: {'Content-Type': 'application/octet-stream'},
processData: false,
- // Any data object indicates the Batch was not committed
- success: ({ data }) => cb(!data),
+ success: function( resp ) {
+ var id = resp.link.split('?')[1]
+ $.get(`${API_URL}/batch_statuses?${id}&wait`, ({ data }) => cb(true))
+ },
error: () => cb(false)
})
}
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/docker-compose.yaml b/LFS171x/sawtooth-material/sawtooth-tuna/docker-compose.yaml
new file mode 100644
index 00000000..d826494d
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/docker-compose.yaml
@@ -0,0 +1,115 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ------------------------------------------------------------------------------
+
+version: '2.1'
+
+services:
+
+ tunachain-shell:
+ build:
+ context: .
+ dockerfile: ./shell/Dockerfile
+ args:
+ - http_proxy
+ - https_proxy
+ - no_proxy
+ image: sawtooth-tunachain-shell
+ container_name: tunachain-shell
+ volumes:
+ - .:/project/sawtooth-tuna
+ - /project/sawtooth-tuna/client/node_modules
+ command: |
+ bash -c "
+ if [ ! -f /root/.sawtooth/keys/root.priv ]; then
+ sawtooth keygen
+ fi;
+ cd client
+ npm run-script build
+ cd ../
+ tail -f /dev/null
+ "
+
+ tunachain-client:
+ build: ./client/
+ image: sawtooth-tunachain-client
+ container_name: tunachain-client
+ volumes:
+ - ./client/:/usr/local/apache2/htdocs/
+ expose:
+ - 80
+ ports:
+ - '8000:80'
+ depends_on:
+ - rest-api
+ - tunachain-shell
+
+ tunachain-tp:
+ build:
+ context: .
+ dockerfile: ./processor/Dockerfile
+ args:
+ - http_proxy
+ - https_proxy
+ - no_proxy
+ image: sawtooth-tunachain-tp
+ container_name: tunachain-tp
+ volumes:
+ - '.:/project/sawtooth-tuna'
+ depends_on:
+ - tunachain-shell
+ command: |
+ bash -c "
+ sleep 1
+ tunachain-tp -vv -C tcp://validator:4004
+ "
+
+ settings-tp:
+ image: hyperledger/sawtooth-settings-tp:1.0
+ container_name: sawtooth-settings-tp
+ depends_on:
+ - validator
+ entrypoint: settings-tp -vv -C tcp://validator:4004
+
+ rest-api:
+ image: hyperledger/sawtooth-rest-api:1.0
+ container_name: sawtooth-rest-api
+ expose:
+ - 8008
+ ports:
+ - '8008:8008'
+ depends_on:
+ - validator
+ entrypoint: sawtooth-rest-api -vv -C tcp://validator:4004 --bind rest-api:8008
+
+ validator:
+ image: hyperledger/sawtooth-validator:1.0
+ container_name: sawtooth-validator
+ expose:
+ - 4004
+ ports:
+ - '4004:4004'
+ command: |
+ bash -c "
+ if [ ! -f /etc/sawtooth/keys/validator.priv ]; then
+ sawadm keygen
+ sawtooth keygen my_key
+ sawset genesis -k /root/.sawtooth/keys/my_key.priv
+ sawadm genesis config-genesis.batch
+ fi;
+ sawtooth-validator -vv \
+ --endpoint tcp://validator:8800 \
+ --bind component:tcp://eth0:4004 \
+ --bind network:tcp://eth0:8800
+ "
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/Dockerfile b/LFS171x/sawtooth-material/sawtooth-tuna/processor/Dockerfile
new file mode 100644
index 00000000..2b92be27
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/processor/Dockerfile
@@ -0,0 +1,28 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+FROM ubuntu:16.04
+
+RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD && \
+ echo 'deb http://repo.sawtooth.me/ubuntu/1.0/stable xenial universe' >> /etc/apt/sources.list && \
+ apt-get update
+
+RUN apt-get install -y -q python3-sawtooth-sdk
+
+WORKDIR /project/sawtooth-tuna
+
+ENV PATH $PATH:/project/sawtooth-tuna/bin
+
+CMD ['tunachain-tp']
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/handlers.js b/LFS171x/sawtooth-material/sawtooth-tuna/processor/handlers.js
deleted file mode 100644
index edce2e11..00000000
--- a/LFS171x/sawtooth-material/sawtooth-tuna/processor/handlers.js
+++ /dev/null
@@ -1,147 +0,0 @@
-// SPDX-License-Identifier: Apache-2.0
-
-/*
-This code was written by Zac Delventhal @delventhalz.
-Original source code can be found here: https://github.com/delventhalz/transfer-chain-js/blob/master/processor/handlers.js
- */
-
-'use strict'
-
-const { createHash } = require('crypto')
-const { TransactionHandler } = require('sawtooth-sdk/processor')
-const { InvalidTransaction } = require('sawtooth-sdk/processor/exceptions')
-const { TransactionHeader } = require('sawtooth-sdk/protobuf')
-
-// Encoding helpers and constants
-const getAddress = (key, length = 64) => {
- return createHash('sha512').update(key).digest('hex').slice(0, length)
-}
-
-const FAMILY = 'transfer-chain'
-const PREFIX = getAddress(FAMILY, 6)
-
-const getAssetAddress = name => PREFIX + '00' + getAddress(name, 62)
-const getTransferAddress = asset => PREFIX + '01' + getAddress(asset, 62)
-
-const encode = obj => Buffer.from(JSON.stringify(obj, Object.keys(obj).sort()))
-const decode = buf => JSON.parse(buf.toString())
-
-// Add a new asset to state
-const createAsset = (asset, owner, state) => {
- const address = getAssetAddress(asset)
-
- return state.get([address])
- .then(entries => {
- const entry = entries[address]
- if (entry && entry.length > 0) {
- throw new InvalidTransaction('Asset name in use')
- }
-
- return state.set({
- [address]: encode({name: asset, owner})
- })
- })
-}
-
-// Add a new transfer to state
-const transferAsset = (asset, owner, signer, state) => {
- const address = getTransferAddress(asset)
- const assetAddress = getAssetAddress(asset)
-
- return state.get([assetAddress])
- .then(entries => {
- const entry = entries[assetAddress]
- if (!entry || entry.length === 0) {
- throw new InvalidTransaction('Asset does not exist')
- }
-
- if (signer !== decode(entry).owner) {
- throw new InvalidTransaction('Only an Asset\'s owner may transfer it')
- }
-
- return state.set({
- [address]: encode({asset, owner})
- })
- })
-}
-
-// Accept a transfer, clearing it and changing asset ownership
-const acceptTransfer = (asset, signer, state) => {
- const address = getTransferAddress(asset)
-
- return state.get([address])
- .then(entries => {
- const entry = entries[address]
- if (!entry || entry.length === 0) {
- throw new InvalidTransaction('Asset is not being transfered')
- }
-
- if (signer !== decode(entry).owner) {
- throw new InvalidTransaction(
- 'Transfers can only be accepted by the new owner'
- )
- }
-
- return state.set({
- [address]: Buffer(0),
- [getAssetAddress(asset)]: encode({name: asset, owner: signer})
- })
- })
-}
-
-// Reject a transfer
-const rejectTransfer = (asset, signer, state) => {
- const address = getTransferAddress(asset)
-
- return state.get([address])
- .then(entries => {
- const entry = entries[address]
- if (!entry || entry.length === 0) {
- throw new InvalidTransaction('Asset is not being transfered')
- }
-
- if (signer !== decode(entry).owner) {
- throw new InvalidTransaction(
- 'Transfers can only be rejected by the potential new owner')
- }
-
- return state.set({
- [address]: Buffer(0)
- })
- })
-}
-
-// Handler for JSON encoded payloads
-class JSONHandler extends TransactionHandler {
- constructor () {
- console.log('Initializing JSON handler for Sawtooth Tuna Chain')
- super(FAMILY, '0.0', 'application/json', [PREFIX])
- }
-
- apply (txn, state) {
- // Parse the transaction header and payload
- const header = TransactionHeader.decode(txn.header)
- const signer = header.signerPubkey
- const { action, asset, owner } = JSON.parse(txn.payload)
-
- // Call the appropriate function based on the payload's action
- console.log(`Handling transaction: ${action} > ${asset}`,
- owner ? `> ${owner.slice(0, 8)}... ` : '',
- `:: ${signer.slice(0, 8)}...`)
-
- if (action === 'create') return createAsset(asset, signer, state)
- if (action === 'transfer') return transferAsset(asset, owner, signer, state)
- if (action === 'accept') return acceptTransfer(asset, signer, state)
- if (action === 'reject') return rejectTransfer(asset, signer, state)
-
- return Promise.resolve().then(() => {
- throw new InvalidTransaction(
- 'Action must be "create", "transfer", "accept", or "reject"'
- )
- })
- }
-}
-
-module.exports = {
- JSONHandler
-}
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/index.js b/LFS171x/sawtooth-material/sawtooth-tuna/processor/index.js
deleted file mode 100644
index d6f840a6..00000000
--- a/LFS171x/sawtooth-material/sawtooth-tuna/processor/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: Apache-2.0
-
-/*
-This code was written by Zac Delventhal @delventhalz.
-Original source code can be found here: https://github.com/delventhalz/transfer-chain-js/blob/master/processor/index.js
- */
-
-
-'use strict'
-
-const { TransactionProcessor } = require('sawtooth-sdk/processor')
-const { JSONHandler } = require('./handlers')
-
-const VALIDATOR_URL = 'tcp://localhost:4004'
-
-// Initialize Transaction Processor
-const tp = new TransactionProcessor(VALIDATOR_URL)
-tp.addHandler(new JSONHandler())
-tp.start()
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/package.json b/LFS171x/sawtooth-material/sawtooth-tuna/processor/package.json
deleted file mode 100644
index f43a34df..00000000
--- a/LFS171x/sawtooth-material/sawtooth-tuna/processor/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "Sawtooth-tuna-chain-processor",
- "version": "0.0.0",
- "description": "A simple browser based blockchain processor",
- "main": "index.js",
- "scripts": {
- "start": "node index.js",
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/hyperledger/education.git"
- },
- "license": "Apache-2.0",
- "dependencies": {
- "sawtooth-sdk": "^0.8.1"
- },
- "devDependencies": {
- "request": "^2.81.0"
- }
-}
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/__init__.py b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/handler.py b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/handler.py
new file mode 100644
index 00000000..0a0026a2
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/handler.py
@@ -0,0 +1,127 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+import logging
+
+from sawtooth_sdk.processor.handler import TransactionHandler
+from sawtooth_sdk.processor.exceptions import InvalidTransaction
+
+from tunachain_processor.tunachain_payload import TunachainPayload
+from tunachain_processor.tunachain_state import TunachainState
+from tunachain_processor.tunachain_state import TUNACHAIN_NAMESPACE
+
+
+LOGGER = logging.getLogger(__name__)
+
+
+class TunachainTransactionHandler(TransactionHandler):
+
+ @property
+ def family_name(self):
+ return 'transfer-chain'
+
+ @property
+ def family_versions(self):
+ return ['0.0']
+
+ @property
+ def encodings(self):
+ return ['application/json']
+
+ @property
+ def namespaces(self):
+ return [TUNACHAIN_NAMESPACE]
+
+ def apply(self, transaction, context):
+ header = transaction.header
+ signer = header.signer_public_key
+
+ payload = TunachainPayload(transaction.payload)
+ state = TunachainState(context)
+
+ LOGGER.info('Handling transaction: %s > %s %s:: %s',
+ payload.action,
+ payload.asset,
+ '> ' + payload.owner[:8] + '... ' if payload.owner else '',
+ signer[:8] + '... ')
+
+ if payload.action == 'create':
+ _create_asset(asset=payload.asset,
+ owner=signer,
+ state=state)
+
+ elif payload.action == 'transfer':
+ _transfer_asset(asset=payload.asset,
+ owner=payload.owner,
+ signer=signer,
+ state=state)
+
+ elif payload.action == 'accept':
+ _accept_transfer(asset=payload.asset,
+ signer=signer,
+ state=state)
+
+ elif payload.action == 'reject':
+ _reject_transfer(asset=payload.asset,
+ signer=signer,
+ state=state)
+
+ else:
+ raise InvalidTransaction('Unhandled action: {}'.format(
+ payload.action))
+
+
+def _create_asset(asset, owner, state):
+ if state.get_asset(asset) is not None:
+ raise InvalidTransaction(
+ 'Invalid action: Asset already exists: {}'.format(asset))
+
+ state.set_asset(asset, owner)
+
+
+def _transfer_asset(asset, owner, signer, state):
+ asset_data = state.get_asset(asset)
+ if asset_data is None:
+ raise InvalidTransaction('Asset does not exist')
+
+ if signer != asset_data.get('owner'):
+ raise InvalidTransaction('Only an Asset\'s owner may transfer it')
+
+ state.set_transfer(asset, owner)
+
+
+def _accept_transfer(asset, signer, state):
+ transfer_data = state.get_transfer(asset)
+ if transfer_data is None:
+ raise InvalidTransaction('Asset is not being transfered')
+
+ if signer != transfer_data.get('owner'):
+ raise InvalidTransaction(
+ 'Transfers can only be accepted by the new owner')
+
+ state.set_asset(asset, transfer_data.get('owner'))
+ state.delete_transfer(asset)
+
+
+def _reject_transfer(asset, signer, state):
+ transfer_data = state.get_transfer(asset)
+ if transfer_data is None:
+ raise InvalidTransaction('Asset is not being transfered')
+
+ if signer != transfer_data.get('owner'):
+ raise InvalidTransaction(
+ 'Transfers can only be rejected by the potential new owner')
+
+ state.delete_transfer(asset)
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/main.py b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/main.py
new file mode 100644
index 00000000..b3e54fbe
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/main.py
@@ -0,0 +1,64 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+import argparse
+import sys
+
+from sawtooth_sdk.processor.core import TransactionProcessor
+from sawtooth_sdk.processor.log import init_console_logging
+
+from tunachain_processor.handler import TunachainTransactionHandler
+
+
+def parse_args(args):
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.RawTextHelpFormatter)
+
+ parser.add_argument(
+ '-C', '--connect',
+ default='tcp://localhost:4004',
+ help='Endpoint for the validator connection')
+
+ parser.add_argument(
+ '-v', '--verbose',
+ action='count',
+ default=0,
+ help='Increase output sent to stderr')
+
+ return parser.parse_args(args)
+
+
+def main(args=None):
+ if args is None:
+ args = sys.argv[1:]
+ opts = parse_args(args)
+ processor = None
+ try:
+ processor = TransactionProcessor(url=opts.connect)
+
+ init_console_logging(verbose_level=opts.verbose)
+
+ handler = TunachainTransactionHandler()
+
+ processor.add_handler(handler)
+
+ processor.start()
+ except KeyboardInterrupt:
+ pass
+ except Exception as err: # pylint: disable=broad-except
+ print("Error: {}".format(err))
+ finally:
+ if processor is not None:
+ processor.stop()
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_payload.py b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_payload.py
new file mode 100644
index 00000000..41eef368
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_payload.py
@@ -0,0 +1,60 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+import json
+
+from sawtooth_sdk.processor.exceptions import InvalidTransaction
+
+
+class TunachainPayload(object):
+
+ def __init__(self, payload):
+ try:
+ data = json.loads(payload.decode('utf-8'))
+ except ValueError:
+ raise InvalidTransaction("Invalid payload serialization")
+
+ action = data.get('action')
+ asset = data.get('asset')
+ owner = data.get('owner')
+
+ if not action:
+ raise InvalidTransaction('Action is required')
+ if action not in ('create', 'transfer', 'accept', 'reject'):
+ raise InvalidTransaction('Invalid action: {}'.format(action))
+
+ if not asset:
+ raise InvalidTransaction('Asset is required')
+
+ if action == 'transfer':
+ if not owner:
+ raise InvalidTransaction(
+ 'Owner is required for "transfer" transaction')
+
+ self._action = action
+ self._asset = asset
+ self._owner = owner
+
+ @property
+ def action(self):
+ return self._action
+
+ @property
+ def asset(self):
+ return self._asset
+
+ @property
+ def owner(self):
+ return self._owner
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_state.py b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_state.py
new file mode 100644
index 00000000..4db84b32
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/processor/tunachain_processor/tunachain_state.py
@@ -0,0 +1,93 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+import hashlib
+import json
+import logging
+
+
+LOGGER = logging.getLogger(__name__)
+
+
+TUNACHAIN_NAMESPACE = hashlib.sha512(
+ 'transfer-chain'.encode('utf-8')).hexdigest()[0:6]
+
+
+def _get_address(key):
+ return hashlib.sha512(key.encode('utf-8')).hexdigest()[:62]
+
+
+def _get_asset_address(asset_name):
+ return TUNACHAIN_NAMESPACE + '00' + _get_address(asset_name)
+
+
+def _get_transfer_address(asset_name):
+ return TUNACHAIN_NAMESPACE + '01' + _get_address(asset_name)
+
+
+def _deserialize(data):
+ return json.loads(data.decode('utf-8'))
+
+
+def _serialize(data):
+ return json.dumps(data, sort_keys=True).encode('utf-8')
+
+
+class TunachainState(object):
+
+ TIMEOUT = 3
+
+ def __init__(self, context):
+ self._context = context
+
+ def get_asset(self, name):
+ return self._get_state(_get_asset_address(name))
+
+ def get_transfer(self, name):
+ return self._get_state(_get_transfer_address(name))
+
+ def set_asset(self, name, owner):
+ address = _get_asset_address(name)
+ state_data = _serialize(
+ {
+ "name": name,
+ "owner": owner
+ })
+ return self._context.set_state(
+ {address: state_data}, timeout=self.TIMEOUT)
+
+ def set_transfer(self, name, owner):
+ address = _get_transfer_address(name)
+ state_data = _serialize(
+ {
+ "asset": name,
+ "owner": owner
+ })
+ return self._context.set_state(
+ {address: state_data}, timeout=self.TIMEOUT)
+
+ def delete_transfer(self, name):
+ return self._context.delete_state(
+ [_get_transfer_address(name)],
+ timeout=self.TIMEOUT)
+
+ def _get_state(self, address):
+ state_entries = self._context.get_state(
+ [address], timeout=self.TIMEOUT)
+ if state_entries:
+ entry = _deserialize(data=state_entries[0].data)
+ else:
+ entry = None
+ return entry
diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/shell/Dockerfile b/LFS171x/sawtooth-material/sawtooth-tuna/shell/Dockerfile
new file mode 100644
index 00000000..354b81f5
--- /dev/null
+++ b/LFS171x/sawtooth-material/sawtooth-tuna/shell/Dockerfile
@@ -0,0 +1,53 @@
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -----------------------------------------------------------------------------
+
+FROM hyperledger/sawtooth-shell:1.0
+
+RUN \
+ if [ ! -z $HTTP_PROXY ] && [ -z $http_proxy ]; then \
+ http_proxy=$HTTP_PROXY; \
+ fi; \
+ if [ ! -z $HTTPS_PROXY ] && [ -z $https_proxy ]; then \
+ https_proxy=$HTTPS_PROXY; \
+ fi
+
+RUN echo "deb apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD" \
+ && apt-get update \
+ && apt-get install -y --allow-unauthenticated -q \
+ curl \
+ python3-pip
+
+RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
+ && apt-get install -y nodejs
+
+RUN \
+ if [ ! -z $http_proxy ]; then \
+ npm config set proxy $http_proxy; \
+ fi; \
+ if [ ! -z $https_proxy ]; then \
+ npm config set https-proxy $https_proxy; \
+ fi
+
+RUN pip3 install \
+ pylint \
+ pycodestyle
+
+WORKDIR /project/sawtooth-tuna
+
+COPY client/package.json /project/sawtooth-tuna/client/
+
+RUN cd client/ && npm install
+
+ENV PATH $PATH:/project/sawtooth-tuna/bin