A sidechain is a distinct blockchain that is connected to the mainchain and operates in parallel to it to improve scalability. Sidechains and mainchains are typically tied via a two-way peg, as transactions are processed separately from each other, resulting in reduced congestion and potentially lower-cost transactions.
Sidechains serve a similar purpose to Layer 2 (L2) solutions, but they are structurally different, as the former operate on their own consensus mechanisms, while the latter are built on top of the mainchain, returning transactions for settlement once they are processed. That renders greater independence to sidechains, which often introduce unique features and governance mechanisms, while maintaining ties to the main blockchain.
Polygon PoS, for instance, is an Ethereum sidechain that enables faster transaction processing with costs that are often significantly lower than mainnet gas fees. However, the existence of separate sets of rules, such as those governing the roles of crypto validators, can result in higher risks.