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 ...
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"...
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 ...
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 ...
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 ...
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!
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 ...
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 ...
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 ...
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,
"...
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 ...
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 ...
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.
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" : "...
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 ...
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.
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 ...
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://...
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
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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=...
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 ...
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
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
json-rpc × 836bitcoind × 317
bitcoin-core × 225
bitcoin-cli × 82
transactions × 60
api × 59
wallet × 36
blockchain × 35
php × 33
client × 30
transaction-fees × 29
raw-transaction × 28
python × 27
development × 20
address × 18
bitcoin.conf × 17
security × 15
electrum × 15
server × 15
multi-signature × 14
testnet × 14
regtest × 14
full-node × 13
authentication × 13
litecoin × 12