Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: OmegaStarScream on June 01, 2018, 03:35:01 PM



Title: Access Trezor using C#
Post by: OmegaStarScream on June 01, 2018, 03:35:01 PM
Unlike Ledger nano S, there is no .NET Library apparently. The main thing I would like to do is access the addresses and get their balances. Any suggestions on how to achieve that?


Title: Re: Access Trezor using C#
Post by: developer4z on June 01, 2018, 04:13:17 PM
Unlike Ledger nano S, there is no .NET Library apparently. The main thing I would like to do is access the addresses and get their balances. Any suggestions on how to achieve that?

Through their API. They do offer different apis and i think that should be sufficient.

doc.satoshilabs.com/trezor-tech/api.htm

I'd probably go with python an try to run python script through C# and process output.


Title: Re: Access Trezor using C#
Post by: achow101 on June 01, 2018, 06:30:31 PM
You would have to use the low level API (https://doc.satoshilabs.com/trezor-tech/api.html#low-level-hid-api) directly. The high level libraries abstract this away, but without the high level library, you have to use the low level API. Or you can write some translation interface between Python and C#.


Title: Re: Access Trezor using C#
Post by: tsknik on June 14, 2018, 02:00:13 PM
Maybe help this library: https://libraries.io/nuget/KeepKeySharp (https://libraries.io/nuget/KeepKeySharp)


Title: Re: Access Trezor using C#
Post by: OmegaStarScream on June 14, 2018, 05:02:39 PM
Maybe help this library: https://libraries.io/nuget/KeepKeySharp (https://libraries.io/nuget/KeepKeySharp)

Definitely useful, I appreciate it.

I managed to get the application to detect the trezor but I'm stuck and unable to get features.


Title: Re: Access Trezor using C#
Post by: hknknitin on July 15, 2018, 04:28:13 PM
Hello,

I have been working since last 2 months to communicate with Trezor for support to integrate their Ledger Nano with our web application but there has been response.

I have been working to find ways to do it and found the way to get address for below 3 more currencies -
Digibyte
Stratis
Pivx

All cryptocurrencies being associated with Bitcoin Wallet it is opening, I am yet looking to find a way to get for the below further currencies -

Ethereum
Ethereum Classic
Ripple
Neo
Ethereum Tokens

If anyone of you could help me how to do as soon as possible will be really good.

@developer4z your link does not work, if you share a working link will really good for me to complete the development.


Looking forward for best knowledge share from our senior developers and member on the form.


Title: Re: Access Trezor using C#
Post by: OmegaStarScream on July 15, 2018, 05:12:59 PM
It's the same link posted by achow101: https://doc.satoshilabs.com/trezor-tech/api.html

but I'm pretty sure you already came across it already because without it, you can't make much progress.


Title: Re: Access Trezor using C#
Post by: Domain_THEME on July 18, 2018, 04:05:16 AM
 Why do not you address this issue to the developers themselves, they have a very responsive support. You can ask them to give an answer about the form in which the simplest technical implementation of this question is possible. https://trezor.io/troubleshooter/


Title: Re: Access Trezor using C#
Post by: OmegaStarScream on July 18, 2018, 10:21:10 AM
Why do not you address this issue to the developers themselves, they have a very responsive support. You can ask them to give an answer about the form in which the simplest technical implementation of this question is possible. https://trezor.io/troubleshooter/

I know, I'm never disappointed with Trezor's support but that's clearly not something they could help with. If they don't have a C# API, you can't force them to make one.



Title: Re: Access Trezor using C#
Post by: Kruddler on August 05, 2018, 05:40:42 AM
Hi. I built this Trezor C# library:

https://github.com/MelbourneDeveloper/Trezor.Net

It's fully open source (MIT License). It's being used in two production versions of the same app Hardfolio which is in the Google Play Store and the Windows 10 Store. I'm happy to support the library so if you have any issues, please log in them in the issues section on GitHub. There's currently only a sample for .NET Core, but I am using it's out in the wild on Android and UWP.

You can get it from NuGet. It's Trezor.Net



Title: Re: Access Trezor using C#
Post by: OmegaStarScream on August 05, 2018, 05:43:46 AM
Hi. I built this Trezor C# library:

https://github.com/MelbourneDeveloper/Trezor.Net

It's fully open source (MIT License). It's being used in two production versions of the same app Hardfolio which is in the Google Play Store and the Windows 10 Store. I'm happy to support the library so if you have any issues, please log in them in the issues section on GitHub. There's currently only a sample for .NET Core, but I am using it's out in the wild on Android and UWP.

You can get it from NuGet. It's Trezor.Net

I found it a few days after my last post in this thread, didn't knew you're from the forums so thank you!


Title: Re: Access Trezor using C#
Post by: Kruddler on August 05, 2018, 06:00:11 AM
That's awesome! Glad to hear you came across it. You'll probably be interested in my app Hardfolio. It's based on Trezor.Net, and will soon support Ledger.


Title: Re: Access Trezor using C#
Post by: Kruddler on August 05, 2018, 06:07:22 AM
Oh. probably a good idea to grab version 1.2.1 because I've been fixing thread safety issues today.

Also, it would be a good idea to join this community:
https://gitter.im/trezor/community

Very helpful


Title: Re: Access Trezor using C#
Post by: Kruddler on August 05, 2018, 06:35:29 AM
Hello,

I have been working since last 2 months to communicate with Trezor for support to integrate their Ledger Nano with our web application but there has been response.

I have been working to find ways to do it and found the way to get address for below 3 more currencies -
Digibyte
Stratis
Pivx

All cryptocurrencies being associated with Bitcoin Wallet it is opening, I am yet looking to find a way to get for the below further currencies -

Ethereum
Ethereum Classic
Ripple
Neo
Ethereum Tokens

If anyone of you could help me how to do as soon as possible will be really good.

@developer4z your link does not work, if you share a working link will really good for me to complete the development.


Looking forward for best knowledge share from our senior developers and member on the form.

I can help with Ledger and Trezor integration. Are you looking for C# libraries? Please PM me if so.


Title: Re: Access Trezor using C#
Post by: BTC-TK on August 05, 2018, 10:50:34 AM
you need use C# with web socket and then use TREZOR Connect API https://github.com/trezor/connect


Title: Re: Access Trezor using C#
Post by: Kruddler on August 19, 2018, 05:45:46 AM
No need to use sockets. Sockets and the Trezor bridge are only workarounds because JavaScript can't talk to USB devices directly. Because C# doesn't suck you can just talk to the device directly.

Library

https://github.com/MelbourneDeveloper/Trezor.Net

My GitHub profile has libraries for KeepKey and Ledger as well. KeepKey has the same protocol as Trezor so you more or less get that for free if you crack Trezor.


Title: Re: Access Trezor using C#
Post by: Kruddler on August 27, 2018, 10:08:25 PM
I've added unit tests for .NET and UWP to my library:

https://github.com/MelbourneDeveloper/Trezor.Net

I'm looking for people test and contribute. Even logging requests or issues would be great.