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

Todos for next POC #18

Closed
8 of 10 tasks
sander2 opened this issue Oct 9, 2023 · 2 comments
Closed
8 of 10 tasks

Todos for next POC #18

sander2 opened this issue Oct 9, 2023 · 2 comments

Comments

@sander2
Copy link
Contributor

sander2 commented Oct 9, 2023

Front-end

  • add bitcoin address validation in ui
  • in complete order dialog, show the actual address
  • until electrs is working, use 30 second countdown after which you can confirm payment
  • in complete order dialog, use electrs to detect the tx and show it
  • handle loading states (rui)
  • supply bitcoin proof in complete order dialog

Back-end

  • add proper address types
  • set contract deadlines to 6 hours
  • Take bitcoin proof in order dialog

Dev-ops

  • make docker-compose image to deploy bitcoin regtest + electrs
@nud3l
Copy link
Contributor

nud3l commented Oct 9, 2023

Adding a bit of detail on the flow:

  1. User buying BTC needs to enter valid BTC address
  2. User selling BTC progresses through the following states:

(1) Awaiting BTC transaction: user has not yet sent BTC transaction. To progress, user sends a BTC transaction to the address of the BTC buyer using a Bitcoin wallet - don't use the bitcoin-cli.
(2) BTC transaction in mempool: user has sent the BTC transaction but it's not yet included in a Bitcoin block. To progress, need to mine blocks using the bitcoin-cli. Best: automatically mine 1 block in the docker-compose every x seconds.
(3) BTC transaction in block: user has sent the BTC transaction but the block with the transaction does not yet have 6 confirmations. To progress, need to mine more blocks. If automatic mining added to the docker-compose, just need to wait. Otherwise, need to manually mine blocks using bitcoin-cli.
(4) BTC transaction confirmed: user has sent the BTC transaction and block with the tx has 6 confirmations. To progress, get the tx inclusion proof and submit it to the swap contract. For now, mock that BTC relay always returns true on the proof. Best: actual check of the tx inclusion proof.
(5) Order confirmed: user has sent the BTC transaction, included the BTC tx inclusion proof and got the ERC20 token in the swap. Done.

@nud3l
Copy link
Contributor

nud3l commented Oct 11, 2023

Next iteration:

@nud3l nud3l closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants