-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Labels
agglayerPRs or issues related to AggLayer bridging integrationPRs or issues related to AggLayer bridging integrationstandardsRelated to standard note scripts or account componentsRelated to standard note scripts or account components
Description
Bridging summary
The overall flow for bridging in from AggLayer -> Miden
0. An oracle (external component) updates the Global Exit Root (GER) stored in the AggLayerBridgeIn contract
- Independently, a claim manager submits a
AGG_CLAIMnote toAggLayerFungibleFaucet - The faucet queries the
AggLayerBridgeInto verify the validity of the claim - If verified, mint the asset requested in the claim, and send it via a
P2IDnote to the target user
AggLayerBridgeIn contract interface
Storage
- Slot 0(map)
faucet_registry:AccountId(of the faucet) ->EMPTY_WORD(potentially mapping to some faucet metadata later) - Slot 1(value)
oracle_account:AccountId(of the owner oracle that is able to update the GER) - Slot 2-3(value)
(ger_upper, ger_lower): Global Exit Root. Unlike the Miden-originated values in LET, GER is constructed externally. We can't control its co-domain, and it could map to values that can't be represented by aWordin Miden. So we need twoWords to represent a GER.
TODO GER is actually a mapping
Internal procedures
Procedure exports
update_ger(called by the oracle). Expected stack[GER_UPPER, GER_LOWER]- check that
note.sender == oracle_account - update GER (TODO is this a vector update?)
- check that
verify_claim(called by the faucet).
Questions:
- The initial Miden design separates out the bridge contract and the faucet contract. This is unlike PolygonZkEVMBridgeV2 with a consolidated approach: it is responsible for updating the LET & GER, but also holds the bridged out assets from users, and sends the assets to users when claimed.
In terms of the number of notes sent, a combined approach would reduce the total number of notes (for bridging out, we wouldn't need a separateBURNnote as the combined contract can handle that internally; for bridging in, there would be no change), but it wouldn't necessarily speed things up for the end-user (the user doesn't care about theBURNnote being processed; the bridging is considered "final" once LET is updated). - How to represent the Global Exit Root manager? It stores a potentially very large number of exit roots
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agglayerPRs or issues related to AggLayer bridging integrationPRs or issues related to AggLayer bridging integrationstandardsRelated to standard note scripts or account componentsRelated to standard note scripts or account components