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.
