The Trezor is a crypto currency “hardware wallet”.
Many people consider Trezor to be the gold standard for hardware wallets.
My library for accessing Trezor via C# on Android, UWP, and .NET are in this repo.
Developing for the Trezor wallet is very straight forward. If you have a basic understanding of USB development or request/response development, you will be able to get your head around programming for the Trezor device. This article is only a introductory article and does not give detail about how to write your first Trezor application. Instead, this article will point you to the relevant resources and give you some idea on how to get started.
The first thing to know about the Trezor is that it is a HID USB device. HID devices are very simple by nature. You simply send and receive data from the device. All data is sent in binary format by default which is unlike how most web transfer protocols like REST work. But, like REST, Trezor works on a request/response basis. You send the Trezor a message, and it will send you one back.
Here is a starting point for reading about Trezor’s programming interface: Trezor API Documentation
I cracked the system without any documentation. I trawled through the existing code and examples which give ample information on how to get information. If you do not use one of the existing libraries, you will also need a HID library. I have posted a C# library called Hid.Net on NuGet.org which you may be able to use currently. You will need to convert messages generated in your language of choice in to protobuf binary messages using a protobuf library, and then, you will need to send those messages to the Trezor via the HID library. The Trezor will then respond with its own message.
A typical conversation will go like this:
App->Trezor: GetAddress (Request an address for a coin)
Trezor->App: PinMatrixRequest (Request pin in encrypted format)
App->Trezor: PinMatrixAck (Send pin in encrypted format)
Trezor->App: Address (Get address information)
To summarize, I recommend using on of the existing libraries or sample apps to get started, but it’s not impossible to figure all this stuff out without doing so. The next article will have more details and have some code samples.