Protocol One: Interop without added trust assumptions

tl;dr

Protocol One is a design for asynchronous asset interop between two rollups on one L1. A user gives input assets on a source chain, and another gives output assets on a destination chain. The two parties enforce settlement directly. In one L2 transaction, a party both escrows funds on the source chain and commits to a subset of escrows on the destination chain that it deems final and acceptable for settlement. A followup L1 transaction then messages both chains to match two or more L2 escrows, with inclusion proofs against the subset commitments. The design has no light client, no oracle, no stake, no dispute, and no timelock, relying only on L1 message ordering and delivery. Each party follows its own finality view and carries its own reorg risk. No party depends on the view of a different party, so the design adds no new trust assumptions. Safety and liveness are guaranteed. Using ZK proofs, we can generalize this to enable interop between any two chains using a common DA layer.

Leveraging subjective finality

In today’s cross-chain intent-based transfers a user locks input assets on a source chain, and a solver fronts the output assets on a destination chain to then later unlock the input assets when a settlement system has verified the fill. Most designs decide when a fill is final using a shared component: a proof of the other chain, an oracle, or a stake with a dispute period. But the parties do not need the same answer! Solvers with a node for each rollup already accept a state after seconds while a different party can wait for the finality of the L1.

In Protocol One, each party gives its own answer and carries the reorg risk of its own answer, making subjective finality the full mechanism. Both sides of an intent escrow input assets on opposite ends, and declare each other as final according to each of their own criteria, whatever they may be (e.g. surveying 5 RPC providers for the latest state, or waiting for the full dispute window to pass).

Overview

Contract A is on rollup A, contract B is on rollup B, and one contract is on L1. Each rollup contract keeps track of its entries: its escrows, and the L1 messages that it processed. Parties collect escrows posted on rollups into an accumulator when they deem them as final, such that an inclusion proof can later show their existence as an attestation to their subjective finality. The L1 carries updates to these attestations across rollups to facilitate cross-chain matching between escrows.

Alice has 1 ETH on A, the source chain, and wants ETH on B, the destination chain. Bob is a liquidity provider on B. His terms: 1 ETH on A for up to 0.999 ETH on B.

  1. Bob opens an escrow of 10 units in contract B costing 9.99 ETH with these terms. The escrow names A_0, the accumulator state that accounts for all escrows on A at that time. The new state of B is B_1 after this escrow.
  2. Alice opens an escrow of 1 unit in contract A costing 1 ETH with the same terms. Her escrow names B_1 as final, which contains the escrow of Bob. The new state of A is A_1 after this escrow.
  3. Bob reads the escrow of Alice in A, and once he deems it final sends an update of his escrow to the L1 contract. Bob’s update explicitly lists the escrow of Alice, along with a proof that the state B_1 that she had named contains the escrow of Bob.
  4. The L1 contract gives the update a position. The canonical bridge of each rollup carries the update and its position to its contract. Each contract processes the messages in the order of their positions. The two contracts, as of processing that message, now have the same data, and they calculate the same match: the escrow of Alice and the escrow of Bob, with 1 unit.
  5. Contract B holds the escrow of Bob, so it pays 0.999 ETH from this escrow to Alice. Contract A holds the escrow of Alice, so it pays 1 ETH from this escrow to Bob. The changes in balances of both escrows are recorded in both contracts.

Alice signed one transaction on the source rollup. Bob paid for the L1 message in addition to his escrow on the destination rollup, which now still has 8.991 ETH for later users. No contract verified the finality or correctness of escrows in an accumulator. The L1 update that pays Alice also pays Bob, whenever each is processed. The output could have also been a different asset (e.g. “1 ETH on A for 3,000 USDC on B”).

For this match, each party made one decision about finality: Alice named a state of B, and Bob listed an escrow of A. Any mistake there, or a rollback, would have cost only the erroneous party its own funds.

digraph { rankdir=LR; labeljust=l; node [shape=box, fontsize=11]; subgraph cluster_a { label="Rollup A: entries of contract A"; A0 [label="A0\ninitial state"]; A1 [label="A1\nescrow of Alice\n1 ETH, names B1"]; A2 [label="A1\nmessage U1\nA pays Bob 1 ETH"]; A0 -> A1 -> A2; } subgraph cluster_l1 { label="L1: one order\lfor all messages\l"; U1 [label="update U1 from Bob\nit lists the escrow of Alice\nproof: B1 contains\nthe escrow of Bob"]; } subgraph cluster_b { label="Rollup B: entries of contract B"; B0 [label="B0\ninitial state"]; B1 [label="B1\nescrow of Bob\n9.99 ETH, names A0"]; B2 [label="B1\nmessage U1\nB pays Alice 0.999 ETH"]; B0 -> B1 -> B2; } U1 -> A2 [style=dashed]; U1 -> B2 [style=dashed]; }

Why this works

Zamyatin et al. (SoK) show that an exchange across ledgers needs a trusted third party. In Protocol One, the third party is L1. It gives the updates one order, and the canonical bridges carry them. It holds no funds, and it verifies nothing. Each contract learns of an escrow of the other rollup from the L1 messages. The authentication path allows both rollup contracts to safely calculate the same matches:

  • An L1 update by the owner of escrow x which lists escrow y as a match must include an inclusion proof of escrow x in one of the named final states of escrow y. The payout from escrow y to x depends on this inclusion proof.
  • An L1 update by the owner of escrow x must have been signed by x, and the signature must cover listing escrow y. The payout from escrow x to y depends on this signature.

In essence, an escrow first naming a state at creation or on update pre-authorizes matching with all escrows covered by that state. An escrow later listing another escrow during an update proves that pre-authorization to enact a match between them. Thus a false escrow can be paid, but it cannot pay. The loss is for the party that accepted the false escrow: this party listed it in an update, or it named a state that contains it.

Limitations

  • Latency. One L1 transaction and its delivery to the two rollups (minutes).
  • Order. L1 builders control the order of the updates, and thus the priority of the fills. This is a potential source of MEV.
  • RPC Access. A party calculates each state from all entries of the other contract. It needs its own node, or an RPC provider or an indexer that it trusts.
  • Bridge Reliability. Each contract depends on the canonical bridge of its rollup: when one delivery is late (or fails), all later updates on that rollup wait (until replay).

Protocol Specification

Escrow (L2). A party opens an escrow with a call to the contract of its own rollup that carries the necessary input assets. This contract is the home contract of the escrow. The entry of an escrow has seven fields:

  1. Rollup: the rollup of the escrow call and input assets.
  2. Other rollup: the rollup of the output assets.
  3. Index: the position of the escrow in the entries of this contract.
  4. Owner: the account that created the escrow entry.
  5. Terms: the provided input asset and its amount on the rollup, and the required output asset and its amount on the other rollup.
  • Two escrows have compatible terms when their inputs correspond with their outputs at compatible prices. An escrow is closed automatically if its output assets are met, and its home contract then returns the input that is left to the owner.
  1. State: a named state the owner accepts as part of the final history of the other rollup.
  • The owner accepts each escrow in said state as a potential match. No contract examines if a named state is real.
  1. Min update: the number of L1 updates that this contract processed before the escrow call.
  • The contract sets it. Each update with a position below it is inapplicable to this escrow.

Update (L1). An update is an advancement or a withdrawal of one escrow, and it carries the full entry of this escrow.

  1. Sender: The account that authorized this update.
  2. Position: The number of updates received prior to this one.
  • An update counts if its sender is the owner in the entry, and the escrow is open.
  1. Escrow: The full seven fields above that denote an escrow.
  • An update with a position below the min update of an escrow is inapplicable to this escrow: it does not count as its update, and it gives no match with it.
  • The canonical bridge of each rollup carries the full update with its position to each rollup contract. A rollup contract processes only the update with the correct next position, and queues up any out of sequence updates, if those are possible, for later processing.
  1. Type: Advancement(state, matches, proofs) or Withdrawal.
  • An advancement can add a named state to the escrow, and list a sequence of matching escrows along with an inclusion proof for each one. Each inclusion proof shows that the listed matching escrow named a state which includes the updated escrow. This enacts payments on both rollups for each validated match. Payments may fail and be retried later on manually.
  • A withdrawal closes its escrow to prevent matches in both contracts, and recalls the remaining input assets to the owner in the home rollup.

Shared data. The two L2 contracts calculate the same matches from shared data which follows from the L1 updates only, so the two contracts have the same shared data after the same L1 update. The shared data is three values for each escrow:

  1. Named states: the state of its original entry, and each state that an update of the escrow added.
  • Parties calculate an accumulator (e.g. Merkle tree) of the entries of a rollup contract off-chain from its events and the updates of L1. A state A_N is shorthand for the accumulator of the first N entries of contract A. A party can just use a prefix, or use an (unvalidated) blob or off-chain mechanism to carry the hashes of all the compatible escrows.
  1. Output balance: the output amount that it did not receive yet. It starts with the output amount of the entry.
  2. Status: If it is open or closed.

Rule 1, Match. Two open escrows of opposite rollups with compatible terms are a match when an advancement of one lists the other and proves that a named state of the other contains the first. The matches are in the order of the L1 positions, and then in the order of the list. Matching processes only the update and shared data. Thus the two contracts calculate the same matches, with the same amounts, in the same order. The amounts of a match are based on the terms of the escrows.

Rule 2, Pay. A contract holds an escrow if one of its escrow calls made it. For a match, a contract pays the amount that its escrow gives to the owner of the other escrow, if it holds its escrow. “Its escrow” is the one whose entry has the rollup of the contract. If it does not hold its escrow, it pays nothing. The two output balances decrease in the two cases.

Security Analysis (Sketch)

Claims. An escrow is real if an escrow call made its entry in the final history of its rollup. A party is honest if it lists only real escrows, and each state that it names is the accumulator of a set of real escrows. Safety: when the home contract of an honest party pays in a match, the other contract (eventually) pays the party at least the amount that its escrow expects in return. Liveness: an honest party eventually gets the output of each match, and it can withdraw the input that is left without any other party.

Assumptions.

  • (A1) L1 gives each update one position and its true sender.
  • (A2) Each contract processes each update one time in order.
  • (A3) Contracts apply the rules and eventually complete each payment.
  • (A4) The abstract accumulator has no correct membership proof for an escrow outside its set.

The adversary controls all other parties and the timing of all events, in the limits of these assumptions.

Proof Sketch. Matching reads only updates and shared data, and the two contracts process the same updates in the same order (A1, A2), so they calculate the same matches. In a match of x and y, the honest owner of x listed y or named a state that contains y (A4), so y is real. The match needs an advancement at the min update of y or later, which the home contract of y processes only after its escrow call (A2). Thus that contract holds y and pays the owner of x (A3). For liveness, each contract eventually processes each update and pays (A2, A3), and a withdrawal that a party sends after its escrow call is applicable.

Evaluation

The table below lists the gas costs of a proof of concept implementation. The columns are the number of matches in one advancement. Each listed escrow has a proof of 20 hashes, for a state with about 1 million entries, and the payments are transfers of a test ERC-20 token. “Per match” is the gas for 16 matches, divided by 16.

Call 1 2 4 8 16 Per match
L1 send 93k 125k 189k 316k 573k 36k
L2 onUpdate, input rollup 86k 147k 268k 512k 1,000k 62k
L2 onUpdate, output rollup 86k 104k 139k 210k 351k 22k
L2 onUpdate, to the queue 27k 27k 28k 30k 33k 2k
L2 advance, from the queue, input rollup 122k 196k 345k 642k 1,236k 77k
L2 advance, from the queue, output rollup 117k 148k 210k 334k 582k 36k
Calls with no match
L2 escrow 75k
L1 send, withdrawal 61k
L2 onUpdate, withdrawal, input rollup 55k
L2 onUpdate, withdrawal, output rollup 34k
L2 retry 53k

N.B.: These numbers do not include the costs of the canonical bridges for the L1 → L2 messages.

Latency. An update gets to each rollup as an L1 → L2 message of its bridge. The documentation of three large rollups give these usual times for a message or a transfer of funds from L1: 1 to 3 minutes for OP Mainnet, within 3 minutes for Base, and 15 to 30 minutes for Arbitrum One. A match is complete when the slower of the two rollups processed the update.

Related work

Design In common Different
Herlihy, Liskov, Shrira, cross-chain deals (2019) In their CBC protocol, a shared ordered log replaces timelocks. The safety claim has the same form: compliant parties always end up no worse off. Each CBC party votes on the log for each deal, and any party then gives each escrow contract a proof of the result. In Protocol One, a party sends a message to the log (L1) only to update or to withdraw its escrow: an escrow gives its consent before a match, for each escrow in a state that it names. The canonical bridge of each rollup delivers the L1 messages, so no party gives a contract a proof of the log.
Canonical cross-chain swap and the CrossTrade code (Tokamak Network) Settlement with canonical L1→L2 messages only. No contract verifies a state of the other chain, and there is no timelock. The post and its code are for L2 to L1: a provider pays on L1. One escrow, one provider, a whole fill. Protocol One has two symmetric escrows, no funds on L1, named states, and partial fills by rule.
EIL A liquidity provider with funds on the destination chain pays the user. The aim is the same: no new trust assumptions. Liquidity providers lock a stake on L1, and a dispute goes through L1. A transfer takes seconds. Protocol One has no stake and no dispute, and its latency is minutes.
HTLC swaps (TierNolan, 2013) The parties verify, and not the chains. Protocol One is in this class. A hashlock and a timelock. Protocol One has one ordered message stream in their place.
Fast (and Slow) L2→L1 Withdrawals (Nethermind) A solver acts on rollup data before a proven state root. The L1 contract does not read the L2 state to check a request: the solver does this. L2 to L1 only. A solution is conditional on the L2 batch on L1, which removes the reorg risk of the solver. The solver gets its tokens through the slow withdrawal path, with a proven state root.
Cross-rollup DEX with smart contracts only on the destination side (vbuterin) An exchange between two rollups through an intermediary, which has an account on A and funds in a contract on B. If the intermediary does not pay, the user proves the transfer on A to the contract on B, with a Merkle branch from an L1 block hash, after a delay. A proof of Protocol One runs against a state that a party named.
ERC-7683 and intent protocols An order offers a payment for the fulfillment of its requirements, which can be on other chains. A solver (also “filler”) executes them with its own funds, and it has the risk until its payment is final. Each intent protocol has its own settlement, which verifies the fulfillment and pays the solver. The ERC does not specify how. In Protocol One, the two escrows settle each other.
Confidential interbank settlement in the Ethereum Economic Zone (Aaryamann, EthSystems) Two ledgers settle the two legs of a trade through Ethereum, with no bridge between them and no shared sequencer. For each ledger, a contract on Ethereum holds the tokens, and the ledger records claims on them. One Ethereum transaction checks a batch proof of each ledger: the two legs settle together, or neither settles. The banks trust a sequencer, a committee, and other parties, and the payments are confidential. In Protocol One, the funds stay on the two rollups, L1 verifies nothing, and the two payments are not atomic.

Extensions

ZK Protocol One. In essence, the L1 only orders the updates, so a different component can take on its job. In ZK Protocol One, we swap the L1 for a DA layer, and either rollup for any chain that can read said layer. The rules and the claims stay the same, just with explicit signatures in update messages. The new shared trust assumption is the (ZK?) proof system used to bridge the DA layer.

Automatic Expiry If the L1/DA layer can provide a monotonically increasing and relatively stable clock, we can give escrows an automatic expiry date (in L1 time) and negate the need for one side of the exchange (e.g. regular users) to issue Withdrawals. Only the other side (e.g. “Solvers”) would still carry the burden of the Advancement updates.

N.B.: Both extensions bring the protocol closer to how CBC works, but with fewer messages and less (regular) user interaction necessary (i.e. only “solvers” would have to deal with the “log” and the bridge).

Conclusion

Protocol One settles a transfer between two chains with two escrows and one update message that arrives to both chains through a shared bridge. Each party follows its own finality view, and no contract verifies a state of the other chain. No honest party can lose funds as long as their own finality claims hold true. We remove the need for added interop coordination infrastructure.