In recent days we are listening and reading a lot of information that speaks to the wonder of smart contracts, but few understand exactly how it works, just what is associated with dApps, let's see this with Waves.

First we need to understand what differs a regular contract from a smart contract, the basic and simplified example, we can mention the Traditional Contract is the agreement between two people described in a contract its clauses where they will be ratified or recognized by a third party that can be an organ for such purpose and then its execution, while an Smart Contract is interposed a cooperation protocol with the "clauses", usually a programming code, and made available for execution, and from this point, by interaction cooperation protocol with the "clauses" of the contract separately accepts your execution.



Unlike the Traditional Contract, which is an agreement between people only, the Smart Contract allows the execution agreement between people, people and computer and computer with computer. Human interaction is indirect because it is independent of intermediaries, has autonomous and reliable execution, after all the code is the law. It is possible to model a hybrid contract known as Ricardian, but this approach will not be interposed in this article. I mention in a quote described in the course "Mastering Web 3.0 with Waves":

Even though they share similar terms, Smart Contracts are not contracts following the definition of an “agreement between parties”. A smart contract is a computer protocol (source code or program) which can be executed within a distributed environment like a blockchain network. All operations including execution results are stored within the blockchain.

Understanding this point, we now define that the Smart Contract derives from two different types, for their purpose being Smart Accounts and Smart Assets or Smart Tokens.

Smart Accounts Waves

A Smart Account, allows the ability to provide your portfolio with definitions of programmable routines to make decisions according to certain actions that may result from its use or also reactions to certain activities linked to your account, wallet or an indicated source. With a Smart Account for example, you can determine which actions are allowed or denied, require the approval of a third account, among other possible settings.

At waves it is possible for the account owner to convert his account at any time to a Smart Account or revert to a Regular Account, simply by inserting or removing the code in question created for his account, the facility is tremendous, because waves not happy about anything, waves has a way of providing ease to the platform user.

Smart Assets Waves or Smart Tokens Waves

A Smart Asset, like the Smart Account, allows the ability to provide execution definitions on the respective asset, but in this case such definitions may be made only by the issuer, and in turn the issuer shall identify at issuance of the asset that will be a Smart Asset or unable to convert it to a smart asset in the future. Therefore, when issuing a token that you want to insert activity you should include in the issuance a simple code and update it in functionality in due time, or implement the desired activity in the issuance.

With a Smart Asset among several possibilities, it is possible to determine asset use relationships in different aspects, but only with what is related to the respective asset only and what can be done with it, such as permissions. For an example of one of the ways that the definitions will be discussed here is the Waves Reward Token (WRT) issued for the benefit of wave ambassadors with rules of functionality as described below.

Smart Asset is promoted similar to a loyalty and motivation program, where by its operation, ambassadors can be rewarded in their activities. Didactically expressing the operation of the script, the issuer and / or any given account may distribute WRT tokens to any address, however such addresses may transfer those tokens only to ambassador addresses (like reward for help or some work), and only ambassadors may trade WRT tokens.



As we can see it is one of several methods that can be applied with a smart asset.

dApps

In conclusion, we could not mention dApps in this story because switching is provided for in smart contracts, precisely for a real and effective purpose of their capabilities. We must keep in mind that dApp is nothing more than an application doing business on the basis of existing smart contract features, whether they are related only to a smart account, a smart asset, or both.

It will be the dApps that will make the interaction of smart contracts with the human being directly, who in turn will perform the actions defined in the smart contract, or between several smarts contracts in a chain of executions.