- get new address and print QR code
ADDR=`bc getnewaddress`
qrencode -m 1 -t ansi256 bitcoin:$ADDR
- check if coins are received
bc getreceivedbyaddress $ADDR 0
bc getreceivedbyaddress $ADDR 1
- polling is not the smartest way to do this
bd ... -walletnotify='echo %s >> ~/wallet.txt'
bd ... -zmqpubrawblock=<zmq socket address>
bc sendtoaddress <address> <amount>
bc listtransactions
bc gettransaction <txid> | egrep "confirmation|fee"
- list your addresses
bc getaddressesbyaccount ""
~/.bitcoin/wallet.dat
contains- master seed
- addr and tx metadata
- backup: turn off bitcoind and copy wallet.dat
- restore: copy saved wallet.dat back
- start with
bd ... -rescan
bc getnewaddress
- start with
- encryption
- either
bc encryptwallet
- metadata not encrypted
- or manual
- either
- means that signing key is not on machine connected to the internet
- with Bitcoin Core
- or hardware wallets
- ledger
- trezor
- digital bitbox
-
bc getrawtransaction
- requires
bd ... -txindex
bc getrawtransaction f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16 1
- can't look up "addresses", as there is no index for it
- requires
-
an exemplary transaction subgraph
+------------+ | out0 +---+ +------------+ | +------------+ TxA +----> in0 out0 | | | +----> in1 | +------------+ | +------------+ | out0 +---+ TxC | | | out1 | +------------+ TxB
-
useful for
- spending multisig
- multisig: f.e. need 2 of 3 keys to spend
- creating
bc createmultisig 1 '["$PK1", "$PK2"]'
- offline signing
- control over which exact coins to spend
- spending multisig
-
bc listunspent
-
bc createrawtransaction
- don't forget to add change!
-
bc signrawtransaction
-
bc submitrawtransaction
-
even more control with the bitcoin-tx tool
bc getnewaddress
- find pubkey with
bc validateaddress <address>
and broadcast to signers - all signers:
bc addmultisigaddress m '["pubKey_1", ..., "pubKey_n"]'
bc createrawtransaction '[{"txid": "multisig_output_txid", "vout": vout, "nValue": value}]' '{"destination_address": value}'
bc signrawtransaction <txhex>
- pass signature to next signer until complete
bc sendrawtransaction <signed_txhex>