Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

feat: add a self-bridge workflow #188

@NiloCK

Description

@NiloCK

This wallet can enable a decent flow for bridging assets (ie: sending them to yourself) across EVMs.

Note: executing a BridgePay with yourself as the target would work, but it requires that you already have the inbound capacity on the destination chain. This is unlikely to be the general case, and "pre-loading" all of that capacity is massively inefficient - not economically viable.

Instead, we reuse the HTLC flow but with the final step as an on-chain tx at the destination chain.

Scenario: Alice, with intermediary Irene, has an active BridgeWallet on Ethereum. She wants to bridge assets to the same wallet on Optimism.

  1. (off-chain) Alice creates an HTLC for Irene in her BW
  2. (off-chain) Irene creates an HTLC to another intermediary Ivan with liquidity on Optimism (or skips to 3 herself if that person is her)
  3. (on-destination-chain) Ivan makes a tx on Optimism, depositing the specified amount, releasable via the HL preimage.
  4. (off-chain) Alice & Irene craft a userOp that inits her wallet and claims the funds via the preimage.
  5. (on-destination-chain) Irene submits it and assumes paymaster duties to cover gas (Alice is "moving in" to this EVM and doesn't presume to have funds)

Griefing Attack: After step 4, Irene can claim her HTLC from Alice but decline to perform step 5. Step 5 costs her a wallet deployment + some other gas costs.

In this failure case, Alice can

  • execute the destination release operation herself (annoying in cases where she has no in-network gas)
  • communicate the preimage to Ivan, so that he can
    • claim his HTLC from Irene (reducing her "take" on the attack to just the gas costs of her step 5 operation)
    • execute step 5 as a courtesy ?

In the failure case, one of Alice or Ivan is robbed of the gas costs associated with step 5. Alice's recourse is to boot Irene from her wallet and to shout about it (Ivan can corroborate). Alice is not out her bridged funds - they exist on the target chain, addressed to her, waiting for unlock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions