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:
- User buying BTC needs to enter valid BTC address
- 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:
- Use bitcoin testnet with the btc relay @sander2
- Initialize btc relay with recent block @sander2
- Upload retarget blocks (check what tBTC already has) @sander2 @gregdhill
- Submit the btc proofs to the btc relay connected to Bitcoin testnet @peterslany @sander2
- Dummy BTC relay contract with same function signature as an actual relay but returns true always @sander2
- Actually check inclusion proof @sander2
-
Actually check payment address & amount @sander2 - publish BOB SDK npm package (CI, ...) @ns212
- Fetch the btc proofs in the background in the UI (integrate SDK) @peterslany
- add standard wallet connect component to UI @danielsimao
- browser test matrix @tomjeatt
- URL to deploy app to demo.gobob.xyz @tomjeatt
- UI cleanup (favicon, website title, ...) @tomjeatt
- Faucet @tomjeatt
- Form validation @danielsimao
- Demo documentation (set up, limitations, known issues) @tomjeatt
- Deduct existing orders amounts from account balances @peterslany @danielsimao (added my @danielsimao )
- Show qr for bitcoin address @peterslany