Thoughts, stories and ideas.

Smart contracts explained

Smart contracts explained

Smart contracts are self-executing programs, written in code, appended to blockchains that launch blockchain-based operations when certain conditions are met. Thus, they are yet another step towards decentralization. Because of them, different parties can interact without knowing each other or relying on a third party since the terms and conditions of their relationship are transparently and immutably written in code, and they execute automatically.

Silly example: imagine you need a logo for the new business you want to open. If you could express the professional relationship between you and a hypothetical designer in a programmable sequence of steps, you could write a smart contract that would unlock payments along the way.

  • Step 1. The client and the designer sign a digital contract where the price for the final logo is established, and the timeline is defined. The agreed amount is locked in an intermediary wallet where neither the designer nor the client can touch it.
  • Step 2. The client provides a detailed description of the business activity, the design needs (a logo for a website, stationery...), and visual references.
  • Step 3. The designer provides 3 initial proposals in the established time, let's say one week. A 15% initial payment is automatically unlocked when the images are sent.
  • Step 4. If the client was unhappy, they could end the relationship and retrieve the remaining 85%. But if the delivery is satisfactory, they would accept the submission and unlock a further 15%.
  • Step 5. The client then picks one of the three proposals and provides detailed feedback in a checklist.
  • Step 6. The designer goes through the feedback and checks all the boxes
  • Step 7. The client approves the changes that were satisfactorily made and requests further changes in some others within the approved timeframe or cancels the work and parts ways. If she decides to go ahead, another 20% is unlocked, and now half of the payment is made.
  • Step 8. The designer provides a final set of changes. If the happy customer approves it by clicking a button, the rest of the payment is finalized.

The example is a tad silly because the design can be subjective and tricky. The human factor is very prevalent in the design process. This hypothesis leaves too much room for either the designer or the client to behave fraudulently or take advantage of the situation. This is just an explanation on how a "real world" professional task can be broken down into steps that trigger transactions. For a case like this to succeed, you would need a very complex platform that was able to host and validate the steps automatically, without human interference (Fiverr is doing its best in some ways). The platform should be able to check that images were sent, changes made, etc.

But token exchanges, loans, etcetera, are already verifiable by software. Especially since crypto has an underlying infrastructure that offers unmatched amounts of transparency and interoperability that help a machine understand wether users have what it takes (balance? collateral?) if they want to enter a financial transaction. And this is how DeFi was born.