bob-collective / bob

BOB is a hybrid L2 that combines the security of Bitcoin with the versatility of Ethereum.

Home Page:https://app.gobob.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Todos for next POC

sander2 opened this issue · comments

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

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.

Next iteration: