Orbis Profile picture
Aug 10 26 tweets 9 min read
A mission-critical financial application must be safe & secure.

When the #Crypto industry goes through multi-million dollar hacks,

building a robust financial platform has been the core driving principle of #Cardano

So here's a thread on Functional Programming: 🧵👇 Image
The public blockchain sphere has been growing rapidly over the past decade

If we reflect on that growth,

it has mainly been on the valuation side of things

and not that much on the utility or user side of things

So why is it that way?
One of the reasons for this lack of growth in utility is the lagging scalability

But there is another elephant in the room, which most don't address

This is the lack of a secure programming environment for the #dApps

and the rest of the #blockchain infrastructure
This lack of security is the most important reason why

#DeFi attracts high-risk tolerant speculative investors

who can tolerate the loss of funds due to hacks

rather than regular risk-averse users

who may want to build a decent portfolio of assets & earn a stable yield
So when it comes to enabling a safe & secure programming environment
#Cardano has a unique approach

In contrast to the rest of the #blockchain industry (especially #Ethereum)

This is the approach based on secure programming with functional
programming language #Haskell Image
So what is functional programming?

Functional programming is the process of building software by composing pure functions

which avoids

• shared state
• mutable data
• side-effects
So what are pure functions?

In the context of computation,

a pure function is analogous to a mathematical function

which is the basis for all formal scientific reasoning It is a function (a block of code)

that always returns the same result

If the same arguments are passed
A function must follow four rules to behave like a function in math:

• It must always take an argument

• It must always return a value

• It must not depend on anything that changes

• It must not change anything by itself A function with such properties is called "Pure"
Pure functions are "stateless" and "timeless"

Meaning,

Pure functions are easily parallelizable since they encourage immutable data structures

which reduces the side-effects

making code hard to run on multiple processors Image
Pure functions are just mappings from inputs to outputs 

It does not depend on any state or data change during a program’s execution

There are no external states & side effects

This gives certainty & predictability to the behaviour of the code
Haskell has 1st-class functions

A programming language is said to have 1st-class functions

When functions are no different from any other variable

So the functions

• Can be used as arguments
• Can be assigned to a variable
• Can be returned as values from other functions
1st class functions allow to abstract out

Any repetitive computation from the code

And ultimately enables to write functions that produce other functions

These functions are referred to as higher-order functions Image
Higher-order functions simply mean

Functions that are operating on other functions

Why is it useful?

1. Higher-order functions raise the level of abstraction

Meaning

It allows to abstract over actions & not just values

Thus, we don’t have to reason about lower-level details
2. Higher-order functions are key to parameterizing code by behaviour

Meaning,

It allows us to define common programming patterns

And write functions about functions

Having higher-order functions is where a lot of the benefits of functional programming come from
In a nutshell

• Functional programming uses mathematics-like values & functions

• To yield results that have no outside influence & are well-evaluated throughout

• Leading to a more parallelizable transparent & cleaner code

• That helps the user in debugging & maintenance
On the other hand, programming in a dynamic environment with object-oriented programming

Results in the creation of huge "Dependency Hell"

Resulting in adding abstraction on top of abstraction to modularize complex systems

This results in a "shared mutable state/global state"
When submodules try to access the global state simultaneously

This significantly complicates the semantics of the code

Complexity arises & it results in a chaotic programming environment

In other words, it creates a much bigger surface area for attacks Image
So now let's take a look at the functional programming model of #Cardano

Plutus platform uses

• Haskell for the off-chain
• PlutusTX for the on-chain code
Which compiles down to Plutus Core

enabling the use of the same

• Syntax
• Compiler
• Data types in both parts of the code

This translates to an integrated, compact & robust programming model
Meaning,

Its a lot easier to reason about the behaviour of a smart contract

while programming a smart contract in Plutus

It won't be too difficult to actually prove that

code will behave exactly how it is supposed to

enabling easily verifiable code for secure & safe dApps
If the #blockchain industry could open its eyes & see the benefits of functional programming

A pure functional programming language like #Haskel

would be the go-to programming language for #dApps
that would one day handle a major portion of the world's financial activities 

when it comes to the programming environment of zk-rollup

Orbis will support writing on-rollup smart contract scripts in Haskell using

• PlutusTx
• Plutarch
• and in Pluto
There are a variety of reasons that make Plutus Tx currently inefficient

Pluto & Plutarch are novel programming languages based on Haskell

Plutarch is significantly more efficient than Plutus Tx

Whereas Pluto is simple & easy to learn
These two languages hold a lot of promise for the future of a secure programming environment on #Cardano

Especially Pluto that one day will be #Cardano's Solidity

Along with the benefits of functional programming
TL;DR -

• Mission-critical DeFi application needs to be safe & secure for mass adoption

• Object-oriented programming fails to deliver this secure programming environment

#Cardano offers a secure programming environment with #Haskell-based PlutusTx, Plutarch & Pluto
If you are looking to learn more about zero-knowledge proofs and zk-rollups —

Here’s a similar thread on Rollups on #Cardano that you might find useful:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Orbis

Orbis Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @orbisproject

Jul 27
#Bitcoin gave us the first glimpse into the future of sound money

#Ethereum showed us how to program money

#Cardano showed us how to program money securely with functional programming

Orbis is showing us how to scale #Cardano

Here's a thread on Rollup-Centric Future: 🧵👇
Currently,

there is no single #Blockchain in existence that can accommodate the financial traffic of the entire world

And there will never be such a blockchain

because it's practically impossible

due to the limited block space, any blockchain can offer
But can there be a blockchain

that could be the settlement layer to most of the financial traffic of the world?

This is possible and this is where we are heading as an industry

The only question is, 

Which blockchain is going to be the major settlement layer of the world?
Read 26 tweets
Jul 20
We are now going through a very defining period in the history of blockchains

where the era of monolithic blockchains is ending and

the era of modular blockchains is starting

marking the first step towards mass adoption!

🧵 A thread on Consensus mechanisms: 👇 Image
Since the inception of #Bitcoin,

the blockchain industry only had monolithic blockchains

where one #blockchain is designed to not outsource components to external networks

and is burdened with too many tasks to perform Image
In a monolithic #blockchain

The #consensus & execution functions are bundled into one layer

And a smart contract is then built on this bundled layer

The users are bound within one execution environment

This limits the potential to optimize & specialize for specific use cases
Read 24 tweets
Jul 6
Solving blockchain trilemma is the holy grail of #crypto

Mass adoption won't happen if a #Blockchain cannot scale WITHOUT compromising #decentralization

Orbis provides a key piece to #Cardano in solving this puzzle

🧵 Here's a thread on Blockchain Trilemma: 👇
The blockchain trilemma is a term coined by Vitalik Buterin

To address the trade-offs developers of #blockchain must make

To achieve scalability

As we see very often in the #Blockchain space, developers are forced to sacrifice one ‘aspect’ for the sake of the other two
The root of the blockchain trilemma lies in the fact that

the underlying structure of decentralized networks

comes with unique challenges when compared to centralized networks

Researchers recognized these challenges way before #Bitcoin was invented

& formulated "CAP Theorem"
Read 32 tweets
Jun 22
#Cardano requires scalability to achieve mass adoption

But scalability has to be achieved without compromising decentralization & security

Rollups are one of the best solutions we have now to achieve this goal

But which one?

Let's compare, "optimistic" and "zk-rollups"🧵👇
So what are rollups?

They are L2 solutions

•That bundle hundreds of transactions into a single transaction

•Rollup transactions get executed outside of L1

•But the transaction data gets posted to L1

•Which allows rollups to be secured by native L1 security
Rollups are general-purpose

Meaning

•You can run a copy of L1 (eg: #Cardano) inside a rollup

•Allowing existing dApps & native assets to migrate to rollups

•With almost no need to write any new code
Read 22 tweets
May 20
📢 We're officially launching #Orbis Academy, our 5 months-long educational initiative consisting of a weekly thread + Twitter Space.

🎙 Set your reminders for the #1 Academy Call on Sunday @ 2pm UTC: bit.ly/OrbisACall1

More info ⤵️
blog.orbisprotocol.com/p/orbis-academ…
Read 5 tweets
May 18
ZK-Rollups represent the future of Layer-2 #Blockchain scaling

@orbisproject is building the first ZK-Rollup on #Cardano

& Orbis plays an indispensable role in scaling #Cardano

Here’s a breakdown of the ZK-Proof Orbis is using to build its scaling solution on #Cardano: 🧵👇 Image
So what is a zero-knowledge proof?

It is a cryptographic technique,

where one party (The Prover) can prove that a specific statement is true to the other party (The Verifier)

without disclosing any additional information

apart from the fact that the statement is indeed true Image
When it comes to computational zero-knowledge, there are 2 types of ZK-Proofs

- Interactive ZK-Proofs
- non-interactive ZK-Proofs

So let's try and understand the major differences between the two

and why non-interactive ZK-Proofs are superior to the former?
Read 23 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(