BTCPayServer.Vault/BTCPayServer.Hwi
Nicolas Dorier d93abb5f15
bump hwi
2026-05-06 15:43:51 +09:00
..
Deployment bump hwi 2026-05-06 15:43:51 +09:00
Internals Fix warnings 2019-11-26 11:27:04 +09:00
Process Fix: Impossible to sign big transactions on windows (#77) 2024-01-23 10:53:38 +09:00
Transports Fix: Impossible to sign big transactions on windows (#77) 2024-01-23 10:53:38 +09:00
BTCPayServer.Hwi.csproj bump .net10.0 and libs 2026-05-06 15:30:30 +09:00
DeviceSelectors.cs Untype hardware model, update NBitcoin 2021-09-08 11:40:47 +09:00
HwiClient.cs Prepare the HttpTransport 2019-10-29 20:29:59 +09:00
HwiCommands.cs Fix display address, add SignMessage 2019-10-27 16:40:25 +09:00
HwiDeviceClient.cs Support DisplayAddress on taproot86 2025-04-17 10:12:56 +09:00
HwiEnumerateEntry.cs Returns raw data of enumerated devices 2025-04-21 14:51:03 +09:00
HwiErrorCode.cs Add BTCpayServer.HWI 2019-10-27 00:25:14 +09:00
HwiException.cs Add BTCpayServer.HWI 2019-10-27 00:25:14 +09:00
HwiOption.cs The Hwi client should assume hwi > 2.0.0. Best effort to keep backward compat with < 2.0.0 clients 2021-05-27 14:51:04 +09:00
HwiOptions.cs Add BTCpayServer.HWI 2019-10-27 00:25:14 +09:00
HwiParser.cs Returns raw data of enumerated devices 2025-04-21 14:51:03 +09:00
PushNuget.ps1 Fix nuget 2019-11-26 11:21:41 +09:00
README.md Bump hwi 2020-06-30 10:12:54 +09:00
Version.csproj bump 2025-04-21 15:35:41 +09:00

NuGet

How to use BTCPayServer.Hwi

First, you need to reference the nuget package in your project.

using System;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Hwi;
using BTCPayServer.Hwi.Deployment;
using NBitcoin;

namespace BTCPayServer.Vault
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // This line will download hwi program in the process current directory
            await HwiVersions.v1_1_2.Current.EnsureIsDeployed();

            var hwiClient = new HwiClient(Network.Main);

            // Enumerate the harware wallets on this computer
            // If your device is not detected and you are on linux,
            // make sure that you properly applied udev rules.
            // These are necessary for the devices to be reachable on Linux environments.
            // See https://github.com/bitcoin-core/HWI/tree/master/hwilib/udev
            var device = (await hwiClient.EnumerateDevicesAsync()).First();

            // Ask the device to display the segwit address on the BIP32 path "84'/0'/0'/0/0"
            await device.DisplayAddressAsync(ScriptPubKeyType.Segwit, new KeyPath("84'/0'/0'/0/0"));
        }
    }
}

You can find some other example on how to use this library in BTCPayServer.Vault.Tests/HwiTests.cs.

Licence

This project is under MIT License.

Special thanks

Special thanks to Wasabi Wallet, this code is based on their work, and as well to the bitcoin developers and achow101 for the HWI Project.