Avalanche Blockchain - Crypto Academy / S5W8 - Homework post for pelon53.

in hive-108451 •  4 months ago  (edited)

ScreenShot_20220103080622.jpeg

ScreenShot_20211115002328.jpeg

(1) Explain X-Chain, C-Chain, and P- chain in detail.

(2) Explore the Avax Network platform. Screenshots required.

(3) Show the last contract verified in the C-Chain network and show the Smart Contract that was generated at that address. Screenshots required.

(4) Explore the last block generated in the C-Chain network. Screenshots required.

(5) Explain in detail the Avalanche consensus protocol and the Snowman consensus protocol.

ScreenShot_20211115002328.jpeg

INTRODUCTION: Good day @pelon53 and every member of this great community. Welcome to my homework post for the last week of season 5. I wish us all the very best of this forthcoming holiday.

ScreenShot_20211115001108.jpeg

(1) Explain X-Chain, C-Chain, and P- chain in detail.

ScreenShot_20211115001108.jpeg

The Avalanche Network in the spite of enhancing scalability without compromising on decentralization make use of three blockchains which are the X-Chain, C-Chain, and P-Chain. is made up of

The X-Chain is the acronym for Exchange Chain, the P-Chain is the acronym for Platform Chain, and C-Chain is the acronym for Contract Chain. These chains are the three (3) built-in blockchains on Avalanche. All these 3 blockchains are validated and are as well secured by the primary network which is a unique subnet in which all participants or members of the primary network must stake AVAX.

ScreenShot_20211115004005.jpeg

Exchange Chain (X-ChaIn)

ScreenShot_20211115004005.jpeg

Exchange-Chain is a decentralized platform used for the creation and trading of digital smart assets, a representation of a real-world resource such as equity, bonds, etc. X-Chain makes use of the Avalanche consensus protocol and it is characterized by a set of rules that govern or guide its behavior. The X-Chain is a piece of evidence of the Avalanche Virtual Machine (AVM).

The Virtual machine specifies the state of the blockchain, the transition function’s state, the transactions, as well as the API with which users can interact with the blockchain. Also, every blockchain on Avalanche is proof of a VM.

AVAX is one of the assets that is traded on the X-Chain. Whenever one makes a transaction on Avalanche, the transaction fee is paid using AVAX which is the native token of the network. Also, the X-Chain API grants users or clients the ability to create and trade assets on the X-Chain.

Summarily, X-Chain makes use of Avalanche consensus protocol, its transaction fees are paid in AVAX.

ScreenShot_20211115004005.jpeg

Platform Chain (P-ChaIn)

ScreenShot_20211115004005.jpeg

P-chain is an acronym for Platform chain which is the metadata blockchain on Avalanche that does the coordination of validators, keeps track of all the active subnets, and that also empowers or enables the creation of new subnets and the staking mechanisms.

Subnets are groups of validators that provide consensus for custom blockchains. We should know that a blockchain can only be validated by just one subnet but a subnet can validate multiple blockchains. The Platform chain makes use of the Snowman consensus protocol.

The P-Chain API grants users or clients the ability to create subnets, add validators to subnets, and also create blockchains.

ScreenShot_20211115004005.jpeg

Contract Chain (C-ChaIn)

ScreenShot_20211115004005.jpeg

The C-Chain also makes use of the Snowman consensus protocol and is a piece of evidence of the Ethereum Virtual Machine powered by Avalanche.

The C-Chain API grants users or clients the ability to create smart contracts for decentralized applications and to execute Ethereum Virtual Machine (EVM contracts).

With each of these blockchains taking on different roles, Avalanche network improves speed and scalability without compromising decentralization and the developers have combined this aspect with two different consensus protocol which is used by each blockchain according to their needs.

Also, Avalanche's native token AVAX is the token that is used by all of these blockchains built on the network and it is what is required of every member or user to stake and to pay network fees, this consequently gives the ecosystem a common usable asset between different Avalanche subnets.

ScreenShot_20211115001108.jpeg

(2) Explore the Avax Network platform. Screenshots required.

ScreenShot_20211115001108.jpeg

To explore the Avax Network platform, I go to Avax Network.

On the homepage we can see the Developer tab, Individual tab, Avalanche X tab, Press tab, Community tab, Contact tab, Build Now tab, Join Discord. Some of these tabs also have subsections all these we are going to explore one after the other.

ScreenShot_20220107235809.jpeg

Still on the homepage, scrolling down further, we can see the things that are possible with Avalanche which is an open, programmable smart contracts platform for decentralized applications (Dapps). Below are some of the things that are possible with avalanche as can be seen in the follow-up image.

  • One can build fast, low cost, Solidity-compatible decentralized applications.

  • One can launch customized blockchains, private & public.

  • One can scale to millions of validators with minimal hardware.

ScreenShot_20220107235843.jpeg

On further scrolling, we can see the section where we can read news about Avalanche.

ScreenShot_20220108000028.jpeg

We can see those who had built or that are building on Avalanche and they are what makes up the Avalanche ecosystem. Below are some of the kinds of project that has been built on Avalanche.

ScreenShot_20220108001825.jpeg

  • DeFi: The DeFi projects are Aave, Avalaunch, BENQI, Curve, DeBank, KUU, Lydia Finance, Markr, Pangolin, ParaSwap, Penguin Finance, Snowball, Sushiswap, Trader Joe, Verso Finance, Yay Games, CyberFi, DCTDao, DeFi Yield Protocol (DYP), Dexalot, E, Money, Elk Finance, Float Capital, Frax, Frontier, Hummingbot, HurricaneSwap, ImmuneFi, InsurAce, Knit Finance, Kyber, Marginswap, MyCointainer, Nexo, OIN, Onomy, OpenOcean, Orion Protocol, Pendle, Poolz, Prosper.

ScreenShot_20220108003406.jpeg

  • Digital Securities: The Digital security project is Securitize.

ScreenShot_20220108003428.jpeg

  • Ecosystem: The Ecosystem projects are Avalaunch, Blockchain Academy Chile, Blockchain Game Alliance, Blockchain Research Institute, DappRadar, Encode Club, LACChain, Proof of Learning (PoL).

ScreenShot_20220108003455.jpeg

  • Exchange:

ScreenShot_20220108003928.jpeg

  • Explorer: The Explorer projects are Avalanche Explorer, Avascan, Vscout.

ScreenShot_20220108003947.jpeg

  • Gaming: Crabada

ScreenShot_20220108004205.jpeg

We also have the Identity, Infrastructure, NFT, Nodes, Oracle, Payments, Play to Earn, Security, Stablecoin, Tooling, Trading Bot, Wallet, and Wealth Management projects.

On further scrolling, we can see the table that shows the comparison between Avalanche, Bitcoin, Ethereum, Pokaldot.

ScreenShot_20220108000148.jpeg

On further scrolling, we can see the section where we can build solidity Dapps without limits since Avalanche is solidity-compatible.

ScreenShot_20220108004813.jpeg

We also have the section where we can see all the solutions powered by Avalanche, the use cases benefit to Decentralized Finance (DeFi), Institutions, Enterprises, and Governments, and Digital Collectibles.

ScreenShot_20220108005157.jpeg

ScreenShot_20220108005208.jpeg

ScreenShot_20220108005220.jpeg

We can Create Avalanche wallet, Open Avalanche in browsers, See the 2021 roadmap, and See about the AVAX token.

ScreenShot_20220108000304.jpeg

Lastly on the homepage, we can join Avalanche community.

ScreenShot_20220108000241.jpeg

Now, let us go through each tab one after the other.

Developers

In this tab, we have two subsections which are Validators and Start building. Here, we can launch Ethereum Dapp, run a Validator, mint a Token, Integrate an Exchange, or access Developer Documentation.

ScreenShot_20220108011605.jpeg

We can as well see why we should build on Avalanche and the reasons are,

ScreenShot_20220108011918.jpeg

  • It is Solidity-compatible. i.e. it can easily launch Ethereum Dapps.
  • It exhibits Fast Transactions.
  • It is Highly-Scalable as it Processes thousands of transactions/seconds.
  • It is Secure.
  • It Scales to millions of validators.
  • Both Private & public blockchains and subnets with custom rules can be created.
  • Virtual Machines (VMs) can be deployed.

We can access the 3 built-in blockchain

ScreenShot_20220108012006.jpeg

We can see what are those things that we can build on the network which are,

  • Solidity Dapps: Decentralized apps written in Solidity are fully compatible with Avalanche.
  • Fixed Cap Assets: Fungible assets with fixed capital. asset's total number changes over time.
  • Variable Cap Assets: Fungible assets with variable capital. i.e., the asset's total number changes over time.
  • Non-Fungible Tokens (NFTs): An asset or collectible that represents something unique.
  • Subnets & Custom Blockchains: Build a custom blockchain implementation with logic that fits your use case.

ScreenShot_20220108012026.jpeg

We can see the Avalanche downloads and Accelerator

ScreenShot_20220108012045.jpeg

ScreenShot_20220108012112.jpeg

Validator subsection

Here we can become a validator by clicking on the button shown in the image below.

ScreenShot_20220108011734.jpeg

We can see the Validator's status

ScreenShot_20220108011709.jpeg

We can also see the reasons why we can be a validator which are,

  • There is Staking Rewards: One can earn up to 11% APY on staked AVAX
  • Secure a Growing Network: This is a result of new applications and assets that are been built and launched daily on Avalanche.
  • No slashing: Unlike many other platforms, the staked tokens on the Avalanche network are not or never at the risk of slashing.
  • It requires Low Hardware.

ScreenShot_20220108011807.jpeg

We can as well access the staking calculator here as shown above.

Individual

Here, we have Roadmap, Solutions, Ecosystem, Avalanche Wallet, Avalanche Explorer, and Avalanche Bridge.

ScreenShot_20220108015448.jpeg

One can create a wallet or access his or her wallet from this section.

ScreenShot_20220108015713.jpeg

We can see the AVAX token price statistics, compatible exchanges, and compatible wallets.

ScreenShot_20220108015736.jpeg

  • Roadmap: Here we can see the road map from Q1 2021 - Jan to Mar to Q4 2021 - Oct to Dec.

ScreenShot_20220108015514.jpeg

  • Solutions: This has been explored earlier while exploring the homepage.
  • Ecosystem: This has also been explored earlier.
  • Avalanche Explorer: Here we can view all Avalanche activities such as all transactions, blocks, addresses, Home, Subnets, Validators, Tokens, Blockchains' Stats, C-Chain, Status, and Resources.

ScreenShot_20220108021059.jpeg

  • Avalanche bridge: Here we can transfer Avalanche assets to another network that supports the asset.

ScreenShot_20220108021117.jpeg

Avalanche-X

Here, we have the Explore Open Grants and Submit a General Proposal subsections. To maximize the impact on one's Dapps, Avalanche developer community, resources, and grants are made available and can be accessed from this tab.

ScreenShot_20220108022046.jpeg

Explore Open Grants

ScreenShot_20220108022116.jpeg

ScreenShot_20220108023256.jpeg

  • Decentralized Exchange: Here, we can learn more about how to build a secure, easy-to-use decentralized exchange on Avalanche.
  • Lending: We can learn more on how to build a safe, non-custodial lending solution on Avalanche.
  • Stablecoin: We can learn more on how to build the next-generation stablecoin on Avalanche.
  • Synthetics and Derivatives: We can learn more on how to build robust decentralized synthetics and derivatives.
  • Volatility Index (VIX): We can also learn more on how to create an application that measures volatility on Avalanche.

Submit a General Proposal

ScreenShot_20220108022100.jpeg

Press

In this tab, we have ** Press inquiries and Press Kits and Media Assets** subsections.

ScreenShot_20220108023742.jpeg

We can read Avalanche in the news.

ScreenShot_20220108024140.jpeg

We can also see the Press Kits and Media Assets

ScreenShot_20220108023809.jpeg

Community

In this tab, we can join the vibrant, international community building on Avalanche.

ScreenShot_20220108024502.jpeg

ScreenShot_20220108024829.jpeg

ScreenShot_20220108024901.jpeg

We can join the Avalanche hub which is a community growth platform that is building an inclusive environment for all aspects of Avalanche by clicking on Register now.

ScreenShot_20220108024612.jpeg

Contact

In this final tab, we can send a message to Avalanche by filling the contact us form.

ScreenShot_20220108025210.jpeg

ScreenShot_20211115001108.jpeg

(3) Show the last contract verified in the C-Chain network and show the Smart Contract that was generated at that address. Screenshots required.

ScreenShot_20211115001108.jpeg

To Check the latest verified contract on the C-Chain. I open Snowtrace website.

  • I clicked on Blockchain and then clicked on verified contract as shown below.

ScreenShot_20220108033403.jpeg

On clicking on the verified contract, a list of the verified contracts was displayed.

ScreenShot_20220108033659.jpeg

And on clicking on the address, the contract properties were displayed.

ScreenShot_20220108034311.jpeg

The table below shows the properties of this verified contract.

Contract Name StakingHelper
Contract Address 0x2BCeA9603178f21ed4ec8bd62F1fB18343245Fe8
Contract Creator 0x67dCf449248290D44AB91463b9c088Bd481C2b1D
Creator Transaction Hash 0xb01be4433f683142d66ec2453507819e02abadf70ef6ef18958d13dfc738cf6b
Balance 0 AVAX
Compiler Version v0.7.5+commit.eb77ed08
Optimization Enabled No with 200 runs
Other Settings default evmVersion, MIT license

ScreenShot_20211115001108.jpeg

(4) Explore the last block generated in the C-Chain network. Screenshots required.

ScreenShot_20211115001108.jpeg

To explore the last block generated in the C-Chain network as at the time of doing this assignment, I go to Avalanche Explorer.

  • I clicked on C-Chain as shown below.

ScreenShot_20220108030026.jpeg

  • I clicked on Blockchain and then clicked on View block in the drop-down box.

ScreenShot_20220108033347.jpeg

ScreenShot_20220108030212.jpeg

ScreenShot_20220108030303.jpeg

As can be seen in the two images above, the block has the following features.

  • Block height: The block height which indicates the length of the blockchain is 9278400.

  • Timestamp: The Timestamp which is the time and date the block was validated is Jan-08-2022 02:01:37 AM +UTC.

  • Transactions: The number of transactions in the block is 4.

  • Burned Fees: The amount of AVAX burned on the block is 0.0541163525 AVAX.

  • Difficulty: The Difficult which is the amount for mining the block is 1.

  • Total Difficult: The total difficulty until this block is 9,278,400.

  • Size: The size which is determined by the block's gas limit is 2731 bytes.

  • Gas Used: The total gas used is 1,160,585 (14.51%).

  • Gas Limit: The Total Gas Limit provided by all transactions in the block is 8,000,000.

  • Base Fee Per Gas: The Base Fee Per Gas which represents the minimum gas price required for a transaction to be included in a block is 0.000000025 AVAX (25 nAVAX).

  • Hash: The Hash of the block header is 0xee1cc68f668d74b751d58b16dfa9c0908c6935c00e77c6684f41486d6a73525e.

  • Parent Hash: The hash of the block from which this block was generated from is 0xf97c10dd6c4b7e7121e104c4c17b1f46d5264c7ad9c2058dfb186dd9beaa9b76.

  • Sha3Uncles: The mechanism which Snowtrace JavaScript's RLP encodes an empty string is 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347.

  • Nonce: The Nonce which is a value used during mining to demonstrate the Proof of Work for a block is 0x0000000000000000.

On clicking on Parent Hash, it will take us to block 9,278,399 properties.

ScreenShot_20220108032548.jpeg

ScreenShot_20211115001108.jpeg

(5) Explain in detail the Avalanche consensus protocol and the Snowman consensus protocol.

ScreenShot_20211115001108.jpeg

What is consensus? Consensus can be defined as a technique or method by which a series of independent voters who are sometimes referred to as validators come to an agreement on a decision.

What is Avalanche consensus protocol? The Avalanche consensus protocol does not require a leader in reaching consensus unlike the Proof of Work, Proof of Stake, etc. and this makes the network pretty much decentralized without compromising its scalability features.

Avalanche consensus protocol makes use of all nodes in processing and validating transactions having implemented an optimized consensus protocol known as Directed Acyclic Graph (DAG) which allows the network to process or validate transactions in parallel. Validator poll other validators randomly to check and determine whether a new transaction is valid and after enough or adequate repeated random subsampling, it is statistically or probabilistically proven that a transaction will be determined to be true. This enhances transaction throughput to 6500 TPS and also provides a sub-one-second finality time.

Afterward, all transactions are then finalized immediately without confirmation.

The Snowman consensus protocol builds on or let me say is a modified or enhanced version of the Avalanche consensus protocol. The only difference is that it orders transactions linearly which is very useful when dealing with smart contracts. Also, Unlike the Avalanche consensus protocol, the Snowman consensus protocol creates blocks and it was designed mainly to power smart contracts.

ScreenShot_20211115004005.jpeg

How Avalanche Consensus Works

ScreenShot_20211115004005.jpeg

This is just to buttress what has been explained earlier.

Avalanche protocol is a voting protocol and what validator does is listen for transactions and subsequently vote on whether the transaction is to be accepted or rejected. If a transaction seems virtuous to a validator, it will e accepted and if it isn’t, it will be rejected. What happens next is that after a validator has made an initial decision to either accept or reject a transaction, the rest of the network will also check if the decision is to be accepted or rejected also.

This kind of voting process is what makes Avalanche network unique. Validators are fully independent when making decisions and there is no leader election. Also, the term repeated random subsampling can be defined as the process used in determining whether a transaction will be accepted or rejected.

In more detail, below are the steps by steps of how it works.

  • Issued transactions are presented to a validator to determine which of the transaction to accept.

  • The node clients will then present the transactions to the virtual machines which will provide information to help the client in determining which of the transactions is acceptable.

  • The validator will then select some of these transactions that do not conflict, mark them as preferred, and then try to accept them over the network.

  • Any nodes that probe this validator receive its current preferred choice for this decision.

  • Each validator that probed this decision will respond with their preferred decisions and the validator’s votes are then updated accordingly and while doing this, from the validator set, other nodes also select random validators to be queried for their preferred response.

  • These processes continue for enough rounds to build enough or adequate confidence and once the confidence threshold has been reached, the transaction decision will be locked in as final.

  • If the transaction was accepted, it will be sent to the virtual machines to be worked on but if it was rejected, the transaction will be removed from the consensus.

The image below is an illustration of how Avalanche protocol works.

ScreenShot_20220107232311.jpeg

ScreenShot_20211115004005.jpeg

CONCLUSION

Avalanche network is characterized by 3 blockchains which are X-Chain, P-Chain, and C-Chain. it is attractive due to its EVM compatibility and low transaction fees.

X- Chain makes use of Avalanche consensus protocol while both C-Chain and P-Chain make use of the Snowman consensus protocol.

The difference between the two protocols is that the formal work in parallel to check the transaction confirmations of other validators at random while the latter work linearly to check the transaction confirmations of other validators at random.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...