Skip to main content
About Crypto

Crypto guides and market analysis

What’s the difference between peg-in and peg-out in TeleSwap?

Peg-in vs peg-out in Bitcoin bridges: peg-in locks BTC and mints teleBTC; peg-out burns teleBTC and releases BTC through a Locker on Bitcoin for you.

The About Crypto Editors3 min read

What’s the difference between peg-in and peg-out in TeleSwap?

A peg-in locks BTC on Bitcoin and mints a token on another chain; a peg-out burns that token and releases BTC on Bitcoin. In TeleSwap, the peg-in is checked against Bitcoin data, while the peg-out requires a Locker to pay BTC by a deadline.

  • Peg-in: send BTC to a Locker address, prove the transaction, receive teleBTC.
  • Peg-out: burn teleBTC with a Bitcoin destination, then have a Locker pay BTC.
  • Set the destination script and its type correctly before burning; they cannot be edited afterward.

What happens during a peg-in?

A peg-in moves value from Bitcoin to another chain by locking BTC and minting a corresponding token. In TeleSwap, you send BTC to a Locker address. A Locker is the service participant responsible for the BTC side of the bridge.

To complete the inbound route, the transaction must be proven with an SPV proof. SPV, or Simplified Payment Verification, checks that a transaction is included in Bitcoin’s blockchain without requiring the receiving chain to process every Bitcoin transaction. TeleSwap checks the proof against a relayed chain of Bitcoin block headers.

Once the proof verifies, teleBTC is minted on the destination chain. The BTC remains locked with the Locker backing that route. For an integration, treat this as a Bitcoin deposit followed by proof submission and token issuance; the proof must correspond to the transaction sent to the Locker address.

When comparing TeleSwap’s lock-and-mint route with a bridge that uses a different BTC custody path, the teleswap guide is relevant to that inbound case. Your integration still needs to distinguish it from the reverse burn-and-release flow.

What happens during a peg-out?

A peg-out moves value back to Bitcoin by burning teleBTC and requesting a Locker’s BTC. In the burn call, the destination is supplied as a Bitcoin locking script plus its script type. The locking script encodes the conditions for spending the BTC to the intended destination.

The Locker must make the payment by the required deadline and submit proof of that payment. If it fails to pay as required, it can lose collateral. This makes the outbound route operationally different from a peg-in: a peg-in is verified from Bitcoin transaction data, while a peg-out relies on the Locker making and proving the payment.

The destination is fixed in the burn request. Once teleBTC has been burned, you cannot edit that request to correct its script or script type. Build and validate both values before submitting the burn call, including checking that the script type matches the locking script you intend the Locker to pay.

For instance, if you pass a script type that does not match the destination script, you create a peg-out request the Locker cannot pay correctly. The request may then fail to meet the payment requirement, putting the Locker’s collateral at risk. Verify the destination and script type before burning teleBTC.