March 23, 2022: Stargate Origins
Alameda Corners $SGT Supply Following Launch of Stargate + LayerZero
Cross-chain bridging remains a major pain point in the multichain future. Bridges are terrible UX and hack-prone. More than a billion dollars was lost in cross-chain hacks in the past year. How many more must suffer until we may freely ape without borders?
Stargate
Stargate has come online and pledges to solve these problems.
Stargate deployed their composable omnichain native asset bridge six days ago. Stargate promises to have solved the UX issues that make bridges so terrible. They’ve already attracted a billion dollars TVL to their platform in this time. Great launch!
Stargate was first teased last year in a paper by Ryan Zarick, Bryan Pellegrino, and Caleb Banister entitled ∆: Solving the Bridging Trilemma. The bridging trilemma they invent and then conveniently solve refers to the common pitfalls with designing cross-chain bridges. They argue bridge architects can only pick two of the following:
The ∆ white paper is a fun read, thoroughly walking through the pseudocode for how the algorithm is architected in a highly digestible fashion.
Even if you can’t follow the logic, you can perhaps at least appreciate the difference between a white paper that’s empty marketing fluff and a white paper with a thoughtful technical solution. This one falls into the latter category. My attempt at translating to plain English (fact checkers encouraged):
Imagine two large piles of native USDC tokens exist on both ETH L1 and a target sidechain. To bridge your ETH to the sidechain, the ETH contract checks its internal ledger. As funds are requested to move among sidechains, the contract keeps track of how its native balance should be apportioned, looking something like this.
If the balances are off, the contract first looks to see if it can settle imbalances. If all works out, the funds are released on the target chain. Otherwise, no bridge.
You’ll notice this involves large single asset pools on two chains, both flush with the native assets. Other bridge designs often rely on minting a new wrapped asset, Stargate helpfully only works with native assets.
This requires bootstrapping sufficient liquidity of the native asset on both chains. Stargate is off to a promising start here. Stargate is offering rewards for depositing liquidity in their native $STG token. They’ve already attracted at least 8 figures in all their pools, so at least relatively small transactions should now be possible.
The other thing you’ll notice is that Stargate requires a reliable communication channel between chains. A cause of several bridge hacks involves spoofing cross-chain communications. Stargate’s ∆-algorithm is designed with a fairly light touch — only after everything is settled on the source chain does the ping gets sent to the destination chain. Back and forth communication is extremely difficult and hazardous.
Sadly, the ∆-algorithm would be entirely theoretical absent a coherent cross-chain messaging channel.
LayerZero
Fortunately, enter yet another white paper to save the day! The LayerZero paper is again authored by familiar faces Ryan Zarick, Bryan Pellegrino, and Caleb Banister. LayerZero proposes a protocol for interchain communications.
This paper I need to spend a bit more time studying, as I’m not well-versed in the nuances of cross-chain communications. In this case, they’re replacing the complex go-betweens of other solutions with… their own go-between layer that is also complex.
The paper cites plans to use Chainlink as the oracle mechanism. Chainlink strikes me as a good choice in terms of decentralization incentives, but presumably this could also drive up the price of transacting to make routine transactions difficult. It appears they can move to other oracle solutions if this became a limiting factor, so it looks like the right choice for launch.
The whitepaper boasts that their solution prevents collusion between the Oracle and Relayer, or at least renders collisions statistically insignificant, and therefore provides trustless valid delivery. While Chainlink serves as the Oracle, LayerZero is operating the Relayer contracts by default.
The mechanisms governing the Relayer are not immediately clear to me. It seems a cost is involved in operating a Relayer, as the docs state simply the Relayer contract has the responsibility to “maintain and balance wallets used for delivering messages / payloads.” The economics are not obvious to me then: is the Relayer operating a charity or taking a cut?
The team provides a sample Relayer contract in their docs and in their Github repo. This would be one of the most obvious points of attack, so it deserves the most scrutiny. Again, I’d need more time to review this, so I couldn’t comment on its safety. It’s a good sign they have a rock star team and a test suite.
You might just assume somebody else did their due diligence for you, but there’s only like a few thousand people in DeFi, and I’d guess 95% don’t even check the code before they transact. So if you’re nervous, you can just… not ape?
Whether or not LayerZero works in theory, we’ll soon find out if it works in practice. LayerZero was also deployed a week ago. If LayerZero works successfully, this completes the puzzle and allows Stargate to function as promised.
Fair Launch
With everything turning up Stargate, the protocol had their auction for their $SGT token. However, their attempt to distribute their token did not come to pass, with the entire supply falling into very few hands.
Perhaps they didn’t review the lessons of the Tubby Cats launch, which also got concentrated into the hands of a small number of technically astute superfans. The culprit in this case turned out to be… :rips off mask Scooby Doo style:… Mr. Tabasco!
Tabasco: And we would have gotten away with it too… and, uh, since there were no meddling kids, we did in fact get away with it!
Alameda now owns all the tokens, but has promised to hold all the tokens and cede their voting rights.
In this spirit, Stargate is going to go back and offer the 160 addresses that preapproved the auction contract the opportunity to buy at a similar terms.
Lucky for Alameda, they avoided too much scrutiny while everybody was distracted by $APE.
They did take notice up in the Alps however.
Curve
With $STG tokens hitting the market, the liquidity is finding its way to Curve v2.
After the token hit the market, $STG was extremely volatile.
The only algorithm capable of smoothly handling such volatility is Curve v2. The pool has skyrocketed, collecting $93MM in TVL already (remember Alameda bought in with $25MM), with the sort of predictably high vAPYs you see when pools launch from scratch.
The pool is not even receiving Curve rewards yet. With no other viable and liquid market for $STG, the pool is soaking up liquidity simply on the basis of Curve’s superior utility.
Curve wasn’t even sure whether or not the pool would hold up under these conditions.
Early returns are promising!
😭
😀
Further Applications
If we see both Stargate and LayerZero fulfill their promises, we’ll see a ton of usability improvements and interesting applications popping up around DeFi. You may note that Stargate somewhat resembles a pool of like assets, spread among different chains. One could imagine someday Curve getting into cross-chain pools, using similar communications and Curve’s proprietary rebalancing algorithms to provide hyper-efficient cross-chain offerings.
Also benefiting is potentially Sushi. It’s no accident that lz.0xMaxi née 0xMaxi is heavily involved with both both new projects (c/f his earlier thread). Sushi is already weighing a proposal to integrate Stargate to improve Sushi’s cross chain capabilities.
We also note how the success of these protocols could in fact benefit all of DeFi.
We see the proof in the pudding, as Stargate launched $SGT as the first OFT.
The possibilities unlocked by the success of these two protocols is certainly plenty of reason to be bullish. We’re looking forward to seeing how this works out.
We know hackers are often successful at identifying weaknesses in bridges and exploiting such weaknesses to drain funds. We may well see some similar growing pains as theory collides with reality here. To this end, having Alameda’s deep pockets ready to smooth over any hiccups could help push the protocol towards success.
We’re very excited by the technology and promise of what’s to come!
Disclaimers! Author has no position or affiliation with $STG
Find "SGT", replace with "STG", ha .. but great stuff, as always