handshake-org / hsd-ledger

Javascript client library for the Handshake Ledger application
Other
18 stars 7 forks source link

Speculos with HID + BUSB #9

Open rithvikvibhu opened 3 years ago

rithvikvibhu commented 3 years ago

With busb removed, it's no longer possible to use the emulator. Would be nice if it's added back, but not a high priority as it only helps a few people without devices and during dev.

nodech commented 3 years ago

I believe we can include both for the hsd-ledger library, probably as optional dependencies. (E.g. WebUSB can only be supported by busb)

This is the current situation of the supported platforms Linux MacOS Windows WebUSB Speculos
HID + + + - -
BUSB + + -* + +

Only thing that needs slight adjustments is API compatibility, after compatibilities are fixed it should be possible to do optional thing.

pinheadmz commented 3 years ago

We could add the speculos feature on top of HID as well, the way it worked with busb is just by changing the require() statement. So the speculos.js module might just need to be tweaked a bit to match the HID API, which isn't too different from the busb API anyway.

nodech commented 3 years ago

I have not looked into speculos much, but I believe we could even move that out of busb and make separate device, like busb and hid. This could also allow us to run tests for lower layer easier (apdu/an inner workings). - If it can be compiled on CI even better.