Two-Way Peg
A mechanism letting an asset move between a mainchain and a sidechain or subchain, by locking it on one side (a 'peg-in') and unlocking or minting it on the other (a 'peg-out').
A two-way peg is the general mechanism that lets value move between a base chain and a connected sidechain (see Kaavon's "Sidechain" glossary definition): a "peg-in" locks the original asset on the base chain and makes an equivalent representation available on the sidechain, while a "peg-out" reverses the process, burning or releasing the sidechain representation and unlocking the original asset back on the base chain. The "two-way" name reflects that value can move in either direction, rather than only one-way wrapping.
Different two-way peg implementations make very different trust-model tradeoffs in how the locked funds are secured and who can authorize a peg-out — a federated peg (see Kaavon's "Federated Peg" glossary definition) relies on a defined group of signers, while other designs aim for more trust-minimized or fully decentralized custody of the locked funds. The security of any two-way peg system is ultimately bounded by whoever or whatever controls the locked base-chain funds, regardless of how the sidechain itself is secured.
Examples
- A user moving Bitcoin to a sidechain performs a peg-in, locking their BTC on the Bitcoin base chain in exchange for an equivalent sidechain asset.
- The security of a two-way peg depends heavily on how the locked base-chain funds are custodied, which can range from a small trusted federation to more decentralized designs.