Part 4: What is the LayerCake Protocol?

Part 4: What is the LayerCake Protocol? 

The LayerCake protocol is a novel L1 bridging protocol that uses other core Flare protocols such as the State Connector and FLR to securely move assets from smart contract L1 platforms to and from each other. As F-Assets have smart contract capabilities on Flare, they can also be bridged to other L1 blockchains. The LayerCake bridging is fast, decentralised and is fully insured for the value that moves across the bridge at any point in time.

What are traditional ways of bridging assets from Layer 1 blockchains?

One traditional model of bridging requires multi-signatures from trusted participants for transactions to occur on each chain, thereby rendering all collateral in the bridge smart contracts under the control of the multisig system hosts.

Another bridging mechanism is the Light Client relay model where decentralised transfers between chains can only be done slowly. Such bridges can only be bilateral which means a new bridge must be created between any two smart contract platforms, origin L1 and destination L2. Light client relay bridging relies on slashing faulty validators of that L1 in order to protect value that crossed the L1 bridge. Flare’s State Connector can safely acquire the state of another chain and does so substantially faster than a light client relay can. Thus a fast moving bridge can be secured by Flare.

How does LayerCake bridging work?

Bandwidth Providers in LayerCake are users that run non-trivial infrastructure and put collateral to facilitate the transfer of an asset from the origin L1 smart contract network to the destination L1 network. This collateral is in the form of the origin L1 asset on the origin L1 chain as well as additional collateral in FLR on Flare. Bandwidth collateral is reserved when a user wishes to move their assets through the LayerCake bridge, known as the mint flow process. The user deposits their assets on the origin L1 chain along with paying a bandwidth reservation fee which they can increase to have higher priority in crossing the bridge sooner. Once the user’s deposit occurs and is verified by the State Connector and that the user’s deposit is sufficiently collateralised for crossing the bridge, the Bandwidth Providers then mint the corresponding representation of the user’s asset on the destination L1 chain. Bandwidth Providers receive the reservation fee in the form of the origin L1 asset, supplied by the user crossing the bridge. The rate at which value can move across the LayerCake bridge depends on the bandwidth collateral available in the system. If the total value to be bridged is greater than the bandwidth collateral available, the user may need to wait for multiple bridging rounds before completing a 1:1 representation of the asset on the destination L1. Upon completion of the bridging, the bandwidth collateral unlocks and can be used to facilitate further mint flows from other users. Contrastingly, multiple users can cross the bridge at the same time given sufficient supply of bandwidth collateral.

What is the redemption process for bridged assets on LayerCake?

Redemption process for the minted asset on the destination chain leverages the same collateral reservation fee mechanism as the mint flow process where collateral on both origin L1 and Flare is reserved. Any dishonest Bandwidth Providers that mint assets for themselves can only do so up to the amount they have locked as collateral. Therefore the bridge is fully compensated by the funds (collateral) held by the contract on Flare.

What are chain reorganisation attacks and how does LayerCake manage this?

Chain reorganisation attacks occur when a user mints an asset on the destination L1 and sells it on the market and proceeds to attack the consensus mechanism on the origin L1 to return the chain to the state prior to the attacker’s original L1 deposit. In LayerCake, the Bandwidth Providers send both short term collateral for immediate bridge crossing AND collateral to protect against chain reorganisation.

What are the incentives for becoming a Bandwidth Provider?

For providing collateral against these risks, Bandwidth Providers earn a small fee in FLR for each bridging event. At a 0.1% bridging fee, BPs will earn approx 37% APY at full utilisation. This is a separate fee to the bandwidth reservation fee in the origin L1 asset which is more akin to transaction gas fees.

The LayerCake White paper