matejcik / microwallet

Trezor-backed, Blockbook-fed CLI Bitcoin wallet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microwallet

Documentation Status Updates

Stateless Bitcoin CLI wallet backed by Trezor hardware and Blockbook indexing servers. Just plug in your Trezor and go!

You can use microwallet as a highly scriptable CLI, or you can use it as a library in your Python application.

Microwallet currently requires an unreleased version of Blockbook. You can use your own instance, or wait for gradual rollout of the required features in the upcoming weeks.

Usage

Microwallet is built with Click library, which means that it has very nice help screens. You can view them any time using the --help argument:

$ microwallet --help            # show general help
$ microwallet receive --help    # show help for the 'receive' command

View your Bitcoin balance on your primary account:

$ microwallet show
Balance: 0.0001 BTC

Get a fresh receiving address for second Dogecoin account, and confirm the address on a Trezor screen:

$ microwallet -c Dogecoin -a 1 receive -s
DKHVXpTX5y31RF48NkpCF3bs43o83UwMUM
Please confirm action on your Trezor device

Send 92 million DOGE (9200000000000000 satoshi) to an address:

$ microwallet -c Dogecoin send DogecoinRecipientAddress 9200000000000000

Offline signing

This is a work in progress.

With microwallet and trezorctl, you can prepare a transaction for signing on an online computer, and sign it with Trezor connected to an offline computer.

  1. On the offline computer, get your XPUB:

    $ trezorctl get-public-node -n m/49h/0h/0h
    node.depth: 3
    node.fingerprint: b9b82be7
    node.child_num: 2147483648
    node.chain_code: 2bb4(...)
    node.public_key: 02b9(...)
    xpub: xpub6D1weXBcFAo8C(...)
  2. On the online computer, use microwallet to create a transaction sending 10000 satoshi:

    $ microwallet \
        -x xpub6D1weXBcFAo8C(...) \
        fund 1BitcoinRecipientAddress 10000 \
        -j offline-tx.json
  3. Edit the generated JSON file. Change every address_n field by prepending the path you used with get-public-node.

    (obviously, this step won't be necessary in future versions)

    You also have to add 2147483648 (0x80000000) to the numbers. I.e., if your path was m/49h/0h/0h, modify the JSON data that says:

    "address_n": [
        0,
        3
    ],

    to this:

    "address_n": [
        2147483697,
        2147483648,
        2147483648,
        0,
        3
    ],

    where 2147483697 corresponds to "49h" and each 2147483648 corresponds to "0h".

Support for BIP-174 PSBT is being developed.

Installing

Refer to the installation guide.

Footer

project template.

About

Trezor-backed, Blockbook-fed CLI Bitcoin wallet

License:Other


Languages

Language:Python 97.3%Language:Makefile 2.7%