• Complain

Lars Brünjes Polina Vinogradova - Plutus: Writing Reliable Smart Contracts

Here you can read online Lars Brünjes Polina Vinogradova - Plutus: Writing Reliable Smart Contracts full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Lars Brünjes Polina Vinogradova Plutus: Writing Reliable Smart Contracts

Plutus: Writing Reliable Smart Contracts: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Plutus: Writing Reliable Smart Contracts" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

This practical ebook is a guide to programming with the Plutus language for highly secure smart contracts on the Cardano blockchain, home of the ada cryptocurrency. Plutus is based on the Haskell functional programming language and comes complete with a full testing environment accessed via GitHub or any browser.The ebook will help you get to grips with using smart contracts on a blockchain by providing real-life examples and functional sample code. Plutus: Writing Reliable Smart Contracts is the first ebook about this new and exciting language and is written by experts from IOHK, the developers of Cardano and ada.This ebook is concise and focused and uses sample scenarios to help the reader grasp the concepts of this new language. The pitch and flow of this book makes it appealing and is it easy to navigate through the samples which get progressively more complex.

Lars Brünjes Polina Vinogradova: author's other books


Who wrote Plutus: Writing Reliable Smart Contracts? Find out the surname, the name of the author of the book and a list of all author's works by series.

Plutus: Writing Reliable Smart Contracts — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Plutus: Writing Reliable Smart Contracts" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Plutus: Writing Reliable Smart Contracts
Table of Contents
AbouttheAuthors

Dr Lars Brnjesholds a Ph D in Pure Mathematics from the University of - photo 1 Dr. Lars Brnjesholds a Ph. D. in Pure Mathematics from the University of Regensburg(Germany) and has been a postdoc at the universities of Cambridge (UK) and Regensburg.After working as a Software Architect for ten years, he joined IOHK in 2016. As Director ofEducation for IOHK he gives talks and delivers trainings and Haskell courses all over the world,but is also involved in IOHK research projects.

Dr Polina Vinogradovaholds a Ph D in Computer Science from the University of - photo 2 Dr. Polina Vinogradovaholds a Ph. D. in Computer Science from the University of Ottawa.Her Ph. D. research consisted of the formalization of category-theoretic proofs,definitions and examples related to the study of abstract computation.She obtained her Masters degree in Mathematics, also from the University of Ottawa,with the focus of her thesis being the study of abstract computation usingCategory theory, in particular, Turing categories.

Dedication

The authors thank Niamh Ahern, Michael Peyton Jones, Alejandro Garcia and the IOHK Plutus Team,without whose hard work and dedication this book would not have been possible.

Colophon

2019 Input Output HK Limited.

The 'Plutus: Writing Reliable Smart Contracts' eBook is the property of Input Output HK Limited. All content and materials havebeen produced by Input Output HK Limited and can be reused in accordance with the Apache 2.0 license.The exercises and code samples included in this book are examples and are usedas learning aids. The source files for this eBook are stored in thePlutus GitHub repository and are covered by our open source license agreement.

Preface

This book teaches you how to write reliable smart contracts with Plutus, thenew general purpose language developed by IOHK for smart contracts on the blockchain.

This book aims to educate beginner Haskell developers in the fundamentals ofPlutus. It is the first book written about Plutus and uses real life samples tohelp anchor the application of this new and exciting smart contract language totangible use cases. This book will be continuously updated with the latest codeto ensure that the content is current and up to speed with the latest version ofPlutus.A general understanding of smart contracts would be useful to learn about andwork with Plutus, but is not essential for starting out. For general functionalprogrammers with blockchain domain knowledge, we recommend that you read aboutand understand the basics of Haskell programming prior to reading this book.

Come and explore the world of Plutus and learn our new language throughreal life scenarios and sample code snippets!

UTXOStyleAccounting

In order to become proficient with all things Plutus, it isinevitable that you must first acquire a solid understanding of howaccounting is done on the Cardano platform.

We traditionally think of money transfers as being between two bank accounts,or perhaps internet addresses in the case of digital currency. The Cardano platform,like a number of other cryptocurrency platforms such as Bitcoin, uses insteadan accounting approach known as UTXO-style. A full formal description ofthis type of accounting can be found as part of the Cardano ledgerformal specification, see .

UTXO-style accounting documents the flow of money not from account to account,but rather from transaction to transaction. Each transaction has inputs(where the money being spent is coming from), and outputs(where this money is going). Note that the body of a transaction may alsocontain other data, as we will see later when we examine the extendedUTXO model in the chapter.

Consider the data flow graph below, . The black lines represent unspent outputsof transactions, and the red lines represent these outputs being used as inputsto subsequent transactions. The vertical unlabelled box represents a singletransaction having several inputs and several outputs. The blue certificatesdenote remaining unspent outputs in our illustration.Note that here, at the start of the data flow graph, Alice has 100 Ada inunspent outputs from before the start time of this graph -this money comes from one or more transactions outside the scope of this picture.We abstract this with a single box (labelled with her name and the 100 Ada).This box has two black (output) lines coming out of it, with the total valueof these outputs adding up to 100 Ada):

  • a 58 Ada output from earlier remains unspent by Alice and is part of herfinal unspent outputs
  • a 42 Ada unspent output of Alices becomes part of the new transaction

Now, Bob has 10 Ada from previous unspent outputs. He spends them as follows:

  • all 10 Ada goes to the new transaction

This new transaction we illustrate here has two inputs, 42 from Alice, and 10from Bob. This transaction has two outputs, 2 Ada to Bob, and 50 to Charlie.We also see that Charlie has 52 Ada from a previously unspent output, fora total of 102 Ada he can spend in future transactions. Bob is left withonly one output of 2 Ada, and Alice, a total of 58 Ada in unspent outputsfrom other transactions.

Figure 1 UTXO Funds Flow ExampleThe above model is strictly showing the flow - photo 3
Figure 1. UTXO Funds Flow Example

The above model is strictly showing the flow of currency between severalparticipants. In this simplified version, the transactions illustrated are notpaying fees, etc.Even in this somewhat simplified model, we see that an output must always be spentin full. That is, a record of an unspent output cannot be modified (this wouldbe account-based bookkeeping), only used entirely. In order to maintainthe ledger bookkeeping integrity, the new transaction must have all the unspent outputs (totalingthe correct amount of all the unspent outputs) that are being used up by it. In theexample above, our new transaction removes (i.e. uses as inputs) unspent outputs of value42 from Alice and 10 from Bob, for a total of 52 Ada. We must then have52 Ada of outputs from this transaction (2 to Bob and 50 to Charlie).Note here that Bob had both an unspent output used by this transaction andan unspent output produced by this transaction. That is, he got, so to say,change (of 2 Ada) from this transaction. Since there is no true way to spendpart of an output, this is how UTXO accounting deals with partial spending -by adding a "change" output.

Notice here that this style of accounting makes it convenient, if not intuitive,to distribute the flow of cash from several contributors to several recipients byhaving it flow into a common pot, i.e. the transaction, before being sent tothe intended payees.This is, in a very general sense, the goal of smart contracts.Let us explore what is going on during the processing of a UTXO transaction event more formally.For the basic transactionmodel we discuss here, refer to .

Figure 2 Basic UTXO definitionsBefore we examine the structure of - photo 4
Figure 2. Basic UTXO definitions

Before we examine the structure of transactions, let us look at how book keepingis done on the ledger. The record on the ledger thatcontains this information is called a UTXO, short of Unspent Transaction Outputsand denoted UTXO in the figure.This record is a finite map, where the key is a pair of transaction ID andan index,

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Plutus: Writing Reliable Smart Contracts»

Look at similar books to Plutus: Writing Reliable Smart Contracts. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Plutus: Writing Reliable Smart Contracts»

Discussion, reviews of the book Plutus: Writing Reliable Smart Contracts and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.