People are calling Polygon both a layer-2 and a sidechain even though these are 2 different concepts. Which one is it?
Polygon Blockchain – Is Polygon (Matic) a Layer-2 or a Sidechain?
blockchainlayer-2polygonsidechain
Related Solutions
I will try to summarize:
On-chain
Something existing in the public blockchain.
Side-chain
Something existing in the different public blockchain with observable relationships between chains like bridges. Cosmos and Polkadot are projects for bridging data between public blockchains.
Off-chain
Something not visible on the public blockchain. But usually, inputs/deposits and outputs/withdrawals are observable in the public blockchain. Everything in the middle of input-output usually is not publicly observable. For example, 0x project allows traders to create limit orders without on-chain transaction by just signing order details. Market order executors will use this signature to proof to a smart contract that exchange is legal. As you may guess canceling of limit orders is made with on-chain transaction.
3.1. Payment channels
2-parties sign the latest state of the balances in the channel and can provide proofs and signatures to the smart contract at the end of the process. The main use case is micropayments, for example, you can pay for downloads per KB or pay for the vehicle per minute without fees for every transaction.
Also Lightning Network for Bitcoin as well as Raiden Network for Ethereum allow to pay over the hops and take fees. In the scheme
A -> B -> C
the B is one who can forward funds completely offchain in a trustless manner and also charge fees.3.2. State channels
Same as payment channels but not only for balances. Potentially could be implemented any 2-party interaction even chess and sea battle.
3.2. Plasma
Same as payment channels but for multi-party interaction. Have a central operator who helps participants to interact. Have limitation to the ledger (usually as UTXO Bitcoin model) due possibility to proof to smart contract plasma operator's misbehavior.
1 - Do I have to redeploy the contract on the Polygon network or does it automatically sync with the Ethereum Mainnet after it is deployed?
Polygon and Ethereum are separate blockchains and do not directly communicate.
2 - If I have a limited amount of tokens to be minted, 5000 for example. Do both networks sync so that this limit is applied for both networks and not 5000 for each one?
There is no "sync".
What you need to do is to learn about bridges.
Also Polygon is not layer two and any claim saying so is false.
Best Answer
A blockchain doesn't exclusively have to be one or the other - it can be both a sidechain and a layer-2. They aren't opposites.
A sidechain refers to a blockchain which has it's own consensus mechanism and doesn't depend on Ethereum for security.
A layer-2 refers to a blockchain that is improving upon Ethereum by adding scalability features (usually lower gas fees).
There's no reason why a blockchain can't be a side chain and a layer-2 at the same time, which is what Polygon is