Bitcoin
$12,767.53 6.83%
BTC · 2w

Power of the Command Line (bitcoin-cli, hwi, electrum, trezorctl)

I think some of the console tools available with HW wallets today are greatly under utilized. Here's a quick write-up on how to create and sign a TXN very similar to [43d27...1fc06](https://tbtc1.trezor.io/tx/43d273d3caf41759ad843474f960fbf80ff2ec961135d018b61e9fab3ad1fc06) found on the [SLIP-14](https://github.com/satoshilabs/slips/blob/master/slip-0014.md) wallet. I'll be using TrezorCTL, Electrum, and HWI for the signing. I won't go much into the setup or install, but feel free to ask if you have questions about it. Note, you don't have to use all three of these. Any one will produce a valid signed TXN for broadcast. I just showed how to do it three ways. Whats more some of the Electrum and HWI steps are interchangeable. ColdCard also has a utility called `ckcc` that will do the sign operation instead of HWI, but in many ways they are interchangeable. KeepKey and Ledger both have libraries for scripted signing but no one-shot, one-line console apps that I know of. But HWI and Electrum of course work on all four. *** ## TrezorCTL This is the what most would think of to use to craft and sign TXNs, and is definitely very simple. The signing uses a script called [build_tx.py](https://github.com/trezor/trezor-firmware/blob/python/v0.12.0/python/tools/build_tx.py) to create a JSON file that is then used by the `btc sign-tx` command. The whole process is basically: 1. `tools/build_tx.py | trezorctl btc sign-tx -` This just means, take the output of `build_tx` and sign it. To copy `43d27...1fc06`, I wrote a small script to feed `build_tx`, so my process looks like: 1. `~/input.sh | tools/build_tx.py | trezorctl btc sign-tx -` But it's all very simple. Note... I used FW 2.3.0 (1.9.0) on this since there are some minor incompatibilities in later FW ^(1). #### [input.sh](https://github.com/brianddk/reddit/blob/68f773cbf588a23a4e8b585d73bd87a712f2d29e/python/tz_cli/input.sh) ``` #!/bin/bash secho() { sleep 1; echo $*} secho "Testnet" # ...
Continue on self.Bitcoin
Recent news
BTC +6.83% · investor.pypl.com · 6h

PayPal gets in to Bitcoin

Will enable cryptocurrency as a funding source for digital commerce at its 26 million merchants Receives conditional Bitlicense from New York State Department of Financial Services  The migration towa...
BTC +6.83% · bitcoinops.org · 7h

Bitcoin Optech Newsletter #120

This week’s newsletter provides an overview of the new MuSig2 paper, summarizes additional discussion about upfront fees in LN, and describes a proposal to simplify management of LN payments. Also inc...
BTC +6.83% · tecuanicapital.medium.com · 18h

Bitcoin Takes A Ride Above $12k

Bitcoin is starting to decouple from the stock market as its correlation weakens. It made sense that bitcoin was correlated to equities in the short-term but now it must prove itself worthy of being…
11