get10101 / 10101-PoC

The world needs more Lightning!
MIT License
17 stars 3 forks source link

Fund on-chain wallet #113

Closed holzeis closed 1 year ago

holzeis commented 1 year ago

We need to be able to fund the on-chain wallet. A screen something like that could be implemented.

Screenshot 2022-11-02 at 17 59 58
holzeis commented 1 year ago

@da-kami any suggestions on the design?

da-kami commented 1 year ago

For more clarity and understanding how this will work, here is what I have in my mind from the top of my head:

  1. Taker -> Maker: Give me BTC address
  2. Maker -> Taker: BTC address to fund
  3. Taker funds BTC address with X
  4. Maker notices funding of address with X
  5. Maker creates initial channel with taker locking up BTC, channel capacity to be X * 2
  6. Maker sends over X (minus opening fee) to Taker
  7. Taker balance in 10101 lightning wallet changes to X (minus opening fee).
bonomat commented 1 year ago

What Daniel proposes sounds good. Just for clarity, he proposes an optimized approach. We could also do this:

  1. Taker: internal BDK wallet: give me BTC address
    1. now the taker has money in the internal address and can also use them on-chain

If taker wants to open a lightning channel ( I assume this is the default setup)

  1. Taker -> Maker: give me BTC Address but also provides details to where to open channel to (i.e. node id,)
  2. Taker sends from internal wallet to maker's btc address
  3. Maker creates initial channel with taker
  4. Maker sends over X (minus opening fee) to Taker
  5. Taker balance in 10101 lightning wallet changes.

One challenge: when the maker wants to open a channel with the taker, he needs to communicate with the taker's node, i.e. connect to an address:port. I'm not sure how we can solve this as the user's ports might not be open :/

da-kami commented 1 year ago

This requires a view on an on-chain wallet next to the Lightning wallet in the app. I will see to extend the wireframes and then implement a simple screen for this.

da-kami commented 1 year ago

FundWalletJourney

Note: We have a Bitcoin wallet and Lightning wallet view now. I captured this in https://github.com/itchysats/10101/issues/139 - I will see to tackle https://github.com/itchysats/10101/issues/139 before this ticket (might be somewhat together).

da-kami commented 1 year ago

Note: The designs slightly changed because we introduced a separate Dashboard view that will have the Deposit Bitcoin card that will take the user to the Deposit Bitcoin screen.

da-kami commented 1 year ago

This was implemented with #167 Follow up tickets recorded:

166

165