Giter Site home page Giter Site logo

yahiheb / btcpayserver.vault Goto Github PK

View Code? Open in Web Editor NEW

This project forked from btcpayserver/btcpayserver.vault

0.0 1.0 0.0 746 KB

Sign with software or hardware wallets

License: MIT License

C# 92.39% PowerShell 0.34% HTML 5.52% CSS 1.50% JavaScript 0.25%

btcpayserver.vault's Introduction

NuGet

BTCPayServer.Vault

This project is composed of two parts:

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_0_3.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.

btcpayserver.vault's People

Contributors

nicolasdorier avatar yahiheb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.