Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Atomic Swaps with Local Verification #16

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

arkoc
Copy link

@arkoc arkoc commented Feb 16, 2025

Introduces a permissionless and trustless cross-chain asset transfer mechanism using Atomic Swaps, PreHTLCs, and local verification. This approach ensures fast settlement times without relying on cross-chain messaging protocols or third-party trust.

@arkoc arkoc force-pushed the docs/atomic-swaps branch from 987fe94 to b4aa5fc Compare February 17, 2025 06:18
@Joxess
Copy link
Collaborator

Joxess commented Feb 17, 2025

It would be great to have some mermaid diagrams (example here and here) so that we can compare with other intent designs

@arkoc
Copy link
Author

arkoc commented Feb 17, 2025

It would be great to have some mermaid diagrams (example here and here) so that we can compare with other intent designs

Added

Copy link
Collaborator

@0xteddybear 0xteddybear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explainations are easy to follow, however I believe the neutrality of this document can be improved by making a clearer separation on what could be standarized in an implementation-agnostic way, and what is coupled to the train protocol.

Also, wdyt on making an entry on docs/intent-types.md?


```mermaid
sequenceDiagram
participant P1 as User
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diagram would be clearer if Alice and Bob were separate participants

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. Aren't they already separate? (P1: User, P2: Solver)

@arkoc
Copy link
Author

arkoc commented Feb 19, 2025

Explainations are easy to follow, however I believe the neutrality of this document can be improved by making a clearer separation on what could be standarized in an implementation-agnostic way, and what is coupled to the train protocol.

Also, wdyt on making an entry on docs/intent-types.md?

Added a new section, Standardization, to further elaborate on what can be standardized.

Should I move the entire document to docs/intent-types.md, or should I just add a reference to this one?

@@ -0,0 +1,63 @@
# Atomic Swaps with Local Verification

This proposal introduces a mechanism for achieving asset interoperability between Ethereum L2s (and beyond) using Atomic Swaps. The approach does not require a cross-chain messaging protocol, does not introduce new trust assumptions, and remains open and permissionless for any network to participate. It leverages an enhanced version of HTLCs (PreHTLC) in conjunction with recent advancements in local verification techniques, such as running a light client in the browser (e.g., Helios), to achieve two primary objectives:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "The approach does not require a cross-chain messaging protocol" refer to the Settlement System defined in ERC-7683, or to something else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a broader term, which includes the Settlement System defined in ERC-7683 as well.

Comment on lines +62 to +63
- The dApp performs local verification by monitoring Bob’s transaction on Optimism.
- If a light client is available, it is utilized for validation. Otherwise, the dApp queries multiple RPC endpoints or a user-specified node.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to read some security considerations regarding the verification step. In ERC-7683, I believe it is better understood since it relies on a message layer. In this case, it would be useful to understand what things could potentially go wrong.

Copy link
Author

@arkoc arkoc Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one scenario where a user's funds could be compromised. For this to occur, all of the following statements must be true:

  • There is no Light Client for the destination network.
  • Only a single RPC provider is available for that network.
  • This single RPC provider is also the solver matched with the user.

Even in this case, the user still has the ability to manually verify/check the destination hashlock and decide whether they want to proceed with the transaction or not.


By integrating an intent/solver-based framework with PreHTLCs and local verification, this protocol achieves:

- Sub-30-second settlement times for cross-chain transfers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds quite good; just to understand better, these 30 seconds are measured based on what exactly? Is there any specific checkpoint you’re referring to?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically the time it takes for all transactions in flow to be included in the blocks. Updated doc to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants