Giter Club home page Giter Club logo

hardware-js-sdk's People

Contributors

bytezhang1024 avatar dependabot[bot] avatar huhuanming avatar loatheb avatar originalix avatar sidmorizon avatar weatherstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hardware-js-sdk's Issues

Question about hardware-sdk passphrase flow

I noticed in the passphrase docs that entering the passphrase through keyboard requires the user-facing wallet to request the passphrase from the user https://github.com/OneKeyHQ/docs/blob/main/connect-to-hardware/hardware-sdk/passphrase.md#enter-the-passphrase-in-the-software. This seems incorrect to me, as the purpose of the hardware wallet is to ensure that the user-facing wallet does not know anything about the PIN or passphrase. Shouldn't this be handled by the bridge software instead? This is what Trezor does, for example.

low level method to sign with ecdsa

Hi team,

I've read the doc about how to sign a BTC transaction https://developer.onekey.so/connect-to-hardware/hardware-sdk/api-reference/bitcoin/btcsigntransaction. It requires passing a struct to describe the transaction

HardwareSDK.btcSignTransaction(connectId, deviceId, {
    inputs: [
        {
            address_n: [(44 | 0x80000000) >>> 0, (0 | 0x80000000) >>> 0, (2 | 0x80000000) >>> 0, 1, 0],
            prev_index: 0,
            prev_hash: 'b035d89d4543ce5713c553d69431698116a822c57c03ddacf3f04b763d1999ac',
        }
    ],
    outputs: [
        {
            address_n: [(44 | 0x80000000) >>> 0, (0 | 0x80000000) >>> 0, (2 | 0x80000000) >>> 0, 1, 1],
            amount: '3181747',
            script_type: 'PAYTOADDRESS',
        }, {
            address: '18WL2iZKmpDYWk1oFavJapdLALxwSjcSk2',
            amount: '200000',
            script_type: 'PAYTOADDRESS',
        }
    ],
    coin: 'btc'
});

I'm wondering if there's a way to call a method to sign with ECDSA, directly passing the sighashPreimage instead of a struct tx, so that we can call like

HardwareSDK.signEcdsa(connectId, deviceId, {
    path: "m/44'/0'/0'",
    sighashPreimage: "xxxxxxxxxx"
});

this method would return the result of the DER signature 3045xxxxxxx, or the raw ECDSA signature (r, s).

Thank you.

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.