$FBX is now available on Gate.io, MEXC, BTSE, Finblox 🚀
logo

D-Apps and Smart Contracts

Last Updated on Oct 15, 2022
HomeFinblox AcademyD-Apps and Smart Contracts

Learn about decentralized apps, smart contracts, and the major types of blockchain tokens!

 

Decentralized apps (dApps) are all the rage these days, yet few people seem to understand how their underlying mechanisms work. There are several requirements that must be met before an application can be classified as a dApp:

 

  • The backend code of a dApp must be running on a decentralized peer-to-peer network - aka the blockchain. The backend just refers to the part of the program that stores and manages data. Meanwhile, the frontend code is the part of the program that can be seen and interacted with by users.
  • This code must be open-source. That means anyone can view, access, and modify the code - a key principle of decentralization. No one entity should have sole control. But, consensus is still necessary to make application-wide changes. If a majority of participants vote for a change in the code, that change will be implemented.
  • Because a vote is required, dApps have governance tokens that can be purchased or distributed to users. The more governance tokens you hold, the more "voting power" you have on the future of the blockchain protocol. A protocol is just a set of rules that determine how the blockchain network functions. There are many other types of tokens that dApps can issue - which we will cover later.
  • Almost all dApps have smart contracts. Smart contracts are programs that automatically run once predetermined conditions are met - and they allow the internal workings of the dApp to remain intervention free.

 

Once a dApp is deployed, it cannot be recalled. Think of it as an immortal AI that is released into the world - developing a personality of its own based on the desires of all its users!

 

1.png

 

What are the different types of dApps?

 

Currently, there are 3 existing types of dApps: Type I, Type II, and Type III. You will sometimes hear these referred to as layers of a blockchain - in fact, both terms are the same thing. They are called layers because each type sits on top of another, like the layers of a cake.

 

Layer-1 blockchains are base networks that can run completely independently on their own. Bitcoin, Ethereum, Binance Smart Chain, and Solana are popular examples of these. The main issue with Layer-1s is that their networks are flooded with transactions and data as they become more and more popular and sometimes exceed their throughput. A throughput is the rate that a blockchain can process transactions - usually measured in transactions per second (TPS). Therefore, greater scalability is a constant pursuit of all Layer-1s.

 

To tackle scalability issues, Layer-2 blockchains were built to sit on top of Layer-1s. Picture them as auxiliary generators, supplying power to a main generator and taking some of the load off. Whenever you hear someone referencing a "sidechain" or an "off-chain" solution - they're usually referring to a Layer-2.

 

Layer-3 blockchains are the newest addition to the space and are known as the application layer. DeFi, GameFi, NFT platforms, and all sorts of apps are Layer-3. Unfortunately, many of these apps have skipped past Layer-2 and are built directly on top of Layer-1, leading to system issues and bugs from reduced performance.

 

To summarize what we just learned:

 

  • Layer-1 blockchains provide the base network, security, and consensus
  • Layer-2 blockchains promote scalability and greater processing power
  • Layer-3 blockchains are the apps that users can interact directly with

 

1654332972399 (1).jpg

 

How does a smart contract work?

 

Before we explain how a smart contract works, you should understand why they were invented in the first place. Bitcoin, the original cryptocurrency - had very primitive smart contracts that were limited to executing transactions only. As a result, Ethereum was designed to be programmed in a language that is Turing-complete - meaning it supports a broader set of computational instructions.

 

This makes smart contracts virtually limitless when it comes to their applications. Over 3,000 dApps can be found on Ethereum alone. There are several similarities that smart contracts have in common:

 

  • They are usually written in a programming language called Solidity or Vyper.
  • Smart contracts are permissionless, meaning they can be created or modified by anyone.
  • They are highly composable, meaning that several smart contracts can be strung together in a complex series to achieve a certain function.
  • Their execution is automatic, guaranteed, and irreversible.
  • Launching, maintaining, and executing a smart contract requires gas - which is basically a transaction fee that is measured in units called gwei.

 

However, a smart contract is not without its weaknesses. Smart contracts cannot pull data directly from the outside world, because that would A) compromise the concept of decentralization and B) produce data conflicts that would send the blockchain into disarray.

 

For example, let's say that a smart contract had an API that directly read the value of foreign currencies - and it decided to read this data at 6 PM. Another smart contract reads the value at 7 PM, but notices it is different. Now imagine thousands of computers on the blockchain reading data from different times and sources - they would be unable to reach consensus, and reject one another.

 

To solve this problem, smart contracts use oracles - which are data feeds that can both retrieve and send data back to the outside world. Oracles are linked directly to the blockchain and act as a conductor that tells every single smart contract: "Hey, this is the value of USD at this moment. Use me as a universal reference."

 

Still, oracles are vulnerable to being hacked or manipulated. If this happens, it would affect every smart contract that read the oracle - and every subsequent layer underneath could potentially suffer the ripple effects.

 

Finally, there is the gas problem. The price of gas is determined by miners on the network, and follows the rules of supply and demand. If network activity is high and exceeds the throughput, users will end up fighting and bidding against each other to execute their activities. The gas limit is a bid that every user can set when they wish to execute an activity. Miners can choose to accept a transaction or ignore it if the gas limit seems too low to make it worth their time. You can imagine the competition, cost, and amount of frustration this produces.

 

Fortunately, Ethereum 2.0 aims to solve this problem by moving away from miners/proof-of-work and migrating to a proof-of-stake consensus.

 

Finblox-Marketing-Templates--2000-x-1216---5-.png

 

What are the different types of tokens issued by dApps?

 

There are 5 primary token classes that help support the infrastructure of dApps. Please note that some of these token classes can even overlap depending on the intended functionality set by the dApp creators:

 

  • Platform tokens are built on an underlying blockchain, gaining increased security and the ability to support transactions. There are so many possible use cases for platform tokens that they cannot all be described.
  • Security tokens have nothing to do with data protection - they actually refer to financial securities which promise ownership, rights, or other legal obligations. They can be representations of real-world assets, such as property or gold.
  • Transactional tokens are used solely to conduct transactions on the blockchain.
  • Utility tokens are built into the protocol of a blockchain and used to access the services of that protocol. They may have monetary value, but not always.
  • Governance tokens, as previously discussed - allow holders to vote on how a protocol functions.

 

2.png

 

The Takeaway:

 

Decentralized apps aren't widely used outside of the Ethereum network - in fact, dApps have yet to appear on the Google Play or Apple stores. While it may take years to reach a critical adoption period, the concept of dApps and smart contracts should remain a hot topic for those who are democratically-minded.

 

With the rise of censorship and increasing regulatory oversight, dApps are the first step towards reclaiming our individual freedoms.

 

Thanks for reading! Please subscribe if you haven't already, and stay tuned for more detailed information on exchanges, wallets, and the transaction process!

 

This content is provided for informational purposes only, and should not be relied upon as legal, business, investment, or tax advice. You should consult your own advisers as to those matters. Charts, graphs and references to any digital assets are for informational and illustrative purposes only.

Featured Posts

Start your crypto journey today

Sign up for Finblox and grow your crypto the smart way.

Onwards to financial freedom!

Don't miss out on the rewards!

Sign up to receive updates on new features, promotions, and more!

© 2023 Finblox. All rights reserved.

When you transfer your digital assets through Finblox, the funds will be held initially with our custodial partner Fireblocks, the most trusted leading digital asset security infrastructure providing enterprise-grade security, insurance, and 24/7 access to digital assets.

Finblox is not a bank nor a deposit account, nor is it a depository institution, custodian, fiduciary, or any other type of asset account characterized as a banking product or service. Any information, services, and comments provided on the site are for informational and self-help purposes only and are not intended to be a substitute for professional financial advice. When you purchase crypto (Digital Assets) on the Finblox platform, your purchase will be facilitated by a third party. Finblox does not provide fiat-to-crypto onboarding.

Any services, information and/or materials contained herein may not be legally available for residents of certain jurisdictions, countries under embargoes or sanctions and/or other blacklisted countries. If such restrictions apply to you, you are prohibited from accessing the website and/or consume any services provided on this platform. You are requested to leave this website. Finblox is not available in some jurisdictions and territories, including Hong Kong.

Holding or trading digital assets could involve a substantial risk of loss, please take the time to fully understand the risks associated in our Risk Disclosure page. Insurance coverage scope is limited, limitations apply, please contact us for more details.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Finblox - Earn Crypto Yield