Why Build Apps on Cardano Blockchain

Posted By : Siddharth

Jun 26, 2022

Cardano

 

Cardano is a global blockchain initiative as it is the first blockchain to be peer-reviewed and academically developed by a panel of experts in the field.

 

Composed of engineers, academics, and one of the founders of Ethereum, the Cardano team chose to do something different and created an original blockchain from scratch, and together they focused on making sure that Cardano would fulfill its purpose to run a digital platform free of intermediaries. This system is more comprehensive and sustainable than other blockchain platforms.

 

The Cardano blockchain is based on the Shelley consensus algorithm, which is a new consensus algorithm. The platform was designed to be secure, scalable, and easy to use for building and running decentralized applications.

 

What is the Native Crypto used in Cardano Blockchain?

 

Cardano's native cryptocurrency, ADA, is a valuable asset on the Cardano blockchain. You can use ADA on the Cardano blockchain just as you would ETH on the Ethereum blockchain. ADA can be used as both a digital currency and a token. As a token, ADA is the only currency that rewards holders

 

What is the Programming Language used in Cardano Blockchain?

 

Plutus

 

It is a smart contract platform for the Cardano blockchain. The SDK enables developers to build apps that communicate with the Cardano blockchain. Plutus makes it possible for all programming to be done in Haskell using a single library. The Cardano platform makes it easy to create safe apps, acquire new assets, and create smart contracts. Additionally, developers do not have to test their work on a complete Cardano node to make sure it is correct. You can create new Plutus tokens in a minimal environment, create smart contracts, and create scripts.

 

Haskell

 

Haskell is the language of choice for developing applications on Plutus. Cardano uses a programming language to create smart contracts. Haskell is Cardano's first choice when it comes to implementing programming languages.

 

Sample program

 

import Data.Text qualified as T

import Playground.Contract

import Plutus.Contract

import PlutusTx.Prelude

import Prelude qualified as Haskell

 

hello :: Contract () EmptySchema T.Text ()

hello = logInfo @Haskell.String "Hello, oodles"

 

endpoints :: Contract () EmptySchema T.Text ()

endpoints = hello

 

type DemoSchema = Endpoint "demo" ()

mkSchemaDefinitions ''DemoSchema

$(mkKnownCurrencies [])

 

Workings of the Above Program

 

1. Libraries 

 

  • Plutus.Contract for using Plutus core library

  • Data.Text for converting strings to text

  • PlutusTx.Prelude for replacing the Haskell library

  • Playground.Contract for importing the interface to the playground

 

2. Code 

 

  • Function name – hello

  • Contract () EmptySchema T.Text () will tell that nothing is returned

  • logInfo is used to print out data to the console

  • endpoints will create a “hello” function to run the code

 

3. Output 

 

  • Hello, oodles

 

Leave a

Comment

Name is required

Invalid Name

Comment is required

Recaptcha is required.

blog-detail

April 4, 2024 at 09:07 pm

Your comment is awaiting moderation.

By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.

Chat with Us
Contact Us

Oodles | Blockchain Development Company

Name is required

Please enter a valid Name

Please enter a valid Phone Number

Please remove URL from text