hsd-ledger icon indicating copy to clipboard operation
hsd-ledger copied to clipboard

Speculos with HID + BUSB

Open rithvikvibhu opened this issue 4 years ago • 3 comments
trafficstars

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.

rithvikvibhu avatar Jul 14 '21 18:07 rithvikvibhu

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 + + -* + +
  • BUSB (node-usb) - needs drivers for windows

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

nodech avatar Jul 14 '21 21:07 nodech

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.

pinheadmz avatar Jul 15 '21 14:07 pinheadmz

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.

nodech avatar Jul 15 '21 15:07 nodech