Season's greetings to everyone out there, I would love to join Prof. @pelon53 to congratulate each and everyone for reaching the last week of this season. This week's topic is Avalanche Blockchain and I'll try my best to give detailed answers to the test questions listed. If you reach the requirements, you could join me to do same by reading up the lesson on this link.
1.)
Explain in detail X-Chain, C-Chain and P-chain
The Avalanche protocol is built with a primary network. This network comprises of 3 seperate blockchains which have their different purposes and work together to improve the nature of the protocol.
- X chain
- P chain
- C chain
1.) X chain: On a normal blockchain, there is a need for blocks to be created in order to record all transactions made by its users and of the 3 blockchains on the Avalanche's primary network, the X chain also known as the exchange chain was created to take up this task. All operations like transfers, trading and creation of new ARC-20 tokens are managed on the X chain. Which means, nodes on the x chain take up the task to verify and validate all transactions made. Also, fees are paid with the blockchain native token AVAX.
The x chain was created to act as the Avalanche Virtual Machine source, which is a platform for trading and creation of ARC-20 smart assets. On the x chain, validation of transactions is done using the avalanche consensus algorithm. This algorithm is optimized with a directed acrylic graph (DAG), which processes and arranges transaction data in parallel.
2.) P Chain: The Avalanche blockchain is different from all other blockchains. It is sometimes called a platform of platforms, which means it allows the creation of subnets. Developers or organizations who have the need to create a blockchain for different purposes don't need to go the length of funding and waiting for the creation of a brand new one, rather Avalanche has provided the ability to create your blockchain on their blockchain using subnets.
The P chain, also called the platform chain is the blockchain on the Primary network created to handle this operation. Management of these subnets and coordination of validators on all these subnets are handled on the P chain. The p chain was created using the Snowman consensus algorithm. Users or clients who seek the need to create a subnet can choose a consensus algorithm for it, decide on its properties, selecting the number of nodes to be allowed on the subnet or either making it permissioned or permissionless. All these are accessed and validated by nodes on the p chain.
3.) C Chain: Since the Avalanche platform was created to support smart contracts, the c chain, also known as the contract chain was created to handle all operations leading to creation of decentralized applications on the blockchain. It was built using the Snowman consensus algorithm.
The C chain is also compatible with the Ethereum Virtual Machine (EVM), which means all tokens or dApps on the Ethereum platform can be supported on the Avalanche protocol. This really helps developers who want to transfer their dApps to the Avalanche protocol because they don't need to start recoding the dApp in another programming language, they just need to copy and paste the codes. For example, developers of a dApp like AAVE can simply transfer it to the Avalanche platform by copying the "solidity" codes used to build the AAVE protocol and pasting them.
2.)
Explore the Avax Network platform . Screenshots required
To explore the avax network platform you will need to load up avax.network on your internet browser.
Here is the home page for the official avax network platform. Above, I have highlighted a list of options that help provide more information about the Avalanche blockchain to its users. I will explain each of them and give screenshots.
Developer: When you click on the developer option, you will see two other options which are the Validator and Start building options.
Start building: Here programmers can develop their dApps and there are documents which help to guide these programmers on how to perform the task.
Launch your ethereum dApp: This is a document that guides you on how to launch a pre-existing dApp which was on the ethereum platform on the avalanche platform. You will be informed how to use the tools to export your solidity codes to the platform and also some disadvantages or risks you will need to consider before doing this.
Mint a token: This is a document which teaches programmers how to create tokens on the network.
Integrate an exchange
Developer Documentation: This is just the white paper of the Avalanche network, which contains all information you need to know.
Validators: This page contains information about on the staking condition on the avalanche network. From the image above, we can see that Validators have staked higher than the delegators with 197,987516 AVAX coins while the delegators have 28,294,466 AVAX coins staked on the network. Also, there are 1,195 validators and 15,054 delegators who will rewards staking rewards of 9.79% at the end of the year.
From the image above, we can see that, the avalanche network offers its validators a no slashing rule, which means in situations where validators operate maliciously, this staked coins won't be slashed rather they would lose staking rewards. Also, validators don't need to have high performance computers like the POW consensus, rather they can use lighter hardwares to validate blocks.
On the right hand side, we will also see that, the minimum AVAX to be staked for delegators is 100 AVAX to receive daily rewards of 0.03 AVAX, monthly rewards of 0.82 VAX and yearly rewards of 9.79 AVAX.
AVAX Tokenomics: On the individuals page, you will see a section below which analysis the AVAX token. From the image above, we will see that, the current price is $89.31, market cap is $21,798,285,423, trading volume on all platforms is $840,723,265, the amount staked on the network is 59.76% of all AVAX tokens in circulation. Also, half of transaction fees are burnt to help reduce inflation of the token. Since launch, a total of 619,173.42 AVAX tokens have been burnt.
AVAX is also available on
- Binance
- FTX
- OKEX
- Huobi
- Gate.io etc.
and also available on the following wallets
- Avalanche wallet
- Frontier
- Ledger
- DCENT.
Solutions: Here, the use cases of the Avalanche blockchain is displayed. From the image above, we can see that Avalanche supports
DeFi products: offering compatibility with Ethereum assets, faster transaction speeds and lower fees. DeFi application currently available are Pangolin, Sushiswap, Snowball and TrueUSD.
Institutions, Enterprises and Government: Avalanche offers a decent protocol for various institution to build decentralised softwares to help run organisation. These institution can launch token assets offering an ICO to help produce capital for their business and also create and customise subnets on the platform based on what they desire. There are currently enterprises like Congress of Quintana Roo and Ryval who are patronizing subnets on Avalanche.
NFTs: Avalanche also supports metaverses and NFT projects, transaction of these NFTs are done quickly due to high throughput on the platform and transaction fees are also cheap.
The Avalanche Ecosystem: This page displays all decentralised applications that are running on the Avalanche platform. Ranging from DeFi to Gaming dApps, Explorers, trading bots etc. There are also some applications like Aave, Avalaunch, Avascan etc. Developers can also submit substantial applications about to be launched on this page.
Avalanche Wallet: Everybody knows what a wallet is. The avalanche wallet is used for storing ARC 20 and ERC 20 compatible tokens. You can receive send and stake your AVAX tokens here.
After loading the avalanche wallet page, you need to click on *Create New Wallet.
On the next page, click on Generate key Phrase to produce a unique set of phrases for your account.
Your key phrase will be genrated. You can copy it into a note book but try to keep the key safe because if lost, you lose whatever amount of tokens the wallet holds. Click thecheck box and select access wallet.
You will be prompted to fill in the key phrases that are missing. This is a test to ensure you copied the words correctly. Click on the verify button.
Once you filled in your key phrases correctly, you have successfully created a wallet. Click on access wallet.
You can now see your wallet, if you need to add tokens, you can click the add token button below.
Avalanche Explorer: On the avalanche explorer, you can see all transactions that go on in the primary network, from the c chain, p chain or x chain. You can also see the senders and receiver's wallet address there.
Avalanche Bridge: The bridge is a protocol that helps users transfer tokens from one network to another. This is not possible with our normal decentralised wallet. For example, using our trust wallet or metamask, USDT which was stored on an ERC 20 address cannot be transferred to a BEP 20 address. But with the avalanche bridge, this is made possible, ERC 20 tokens like AAVE on the Ethereum network can be transferred to the Avalanche network with some fees.
I would love to explain to you how to connect our wallets to the Avalanche bridge. We will be using metamask.
After loading up bridge.avax.network, click on Metamask.
The metamask extension will appear on the screen prompting you to input your password.
Select the wallet you would love to use then click on next.
Click connect on the next screen
Your wallet is successfully connected to the avalanche bridge, you can now select an ERC 20 token to convert to the Avalanche network or click on the switch icon to convert the tokens back to the ethereum network.
Avalanch-X: On the Avalanche-x platform, developers who have ideas of new decentralized application can pitch their ideas to Ava Labs group in other to receive a grant to start building these applications. You just need to submit an application, if your application is selected, you receive a call then you will be approved to start building your dApp.
Explore Open grants: Here you can see a list of various types of decentralised applications with available grants.
Press: On the press section, users can view news that have been published about the Avalanche network. User can also send inquires by mail to the Ava Labs team.
Community: Here, users can discover various social media platform the Avalanche community has an account on. You can click the links of the platforms and you will be taken to the official account. Currently, the Avalanche community is on FaceBook, Twitter, Telegram, Discord, Forum, Reddit, LinkedIn, YouTube, Meetup and Clubhouse. On this social media platforms, users can ask questions and get quick responses about the Avalanche network.
Contact: Here, users who have requests or problems can seek aid from the Avalanche team by inputting their details, verifying they are human and sending a message to the team.
Well, that's all the features available on the avax.network official website. More information is available on documents and the whitepaper.
3.)
Show the last verified contract in the C-Chain network and show the Smart Contract that was generated at that address
To view the last verified contract, you will need to load up snowtrace.io.
On the home page of snowtrace.io, click on blockchain above then select Verified Contracts from the drop-down menu.
To view details of the first contract, click on the address as highlighted in the image above.
From the detail above, details of the latest smart contract are as follows:
Contract Address | 0x8C974dDeF4741AEe9b59C4727AA1b25480F1a705 |
---|---|
Balance | 0 AVAX |
AVAX Value | $0 |
Contract Creator | 0x1ae0543C8440e1aAa7c2FCD5Dcf7cb2c64911580 |
Transaction Hash | 0xc7f9c4f2694d1353b84250dd7ac0cac21735e44ff9dc91972223244ed0e19f4d |
Token Tracker | AvaRobots |
Contract Name | AvaRobots |
Compiler Version | v0.8.7+commit.e28d00a7 |
Below, all you would see about the contract is the contract source code which was written in solidity, the contract ABI, Contract Creation Code, Deployed ByteCode Sourcemap and the Swarm Source.
3.)
Explore the last block generated in the C-Chain network.
To view the last block generated in the C chain network, we will have to load up snowtrace.io.
From the home page of snowtrace.io, you can view the latest blocks which have been rather or for a larger view, click Blockchain* then from the drop down menu, clcik View Blocks.
When I loaded up this page, a new block was already created which means it takes the network, 1-3 secs to create blocks. To access the full details about the latest block, click on the block number as I have highlighted above.
Details of the block are in the table below
Block Height | 9309682 |
---|---|
Timestamp | 16 secs ago (Jan-08-2022 07:25:28 PM +UTC) |
Transactions | 45 transactions and 14 contract internal transactions |
Burned Fees | 0.206478432962301058 AVAX |
Difficulty | 1 |
Total Difficulty | 9,309,682 |
Size | 11,441 bytes |
Gas Used | 7,985,513 (99.82%) |
Gas Limit | 8,000,000 |
Base Fee Per Gas | 0.000000025 AVAX (25 nAVAX) |
Hash | 0x71561b4f31377a9343941398fd71017af2bf0258cb981b48a56d5c14ead34a4b |
Parent Hash | 0x01cd4fa11ff0febedd1c4a10a8fb17d0bd1e9dc2ab5be76fefa439fef35aba6f |
Sha3Uncles | 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 |
Nonce | 0x0000000000000000 |
5.)
Explain in detail the Avalanche consensus protocol and the Snowman consensus protocol
On the Avalanche network, there are two main consensus mechanism used in the three blockchains, which are the X chain, C chain and P chain. This consensus mechanisms are the Avalanche consensus and the Snowman consensus.
Avalanche Consensus Protocol: The avalanche consensus protocol is the protocol used in the X chain blockchain. Like I explained above, all data is arranged in parallel and this is because of the directed acrylic graph DAG system which is used in this protocol. Validators still has to buy their way to become nodes by staking on the network just like the POS consensus.
On the Avalanche protocol, the level of decentralization is higher than that of the POS because for the creation of new blocks to occur, there is no need for a particular validator to be selected rather all nodes validate transactions together and this increases the throughput and reduces latency of the network, hereby solving the blockchain trilemma. Producing high level of decentralization, high scalability and a good security for all its users.
The avalanche consensus protocol also uses a strategy term as gossip where validators come together in groups to criticize what other validators did in contributing to the creation of a block and if any validator is noted to be performing malicious operations, he wont receive block rewards from the network. This makes staking on the Avalanche network good because your stake won't be slashed rather you will be denied of rewards.
Snowman Consensus Protocol: The snowman consensus is the protocol used in the C chain and P chain blockchains. It is a new type of consensus produced by Ava Labs and the difference between the Avalanche consensus and the Snowman consensus is that the Snowman consensus is Linearlized.
The consensus was actually linearlised so that it can meet up with the needs and requirements of the Ethereum Virtual machine. The snowman protocol was creation for the production of smart contracts on the C chain and an overall high level of throughput for transactions.
- The snowman consensus has the capacity to process 4,500 transactions per second
- The level of security is higher than other networks because a hacker needs more than 51% of the blockchain native tokens to crack the network.
- Offers the ability for institutions or government to build public or private blockchains using the subnet features. They can also select any consensus mechanism they would love to use in their blockchains.
The Avalanche blockchain brings a new generation of consensus mechanisms which tries to solve the blockchain trilemma, offering its users a moderate rate of all features of decentralized platforms. It also offers its users the opportunity to set up their own blockchains customizing them to fit their desires.
Currently, the AVAX token is ranked as the #11 in the world and I believe the platform has higher potentials in future.
Thank you Prof. @pelon53 for this wonderful lesson.