LearnBitcoin

Bitcoin Dev Archive 2019

I want to rebuild the GUI in JavaScript

5 messages, 23 Nov 2019 to 16 Jan 2020. Started by M.K. Safi.

M.K. Safi (2), Oscar Lafarga, Jonas Schnelli, Daniel Edgecumbe

Permalink Original thread on gnusha.org

M.K. Safi permalink original

I’d like to try to rebuild Bitcoin Core GUI using the JavaScript Electron framework. My goal is to get a real world understanding of the pros and cons of moving from Qt to Electron.

Before I start, I‘d like to know if this has been tried before or if there are ongoing efforts in this direction by anyone?

I spent sometime looking into how to implement this. One approach could be for Electron to drive the UI by running bitcoind and communicating with it through RPC. But I don’t know if such implementation can achieve feature-parity with the Qt implementation. Qt has the advantage of direct access to Bitcoin Core code.

Anyways, I just wanted to share these ideas before going further with them, so please let me know if you have any information on the above!

Oscar Lafarga in reply to M.K. Safi permalink original

Hi MK,

I very much share your interests and curiosities here and actually don't have an answer on whether it's been tried before.

One of the few things I am imagining is that given the security-focused nature of the Bitcoin Core software, any vulnerabilities in the way NPM handles the dependencies of the Electron app would be a very high priority (see https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/)

In NodeJS-land, my sense is that there is a "move fast and break things" mentality that may have seeped into some practices that may be considered standard. I have seen some recent developments over the past few years to address these kinds of issues such as npm-audit (as of Node v6+) but I would recommend doing some thorough research on this front to make sure there is a secure dependency management solution in place for such a GUI.

Another comment I'd make is that if we consider the GUI as a layer that is separate from the protocol layer, this mailing list may not be the best place to fully discuss this. However I think if anyone here who has been around longer can contribute info on past attempts at this, it could be quite productive. This could technically exist as an independent client, but I guess there's a conversation on whether this new Electron UI would ever replace the Qt UI, but since it doesn't exist yet it could be far too early for that.

Thanks,

On Sat, Nov 23, 2019, 2:17 PM M.K. Safi via bitcoin-dev < bitcoin-dev@lists•linuxfoundation•org> wrote:

Quoted text (22 lines)
> I’d like to try to rebuild Bitcoin Core GUI using the JavaScript Electron
> framework. My goal is to get a real world understanding of the pros and
> cons of moving from Qt to Electron.
>
> Before I start, I‘d like to know if this has been tried before or if there
> are ongoing efforts in this direction by anyone?
>
> I spent sometime looking into how to implement this. One approach could be
> for Electron to drive the UI by running bitcoind and communicating with it
> through RPC. But I don’t know if such implementation can achieve
> feature-parity with the Qt implementation. Qt has the advantage of direct
> access to Bitcoin Core code.
>
> Anyways, I just wanted to share these ideas before going further with
> them, so please let me know if you have any information on the above!
> --
> Sent from my iPhone
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation•org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
Jonas Schnelli in reply to M.K. Safi permalink original

Hi

This is probably the wrong place to discuss that (OT).

Quoted text (1 line)
> I’d like to try to rebuild Bitcoin Core GUI using the JavaScript Electron framework. My goal is to get a real world understanding of the pros and cons of moving from Qt to Electron.

There is a relatively new Bitcoin Core Github issue that covers that topic [1]. AFAIK many Bitcoin Core contributors (and users?) don’t like the idea of having a Browser and JavaScript to achieve a UI with relatively simple user-stories.

I think if you want to do this, try to work on a third party project and let your Electron UI connect to Bitcoin Core over RPC. To avoid pulling, eventually use ZMQ or help getting long polling into Bitcoin Core [2].

Adding a Electron/JavaScript UI to the Bitcoin Core repository is very unlikely to happen.

[1] https://github.com/bitcoin/bitcoin/issues/17395
[2] https://github.com/bitcoin/bitcoin/pull/7949
Daniel Edgecumbe in reply to Oscar Lafarga permalink original

You may find my (incomplete) front-end of interest:

https://bitcoin.electronrelocation.com

The live demo is backed by a -disablewallet node, but it was able to accept payments and send them via QR codes before I stopped development.

The source is available via AGPLv3.

https://git.esotericnonsense.com/pub/bitcoin-top.git

I am unable to continue development due to time constraints.

Daniel Edgecumbe | esotericnonsense email@esotericnonsense•com | https://esotericnonsense.com

On Sat, Nov 23, 2019, at 17:49, Oscar Lafarga via bitcoin-dev wrote:

Quoted text (55 lines)
> Hi MK,
>
> I very much share your interests and curiosities here and actually
> don't have an answer on whether it's been tried before.
>
> One of the few things I am imagining is that given the security-focused
> nature of the Bitcoin Core software, any vulnerabilities in the way NPM
> handles the dependencies of the Electron app would be a very high
> priority (see
> https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/)
>
> In NodeJS-land, my sense is that there is a "move fast and break
> things" mentality that may have seeped into some practices that may be
> considered standard. I have seen some recent developments over the past
> few years to address these kinds of issues such as npm-audit (as of
> Node v6+) but I would recommend doing some thorough research on this
> front to make sure there is a secure dependency management solution in
> place for such a GUI.
>
> Another comment I'd make is that if we consider the GUI as a layer that
> is separate from the protocol layer, this mailing list may not be the
> best place to fully discuss this. However I think if anyone here who
> has been around longer can contribute info on past attempts at this, it
> could be quite productive. This could technically exist as an
> independent client, but I guess there's a conversation on whether this
> new Electron UI would ever replace the Qt UI, but since it doesn't
> exist yet it could be far too early for that.
>
> Thanks,
>
>
>
>
>
>
> On Sat, Nov 23, 2019, 2:17 PM M.K. Safi via bitcoin-dev
> <bitcoin-dev@lists•linuxfoundation•org> wrote:
> > I’d like to try to rebuild Bitcoin Core GUI using the JavaScript Electron framework. My goal is to get a real world understanding of the pros and cons of moving from Qt to Electron.
> >
> > Before I start, I‘d like to know if this has been tried before or if there are ongoing efforts in this direction by anyone?
> >
> > I spent sometime looking into how to implement this. One approach could be for Electron to drive the UI by running bitcoind and communicating with it through RPC. But I don’t know if such implementation can achieve feature-parity with the Qt implementation. Qt has the advantage of direct access to Bitcoin Core code.
> >
> > Anyways, I just wanted to share these ideas before going further with them, so please let me know if you have any information on the above!
> > --
> > Sent from my iPhone
> >  _______________________________________________
> >  bitcoin-dev mailing list
> > bitcoin-dev@lists•linuxfoundation•org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation•org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
M.K. Safi in reply to Jonas Schnelli permalink original

Thank you for the feedback Jonas. It was helpful.

I'll take this topic off list since this is probably not the right place for it, but just for those who emailed me asking about how to follow the progress, I've been working on a proof-of-concept over the last month and published it here: https://github.com/orange-org/orange

I would appreciate contributions toward growing this. Check out the bottom of the README for ways to get involved. Thanks!

On Sat, Nov 23, 2019 at 10:36 AM Jonas Schnelli via bitcoin-dev < bitcoin-dev@lists•linuxfoundation•org> wrote:

Quoted text (29 lines)
> Hi
>
> This is probably the wrong place to discuss that (OT).
>
> > I’d like to try to rebuild Bitcoin Core GUI using the JavaScript
> Electron framework. My goal is to get a real world understanding of the
> pros and cons of moving from Qt to Electron.
>
> There is a relatively new Bitcoin Core Github issue that covers that topic
> [1].
> AFAIK many Bitcoin Core contributors (and users?) don’t like the idea of
> having a Browser and JavaScript to achieve a UI with relatively simple
> user-stories.
>
> I think if you want to do this, try to work on a third party project and
> let your Electron UI connect to Bitcoin Core over RPC.
> To avoid pulling, eventually use ZMQ or help getting long polling into
> Bitcoin Core [2].
>
> Adding a Electron/JavaScript UI to the Bitcoin Core repository is very
> unlikely to happen.
>
> [1] https://github.com/bitcoin/bitcoin/issues/17395
> [2] https://github.com/bitcoin/bitcoin/pull/7949
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation•org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>