I know what bridges are and the problem they solve. The only problem now is I am trying to wrap my head around how they actually do what they do.
I found an answer similar to this question here, where it states:
Create 2 contracts on 2 chains, you then lock tokens on mainchain contract, listen off-chain (you choose Node.js/GoLang/Python/etc). You then listen for the event that is emitted when the lock (deposit) function executes and on the secondary chain the offchain trusted (whitelister/relayer/messenger) mints the equivalent amount of tokens. If you want to withdraw you burn your tokens on the secondary chain, then the offchain service unlocks the equivalent burned of tokens and transfers them to the users main-chain address.
Question I have is, how exactly do the token gets minted on the second chain? For example given a Ethereum/Polkadot bridge, how will a Dot token be minted on Polkadot? I ask because I assume tokens gets minted either via mining or validator (in proof of stake). So for bridging, how does the bridge manage to mint a new token when there is no mining or validating?
Also on the side of the originating chain, how does locking of coin works?