github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docs/source/introduction.rst (about) 1 ************ 2 Introduction 3 ************ 4 5 Hyperledger Sawtooth is an enterprise blockchain platform for building 6 distributed ledger applications and networks. The design philosophy targets 7 keeping ledgers *distributed* and making smart contracts *safe*, particularly 8 for enterprise use. 9 10 Sawtooth simplifies blockchain application development by separating the core 11 system from the application domain. Application developers can specify the 12 business rules appropriate for their application, using the language of their 13 choice, without needing to know the underlying design of the core system. 14 15 Sawtooth is also highly modular. This modularity enables enterprises and 16 consortia to make policy decisions that they are best equipped to make. 17 Sawtooth's core design allows applications to choose the transaction rules, 18 permissioning, and consensus algorithms that support their unique business 19 needs. 20 21 Sawtooth is an open source project under the Hyperledger umbrella. For 22 information on how to contribute, see `Join the Sawtooth Community`_. 23 24 25 About Distributed Ledgers 26 ========================= 27 28 A "distributed ledger" is another term for a blockchain. It distributes a 29 database (a ledger) of transactions to all participants in a network (also 30 called "peers" or "nodes"). There is no central administrator or centralised 31 data storage. In essence, it is: 32 33 * **Distributed**: The blockchain database is shared among potentially 34 untrusted participants and is demonstrably identical on all nodes 35 in the network. All participants have the same information. 36 37 * **Immutable**: The blockchain database is an unalterable history of all 38 transactions that uses block hashes to make it easy to detect and 39 prevent attempts to alter the history. 40 41 * **Secure**: All changes are performed by transactions that are signed by 42 known identities. 43 44 These features work together, along with agreed-upon consensus mechanisms, to 45 provide "adversarial trust" among all participants in a blockchain network. 46 47 48 Distinctive Features of Sawtooth 49 ================================ 50 51 Separation Between the Application Level and the Core System 52 ------------------------------------------------------------ 53 54 Sawtooth makes it easy to develop and deploy an application by providing a 55 clear separation between the application level and the core system level. 56 Sawtooth provides smart contract abstraction that allows application 57 developers to write contract logic in a language of their choice. 58 59 An application can be a native business logic or a smart contract virtual 60 machine. In fact, both types of applications can co-exist on the same 61 blockchain. Sawtooth allows these design decisions to be made in the 62 transaction-processing layer, which allows multiple types of applications to 63 exist in the same instance of the blockchain network. 64 65 Each application defines the custom 66 :term:`transaction processors<Transaction processor>` for its unique 67 requirements. Sawtooth provides several example 68 :term:`transaction families<Transaction family>` to serve as models for 69 low-level functions (such as maintaining chain-wide settings and storing 70 on-chain permissions) and for specific applications such as performance 71 analysis and storing block information. 72 73 Transaction processor SDKs are available in multiple languages to streamline 74 creation of new contract languages, including Python, JavaScript, Go, C++, 75 Java, and Rust. A provided REST API simplifies client development by 76 adapting :term:`validator<Validator>` communication to standard HTTP/JSON. 77 78 Private Networks with the Sawtooth Permissioning Features 79 --------------------------------------------------------- 80 81 Sawtooth is built to solve the challenges of permissioned (private) networks. 82 Clusters of Sawtooth nodes can be easily deployed with separate permissioning. 83 There is no centralized service that could potentially leak transaction 84 patterns or other confidential information. 85 86 The blockchain stores the settings that specify the permissions, such as roles 87 and identities, so that all participants in the network can access this 88 information. 89 90 Parallel Transaction Execution 91 ------------------------------ 92 93 Most blockchains require serial transaction execution in order to guarantee 94 consistent ordering at each node on the network. Sawtooth includes an advanced 95 parallel scheduler that splits transactions into parallel flows. Based on the 96 locations in state which are accessed by a transaction, Sawtooth isolates the 97 execution of transactions from one another while maintaining contextual 98 changes. 99 100 When possible, transactions are executed in parallel, while preventing 101 double-spending even with multiple modifications to the same state. Parallel 102 scheduling provides a substantial potential increase in performance over 103 serial execution. 104 105 Event System 106 ------------ 107 108 Hyperledger Sawtooth supports creating and broadcasting events. This allows 109 applications to: 110 111 * Subscribe to events that occur related to the blockchain, such as a new 112 block being committed or switching to a new fork. 113 114 * Subscribe to application specific events defined by a transaction family. 115 116 * Relay information about the execution of a transaction back to clients 117 without storing that data in state. 118 119 Subscriptions are submitted and serviced over a ZMQ Socket. 120 121 Ethereum Contract Compatibility with Seth 122 ----------------------------------------- 123 124 The Sawtooth-Ethereum integration project, Seth, extends the interoperability 125 of the Sawtooth platform to Ethereum. EVM (Ethereum Virtual Machine) smart 126 contracts can be deployed to Sawtooth using the Seth transaction family. 127 128 .. _dynamic-consensus-label: 129 130 Dynamic Consensus Algorithms 131 ---------------------------- 132 133 In a blockchain, consensus is the process of building agreement among a group 134 of mutually distrusting participants. Algorithms for achieving consensus with 135 arbitrary faults generally require some form of voting among a known set of 136 participants. General approaches include Nakamoto-style consensus, which 137 elects a leader through some form of lottery, and variants of the traditional 138 `Byzantine Fault Tolerance (BFT) 139 <https://en.wikipedia.org/wiki/Byzantine_fault_tolerance>`_ 140 algorithms, which use multiple rounds of explicit votes to achieve consensus. 141 142 Sawtooth abstracts the core concepts of consensus and isolates consensus from 143 transaction semantics. The interface supports plugging in various consensus 144 implementations. More importantly, Sawtooth allows different types of 145 consensus on the same blockchain. The consensus is selected during the initial 146 network setup and can be changed on a running blockchain with a transaction. 147 148 Sawtooth currently supports these consensus implementations: 149 150 * Proof of Elapsed Time (PoET), a Nakamoto-style consensus algorithm that is 151 designed to be a production-grade protocol capable of supporting large 152 network populations. PoET relies on secure instruction execution to 153 achieve the scaling benefits of a Nakamoto-style consensus algorithm 154 without the power consumption drawbacks of the Proof of Work algorithm. 155 156 * PoET simulator, which provides PoET-style consensus on any type of 157 hardware, including a virtualized cloud environment. 158 159 * Dev mode, a simplified random-leader algorithm that is useful for 160 development and testing. 161 162 .. _sample-transaction-families-label: 163 164 Sample Transaction Families 165 --------------------------- 166 167 In Sawtooth, the data model and transaction language are implemented 168 in a :term:`transaction family<Transaction family>`. While we expect users to 169 build custom transaction families that reflect the unique requirements of their 170 ledgers, we provide several core transaction families as models\: 171 172 * IntegerKey - Used for testing deployed ledgers. 173 174 * Settings - Provides a reference implementation for storing 175 :term:`on-chain configuration settings<On-chain setting>`. 176 177 * Identity - Handles on-chain permissioning for transactor 178 and validator keys to streamline managing identities 179 for lists of public keys. 180 181 Additional transaction families provide models for specific areas\: 182 183 * Smallbank - Handles performance analysis for benchmarking 184 and performance testing when comparing the performance of 185 blockchain systems. 186 This transaction family is based on the H-Store Smallbank benchmark. 187 188 * BlockInfo - Provides a methodology for storing information 189 about a configurable number of historic blocks. 190 191 For more information, see :doc:`transaction_family_specifications`. 192 193 194 Real-world Application Examples 195 =============================== 196 197 * XO: Demonstrates how to construct basic transactions by playing 198 `Tic-tac-toe <https://en.wikipedia.org/wiki/Tic-tac-toe>`_. The 199 XO transaction family includes create and take transactions, with an ``xo`` 200 command that allows two participants to play the game. 201 For more information, see 202 :doc:`/app_developers_guide/intro_xo_transaction_family`. 203 204 * Sawtooth Supply Chain: 205 Demonstrates how to trace the provenance and other 206 contextual information of any asset. Supply Chain provides an 207 example application with a transaction processor, custom REST API, and web 208 app. This example application also demonstrates a decentralized solution 209 for in-browser transaction signing, and illustrates how to synchronize the 210 blockchain state to a local database for complex queries. For more 211 information, see the `sawtooth-supply-chain repository on GitHub 212 <https://github.com/hyperledger/sawtooth-supply-chain>`_. 213 214 * Sawtooth Marketplace: 215 Demonstrates how to exchange specific quantities of customized assets with 216 other users on the blockchain. This example application contains a number 217 of components that, together with a Sawtooth validator, will run a Sawtooth 218 blockchain and provide a simple RESTful API to interact with it. For more 219 information, see the `sawtooth-marketplace repository on GitHub 220 <https://github.com/hyperledger/sawtooth-marketplace>`_. 221 222 * Sawtooth Private UTXO: 223 Demonstrates how assets can be created and traded. 224 This example application shows how to use SGX to allow for assets to be 225 transferred off ledger and privately traded, where only the trading parties 226 know the details of the transaction. For more information, see the 227 `sawtooth-private-utxo repository on GitHub 228 <https://github.com/hyperledger/sawtooth-private-utxo>`_. 229 230 231 Getting Started with Application Development 232 ============================================ 233 234 Try Hyperledger Sawtooth 235 ------------------------ 236 237 The Sawtooth documentation explains how to set up a local 238 :term:`validator<Validator>` for demonstrating Sawtooth functionality and 239 testing an application. Once running, you will be able to submit new 240 transactions and fetch the resulting state and block data from the blockchain 241 using HTTP and the Sawtooth :term:`REST API`. These methods apply to the 242 included example :term:`transaction families<Transaction family>`, as 243 well as to any transaction families you might write yourself. 244 245 Sawtooth validators can be run from pre-built Docker containers, installed 246 natively using Ubuntu 16.04, or launched in AWS from the AWS Marketplace. 247 248 To get started, see :doc:`/app_developers_guide/installing_sawtooth`. 249 250 Develop a Custom Application 251 ---------------------------- 252 253 In Sawtooth, the data model and transaction language are implemented in a 254 transaction family. Transaction families codify business rules used to modify 255 state, while client programs typically submit transactions and view state. You 256 can build custom transaction families that reflect your unique requirements, 257 using the provided core transaction families as models. 258 259 Sawtooth provides a REST API and SDKs in several languages - including Python, 260 C++, Go, Java, JavaScript, and Rust - for development of applications which run 261 on top of the Sawtooth platform. In addition, you can write smart contracts in 262 Solidity for use with the Seth transaction family. 263 264 For more information, see :doc:`app_developers_guide`, :doc:`sdks`, and 265 :doc:`rest_api`. 266 267 Participating in Core Development 268 ================================= 269 270 Learn about Sawtooth Architecture 271 --------------------------------- 272 273 See :doc:`/architecture` for information on :term:`Sawtooth core` features such 274 as :term:`global state<Global state>`, transactions and :term:`batches<Batch>` 275 (the atomic unit of state change in Sawtooth), permissioning, the validator 276 network, the event system, and more. 277 278 Get the Sawtooth Software 279 ------------------------- 280 281 The Sawtooth software is distributed as source code with an Apache license. You 282 can get the code to start building your own distributed ledger. 283 284 * `sawtooth-core <https://github.com/hyperledger/sawtooth-core>`_: Contains 285 fundamental classes used throughout the Sawtooth project, as well as the 286 following items: 287 288 * The implementation of the validator process which runs on each node 289 * SDKs for writing transaction processing or validation logic in a variety 290 of languages 291 * Dockerfiles to support development or launching a network of validators 292 * Source files for this documentation 293 294 * `Seth <https://github.com/hyperledger/sawtooth-seth>`_: 295 Deploy Ethereum Virtual Machine (EVM) smart contracts to Sawtooth 296 297 * `Sawtooth Marketplace <https://github.com/hyperledger/sawtooth-marketplace>`_: 298 Exchange customized "Assets" with other users on the blockchain 299 300 * `Sawtooth Supply Chain <https://github.com/hyperledger/sawtooth-supply-chain>`_: 301 Trace the provenance and other contextual information of any asset 302 303 * `Sawtooth Private UTXO <https://github.com/hyperledger/sawtooth-private-utxo>`_: 304 Create and trade assets, using SGX to allow assets to be transferred 305 off-ledger and traded privately 306 307 Join the Sawtooth Community 308 --------------------------- 309 310 Sawtooth is an open source project under the Hyperledger umbrella. We welcome 311 working with individuals and companies interested in advancing distributed 312 ledger technology. Please see :doc:`/community` for ways to become a part of 313 the Sawtooth community. 314 315 316 Acknowledgements 317 ================ 318 319 This project uses software developed by the OpenSSL Project for use in the 320 OpenSSL Toolkit (http://www.openssl.org/). 321 322 This project relies on other third-party components. For details, see the 323 LICENSE and NOTICES files in the `sawtooth-core repository 324 <https://github.com/hyperledger/sawtooth-core>`_. 325 326 .. Licensed under Creative Commons Attribution 4.0 International License 327 .. https://creativecommons.org/licenses/by/4.0/