15 votes
Accepted

How to generate SegWit address

How do I generate a SegWit address using Bitcoin Core CLI? You can use addwitnessaddress addr, where addr is an existing P2PKH or P2SH address of yours. It will construct a P2SH-P2WPKH or P2SH-P2WSH ...
Pieter Wuille's user avatar
13 votes
Accepted

fundrawtransaction - what is it?

Just to give a little background first: Bitcoin uses a so-called UTXO model. You own UTXOs (or "coins", to give an analogy). Every coin has a value (which can be any number of satoshis) and ...
Pieter Wuille's user avatar
10 votes
Accepted

Bitcoind error -28

Error -28 is defined as RPC_IN_WARMUP, see https://github.com/bitcoin/bitcoin/blob/master/src/rpc/protocol.h. The bitcoind server has just started and is still processing its stored blockchain data ...
Nate Eldredge's user avatar
10 votes
Accepted

Why does importmulti not support zpub and ypub?

The "xpub" format was defined by BIP32. It's a standard that specifies how to derive public keys from master public keys and seeds. Parts of it are widely adopted, some parts aren't. However, it does ...
Pieter Wuille's user avatar
9 votes

How to check if node is on TestNet or MainNet via `bitcoin-cli`?

Before version 0.16.0: $ bitcoin-cli getinfo { "version": 120100, "protocolversion": 70012, "walletversion": 60000, "balance": 0.00000000, "blocks": 414105, "timeoffset": -165, "...
knocte's user avatar
  • 1,754
9 votes

bitcoin-cli not found on OSX

There is a bitcoin-cli available for OSX. I also ran into this issue, and it is because I missed one of the setup steps. Here they are for posterity! Install Xcode: $ xcode-select --install ...
zero_cool's user avatar
  • 363
9 votes
Accepted

bitcoin-cli could not locate RPC credentials

You are using bitcoin-cli incorrectly. The command line arguments come before the RPC command. Anything that comes after the RPC command will be interpreted as arguments for the RPC, not arguments to ...
Andrew Chow's user avatar
  • 67.4k
9 votes
Accepted

running live and test node simultaneously

You can run both at the same time: $ bitcoind -daemon $ bitcoind -testnet -daemon Then you can issue commands on either using: $ bitcoin-cli <commmand> or $ bitcoin-cli -testnet <...
JBaczuk's user avatar
  • 7,278
8 votes

bitcoin-cli not found on OSX

It's as simple as running brew install bitcoin assuming you are on macOSX and have brew installed.
mayorsanmayor's user avatar
8 votes

How to check if an output has been spent?

If gettxout returns something, the output is unspent. If it returns nothing, the output either never existed or is spent. You do not need -txindex for this.
Pieter Wuille's user avatar
8 votes
Accepted

What are the hex and asm field values in the JSON decoded from a raw transactions?

asm refers to the de-serialised form of the script, with well-known tokens parsed as script tokens. hex is just the serialised form of the script in hex encoding. If you compare them carefully, ...
rny's user avatar
  • 2,398
8 votes
Accepted

What is the key differences between bitcoin-qt, bitcoin-cli, bitcoind, bitcoin rpc, and daemon?

All of those things are part of the same program, Bitcoin Core. bitcoin-qt: The GUI version of Bitcoin Core. Most users will use this as it provides a nice Graphical User Interface that uses the Qt ...
Andrew Chow's user avatar
  • 67.4k
8 votes
Accepted

Breaking down a raw transaction:

The bolded byte in the following raw transaction is the number of outputs (two in this transaction): ...
David A. Harding's user avatar
7 votes

Can you list receiving addresses in bitcoin-cli?

Yes, you can do it. bitcoin-cli listreceivedbyaddress 1 true I had to read the argument documentation. Thanks Sven Williamson.
Ian Kelling's user avatar
7 votes
Accepted

bitcoin.rpc python library problem

in debian =) sudo apt-get install libssl-dev pip install python-bitcoinlib or pip3 install python-bitcoinlib
Guillermo Graña's user avatar
7 votes
Accepted

Bitcoin-cli how to get balance of a wallet on different node?

You cannot because Bitcoin Core does not store such information. Bitcoin Core does not store all information for all addresses, it only stores information for its own addresses and the lower level ...
Andrew Chow's user avatar
  • 67.4k
7 votes

Method not found when I use bitcoin-cli to generate blocks under regtest mode

For the upcoming Bitcoin Core 0.18 release, the generate command has been deprecated and its functionality disabled. For the following major release, 0.19.0, the generate command has been removed ...
Andrew Chow's user avatar
  • 67.4k
7 votes
Accepted

How do I get the private key of an address in descriptor wallets? How to dumpprivkey?

It is currently not possible to export private keys from a descriptor wallet. There is currently an open pull request which allows the listdescriptors command to optionally return descriptors with ...
Andrew Chow's user avatar
  • 67.4k
7 votes
Accepted

Is it possible to set RBF as always-on in bitcoind?

You're looking for walletrbf=1. You can configure bitcoind to always create transactions that signal replaceability by using the -walletrbf startup option or setting walletrbf=1 in the config. ...
Murch's user avatar
  • 71.6k
7 votes
Accepted

How do I create a taproot multisig address requiring 21 of 210 keys to spend?

This will be possible in the upcoming Bitcoin Core 24.0 release, using RPCs like deriveaddresses and importdescriptors, which take as input specifications in the output descriptor language. RPCs like ...
Pieter Wuille's user avatar
7 votes
Accepted

Mismatch between utxo increase and total utxos

The utxo_increase and utxo_size_inc fields of getblockstats does not exclude provably unspendable outputs. However provably unspendable outputs will not be added to the UTXO set, so gettxoutsetinfo ...
Andrew Chow's user avatar
  • 67.4k
7 votes
Accepted

Testing pruning logic with bitcoind

There is the test-only -fastprune bitcoind option, which results in a much smaller maximum blockfile size (16 kb) and a lower minimum prune height. If that option is used, you could just bitcoin-cli -...
Lightlike's user avatar
  • 581
6 votes
Accepted

How to detect a fork with bitcoin-cli?

You can use the getchaintips RPC, which will list all tips of the known block tree, including branches that were never active. You may see for example: { "height": 420561, "hash": "...
Pieter Wuille's user avatar
6 votes
Accepted

How to check if node is on TestNet or MainNet via `bitcoin-cli`?

Since version 0.16.0 $ bitcoin-cli getblockchaininfo { "chain": "main", "blocks": 525663, "headers": 525663, . . . } Reference: https://...
Kerem atam's user avatar
6 votes
Accepted

How to check if my node is fully sync'ed

Calling getblockchaininfo is your best bet. It includes a field called verificationprogress, which is an estimate of how much of the chain you have validated. Alternatively, compare headers to ...
Jestin's user avatar
  • 8,802
6 votes

bitcoin-cli not found on OSX

There it's no bitcoin-cli built in the dmg file for mac os. (Unless you compile it yourself, nor is there a bitcoind from my understanding) You can execute RPC commands using the built in options ...
Mark S.'s user avatar
  • 2,680
6 votes

Why does importmulti not support zpub and ypub?

ypub and zpub are not things that are specified in BIPs. They are things that people have decided to use and specify outside of the BIPs process. Furthermore, they are a layer violation. They specify ...
Andrew Chow's user avatar
  • 67.4k
6 votes
Accepted

Why can't Core CLI query wallet balance when loading block index or verifying blocks?

The wallet needs access to the chainstate for normal operation, and that needs access to the block index. So the wallet requires a chainstate in its constructor, and the object managing the chainstate ...
Andrew Chow's user avatar
  • 67.4k
6 votes
Accepted

Which RPC method is used to mine bitcoin?

Which of the following rpc methods is used to mine bitcoin and receive its reward? None, really. The primary way of interfacing with Bitcoin Core for mining is through the getblocktemplate (GBT) RPC, ...
Pieter Wuille's user avatar
5 votes
Accepted

Why is my bitcoind daemon not listening on RPC port at 8332?

Two thoughts: The wildcard syntax is not supported anymore. Instead of 192.168.*.*, use 192.168.0.0/16. Instead of 192.168.1.*, use 192.168.1.0/24. As an additional debugging step, try running ...
Nick ODell's user avatar
  • 29.2k

Only top scored, non community-wiki answers of a minimum length are eligible