Ask HN: Use Bitcoin on the command line?

1 points by JonathanBeuys ↗ HN
What is a good tool to use Bitcoin on the (Linux) command line?

I would like to do only 3 things:

1: Import an existing seed

2: Show the addresses for that seed

3: Sign a transaction

4 comments

[ 3.2 ms ] story [ 22.3 ms ] thread
One such tool is `bitcoin-cli`

A wallet is automatically created in ~/.bitcoin/wallet.dat when bitcoind starts.

Presumably, you can move your backed-up wallet there to "import" the seed?

Not sure how or if multiple addresses are mapped to one seed, but check out

  $ ./bitcoin-cli getwalletinfo
To send money (sign a transaction?),

  $ ./bitcoin-cli -named sendtoaddress \
      address="a-long-string" \
      amount=0.001 \
      conf_target=20 \
      estimate_mode=ECONOMICAL
But only after you decrypt your private keys (including suggested 300 timeout).

See Grokking Bitcoin (2019) by Manning.

Thanks for the tip! I will try bitcoin-cli. Is it in the Debian repos?

I don't have a wallet. I just want to feed a seed to the tool.

I now managed to do it with electrum like this:

    electrum --offline restore 'act act act act act act act act act act act act'
I don't use this for real transactions. Just to get to know how Bitcoin works. So the 'act act act ...' is simply the simplest one I came up with.

That creates some kind of wallet in ~/.electrum/wallets/default_wallet

I don't know what type of seed 'act act act ...' is though. Does Electrum interpret it as a BIP39 seed?

Hmm, I'm seeing seed is generated from the BIP39 mnemonic, which is generated from a long string:

  random number generator -> 1642a2...819d
  -> generate mnemonic
  -> bind bone... hotel ten parrot depend
  -> generate seed
  -> seed
> Is it in the Debian repos?

Maybe. Try `apt-get bitcoin-cli`

At least one place is to download from https://bitcoincore.org

As with all binaries outside of package managers that handle signed verification, be sure to verify the signature.

Also, I'm not sure if Bitcoin and Electrum are exactly the same. You're using `electrum`, for example. And I cite `bitcoin-cli`. So they may be "different peer-to-peer (P2P) networks."