<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: βετα</title>
    <description>The latest articles on DEV Community by βετα (@betaworldpeace).</description>
    <link>https://dev.to/betaworldpeace</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F474570%2F4ba31fe0-46d0-48ac-be72-d1b71193039e.jpg</url>
      <title>DEV Community: βετα</title>
      <link>https://dev.to/betaworldpeace</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/betaworldpeace"/>
    <language>en</language>
    <item>
      <title>Smart Contracts: Execution &amp; Examples</title>
      <dc:creator>βετα</dc:creator>
      <pubDate>Mon, 02 Nov 2020 23:41:59 +0000</pubDate>
      <link>https://dev.to/betaworldpeace/smart-contracts-execution-examples-5bbh</link>
      <guid>https://dev.to/betaworldpeace/smart-contracts-execution-examples-5bbh</guid>
      <description>&lt;p&gt;What is a smart contract? At its simplest, it’s a contract between two parties that cuts out the middleman. Smart contracts digitally facilitate, verify, or enforce the negotiation of a contract, allowing you to exchange money, property, or anything of value in a transparent, conflict-free way. And since a blockchain exists in a decentralized system between all permitted parties, there’s no need to pay intermediaries. Of course, blockchains can present their own problems, but they are faster, cheaper, and more secure than traditional systems, which is why even banks and governments are turning to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two Aspects of Smart Contracts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two notable aspects of smart contracts that make them so enticing to clients. One aspect is the non-functional property that blockchain provides, a consequence of block processing’s distributed nature that still maintains its trustworthiness and non-repudiability. While smart contracts’ public key crypto technology is built on many established ideas, theirs is still a novel approach. &lt;/p&gt;

&lt;p&gt;The other aspect of smart contracts is a flexibility that allows even non-programmers to specify, analyze, simulate, and ultimately execute them. The non-functional properties of blockchains are especially beneficial in these instances. This really is a contract, a process where multiple involved parties can make a sequence of decisions. And if you trust a central entity, you can delegate the execution of the contract to that entity and use crypto to control who is allowed to do what as part of a contract. This second quality of smart contracts is very much in line with the computerification of other non-technical domains, be it computational law or computational governance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture for Smart Contract Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5ZyeF4mP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pih6ymfr35erzokdmx10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ZyeF4mP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pih6ymfr35erzokdmx10.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Execution of a smart contract is made simple thanks to blockchain technology. You can deploy a contract to the blockchain and execute it there, benefiting from the guarantees provided by the blockchain. As with any binding contract, it is necessary that the infrastructure itself provides correctness guarantees, which is why various projects are under way to formally verify and enhance the solidity compiler so as to support advanced checking through integration. This is where the importance of the right contract development languages and tools come in handy.&lt;/p&gt;

&lt;p&gt;Contract development should rely on a language stack. For contract-style programs, functional languages are useful because they can be relatively easy to verify and can also easily support in-memory transactions. On top of its functionality, language extensions can directly support additional contract needs: decisions, auctions, agreements or resource allocations. Each of those can additionally be broken down into a whole range of configuration options to determine the specific behavior.&lt;/p&gt;

&lt;p&gt;In the above diagram, Executable Multi-Party Contract Language (EMPCL) contains language constructs typical in most Smart Contract building blocks. Once a language (or a language extension) is stable, it is easier to write the correct code rather than using frameworks or libraries. Language constructs –at an appropriate level of abstraction– means that most lower-level mistakes cannot be made in the first place. The contract is to some degree correct-by-construction. It also means that there is less code to write, so it’s ultimately easier to understand and review. One can even interactively play with the contracts and explore their behavior or else write test cases that can be executed immediately. There’s even a realistic possibility that non-programmer domain experts could read or write the code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An Example of a Smart Contract&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below is an example of a smart contract based on trades:&lt;/p&gt;

&lt;p&gt;daml 1.2&lt;br&gt;
module Trade where&lt;/p&gt;

&lt;p&gt;data TradeData = TradeData&lt;br&gt;
  with&lt;br&gt;
    buyer : Party&lt;br&gt;
    seller : Party&lt;br&gt;
    uuid : Text&lt;br&gt;
    currency : Text&lt;br&gt;
    amount : Int&lt;br&gt;
    volume : Int&lt;br&gt;
  deriving (Eq, Show)&lt;/p&gt;

&lt;p&gt;type TradeCid = ContractId NewTrade&lt;/p&gt;

&lt;p&gt;template NewTrade&lt;br&gt;
  with&lt;br&gt;
    facilitator : Party&lt;br&gt;
    observers : [Party]&lt;br&gt;
    trade: TradeData&lt;br&gt;
  where&lt;br&gt;
    ensure (trade.amount &amp;gt; 0 &amp;amp;&amp;amp; trade.volume &amp;gt; 0)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;signatory trade.buyer, facilitator

observer observers

controller facilitator can
  MakePayment : () do return ()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;template TradeProposal&lt;br&gt;
  with&lt;br&gt;
    newTrade: NewTrade&lt;br&gt;
  where&lt;br&gt;
    signatory newTrade.facilitator&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;controller newTrade.trade.buyer can
  AcceptTradeIssuance: TradeCid
    do create newTrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;happyPath = scenario do&lt;/p&gt;

&lt;p&gt;authority &amp;lt;- getParty "SunWater"&lt;br&gt;
  facilitator &amp;lt;- getParty "WaterLedger"&lt;br&gt;
  seller &amp;lt;- getParty "Alice"&lt;br&gt;
  buyer &amp;lt;- getParty "Bob"&lt;/p&gt;

&lt;p&gt;let&lt;br&gt;
    uuid = "abc123"; currency = "AUD"; amount = 1000; volume = 50&lt;br&gt;
    observers = [seller]&lt;br&gt;
    trade = TradeData with ..&lt;br&gt;
    newTrade = NewTrade with ..&lt;/p&gt;

&lt;p&gt;createProposal &amp;lt;- submit facilitator do create TradeProposal with newTrade&lt;br&gt;
  acceptProposal &amp;lt;- submit buyer do exercise createProposal AcceptTradeIssuance&lt;br&gt;
  facilitatorPaid &amp;lt;- submit facilitator do exercise acceptProposal MakePayment&lt;/p&gt;

&lt;p&gt;return()&lt;/p&gt;

&lt;p&gt;This particular example is formally defined, so no different interpretations are possible and it can be executed automatically. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smart Contracts and Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the moment, the languages most commonly associated with blockchain are DAML, Golang, Corda, Solidity, and FLETA. As you can see, these languages are not beholden to blockchain or even much resemble a domain specific language specifically intended to represent contracts. These are often common general purpose languages. It is but one limitation of smart contracts. &lt;/p&gt;

&lt;p&gt;The other is that while smart contracts are ideal when it comes to an exchange of virtual assets or to transfer data, they still aren’t quite capable of replacing real-life contracts when it comes to the physical exchange of goods. For all of its benefits in business, it still cannot operate changes on the real world or measure them directly. The highly specific language of legal documents and the highly specific technical language of developers don’t always overlap. But in an increasingly online world, smart contracts will continue to be the go-to for most readily transferable assets. &lt;/p&gt;

&lt;p&gt;Transparent and conflict-free, smart contracts’ non-centralized attributes and ease of construction make them ideal for more and more transactions. Thanks to their flexibility and fluidity, the demand for smart contracts will continue to grow as more businesses, banks, and even governments pivot towards them.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>smartcontracts</category>
      <category>opensource</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>Distributed Applications: Building More Completely with the Right Tools</title>
      <dc:creator>βετα</dc:creator>
      <pubDate>Mon, 05 Oct 2020 13:25:04 +0000</pubDate>
      <link>https://dev.to/betaworldpeace/distributed-applications-building-more-completely-with-the-right-tools-f8m</link>
      <guid>https://dev.to/betaworldpeace/distributed-applications-building-more-completely-with-the-right-tools-f8m</guid>
      <description>&lt;p&gt;In my &lt;a href="https://dev.to/betaworldpeace/building-businesses-opportunities-with-distributed-applications-50ji"&gt;previous post&lt;/a&gt;, we discussed the exciting, entirely new business opportunities that now exist in the blockchain space identified the four key pillars that comprise the Distributed Application. We then detailed the first two pillars: “Abstract away the infrastructure” and “Bring Agile to applications.” For this post, we will now turn our attention to the third and fourth pillars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third pillar: Provide tools to build complete applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Build complete application, integrations, automations, user-interfaces. Smart contracts running on a blockchain are but a small part of possible applications for DAML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fourth pillar: Make cheap, fast and complete deployment targets available.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are trying to make the road to production as smooth as possible. With DAML, your development team can write code once and deploy anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s a Distributed Application?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a step back and clarify what we mean by Distributed Application. DAML is a purpose-built smart contracts platform aimed at creating multi-party workflows that come with strong privacy, rights, and obligations guarantees. DAML applications can run on an array of DLTs / blockchains and databases without requiring any changes. As the saying goes: “Write once, run anywhere.” Your favorite programming stack (React, .Net, Java, Python etc.) will work with the DAML smart contract layer.&lt;/p&gt;

&lt;p&gt;It’s not quite correct to say that DAML runs its applications on Blockchain, in that we don’t classify applications by the infrastructure on which they run. Instead, DA has these defining distribution characteristics: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Distribution in terms of infrastructure.&lt;/strong&gt; DAML does not run on a single physical machine. Software engineers know that every large application now falls under this category.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution in terms of trust.&lt;/strong&gt; There is no central point of trust or fulcrum through which all information flows. Take for example encryption: messages that enter encryption remove the operators’ ability to read our messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution in terms of control.&lt;/strong&gt; Systems where there is no single entity means there is no power to materially disrupt an entire network. Social networks and the internet itself are a good example of this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution in terms of knowledge.&lt;/strong&gt; Information only flows to real stakeholders of pertinent information. Peer-to-peer messaging such as email is an example. Email gets read by you, the recipient, and the people who route it in-between, but no one else.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, none of these distribution characteristics are new, novel, or have anything specifically to do with blockchain. Most inter- and intra-business applications need most of these properties and that’s why so many systems are now message-based. But at the same time, these message-based systems tend to be error-prone, requiring a lot of data duplication and heavy reconciliation, all of which is expensive. In these systems, cost and value are inversely proportional. Robust infrastructure is expensive, as is running it with specialized personnel.&lt;/p&gt;

&lt;p&gt;This is where blockchain’s great innovation comes in. Blockchain provides consistency and brings integrity to a system. It removes the need for duplication, error scenarios, and the need for reconciliation. On top of that, smart contracts give us a mechanism for shared understanding for the rules of such systems. &lt;/p&gt;

&lt;p&gt;So how does that change the cost equation? Once such infrastructure has matured and been made interchangeable, you have easy access to managed offerings. In the blockchain world, large tech companies are coming in now and offering properly productionized infrastructures. That’s what we target with DAML. Once that’s established, skillsets and personnel become freed up and increasingly available, allowing for even further innovation. Developers can focus on the application logic and the code that differentiates offerings and brings value to the customer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Abstracting infrastructure is only part of the story for Distributed Applications. The current infrastructure abstraction that DAML offers makes applications portable between different platforms and is an important stepping stone in the future of blockchain technology. There’s more ahead in the months and years to come.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>opensource</category>
      <category>smartcontracts</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>Building Business Opportunities with Distributed Applications
</title>
      <dc:creator>βετα</dc:creator>
      <pubDate>Thu, 24 Sep 2020 15:06:00 +0000</pubDate>
      <link>https://dev.to/betaworldpeace/building-businesses-opportunities-with-distributed-applications-50ji</link>
      <guid>https://dev.to/betaworldpeace/building-businesses-opportunities-with-distributed-applications-50ji</guid>
      <description>&lt;p&gt;What do the mainframes of the 1960s, the databases of the 1990s, and the blockchains of the past decade all have in common? With every new generation of technological infrastructure, the changes start at a very low-level and ripple outwards, soon reaching an inflection point wherein the technology explodes, transforming the very way that business is conducted globally. Every time after that initial explosion comes a consolidation, where the infrastructure becomes abstracted away and applications themselves become the focus. And that’s when the real innovation starts happening. &lt;/p&gt;

&lt;p&gt;“Blockchain” can mean any platform that adds consistency guarantees and commonly includes some form of applications running on these platforms. This technology can bring new properties to an existing category of applications and we don’t need to invent a new blockchain application to get value from technology. Rather, we need to get the technology to support these existing applications.&lt;/p&gt;

&lt;p&gt;Take a traditional blockchain example that everyone knows: Bitcoin. It’s the original blockchain app and it remains a high-value application. Blockchain remains highly valued and closely associated with such digital assets, but so far it has rarely ventured beyond such core use. &lt;a href="https://daml.com/"&gt;DAML&lt;/a&gt; sees the potential to take some of these ideas and apply them to other branches of business beyond cryptocurrency.&lt;/p&gt;

&lt;p&gt;We currently find ourselves at such an inflection point. Realizing the historical parallels to these other technological paradigm shifts over the decades, we see in the distributed ledger technology (DLT) of the blockchain space entirely new business opportunities that are well within reach. With this post, we will show examples of the changes and new opportunities that lie ahead in the near future. For this piece, the examples chosen are non-financial, but everything is transferable to the financial sector and other business opportunities.&lt;/p&gt;

&lt;p&gt;To clarify, DAML is not a blockchain platform. DAML is an open source tool stack developed by Digital Asset that allows developers to build and deploy distributed applications that run on top of these platforms. We want to enable development teams the world over to build value. But in order to do that, they need to put the application first. &lt;/p&gt;

&lt;p&gt;We identify four key pillars that comprise the Distributed Application:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Pillar: Abstract away the infrastructure.&lt;/strong&gt; &lt;br&gt;
&lt;strong&gt;Second Pillar: Bring Agile to applications.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Third pillar: Provide tools to build complete applications.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Fourth pillar: Make cheap, fast and complete deployment targets available.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this post, we will look at the first two pillars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Pillar: Abstract away the infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Putting value first means that you need abstraction. Developers can write a program once and just deploy it anywhere it fits, utilizing DLT, blockchain, cryptographic database or any other similar system. Developers generate business value by focusing on the app instead of other structural concerns. &lt;/p&gt;

&lt;p&gt;The benefits can then flow to all sorts of applications. For example, let’s look at project management. These have lots of features, automations, and integrations, features that are seemingly far away from the monetary aspect of blockchain technologies. So nobody would think of this as a blockchain application, but there are strong distributive components, especially centered around qualities like trust, knowledge, and control. A lot of sensitive information gets shared in a project management application and we get used to these applications being centralized, so we work around such limitations.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second Pillar : Bring Agile to applications.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Distributed Applications need Agile in order to keep pace with the modern business world. With iterative scaling, developers can go all the way from a Proof of Concept built-in base to the scale of a national infrastructure. An Agile approach becomes crucial for minimizing risk and reaching solutions quickly. &lt;/p&gt;

&lt;p&gt;Every cycle accumulates risks and costs, so keeping a short cycle is important. Agile allows us to test a product hypothesis with minimal resources, deliver a complete product to customers, and iterate quickly and do regular releases. To allow for rapid development and scale to significant size, we need that infrastructure, upgradeability and tooling to allow developers to be Agile to scale. DAML’s smart contracts can unlock all kinds of new business opportunities and there is more to come. &lt;/p&gt;

&lt;p&gt;﻿In the next post, we will examine pillars three and four to see how each of these pieces works towards the modern conception of working with tools like DAML.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>opensource</category>
      <category>smartcontracts</category>
      <category>distributedsystems</category>
    </item>
  </channel>
</rss>
