High Seas: ETHIndia Fellowship 3.0

This week was focused more on the real-world applications of Ethereum. Starting off with an introduction to the basics of a Decentralized Exchange through the uniswap series. We also looked into how Filecoin + IPFS is aiding the decentralized storage of data on the blockchain. IPFS is a decentralized web protocol for sharing data quickly and easily. Filecoin is built on top of IPFS and supports storing data long-term via on-chain deals.

Filecoin lets users store their data on the filecoin network through storage deals. Storage providers (SPs) on the network take these storage deals, add the files onto the network and generates a proof of storage at regular intervals to prove that the data is correct. These SPs get rewards for their services and anyone with enough space on their devices and the required specs can become SP for the network.


The challenges for the week had us build our own minimum viable DEX. Learning about how liquidity pools maintain liquidity using the curve function along with the interactive front-end to see it in action was really interesting. Based on the reserves added to the pools, we calculate the number of tokens we can swap for a given token and the curve function ensures that the pool never runs out of liquidity. This knowledge could also help users make favourable trades. For a more detailed version of the DEX take a look into uniswap-solidity. The fact that anybody having the token pairs could participate in providing liquidity into the pools highlights the permissionless aspect of blockchains.

DEX: soft-grandmother.surge.sh


The second challenge introduces us to a major problem in blockchains, blockchain trilemma. A trilemma is a situation where there are three options, but at most only two of them are possible to achieve at the same time. In the case of the blockchain trilemma, the three options are security, scalability, and decentralization.

State channels really excel as a scaling solution in cases where a fixed set of participants want to exchange value-for-service at high frequency. The canonical example is in file sharing or media streaming: the server exchanges chunks of a file in exchange for micropayments.

Building the state channel application introduces all the core aspects of such layer 2 solutions. Building an application where a client/user could get off-the-cuff services in exchange for payment only for the services received was a great way to see these solutions in action. The challenge also urged me to look into other L2 solutions and how those compared to state channels.

While hacking the challenge, I also learned how to sign and verify signed messages using the ECDSA library. The only downside, all the off-chain services could only be passed between tabs open in the same window.

State Channel: ratty-achieve.surge.sh

I also faced an overflow issue while making the contracts where the timeLeft function wasn’t taking into account where the deadline was already crossed and a simple if-else statement did the trick. This week I also started taking into account how to make my code gas optimized and why it was necessary when deploying contracts.

If you made it through the entire blog, you deserve 🙌👏

Subscribe to Kalpita Mandal
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.