Zondax/ledger-rs

Codebase fork

Closed this issue · 2 comments

Hey, quick heads up, we forked this codebase at 7d40af9 (the latest commit in #14). You can find our code here. We do intend to keep diverging from your crate. I'd like to get no_std support for the WASM parts at least.

Our changes are LGPL licensed, but we're happy to contribute any changes you like back to this repo under the Apache 2 license. If you want to read the code and make a PR against your repo, I can explicitly sign off on including our code.

Changes you might want to upstream so far:

  • refactor APDUErrorCodes
  • refactor APDUCommand to move towards no_std support. They hold &'a [u8] instead of vectors.
  • refactor APDUAnswer to move towards no_std support and avoid unnecessary copies. It is now a thin wrapper around a &[u8].
  • change exchange functions to accept a mutable buffer. The caller must allocate space for the response packet
  • wasm_bindgen bindings for JS ledger transports. These have been tested (manually) in node. Can succesfully exchange packets with the device.
  • conditional compilation based abstraction of transport type
    • native HID if not wasm32
    • feature flags for browser or node if wasm32
  • break out integration tests
jleni commented

Hi James,
Actually this is funny, but we are doing exactly the same on our side (with plans for a bit more). We have already integrated Zemu everywhere, and unifying Rust+WASM. We already have full support for transport classes (as you saw in #14).

We already have:

  • WASM node & browser support
  • native HID and JS transports (this is what #14 was about)
  • Have a fully working interaction with apps
  • Have complete integration with Zemu
    The PRs will get completed this week and merged into master.

Would it make sense that we open a communication channel and collaborate instead of you forking away?

Yeah, we decided to fork from #14 because of that. Again, the purpose is to diverge pretty significantly (e.g. we made changes to the dev ergonomics on the JS side wrt transport instantiation)

Let me know if you're interested in upstreaming anything this week 👍