serai-dex / serai

Other
255 stars 47 forks source link

Bridge from Serai onto other chains #292

Open kayabaNerve opened 1 year ago

kayabaNerve commented 1 year ago

The notable target would be XMR -> ETH.

Bond Utilization

The primary issue present is the bond utilization without return. If we bridge 1 XMR to ETH, we lose ~2 XMR of bond capacity (technically as low as 1.5 XMR of bond capacity). Since that XMR could be stolen by the ETH validators, the ETH validators also have to bond 2 XMR of value.

We can reduce this from 3-4 XMR of bond back down to 1.5-2 if the ETH validators can't commit theft. This would mean the XMR validators have the ability to independently verify ETH transitions. This can be done by the XMR validators running ETH light nodes, which would enable them to be informed of logs. With proofs of those logs' validity, each XMR validator would be able to independently verify all burns, making theft impossible without a supermajority of ETH validators equivocating. The proofs used would simply be merkle inclusion proofs against the header (or theoretically, some ZK-SNARK, yet that likely isn't worth the effort).

Light Clients

Technically, we likely wouldn't use light nodes, yet CL nodes without a matching EL client. While there is work on CL light clients, none are production ready.

Then the issue is how the XMR validators have to run n light nodes for all the chains they connect to. We can take advantage of how most L2s post their state onto Ethereum to use a single ETH light client. The proofs would be proving the relevant log exists in some L2 header, then proving the L2 header in question was published onto Ethereum. This would even work for Polygon, a distinct PoS network, as it also commits onto Ethereum.

There is some further commentary available about the security of L2 posted data, notably involving malicious sequencers and challenge periods. That's left to another day, if we pursue this.

Economics

Due to the bond utilization, if we target a 5% APY (denoted in the coin bridged), we need to earn ~10% a year. That means decaying bridged sriXMR by roughly 1% a month. While we could mint SRI to provide these returns, bridging tokens provides no direct economic benefit, and potentially severe loss (as it directly uses capacity which LPs can no longer use). The only other option would be mint/burn fees, which we assume are active enough to independently cover fees. I would not make that assumption, yet have yet to review renVM's revenue statements (which needs to be compared to the theoretically needed bond for the volume they had).

This would force sriXMR to be Ethereum-represented as dsriXMR, a token which rebases so account balances are continuously smaller and smaller, even though 1 dsriXMR is still redeemable for 1 sriXMR which is worth 1 XMR. In order to be used a DeFi, wdsriXMR would be available, which provides a consistent balance of some share of a pool which goes down in supply.

kayabaNerve commented 1 year ago

It would be possible to accumulate mint + burn fees, and upon reaching sufficient volumes, lowering mint/burn fees (subsidizing them from past paid mint + burn fees). That way, on sufficient turnover, only mint+burn fees would be applied to the entire protocol.

If the mint + burn fees are 1%, then the yearly bridged volume has to be ~10x the bridged supply.

monerobull commented 1 year ago

This sounds like a cool feature but wouldn't this drive away volume from Serai when people instead trade wrapped tokens on uniswap? Unless evry transaction of a wrapped token also pays a fee back to Serai I don't think it would be worth the extra bond requirements and loss of "local" volume or am i getting something wrong?

kayabaNerve commented 1 year ago

That is a concern, yet I'd expect the Uniswap pool to have less liquidity than the Serai pool.

That decay mechanism would be a fee for usage.