Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop and integrate a cgo-free hid library for ledger support #3051

Open
thehowl opened this issue Oct 30, 2024 · 1 comment
Open

develop and integrate a cgo-free hid library for ledger support #3051

thehowl opened this issue Oct 30, 2024 · 1 comment
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors help wanted Want to contribute? We recommend these issues. 🌟 improvement performance improvements, refactors ...

Comments

@thehowl
Copy link
Member

thehowl commented Oct 30, 2024

This is unlikely to be officially tackled by the core team, but can be a fun pet project for anyone who's interested.

Currently, we use https://github.com/zondax/hid indirectly, to support ledger in gnokey:

$ go mod why github.com/zondax/hid
# github.com/zondax/hid
github.com/gnolang/gno/tm2/pkg/crypto/internal/ledger
github.com/cosmos/ledger-cosmos-go
github.com/zondax/ledger-go
github.com/zondax/hid

There is an existing attempt, started by zserge, to make a non-cgo hid driver. However, it only works on linux.

For inclusion in gno, there should be a hid library, possibly mimicking zondax/hid's API, which doesn't use cgo and instead uses build tags and pure go functions. Then, we can adapt the existing ledger libraries so that they use the new API.

Avoiding cgo simplifies our (cross-)compilation processes and allows to create entirely static binaries.

Related: #2928

@thehowl thehowl added 🗺️good first issue🗺️ Ideal for newcomer contributors 🌟 improvement performance improvements, refactors ... help wanted Want to contribute? We recommend these issues. labels Oct 30, 2024
@clockworkgr
Copy link

@thehowl came across this as well: https://github.com/rafaelmartins/usbhid which claims linux/win/mac

@thehowl thehowl changed the title develop a cgo-free hid library for ledger support develop and integrate a cgo-free hid library for ledger support Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors help wanted Want to contribute? We recommend these issues. 🌟 improvement performance improvements, refactors ...
Projects
Status: Triage
Development

No branches or pull requests

2 participants