20 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 ...
user avatar
  • 481
15 votes

json-rpc via curl

I got it to work by adding the password to the --user value, separated with ":". So the example becomes: curl --user bitcoinrpc:xxxxxxxxxxxxxxx --data-binary '{"jsonrpc":"1.0","id":"curltext","method"...
user avatar
15 votes
Accepted

What is chainwork?

The chainwork value is really just the total amount of work in the chain. It is the total number of hashes that are expected to have been necessary to produce the current chain, in hexadecimal. ...
user avatar
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 ...
user avatar
12 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 ...
user avatar
  • 221
11 votes

How to check if the block chain is up to date using bitcoind or json-rpc?

Bitcoind no longer supports RPC calls. Try: watch bitcoin-cli getblockchaininfo When the displayed number of blocks equals the displayed number of headers, you're synced!
user avatar
  • 111
11 votes

Why is JSON-RPC over SSL "strongly discouraged"?

The RPC interface isn't designed to be used in any scenario which would require SSL, which would be access over the internet or other untrusted networks. It doesn't have the necessary denial of ...
user avatar
  • 15k
10 votes
Accepted

rpcallowip=192.168.0.* ?? invalid configuration

You want to use 192.168.0.0/24. That's CIDR notation for 192.168.0.*.
user avatar
  • 216
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 ...
user avatar
8 votes
Accepted

How to get the immature balance of an account?

Using the listtransactions command, you can see your immature coinbase transactions listed with category immature. listtransactions appears to include both spent and unspent transactions in general, ...
user avatar
8 votes

Does bitcoind accept batch RPC calls?

Yes, this is supported. As specified by JSON-RPC 2.0, you can send in an array of requests, and receive an array of solutions.
user avatar
8 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, "...
user avatar
  • 1,673
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.
user avatar
8 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 ...
user avatar
7 votes

Add a Watch-only Wallet in Bitcoind

As of bitcoind v10, there is support for watch-only addresses. A bitcoin address is sufficient. The bitcoin-cli command is: bitcoin-cli importaddress "address" ( "label" rescan ) Where "address" is ...
user avatar
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 ...
user avatar
6 votes
Accepted

Where can i get all the commands with descriptions for Bitcoind on my linux server?

These days the most thorough and handy guide for the Bitcoin Core RPC commands is the bitcoin.org developer reference page.
user avatar
6 votes

listsinceblock parameter: target-confirmations

As per: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list We have, [target-confirmations] intentionally does not affect the list of returned transactions, but only affects the ...
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.
user avatar
  • 4,307
6 votes
Accepted

How do I query a remote bitcoin node like RPC?

Excellent question, and welcome to the community! Short Answer Maybe. Long answer Yes, you can send queries to other nodes on the Bitcoin network. Note that these aren't RPC calls, but Bitcoin's ...
user avatar
  • 28.7k
6 votes
Accepted

How to get a wallet address and set label via RPC?

You may have already read this, but make sure you read this if you want to know about how the accounts feature of the core client works: https://en.bitcoin.it/wiki/Accounts_explained. (It's somewhat ...
user avatar
  • 13.7k
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 ...
user avatar
  • 61
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
user avatar
  • 1,815
6 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 ...
user avatar
  • 61.5k
6 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 ...
user avatar
  • 16.5k
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 ...
user avatar
  • 9,819
6 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 ...
user avatar
  • 61.5k
5 votes

How to get the number of the confirmed transactions from Bitcoin QT Rpc

You can use the RPC command "getrawtransaction" to receive a JSON response with information for that transaction including a "confirmations" field if that transaction has been included in a block (if ...
user avatar
5 votes

Using bitcoind JSON-RPC, how to get transaction from input address?

The data you are looking for isn't actually included in the transaction that spends the UTXOs. Addresses are basically shorthand for a scriptPubKey, and scriptPubKeys are associated with outputs, not ...
user avatar
  • 13.7k

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