Hey everybody, excuse the delay I was busy with some events.
Public vs Private Bridge
@Amxx articulated a very important design consideration: whether the ERC supports public or private bridges.
Public bridge: a bridge that anyone can use to send messages. It’s generalized, such that the receiver knows the caller on the origin chain. Many bridges are like this; Optimism, Polygon, and others.
Private bridge: a bridge is specific to a dapp. This is like Nomad’s home and replicas (i.e. relayer and receiver). Replicas need to be censorable by a dapp, so Nomad considers them dapp-specific.
The above EIP is essentially a private bridge; which means a user would need to deploy wrappers for some existing bridges. It’s compatible with Nomad, but precludes public bridges. Not ideal.
By having the EIP support public bridges it will be compatible with both approaches. A public design would still allow the user to deploy their own for a private bridge, but would support public bridges as well.
This is why I was thinking the spec should support bridge swaps @nambrot, because in its current design the receiver executes the call, making it a privileged part of the protocol. To swap the bridge we’d need to update the receiver. Not ideal.
Btw @nambrot, you asked why we would swap: for chains such as Optimism I’d prefer to use the native bridge for slow-moving pieces like governance. However, when tech like Nomad is more robust and has an incentivized censorship layer we’d be able to switch to it for faster bridging.
Additional Fields
Gas
That’s smart- I like it. Should we have a special value? I.e. if gas
is zero then it’s considered no-limit?
Caller
100%. Going with a public approach would necessitate this.
Payable
That’s a cool idea! The send message function should be payable.
Summary
- Update the EIP to be public, not private
- Make
relayCalls
payable
- Add gas limit and caller
Note: by making the bridge public the receiver contract will be verifying the caller as being their desired bridge. We won’t have to worry about authentication @drinkcoffee, as it’s dapp-specific (imagine a dapp that has a public function that can be called across a bridge).
I’ve updated the EIP with the above changes
view the new version here.
Please review and comment so that we can continue iterating!
Open Questions
Should we have a relayData
call that relays a simple bytes data
param? Or perhaps the Calls struct could be an extension? Would be curious to hear anyone’s thoughts.