Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Mobile wallet #6

Closed
6 tasks done
holzeis opened this issue Oct 14, 2022 · 8 comments
Closed
6 tasks done

Mobile wallet #6

holzeis opened this issue Oct 14, 2022 · 8 comments

Comments

@holzeis
Copy link
Collaborator

holzeis commented Oct 14, 2022

Mobile wallet

Goal: Develop a mobile lightning wallet which offers non-custodial financial products based on bitcoin. The first financial product will be CFD trading.

Open Decisions

@bonomat
Copy link
Contributor

bonomat commented Oct 16, 2022

  • What framework should be used for the mobile project - react native? (reactnative.dev)

Most of the team are already familiar with react, so let's go with react native.

  • Do we want to build the wallet in typescript (what library to use) or build a native module using neon (neon-bindings.com)? Second option may be hard to cross-compile for all architectures.

I propose to go for cross-compilation. Try for iOS and Android but if we have troubles on iOS drop it because it was mentioned it is easier for us to develop for Android by @klochowicz and @da-kami .

Good question, we could build a simple polling process, which polls a backend every now and then (e.g. regular, on a certain action, or a mix of both).

@klochowicz
Copy link
Contributor

klochowicz commented Oct 16, 2022

I've got some questions about react native:

  • how convenient is to use that with Rust?
  • do we need to compile to wasm or is the plan to build the whole thing in TS? or is the idea to actually try compiling itchysats with neon as a nodejs library? or are we going for native compilation? This is the biggest unknown for me as for choosing react native.
  • does react native have it's own component set or are we trying to use chakra there too?

my personal preference for the framework would be flutter (https://docs.flutter.dev/), as this seems as the fastest way to develop a compelling UI and it's straightforward to bind it to Rust (see: https://github.com/fzyzcjy/flutter_rust_bridge).
It can be readily deployed to both iOS and Android and desktop/web as well without any further change. It is also recommended over react native for the faster app development (in both senses of the word 'faster', the dev speed and resulting app is faster).

@bonomat
Copy link
Contributor

bonomat commented Oct 17, 2022

I've got some questions about react native:

* how convenient is to use that with Rust?

I personally have no experience but I found a blog post about someone building an ethereum wallet with rust and react native which is very close to what we need

* do we need to compile to wasm or is the plan to build the whole thing in TS? or is the idea to actually try compiling itchysats with neon as a nodejs library? or are we going for native compilation? This is the biggest unknown for me as for choosing react native.

I think compiling to native is the preferred way to build for mobile. Particularly if we want to sign 100s of transactions we will appreciate the performance.

* does react native have it's own component set or are we trying to use chakra there too?

Afaik chakra can't be used in react native but we can reuse our components.

my personal preference for the framework would be flutter (docs.flutter.dev), as this seems as the fastest way to develop a compelling UI and it's straightforward to bind it to Rust (see: fzyzcjy/flutter_rust_bridge).
It can be readily deployed to both iOS and Android and desktop/web as well without any further change. It is also recommended over react native for the faster app development (in both senses of the word 'faster', the dev speed and resulting app is faster).

I'm against flutter because it is a

  • new framework: flutter
  • a new language: dart

We have no experience with neither.

@klochowicz
Copy link
Contributor

I've got some questions about react native:

* how convenient is to use that with Rust?

I personally have no experience but I found a blog post about someone building an ethereum wallet with rust and react native which is very close to what we need

that project went only until setup & "Hello World" stage (!), this does not instil much confidence. It also needed to interact with JNI on android, and suggested creating custom Java bindings yourself.

* do we need to compile to wasm or is the plan to build the whole thing in TS? or is the idea to actually try compiling itchysats with neon as a nodejs library? or are we going for native compilation? This is the biggest unknown for me as for choosing react native.

I think compiling to native is the preferred way to build for mobile. Particularly if we want to sign 100s of transactions we will appreciate the performance.

* does react native have it's own component set or are we trying to use chakra there too?

Afaik chakra can't be used in react native but we can reuse our components.

my personal preference for the framework would be flutter (docs.flutter.dev), as this seems as the fastest way to develop a compelling UI and it's straightforward to bind it to Rust (see: fzyzcjy/flutter_rust_bridge).
It can be readily deployed to both iOS and Android and desktop/web as well without any further change. It is also recommended over react native for the faster app development (in both senses of the word 'faster', the dev speed and resulting app is faster).

I'm against flutter because it is a

  • new framework: flutter
  • a new language: dart

We have no experience with neither.

They seem quite straightforward; it's just declaring a widget tree and hooking up Rust functions. I would expect much, much less pain in the dev process thanks to the lack of virtual DOM, hooks etc.

@bonomat
Copy link
Contributor

bonomat commented Oct 17, 2022

I've got some questions about react native:

* how convenient is to use that with Rust?

I personally have no experience but I found a blog post about someone building an ethereum wallet with rust and react native which is very close to what we need

that project went only until setup & "Hello World" stage (!), this does not instil much confidence. It also needed to interact with JNI on android, and suggested creating custom Java bindings yourself.

There is a part 2 of this blog post and here is the parity signer which was written in react native and rust and then moved to native iOS and native Android as it looks like.

But maybe React Native + Rust is not the best call afterall. Any other thoughts @holzeis / @da-kami / @luckysori?

@holzeis
Copy link
Collaborator Author

holzeis commented Oct 17, 2022

Well, any combination where we are cross compiling from rust to android and bridging it will introduce some complexities. I can't judge if this will only be a one time hassle or will follow us along the project. I feel like the easiest way would be to stay completely within TS, yet it does not look like there are many options for that. From a quick google the preferred way seems to build the wallet in rust and bridge to the respective platforms.

I can't say if flutter is better than react or the other way around. On the one hand I do agree with @bonomat arguments on the team skills, which rather speaks for react than for flutter. On the other hand, though, I don't think we should bother too much with that as I am sure the team will pick up the new framework very quickly.

I suggest we make quick prototypes with both frameworks and then go with the framework offering the best dev experience.

@holzeis
Copy link
Collaborator Author

holzeis commented Oct 17, 2022

@bonomat @klochowicz Lets continue the mobile tech stack discussion here #5

@holzeis holzeis transferred this issue from get10101/itchysats Oct 17, 2022
@holzeis holzeis changed the title Mobile Wallet Mobile wallet Oct 17, 2022
@holzeis
Copy link
Collaborator Author

holzeis commented Nov 7, 2022

I am closing this ticket as the discussion has already moved on.

@holzeis holzeis closed this as completed Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants