Laisha Wadhwa Profile picture
DevRel @animocabrands | Ex @GoldmanSachs @AleoHQ @0xPolyAdvocates | Speaker ๐ŸŽ™๏ธ| Technical Writer โœ๏ธ| AI, Web3 ๐Ÿš€

Aug 15, 2022, 15 tweets

Gm Gm web3 fam!

Its Day 19 of #web3glossary ๐Ÿš€๐Ÿš€

S- Sidechain, smart contract, Sharding, sandwich attack

๐Ÿ‘‡๐Ÿ‘‡

Sidechain is a parallel blockchain used to offload txns from the mainchain to increase scalability/add other functionality. Theyโ€™re connected to their parent chain, via a two-way link that allows data & assets to be seamlessly transferred.

Interestingly, the assets are not actually transferred. They are simply locked on the mainnet while the equivalent amount is unlocked in the sidechain.

How does the validation of this imaginary transfer happen?๐Ÿค”

via a smart contract
They ensure that foul play is minimized by..

..enforcing validators on the mainchain & sidechain to act honestly confirming cross-chain txns
Once a txn has happened, a smart contract will notify the mainnet - an event has happened. Next, the offchain process will relay the txn info to a smart contract on the sidechain..

..verifying the txn.

Post this, funds can be released on the sidechain, facilitating movement of digital assets across both blockchains.

๐Ÿ“ŒThis process can occur from the mainchain to the sidechain or vice versa.

eg. Bitcoinโ€™s @Liquid_BTC and @RSKsmart

Sidechains help mainchains scale & become more interoperable.๐Ÿ’ฏ

Blockchains have been facing the classic โ€˜trilemmaโ€™ of simultaneously achieving scalability, security, and decentralisation since their inception. Adding more nodes helps decongest the blockchain network

BUT... ๐Ÿ‘€

What do we do about the reduced processing speed? Thatโ€™s where sharding comes in.๐Ÿง

Sharding is a method of separating a networkโ€™s nodes out into smaller groups (shards) in an attempt to increase scalability.

Think of them as sub-chains.
๐Ÿ‘‡๐Ÿ‘‡

Each shard is a mini-blockchain on its own with their own set of nodes and processing power. Thus, sharding helps reduce the required computing power as theyโ€™re able to reach consensus on behalf of the entire network, removing the need for every node to process every txn

How sharding works would be a deep dive. Let me know if youโ€™d like to see a thread on that with some infographics๐Ÿš€๐Ÿš€

@DotParachains , @NEARProtocol , @eth2 use sharding

The whole idea of the #web3glossary series is to help demystify commonly used terminology and to help you better understand Web3. ๐Ÿ˜‡๐Ÿ˜Š
Letโ€™s break down sandwich attacks in DeFi simple terms.
๐Ÿ‘‡๐Ÿ‘‡

In a sandwich attack, a foul trader looks for pending txns on the network of their choice, say Ethereum
Sandwiching occurs by placing one order right before the trade and one right after it. The attacker front-runs and back-runs simultaneously, with the original pending...

.. txn sandwiched in between.

How is the victim affected?

Say Alex (victim) trades a crypto-currency asset X (ex: ETH) to another crypto-asset Y and makes a large purchase
A bot sniffs out this txn in the mempool and Front-Runs Alex by purchasing asset Y...

..before the large trade is approved.
This purchase raises the price of asset-Y for Alex & increases the slippage๐Ÿคฏ

Due to this high purchase of asset Y, its price goes up, and Alex buys Y at at a higher price, post which the attacker sells at a higher price.

This type of attack is most common in DExs
and in most cases the attack depends on the slippage tolerance set by the victim

Protocols are trying to incorporate new technologies like ZK-Snarks to help users mask the trade information so that bots canโ€™t identify it.

WAGMI ๐Ÿš€๐Ÿš€

That's a wrap for Day 19!

Iโ€™ll be sharing information on the new vocabulary of the web for next 30 days.๐Ÿš€

Itโ€™s like a free crash course on the terms and methodolgies in Web3.

๐Ÿ“ŒFollow me @laishawadhwa for more such web3 gyaan!

๐Ÿ“ŒRT the first tweet to share with the community

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling