-
Notifications
You must be signed in to change notification settings - Fork 38
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
Product POC: P2P Swap #7
Comments
We had some discussions on the last week. To summarize: The problems we need to address, are:
Number 3 is the most difficult to address. We discussed various (non-)possibilities:
In the end, the most straightforward way to move forward is to disallow partial fulfillment altogether, and to require fresh bitcoin addresses every time. The first restriction is very limiting from a usability perspective.. The second restriction could also be a limiting factor, since some CEX wallets have a limit on how many fresh addresses they can generate. It was agreed that the poc can be without partial fulfillment, but that we do need to think about a solution in the longer term:
|
Abstract
Create a P2P marketplace to allow anyone to swap BTC, BRC20s, and ERC20s (including WETH) without a third party.
Motivation
Building out BOB is best done in combination with a use case from which we can draw conclusions which additional features or improvements we need to make to the base layer.
P2P swaps are one of the earliest use cases of cross-chain communication and have the advantage that users can swap directly without giving up custody to anyone. There's currently no P2P swap for BTC and BRC20s that is both cheap and works without a custodian.
Specification
Target time: end of September 2023
Hackathon-level implementation of the P2P swap. The goal of this project is to understand the complexities of developing the P2P marketplace by delivering a usable deployment of the P2P on a testnet rollup that allows swapping testnet BTC, BRC20s, and ERC20s. Mocking of complex parts of the application is highly encouraged to deliver a usable app.
User Requirements
These functions MUST be available for the PoC level.
Protocol Requirements
Protocol
The protocol follows a simple OTC trade logic for the POC stage. In the future, more complex schemes including off-chain order books, Dutch auctions, and other mechanisms will be explored.
The protocol consists of three parts:
Placing an order
Filling an order
a. If the user is selling an ERC20, the ERC20 is directly transferred to the user that created the order and order is (partially) filled.
b. If the user is selling BTC or a BRC20, the user reserves part of the order instantly and has then 6 hours to fill the order on Bitcoin. Once the BTC/BRC20 transaction is sent, a transaction inclusion proof verifies the correctness of sending the BTC/BRC20 and then marks the order as (partially) filled.
It is yet unclear how we ensure unique BTC transactions for proofs.
Withdrawing an order
Security
The text was updated successfully, but these errors were encountered: