Sidechains - Crypto Academy / S4W8 - Homework post for pelon53.

in SteemitCryptoAcademy3 years ago

Screenshot_20211030-214146.png

image edited with Canva

QUESTION 1

EXPLAIN IN DETAIL THE SIDECHAINS WITH THE USE OF ZK-ROLLUPS.

The rise in awareness and Knowledge of blockchain technology and the adoption of its services, most especially Ethereum that offers decentralized, open source and smart contract functionality has birthed a whole lot of advantages and innovation to the world at large. However, this rise in adoption has its disadvantages also, and this disadvantages includes but not limited to Saturation, and congestion of the blockchain network.
The problem of saturation and congestion is leading to a negative user experience and tis birthed the opportunity for an alternative. However, this alternative is not aimed at competing with the already existing blockchains, rather its aimed at complementing them, by bettering them and proffering a positive user experience while interacting with them.

I guess, this sound interesting right? Now what are those things that complements and proffer a positive user experience in the course of interacting with blockchains. They are simply known “Sidechains”
OK, so they are sidechains... You still don’t get it right? Join me as I give a more detailed explanation below

HOW DO I GRASP THE CONCEPT OF SIDECHAINS?

Its best to see sidechains as a faster, easier and cheaper alternative to getting to a destination. Does this make sense to you? So an example; Let’s say you have 30mins to get to point B from A, that is if you drive a car and you don’t encounter traffic on the road, however if you encounter traffic on the road, there’s a high possibility of spending up to an hour. Now, there’s an alternative route where you can spend less than 15mins to get to our destination. Will you take the faster, easier and cheaper route or not? Of course, yes. Hence, a sidechain is a secondary blockchain, which is connected to the main blockchain with a two-way peg (that means the process is reversible) with the sole purpose of enhancing user experience while in the course of interacting with the main blockchain.

HOW DOES SIDECHAINS FUNCTION?

Now, remember the example I gave earlier, now let’s relate it to the blockchain for proper understanding, so for instance you intend to send out a crypto out of a centralized exchange to a decentralized exchange for an urgent transaction, however this transaction will take approximately 30mins to confirm the transaction, and will cost you about $20. However, there’s another means that will is aimed at complementing the former by offering a faster transaction for 5mins and it will cost $1 to confirm the direction. This is exactly what a sidechain does.

So the idea that they are competing with main blockchain projects is a myth and not true. For a matter of fact, there goals and total existence are built around an existing blockchain. They are aimed at improving the services of the existing blockchain.

Hence, we can now say sidechains functions as a separate blockchain which usually acts as an extension to the parent blockchain. The parent blockchain in this case refers to the mainchain.

THE SIDECHAIN PROCESS ARE AS FOLLOWS;

A user deposits his cryptocurrency into a mainchain, immediately it gets there, it is locked until it is proven or confirmed to not be in use in another chain. This is done through a transaction to a smart contract. The smart contract in this case emits what is termed as an event, which in turn will be picked up by the off chain process. The off chain process is responsible for taking care of that event and therefore create a transaction that will pass the information to the smart contract in the opposite blockchain in a form that will allow verification of the event’s validity. Once the validity of the event is verified, the smart contract in the opposite blockchain now releases and transfer the cryptocurrency to the user. It’s that simple to understand.
Now remember a sidechain is a secondary blockchain, which is connected to the main blockchain with a two-way peg, this implies the operation can as well be done in both directions, which gives us the leverage to use both the mainchain and the sidechain interchangeably. Also, they have their own consensus protocols, which could be completely different from the main chain’s protocol

WHAT ARE THE BENEFITS OF USING SIDECHAINS?

The benefit of using sidechains includes but not limited to the following;
The sidechain is aimed at complementing the mainchain by lessening its burdens; we all know the waiting time for the confirmation of a block could be too big or even expensive to process. Hence, sidechains are aimed at attacking the problem of saturation by rescuing and complementing blockchains to ensure the process of storing data and processing transactions are faster and cheaper, this is so as to maintain their integrity and boost user’s confidence and experience.
Sidechains allows new and what is termed to be potentially unstable software to get deployed and tested on a sidechain. So in a situation the software therefore causes harm to the blockchain the damage is contained within the sidechain.

WHAT ARE ZK ROLLUPS?

ZK Rollups are layer 2 scaling solution in which all funds are been held by a smart contract on the mainchain. Remember from the class, you made mention of Plasma as the addition to which polygon uses to create a two-way communication with the Ethereum ecosystem. Hence, Plasma is the name given to the construction of scalability method that places layer 2 blocks on top of the Ethereum blockchain in form of sidechain.
The introduction of plasma to the process in creating a two-way communication gives the opportunity for hundreds of sidechain transaction to be processed offline with only a single hash of the sidechain block being added to the Ethereum blockchain. However, this does exist without flaws. These flaws are capable of preventing further scalability. Hence, this is the reason that brought about the development of ZK rollups, which is in other to provide a more user friendly and less resource intensive to improve layer 2 scalability. Hence the difference between ZK Rollups and plasma is that Plasma creates one transaction per transfer while ZK roll ups bundle hundreds of transfers into a single transaction.
ZK Roll ups, which is also known as “Zero knowledge’ Roll ups is used to present and publicly record the validity of the block on the Ethereum blockchain. Zero knowledge roll ups reduces computing and storage resources for validating the block by reducing the amount of data held in a transaction.

HOW DOES THE ZK ROLLUPS FUNCTIONS?

So the ZK-Rollup is made up of two types of users, these users are known as transactors and relayers. I guess you are wondering and asking yourself “How does this function?”
Well, the transactors create their transfer and broadcast the transfer to the network. The transfer data consists the following; an indexed to and from address, a value to transact, the network fee to charge, and nonce. Which are further explained as;

  • A shortened 3 byte indexed version of the address reduces processing resource needs.

  • The value of the transaction being greater than or less than zero creates a deposit or withdrawal respectively.

  • The smart contract records the data into a merkle tree and transfer amounts in another.

The smart contract on chain which maintains a state root; the Merkle root of the state of the rollup, which implies the account balances, contract code that are inside the rollup.
Basically anyone can publish a batch, which is known as a collection of transactions in a highly compressed form together with the previous state root and the new state root (Merkle root after processing the transactions). The contract checks that the previous state root in the batch matches units’ current state; if it does it switches the state root to the new state root.
This is done so as to support depositing and withdrawal, they added the ability to have transactions whose input or output is outside the rollup state. If a batch has inputs from the outside, the transaction submitting the batch needs to also transfer these assets to the rollup contract. For instance, if a batch has outputs to the outside, then upon processing the batch the smart contract initiates those withdrawals
So aside the ZK rollups, another rollup exists and it’s known as an Optimistic Rollup, but that’s not the course of study at the time. What is most important is that, two types of rollups exist and they are known as the ZK rollups and the Optimistic Rollups

As every system has its advantage and disadvantages, so does the ZK Rollups and I will be highlighting some of its advantages and disadvantages below;
Relayers usually collects a large amount of transfers to create a rollup. Kindly note that, it is the relayers job to generate the SNARK proof and the SNARK proof spoken about here is a hash that represents the delta of the blockchain state, while state refers to a snapshot of it.

ADVANTAGE OF ZK ROLLUPS.

  • It offers the opportunity of a faster transaction, for a matter of fact, it’s faster than optimistic rollup and as well plasma.

  • It encourages the adaptation of decentralization as blocks will be computed in a parallel computing model.

  • As a result of the less data contained in each transaction increases through put and scalability of layer 2 solution.

  • It doesn’t encourage, accept or require the fraud game verification like optimistic rollups, which can delay withdrawals by up to two weeks.

DISADVANTAGE OF ZK ROLLUPS.

  • The quantum computing process which is usually the method of computing poses a threat to hacking the blockchain.

  • The difficulty in computing zero knowledge proof will require data optimization to get maximum throughput.

  • The security scheme assumes a level of unverifiable trust.


QUESTION 2

EXPLAIN THE LIQUID NETWORK SIDE CHAIN
LIQUID NETWORK SIDECHAIN.

Remember I have spoken about what sidechain is in the previous section. However, I’ll briefly recap on what sidechain is; Sidechain is a secondary blockchain, which is connected to the main blockchain with a two-way peg (that means the process is reversible) with the sole purpose of enhancing user experience while in the course of interacting with the main blockchain. Now we are refreshed on what sidechain is, sol

what is a Liquide network sidechain?

A liquid network is a sidechain based settlement network that enables faster, more confidential bitcoin and tether transactions, and provides issuance of digital assets as well. The liquid network is built on the elements code base and further uses block streams federation technology to support the one to one exchange of bitcoin between chains.

As a sidechain of bitcoin, Liquid allows you to move Bitcoins between the bitcoin main chain and the liquid sidechain through verifiable 1 to 1peg. This liquid network is primarily designed to improve the efficiency of the cryptocurrency trading market, which implies that their users are usually retails traders, exchange platforms, over the counter trading desks and asset users.
We might want to further understand what liquid network sidechain is used for. Below is a list of what liquid network sidechain is used for;

  • Liquid Network sidechain is used to improve the confidentiality of Bitcoin transactions.

  • Liquid network is used to issue new assets i.e. liquid network sidechain gives the ease for anyone to issue assets on it, so this implies the likes of utility tokens, security tokens, stable coins and non-fungible tokens can be issued on liquid, because they all enjoy the same speed and confidential features as liquid bitcoin.

  • Liquid network sidechain facilitates faster bitcoin transaction.

  • Liquid network sidechain improves the confidentiality of bitcoin transactions.

  • liquid network sidechain gives the opportunity for a more efficient arbitrage. Hence it is used for arbitrage.

  • Liquid network sidechain reduces front run risk for large trades, by not making transaction amounts of large over the counter trades visible o third parties on the liquid blockchain, which is a good thing because it prevents competitors from acting on the information before settlement.

The liquid network sidechain does not exist without having a special type of asset. This will be discussed below;

WHAT IS THE SPECIAL ASSET OF THE LIQUID NETWORK SIDECHAIN?

The liquid network sidechain has a special type of asset known as the Liquid Bitcoin. The liquid bitcoin supply is verifiably backed 1 to 1 with bitcoin held on the bitcoin mainchain. Liquid Bitcoin is usually created whenever Bitcoin is moved out of the network. The process of moving Bitcoin out of the mainchain to the liquid sidechain is generally referred to as a peg in, and the process of moving Bitcoin out of Liquid sidechain to the mainchain is known as Peg out. Asides from the general use of Liquid Bitcoin in trading, Liquid Bitcoin is also used and generally needed in the payment of transaction fees when transacting any type of asset on liquid.

HOW DOES LIQUID WORK?

The general running of liquid network is done by Liquid federation. The liquid federation are made up by a group of leading exchanges, trading desks, wallet providers, payment processing service, and other financial institutions. No single member of this liquid federation has control over the network. Unlike on Bitcoin, blocks are signed by 15 liquid functionaries in a round robin. Wondering what liquid functionaries are? Well, for your notice liquid functionaries are basically specialist hardware units operated by a subsection of the liquid federation, which are geographically dispersed around the world. Here is a screenshot that shows the liquid federation members.

IMG-20211030-WA0075.jpg

It is important to note that, while anyone can run a liquid node and verify the state of the network, the liquid functionaries are the “beating heart” of the network, signing transactions, generating bocks, and securing the BTC held by the network.

Below is a screenshot to further buttress how the liquid network works.

IMG-20211030-WA0080.jpg

HOW TO GET STARTED WITH LIQUID

  • Download Liquid wallet; This is the best approach to getting started, you need to download a liquid wallet, because this would be the most easily accessible means for users to get started with the sending and receiving of the special user. However, to getting a liquid wallet you need to download a Blockstream Green. A screenshot is shown below to illustrate this

IMG-20211030-WA0079.jpg

  • Acquire Liquid Bitcoin: You have to connect to the network, then purchase small amounts of Liquid Bitcoin with either a debit card or an Apple Pay on the official liquid Network site. You can as well convert Bitcoin to Liquid Bitcoin on various exchanges’ as well as through peer to peer trading platforms.

  • Run a Liquid Node: anyone can permissionlessly validate the information on the liquid sidechain by installing a Liquid node. You can as well use your liquid node to initiate a peg in or issue an asset.

  • Get integrated: You don’t need to be a Liquid member to offer Liquid-based features to your users. Check our technical documentation for basic details on how to start integrating your platform or application.

  • Join as a member: The Liquid Federation comprises key industry participants such as exchanges, OTC desks, wallet providers, and payment processors. If you are interested in joining, you might have to submit your interest through the liquid network official site.


QUESTION 3

SIDECHAINS:

DESCRIBE THE STEPS TO CONNECT THE METAMASK WALLET AND THE POLYGON NETWORK WALLET.

In connecting the Metamask wallet and the polygon wallet, we need to set up these wallets first before we can commence with anything. However, there’s a need to explain what these wallets are

WHAT IS A METAMASK WALLET?

Metamask is known to be a software cryptocurrency wallet used to interact with the Ethereum blockchain. It allows users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications.

HOW TO CONNECT METAMASK?

Here are the steps to connect Metamask with screenshots to give a clearer view;

  • You need to search for Metamask through their website (www.metamask.io) on your search engine i.e. google. Then it brings you to the screenshot below;

IMG-20211030-WA0076.jpg

  • You need to download the Metamask app for those who are using phone, while you need to download its extension for those using computer, and this can be done by clicking the download now option available above. Once you download, It takes you to where you need to click the install Metamask for chrome option. Click on install metamask for chrome on your computer

IMG-20211030-WA0077.jpg

  • Once you download, and have successfully installed the Metamask extension on your computer, and then you need to add it to chrome through the illustration shown in the screenshot below;

IMG-20211030-WA0078.jpg

  • Once you have added it to chrome, then you’ll find the Metamask extension option on the bar as illustrated below;

IMG-20211030-WA0083.jpg

  • Once your Metamask extension is added to the bar above, then you click on it to create an account, once you click on it pops out the extension for you to click. Look at the screenshot below to understand better.

IMG-20211030-WA0082.jpg

From the screenshot above, you can Ignore the other extensions. I already have them long before now. So our focus is the Metamask extension. Now click on the Metamask extension.

  • Once you click on the Metamask extension, it takes you to an interface where you need to create a password to set your metamask.

IMG-20211030-WA0084.jpg

  • Once you are done setting your password, click create. Then click next and ensure you accept the terms. After doing this it takes you to an interface where you need to click reveal secret words, this is where you need to copy the revealed secret phrase and keep it somewhere you can’t misplace it. If you misplace this phrase you might not have access to this specific Metamask wallet again. After doing this, click on confirm.

IMG-20211030-WA0087.jpg

NOTE: After doing this, you can now fund your wallet address. Then select the network to be Polygon. If the network isn’t there you can add the network by imputing Polygon contract address, the decimal and the symbol. However, in the screenshot below, it has been added to be Polygon, so as to aid smooth sail when connecting between the two wallets.

IMG-20211030-WA0086.jpg

Now, to connect the Metamask wallet and the Polygon wallet, we need our Metamask wallet fully setup, which has already been done. Now the following are the steps required to get these wallets connected;

  • Go to your search engine and search www.polygon.technology

  • Then it presents this interface to you.

IMG-20211030-WA0098.jpg

  • Click on Use Polygon, it brings a dropdown which brings different options to click on. These options include Polygon wallet, Polygon Bridge, Stake Matic and Dapps on Polygon. We are interested in the Polygon wallet, so we click Polygon wallet

IMG-20211030-WA0090.jpg

  • Once we click Polygon wallet, it takes us to an interface where we are expected to connect the two wallets together i.e. The Metamask wallet and the Polygon wallet.

IMG-20211030-WA0097.jpg

  • Now click on Polygon wallet
    IMG-20211030-WA0096.jpg

  • Once you click on the Polygon wallet, an interface pops out. This interface carries different wallets, and based on the subject matter e are expected to connect to Metamask.

IMG-20211030-WA0095.jpg

  • We are interested in Metamask, so we click Metamask to connect with Polygon. The moment I clicked Metamask to connect with Polygon, it brought the interface below

IMG-20211030-WA0091.jpg

In the interface above, we can see the Polygon (Matic) account is in blue tick, after then we can now click Next. Once next is clicked it brings us to an interface where we need to sign in once we click in sign we are done with the process, as we have successfully linked our metamask wallet to our polygon wallet.

IMG-20211030-WA0094.jpg

We can now see the message from Polygon on the screenshot above. However, because of their privacy policy, I can’t screenshot beyond here. Hence, the steps above are the steps to connecting Metamask wallet and Polygon wallet together.


QUESTION 4

ACCORDING TO THE POLYGON SCAN BLOCK EXPLORER, WHEN WILL THE BLOCK 25,000,000 BE GENERATED? SHOW SCREENSHOT. EXPLORE THE 12,000,000 BLOCK, AT THAT TIME, WHAT WAS THE PRICE OF THE MATIC?

Before I get to answer this question with images, I will like to give us all a grasp of what block explorer does. A block explorer is basically a tool in which financial market analysts uses to view certain information about each cryptocurrency of interest online.

A better of understanding of it, is you understanding that the block explorer functions just like every other search engine, where you can dig out meaningful information that will help you reach a logical conclusion regarding a financial market. This information usually includes the activities carried out on a crypto blockchain at a given period.

The question says according to the Polygon scan block explorer, when will the block 25,000,000 be generated?

ANSWER

The polygon scan block explorer will be generated in 125 days, and to be specific 125days, 2hours 57minutes and 18seconds.

IMG-20211030-WA0093.jpg

EXPLORE THE 12,000,000 BLOCK, AT THAT, WHAT WAS THE PRICE OF MATIC?

I explored the 12million block as requested by the question, at that time the price of Matic was $0.30. Matic was just 30cent. We had 14 transactions and 0 contract internal transaction in this block which was validated in 6secs. We could also see the size was 5826 bytes and the gas used was 3,022,128, which amounted to 15.11%, while the gas limit was 20,000,000. This occurred at exactly 227 days, 10 hours ago on March 14, 2021 at 09:35:48 AM +UTC.
A screenshot is shown below to illustrate give us clarity

IMG-20211030-WA0092.jpg


CONCLUSION

Sidechains are great innovation to the blockchain technology space, for this reason their impact cannot be over emphasized. They have added value and as well complimented different blockchain projects. It is right to say their functionality has contributed immensely to the overall user experience and has boost users’ confidence in carrying out transactions freely at any time with the hope of experience fast, cheap and easy transaction.
On the other hand, ZK Rollups are layer 2 scaling solutions in which funds are held by a smart contract on the mainchain. The sole aim of this is to offer an opportunity that encourages decentralization, present an opportunity for faster transaction and prevents fraud.
I hope this assignment presents an opportunity for you to be enlightened. If so, remain blessed and Thank you.

Cc: @pelon53


Sort:  
Loading...

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59417.60
ETH 2672.31
USDT 1.00
SBD 2.44