0% found this document useful (0 votes)
48 views

Avalanche Subnets Custom VMs

Uploaded by

swarajdian05meet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Avalanche Subnets Custom VMs

Uploaded by

swarajdian05meet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Check-In

Introduction to Web3.0,
Avalanche, Subnets,
and Customized VMs
Sarnavo Saha Sardar
Dev Advocate @AvalancheDAO
Agenda

1. Introduction
2. Blockchain
3. Cryptocurrency
4. Avalanche
5. Smart Contracts
6. Oracles and Chainlink
7. Avalanche L1 (subnets)
Evolution of the Internet
WEB 1.0 WEB 2.0 WEB 3.0
● Base Protocols ● Private Chats ● Search ● Encryption ● Video ● Bitcoin (2008) ● Blockchain
● Static Web Pages ● Discussion Boards ● Music ● Payments ● Mobile ● Smart Contracts ● Oracles
● Email ● Web Browsers ● Apps ● Social ● Cloud ● Wallets ● Tokens
● Gaming ● Trust Minimized ● Open Source
Protocol Acronym Purpose

Internet Protocol IP Physical network

Internet Control Message Protocol ICMP Status messaging

Transmission Control Protocol TCP Guaranteed delivery

User Datagram Protocol UDP Coordination, Audio

Telnet Protocol TELNET Remote login

File Transfer Protocol FTP Network utility

Simple Mail Transfer Protocol SMTP Email servers

Network News Transfer Protocol NNTP Usenet

Hypertext Transfer Protocol HTTP Web

Communication Dematerialization / Centralization Decentralization


1983-2004 2004-Present 2018-Present
Key WEB 3.0 Technologies

Blockchain Smart Contracts


A blockchain is a highly secure ledger operated by Smart Contracts are pieces of code on blockchains
a network of computers (nodes), rather than a that enable automatic transactions by using
central authority. Blockchain is the backbone of conditional software logic such as, “if x is true, then
WEB3 execute y.”

Programmable smart contracts enable the


Cryptocurrencies creation of dApps, which are not maintained by
any single organization or individual (unlike Web
Cryptocurrencies are digital tokens that leverage
2.0 apps).
blockchain technology to facilitate highly secure
transactions. They are the native form of payment
in WEB3
Blockchain Oracles
To achieve full utility and ultimately widespread
adoption, smart contracts need to access
real-world data and systems that exist outside of
blockchain networks. To access these resources,
they need oracles. Without Oracles, blockchains
cannot access the data needed to create the
complex applications users demand.
Blockchain
Blockchain is the foundational technology
powering cryptocurrencies and Web 3.0

Decentralized Architecture
Distributed computational power providers, called nodes,
compete to validate transactions and secure the network
against malicious attacks through lack of dependency on
any oneUsers
participant.
Developers
Researchers
Automated Digital Transaction Ledger
An excel spreadsheet of transactions without manual
data entry or amendment of data after the fact, offering
public transparency and consensus agreement of truth

Cryptographic Encryption Security


Cryptography based encryption offers a trustless and
immutable medium for agreement in value transfer
without the need for any third party intervention
Consensus Mechanisms for Trustless Agreement
and Differentiated Value Propositions

1 2 3

Proof of Work Proof of Stake Others in Development

Energy and computational power are used Cryptocurrency owners pledge their Alternatives to PoW & PoS have been
to solve for cryptographic equations to coins for use in the transaction introduced in recent years as
validate transactions and produce validation process and receive experimentation continues within
cryptocurrency rewards in return cryptocurrency rewards in return the industry.
Blockchain Limitations and Trade-Offs
The benefits of decentralization, distributed consensus and cryptographic encryption security
are only achieved based on certain sacrifices compared to existing mature WEB 2.0 alternatives

Scalability

● Transaction Volumes
● Transaction Speeds (TPS)
● Tamper Proof = Closed End Systems
● Limited External Interaction Possible
Blockchain
Trilemma ● Scalability Issues Currently

Security Decentralization
Cryptocurrency
Types of Cryptocurrencies

Mining Based (PoW) Staking Based (PoS)


Uses a process called mining to verify transactions Uses a process called staking to verify transactions
and add more coins to the supply. Miners use and add more coins to the supply. Holders of a
computational hardware to solve mathematical staking-based cryptocurrency can choose to stake
equations. Typically, the first miner to solve the their coins, meaning they're pledging those coins
equation gets to verify a block of transactions. In to be used for transaction processing. The
return, miners who verify blocks receive cryptocurrency blockchain protocol chooses a
cryptocurrency rewards. participant to verify a block of transactions. In
return, participants receive crypto rewards.

Security Tokens
Security tokens are digitally recorded assets that Utility Tokens
function similarly to equities traded on stock Utility tokens are a type of cryptocurrency that
exchanges. Security tokens resemble regular exist within a network. They may be used to pay
stocks and, in many cases, provide equity or a for services, pay network costs, or redeem rewards,
dividend payout to investors. among other things.

Stable Coins Meme Coins


Designed to follow the price of another asset. Most Meme coins are designed to mimic other
of the biggest stablecoins are pegged to the U.S. cryptocurrencies and are named because they
dollar and attempt to mimic its value. If the price depend on a joke or a ridiculous interpretation of
fluctuates, the issuer of the coin or algorithm will well-known digital currencies.
take steps to correct it.
Three Unique Use Cases of Cryptocurrency

1 2 3

P2P Payments Governance Non Fungible Token (NFT)

Permissionless value transfer Digital voting rights to facilitate Digital Provenance for exclusive
eliminating the need for any decentralized democratic decision ownership / property rights of real
intermediaries making and help shape the future of world and digital assets.
the project
Cryptocurrency Evolution Timeline
From Bitcoin’s inception to the recent NFT Boom, it’s been an exciting yet
volatile process of experimentation and innovation over the last 14 years.

2011 - Altcoin Forks Begin 2017 - ICO Boom 2021 - NFT Boom
Namecoin, Litecoin, Token sales become an Increased DeFi adoption
Monero, & Zcash among alternative crowd catalyzes further
others copy Bitcoin code financing structure to raise exploration of creator and
while amending certain start-up funding amidst a community use cases
features to differentiate & new wave of blockchain
experiment use cases

2008 - 2009 2014 - Ethereum ICO 2020 - DeFi Rises


Bitcoin White Paper An effort to develop Pandemic lockdowns and fiscal
published and first BTC further blockchain utility stimulus create the perfect storm
transactions completed through the introduction of dApps experimentation
of the first Smart Contract resulting in a 10X increase in
Protocol decentralized financial services
TVL
Avalanche
What is Distinctive Features
Avalanche?
Avalanche is a performant, modular,
Globally Decentralized ecosystem with
and VM-agnostic platform to launch L1 over 1700 Validators
blockchains in an interoperable, highly
scalable decentralized ecosystem. L0/L1 platform to launch independent
blockchains + build dApps

// “network of fast layer 1


Groundbreaking Snowman Consensus
blockchains ”
What Avalanche Really Isn't 🧐 Interoperability enshrined at the base
layer with Warp Messaging
→ Not a Sidechain to Ethereum !
→ Not a Layer 2 blockchain Groundbreaking VM development SDK
→ Not just another EVM-compatible chain which achieves 143k+ TPS
Snowman
Consensus ‼
In the 45-year history of distributed systems, only
three new consensus mechanism have emerged,
with Avalanche marking the latest breakthrough.

Avalanche uniquely combines the strengths of


Satoshi's protocol and Classical consensus
mechanisms, offering unprecedented scalability.

All L1 subnets and C-chain finalize transactions in


less than 2 seconds using the Snowman Consensus.
Build Whatever-You-Want
Consensus Layer
With Snowman Consensus, Avalanche enables an
ultra-fast, highly performant and scalable network
of blockchains.

Any L1 Subnet with EVM or a custom virtual machine (SVM,


MoveVM, zkVM) can finalize transactions at lightning speed.

What your L1 Subnet has from day one?


→ Sub-second transaction finality
→ Highly scalable (~4,500 TPS)
→ Choice of your own VM
→ Independent tokenomics
→ Subset of Avalanche validators

Credits: https://snowpeer.io
Avalanche Primary Network
Primary Network is a special Subnet which utilizes the Snowman Consensus.
It runs three different blockchains: X, P and C-chain

X-Chain: native chain meant for creating and trading assets (ANTs), runs an
instance of Avalanche Virtual Machine.

P-Chain: used for validator and Subnet-level operations. Creation of new


Subnets, addition of validators to Subnets, and staking operations happens
on the P-Chain.

C-Chain: EVM-compatible blockchain which supports deployment and


execution of arbitrary smart contracts written in Solidity.
What’s the Contract or C-Chain?
→ Fork of the Ethereum Virtual Machine which enables
the creation and execution of Solidity smart contracts

→ Compatible with the full suite of Ethereum developer


tools (Remix, Hardhat, Metamask, etc)

What’s Special then?

→ Higher throughput
→ Lower Fees
→ Least Time to Finalize transactions
What is a Subnet?
Subnet is essentially a subset of Avalanche
validators working together to achieve
consensus on the state of one or more
blockchains.

All the blockchains validated by Subnets are


sovereign, independent Layer 1 blockchains.

Each Subnet blockchain on Avalanche can


theoretically scale upto ~4,500 TPS while
ensuring < 2 second time to finality.
When do you need a Subnet?
→ When you are building high performance
decentralized applications

→ When you want to customize the execution


layer of your blockchain (with custom VMs)

→ When you want a native gas token, and


don’t want to pay rent to Ethereum (all L2s,
L3s pay 💸)
Independence Customizability
Subnet 1
Subnet A

Subnet B Subnet 2

Subnet C Subnet 3

Traffic on Subnet A doesn’t impact Subnet A can have a different


the gas prices on Subnet B and C architecture compared to B and C
Smart Contracts Solidity

Ethereum Execution EVM

Blockchain Consensus Gasper

Smart Solidity Rust Move


Contracts

Avalanche Ecosystem Execution EVM SVM MoveVM

Consensus Snowman Consensus


Smart Contracts
Lets Code
https://scanqr.to/d8a6afc0
Create Your Own Avalanche L1
(prev. Subnets)
Subnets are Cool! Is it tough to deploy an
Avalanche Subnet?
Nope, not at all.

Two Ways To Launch a Subnet

Using Avalanche CLI, anyone can deploy Using AvaCloud, you can get your test
your subnet in under 3 minutes. Subnet up and running in under 1 minute!

Just select the virtual machine (EVM or a All you need is an AvaCloud account and
custom VM) and include the precompiles. Core Wallet extension pre-installed.
Deploying Subnets Locally Results
If all works as expected, the command output should
look something like this:
Install Core Wallet Extension > avalanche subnet deploy mySubnet
✔ Local Network
https://chromewebstore.google.com/detail/core-crypto-w Deploying [mySubnet] to Local Network
Installing subnet-evm-v0.4.3...
allet-nft-ex/agoakfejjabomempkjlepdflaleeobhb?hl=en subnet-evm-v0.4.3 installation successful
Backend controller started, pid: 93928, output at:
/Users/subnet-developer/.avalanche-cli/runs/server_20221122_173138/avalanche-cli-backend
Install Docker and Dev-Container Extension in VScode Installing avalanchego-v1.9.3...
avalanchego-v1.9.3 installation successful
VMs ready.
Starting network...
..................
Clone this Repo Blockchain has been deployed. Wait until network acknowledges...
......
https://github.com/ava-labs/avalanche-starter-kit Network ready to use. Local network node endpoints:
+-------+----------+------------------------------------------------------------------------------------+
| NODE | VM | URL |
+-------+----------+------------------------------------------------------------------------------------+
In the following commands, make sure to substitute the | node2 | mySubnet |

name of your Subnet configuration for <subnetName> http://127.0.0.1:9652/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc |


+-------+----------+------------------------------------------------------------------------------------+
| node3 | mySubnet |
To deploy your Subnet, run http://127.0.0.1:9654/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc |

avalanche subnet deploy <subnetName>


+-------+----------+------------------------------------------------------------------------------------+
| node4 | mySubnet |
http://127.0.0.1:9656/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc |
+-------+----------+------------------------------------------------------------------------------------+
and select Local Network to deploy on. Alternatively, | node5 | mySubnet |
http://127.0.0.1:9658/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc |

you can bypass this prompt by providing the --local


+-------+----------+------------------------------------------------------------------------------------+
| node1 | mySubnet |
http://127.0.0.1:9650/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc |
flag. For example: +-------+----------+------------------------------------------------------------------------------------+

avalanche subnet deploy <subnetName> Browser Extension connection details (any node URL from above works):
RPC URL:
--local http://127.0.0.1:9650/ext/bc/SPqou41AALqxDquEycNYuTJmRvZYbfoV9DYApDJVXKXuwVFPz/rpc
Funded address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC with 1000000 (10^18) - private key:
56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027
Network name: mySubnet
Chain ID: 54325
Currency Symbol: TUTORIAL
Import Your Wallet in Core
Add Your Subnet
Reward Time
Tweet about your learning
1. Follow @AvaxDAO_

2. What did you learn?

3. How was your experience?

4. Tag @0xSarnavo @AvaxDAO_


@Avalanche_In @avax
(you may follow for more updates on opportunities)

5. Use hashtag #Avalanche9000


Reward Form
Questions & Discussion

You might also like