Skip to main content
21 votes

What is chainwork?

Pieter's answer is good, the chainwork value is the expected work amount in the chain, expressed as a 32 bytes integer, for the double SHA-256 hashes calculation work. The chainwork is used to ...
gary's user avatar
  • 529
14 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

error : incorrect rpcuser or rpcpassword (authorization failed)

I was having the same problem and just managed to fix it now. Since the file bitcoin.conf does not exist inside ~/.bitcoin, Just create one. Here's what did: vi ~/.bitcoin/bitcoin.conf Enter ...
tormuto's user avatar
  • 231
13 votes
Accepted

Why does Bitcoin Core support a transaction index but not an address index?

The transaction index exists because it is leftover from how Bitcoin Core used to work for validating new blocks and transactions. Prior to 0.8.0, Bitcoin Core maintained the transaction index, and ...
Ava Chow's user avatar
  • 70.5k
10 votes
Accepted

How does the electrum wallet 'payto' command work

There is one more step to actually process the transaction, you have to broadcast it. What you have got is a signed transaction which you can save (& even send to someone else to broadcast). The ...
Jikku Jose'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,784
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 ...
Ava Chow's user avatar
  • 70.5k
9 votes
Accepted

How Do HD Wallets Keep Track of all accounts?

In general, HD Wallets use the following logic for how many addresses to query, and when to stop: Start with account 0, generate gap limit number of addresses (usually 20) Check for any transactions ...
Raghav Sood'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
7 votes

Import multiple watch-only addresses using importaddress?

There is an alternate command importmulti to be used as follows: bitcoin-cli importmulti '[ { "scriptPubKey" : { "address": "mxbvcPj7cnbxPP6oqpHJxxNb4xC8QoLquG" }, "timestamp" : 0, "label" : "...
Jus12's user avatar
  • 1,365
7 votes
Accepted

Determine address balance using bitcoin core

AFAIK, this can't be done in any reasonable way with Bitcoin Core and its derivatives. The only way I know to do it with Bitcoin Core is to use importaddress or importmulti to add your address(es) to ...
Nate Eldredge's user avatar
6 votes

How can an unconfirmed transaction be removed from the memory pool?

Try the removeprunedfunds RPC command. It deletes the specified transaction from the wallet. … This will effect wallet balances.
Geremia's user avatar
  • 4,636
6 votes

Using PHP with RPC and cookie

Not sure if you're still looking for an answer, but I just stumbled upon this myself and for the benefit of anyone running into this. Even though it's called cookie based authentication, you still ...
tsak's user avatar
  • 61
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

Debug log for RPC access log

I found the way. I confirmed the logs are saved as I expected. bitcoin.conf debug=mempool debug=rpc
zono's user avatar
  • 1,935
6 votes
Accepted

Can I send almost 1MB transaction?

Can I send almost 1MB transaction? To be able to send a transaction that a miner will accept, that transaction has to be a standard transaction. As defined in policy.h /** The maximum weight for ...
MCCCS's user avatar
  • 10.2k
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 ...
Ava Chow's user avatar
  • 70.5k
6 votes

-fallbackfee option in sendtoaddress

Another option that works for me is to call the settxfee with amount before calling sendtoaddress.
liorko's user avatar
  • 239
6 votes

RPC getblockstats call using genesis block

This occurs because the genesis block is a special block. It is not written to disk like all other blocks are. It cannot be undone so there is no undo data for it. getblockstats uses the undo data (...
Ava Chow's user avatar
  • 70.5k
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

Is there a light (SPV) version of bitcoin core (bitcoind)?

Yes, bitcoind with pruning is similar to bitcoind, though some RPCs are disabled (naturally, because of pruning). bitcoind in pruning mode does not store the whole blockchain, and can reduce your ...
Alin Tomescu's user avatar
  • 1,337
5 votes

bitcoin-cli commands like createrawtransaction not working with json on command line

When looking at the Bitcoin Developer Reference I saw an example where they use two additional '' before and after the list of inputs in comparison to you. For your input, I also got "Error parsing ...
Murch's user avatar
  • 75.4k
5 votes

64: too-long-mempool-chain

You will not be able create unconfirmed chain for 300 transactions. Bitcoin core default limit is 25 transactions. In case you modify this parameter on your local node, network will not accept tx ...
bitaps.com's user avatar
5 votes
Accepted

rpc json outside localhost

The listen option is for the P2P network connection, not the RPC service. The option you want is rpcallowip=<ip>. To allow all IP addresses to connect to your node's RPC port, you can use ...
Ava Chow's user avatar
  • 70.5k
5 votes
Accepted

Does Bitcoin RPC API have a realtime websocket?

Since you only care about transactions involving your wallet, you can specify the walletnotify option in your bitcoin.conf or your bitcoind start command. Since walletnotify allows you to execute an ...
Raghav Sood's user avatar
5 votes
Accepted

How to have my bitcoin-cli connect to an outside fullnode

configure it to connect to an external full node. Is that possible? Technically yes, but in practice, no. bitcoin-cli connects to a bitcoind via the RPC interface. This interface is typically not ...
Ava Chow's user avatar
  • 70.5k
5 votes
Accepted

How to change RPC port for bitcoind? (rpcport=xxx in bitcoin.conf doesn't work)

Found the solution: rpcport needs to be in the [test] section Please update your original config file to read: testnet=1 server=1 daemon=1 txindex=1 rpcuser=XXXXXXXXXXXXXXXXXXXXXXX rpcpassword=...
Alistair Mann's user avatar
5 votes
Accepted

Is there's anyway to get fee estimation with vbyte instead of KB using "estimatesmartfee" RPC command?

It is of course already using vbytes; anything else doesn't make sense. Almost everywhere Bitcoin Core reports transaction sizes, they're reported in vbytes (for non-segwit transactions, 1 vbyte = 1 ...
Pieter Wuille's user avatar
5 votes
Accepted

How to set up Lightning Network conf file. RPC user / password? and zmqpubraw?

So in Bitcoind you can define authentication via an rpc interface (remote procedure call). In the config file of Bitcoind which is usually located in ~/.bitcoin/bitcoin.conf you can set the values for ...
Rene Pickhardt's user avatar

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