Bitcoin client warning I get this warning on my Bitcoin client:
"Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade."
I am also downloading the blockchain and i am stuck at "18 weeks behind" for days now. Is everything alright?

you should download the bootstrap.dat - this will take the time for the blockchains to catch up from days to two hours... google it.


Why do some mining algorithms run "cooler" than others? So, there are some altcoin mining algorithms now that run cool, such as X11 and groestl. By cool, I mean even when mining at full GPU capacity, the card still remains at 60C or cooler with little to no fans, and drawing little power when compared to scrypt or sha-256 mining.

What mechanism is it that makes these algorithms run cooler than other proof of working algorithms?

With any given algorithm and hardware, there's something that will be the bottleneck: this portion is taxed to its full 100% capacity, while the rest of the hardware is used at <=100% of its capacity. Different portions of the hardware take different amounts of power and heat to run to capacity. Creating an algorithm that taxes the lower-power portions, while leaving the high-power portions largely free, results in a cooler-running algorithm.

For example, let's say you have one algorithm that's heavily processor-bound, and one that's heavily memory-bound. It'd be perfectly reasonable to expect that the processor-bound one runs hotter than the memory-bound one, so if you want your algorithm to run cool, you choose the memory-bound one.

I should also note that some processes are complicated enough that there is no one bottleneck, but it shifts from time to time (e.g. if you read data from your hard drive, compress it, and transfer it over the network, you might have three completely separate bottlenecks at the different times: disk IO, CPU power, and then network IO). You can view this as a composite of algorithms that individually (should) follow the general rule I outlined above.


Transaction verification process in full nodes I'm having some trouble understanding the process of transaction verification on full nodes. I understand how a transaction is verified via public cryptography (hashes, signature, etc, as it's explained in the original Satoshi paper), but i can't find how this process is done on the real software, involving the UTXO database and any other optimizations that may be done in the actual full node clients.

I've started to dig on the reference implementation code, as a I'm a programmer and i hope to understand the process a little more by looking at the sources but, until then and maybe as a guide, could some expose how that process is done with a little example, even in broad terms it could be helpful, or point toward some technical resource where I could find that description ?

A bit late, but for the audience eventually searching for this response:

  point toward some technical resource where I could find that
  description ?

https://en.bitcoin.it/wiki/Transaction#Verification

https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages

Short cut&paste (march 2018):

These messages hold a single transaction.
Check syntactic correctness
Make sure neither in or out lists are empty
Size in bytes <= MAX_BLOCK_SIZE
Each output value, as well as the total, must be in legal money range
Make sure none of the inputs have hash=0, n=-1 (coinbase transactions)
Check that nLockTime <= INT_MAX[1], size in bytes >= 100[2], and sig opcount <= 2[3]
Reject "nonstandard" transactions: scriptSig doing anything other than pushing numbers on the stack, or scriptPubkey not matching the two usual forms[4]
Reject if we already have matching tx in the pool, or in a block in the main branch
For each input, if the referenced output exists in any other tx in the pool, reject this transaction.[5]
For each input, look in the main branch and the transaction pool to find the referenced output transaction. If the output transaction is missing for any input, this will be an orphan transaction. Add to the orphan transactions, if a matching transaction is not in there already.
For each input, if the referenced output transaction is coinbase (i.e. only 1 input, with hash=0, n=-1), it must have at least COINBASE_MATURITY (100) confirmations; else reject this transaction
For each input, if the referenced output does not exist (e.g. never existed or has already been spent), reject this transaction[6]
Using the referenced output transactions to get input values, check that each input value, as well as the sum, are in legal money range
Reject if the sum of input values < sum of output values
Reject if transaction fee (defined as sum of input values minus sum of output values) would be too low to get into an empty block
Verify the scriptPubKey accepts for each input; reject if any are bad
Add to transaction pool[7]
"Add to wallet if mine"
Relay transaction to peers
For each orphan transaction that uses this one as one of its inputs, run all these steps (including this one) recursively on that orphan


How to sign a raw multisig transaction from an external private key I am creating a 2-of-3 multisig wallet, where the 2 hot keys are external HSM devices.
I am using Bcoin to create my transactions.
After the transactions are created, I will send the raw transaction to an external application to do the signing.

My question is, which part exactly needs to be signed by the private key?

For example, this is my transaction:

{
    "hash": "e82c7bdfc864ab4d0592045dd86b81a438eeee77f8415c0a84e1aa0ea8e17786",
    "witnessHash": "e82c7bdfc864ab4d0592045dd86b81a438eeee77f8415c0a84e1aa0ea8e17786",
    "fee": 1000000,
    "rate": 4424778,
    "mtime": 1568880046,
    "version": 1,
    "inputs": [
        {
            "prevout": {
                "hash": "3b1dd17cc82e2ac43ba62bf8f1c6a0fe805df43911653d22c902571eb3a212ce",
                "index": 0
            },
            "script": "000000004c6952210209ad6cf408e41362fa175d5869e4561f1890c0d8d74353c86095fdecde34459721024a92aa3f883cc4438b75205555e517a4f7cc10ffd42517297a17821ae6f0bb8821037d2a259a52f62fee96fea072844139224fbd9027116ac7582025dd446fc73e3e53ae",
            "witness": "00",
            "sequence": 4294967295,
            "coin": {
                "version": 1,
                "height": -1,
                "value": 10000000000,
                "script": "a9144de6d3580732a7c7c2b1eb043cb1b89350c265fa87",
                "address": "38nvUMbXFdXDp4PTWvbohCbnPJuLUVwzXr",
                "coinbase": false
            }
        }
    ],
    "outputs": [
        {
            "value": 5000000000,
            "script": "a91481be67198d33319415d09b03f2dc2cfa4cdb42aa87",
            "address": "3DX3BhmdRGf5vYbtzHKzazGmZ7WgUkhFRk"
        },
        {
            "value": 4999000000,
            "script": "a9144de6d3580732a7c7c2b1eb043cb1b89350c265fa87",
            "address": "38nvUMbXFdXDp4PTWvbohCbnPJuLUVwzXr"
        }
    ],
    "locktime": 0,
    "hex": "0100000001ce12a2b31e5702c9223d651139f45d80fea0c6f1f82ba63bc42a2ec87cd11d3b000000006f000000004c6952210209ad6cf408e41362fa175d5869e4561f1890c0d8d74353c86095fdecde34459721024a92aa3f883cc4438b75205555e517a4f7cc10ffd42517297a17821ae6f0bb8821037d2a259a52f62fee96fea072844139224fbd9027116ac7582025dd446fc73e3e53aeffffffff0200f2052a0100000017a91481be67198d33319415d09b03f2dc2cfa4cdb42aa87c0aff6290100000017a9144de6d3580732a7c7c2b1eb043cb1b89350c265fa8700000000"
}

If you decode the script in the inputs it is:

OP_0 OP_0 OP_0 OP_0 52210209ad6cf408e41362fa175d5869e4561f1890c0d8d74353c86095fdecde34459721024a92aa3f883cc4438b75205555e517a4f7cc10ffd42517297a17821ae6f0bb8821037d2a259a52f62fee96fea072844139224fbd9027116ac7582025dd446fc73e3e53ae

As you can see there are 4 OP_0 placeholders to input the signatures.
Now my question is, which part of the transaction the external signing application should sign. Is it just the 000000004c6952210209ad6cf408e41362fa175d5869e4561f1890c0d8d74353c86095fdecde34459721024a92aa3f883cc4438b75205555e517a4f7cc10ffd42517297a17821ae6f0bb8821037d2a259a52f62fee96fea072844139224fbd9027116ac7582025dd446fc73e3e53ae
part?

Any reference is highly appreciated.
I have read https://en.bitcoin.it/wiki/Transaction and https://en.bitcoin.it/wiki/OP_CHECKSIG but I can't figure out for sure.
Thank you.

The Bitcoin Wiki entry for OP_CHECKSIG answers your question. OP_CHECKMULTISIG works the same way, just applied to each signature in the sequence.

First of all, it depends on the SIGHASH type you, as the signer, choose. Most likely you will use the default SIGHASH_ALL for each of the required signatures, but you could actually use different SIGHASH methods for each individual signature.

Since you mentioned bcoin, you can review the signature hash methods in lib/primitives/tx.js here, and in the methods immediately following.

Very briefly:

The SIGHASH_ALL method will serialize all the inputs* and all the outputs of the transaction, including the nLocktime, and sign that blob.

*The input scripts are all replaced with a sinlge 0x00 byte. The script of the input being signed/checked is replaced by the corresponding output script from the funding transaction. So actually, the hex string you posted (the templated input script 000000004c695...) is the only part of the transaction that will NOT be signed by any of the multisig participants for this input!

bonus tidbit: The 2-of-3 signature template has FOUR OP_0's. Why? Well. the first one is popped off the stack by OP_CHECKMULTISIG, that's a bug Satoshi left us with. The other three are placeholders for the actual signatures. There are THREE instead of just TWO because the signatures need to be in the same order as the pubKeys in the redeem script. The extra placeholder is removed before broadcasting the transaction. In bcoin, this script template is assembled here.


Is it legal to use bitcoin in a domain name? Is it legal to use bitcoin in a domain name? Not a sub domain, but in the main domain name.

To date, no entity has trademarked word "Bitcoin" in the US. This means that it's highly unlikely that any US entity would file against your domains under the ICANN Uniform Domain-Name Dispute-Resolution Policy.

There was a servicemark application for Bitcoin, but it was abandoned in July 2011.

Related trademark applications

Bitpay applied for Merchant Solutions for the bitcoin currency and Bitcoin Merchant Solutions, both also abandoned.
There is one for Bitcoin appliance, also abandoned.
Bitcoin Magazine applied for a trademark, and it's still in processing.


How do I withdraw USD from Mt. Gox through SEPA? Can Mt. Gox convert USD to EUR or do I have to convert it through Bitcoin myself?

Mt. Gox has a BTC/EUR market so you can sell your bitcoins for EUR and withdraw them.

But you mention that you already have a USD balance at Mt. Gox.  The cost to convert them to EUR within Mt. Gox will vary based on the ask price on the BTC/USD market and the bid price on the BTC/EUR market.  It is possible you can buy BTCs with your USDs, then sell them on the BTC/EUR market and even after fees still end up paying less than any other conversion method (based on the forex EUR/USD exchange rate).

However, if you simply want to do an international withdrawal, you can withdraw USDs to your bank and your bank will charge you a conversion fee to change those funds into EUR.  Wire fees from Mt. Gox apply.

For smaller amounts (e.g., less than $1K USD or so), you will likely find it more affordable to buy bitcoins and sell them for EUR then withdraw as an inexpensive SEPA transfer.


Does Satoshi Dice owe its customers money? How come? From this analysis thread:

SD Profit after fees:       22476.66146080 BTC (1.688%)
Pending Liabilities:         6821.78965204 BTC
Final SD Profit:            15654.87180876 BTC

...

  From now on my reports will include this 'pending liabilities' figure
  since it's really getting out of hand.  There are bets going back 5
  days which haven't been paid out, almost all of them are winning bets.
  In total SDICE currently owes its customers around 6800 BTC, or around
  $91,000 US in unpaid bets.

How come there are unpaid bets going back 5 days? Does Satoshi Dice always pay immediately?

SatoshiDice pays most bets instantly, but for whatever reason sometimes bets get 'stuck'.

The issue you're referring to in your question happened during an exceptionally high volume period for SatoshiDice.  They received over 70,000 BTC worth of bets in a 24 hour period, which is much higher than usual.  The high turnover apparently causes issues with paying out in a timely fashion.  This was compounded by a bug which caused too much of SatoshiDice's BTC holdings to be transferred into cold storage.

As of this morning there is only one bet that hasn't been paid out.  It was a bet for 0.35 BTC, and it lost.  So to answer your question "No, they don't currently owe their customers money.  But sometimes they do fall behind for a few days".


Is there any regulations on buying and selling Bitcoin on eBay? I see a lot of people selling Bitcoin on eBay. Since the government began regulating exchanges, are there any rules you have to follow now to sell Bitcoins on a site like eBay? Additionally, are there any rules you have to follow when buying from eBay?

According to eBay's Stamps, Currency and Coins Policy:

  Virtual currency must be listed in the Classified Ad format in the Coins & Paper Money > Virtual Currency category. These requirements apply regardless of whether the virtual currency is digitally or physically delivered. Examples of items subject to this policy include Bitcoins, Litecoins and other similar cryptocurrencies.

In particular, it appears you are currently not allowed to auction Bitcoins.


Is there a historical timeseries of market depth & transactions available? Has anyone stored the historical market depth & tick data from MtGox? Is it available publically? Would be useful if you were making a bot.

Current market depth available at

https://mtgox.com/api/0/data/getDepth.php?Currency=USD

All trades which happened in the last 24 hours available at

https://mtgox.com/code/data/getTrades.php

Retrieves 100 trades that happend after specified transaction

https://mtgox.com/code/data/getTrades.php?since="transaction tid"

A script is required to retrive all historical data, like the one posted by mizerydearia. The idea is to cycle download request while incrementing "transaction tid" aka "lasttrade" to download all data in steps.

#!/bin/bash
outputfile=data
lasttrade=0
while test -n "$lasttrade";do
    wget --quiet https://mtgox.com/code/data/getTrades.php?since=$lasttrade
    if test "`cat getTrades.php\?since\=$lasttrade`" != "[]";then
        cat getTrades.php\?since\=* >> $outputfile;
        echo >> $outputfile;
        lasttrade=`cat getTrades.php\?since\=$lasttrade|sed "s/,/\n/g"|grep tid|tail -n 1|cut -d ":" -f 2|cut -d "\"" -f 2`;
        lasttradets=`cat getTrades.php\?since\=*|sed "s/,/\n/g"|grep date|tail -n 1|cut -d ":" -f 2`;
        echo "$(date -d @$lasttradets)  tid $lasttrade"
    else
        echo Finished
    fi
    rm getTrades.php\?since\=*;
done

See MtGox - API for more http API calls.


How has the hash rate for bitcoin continued to increase despite price drops and miners dropping out? Despite price dropping in 2018, the hash rate for bitcoin tripled from around 15 EH/s to 45 EH/s. Why is this the case? I am aware that the network difficulty adjusts meaning that if miners drop off, it will be more profitable for others to mine but what are the key factors driving the hash rate increase? Is it related to the increasing ledger, an increased amount of miners, and/or other factors?

the hash rate for bitcoin tripled from around 15 EH/s to 45 EH/s. Why is this the case?

Well, at the simplest level, that means more hashing power is being used to secure the network.

This could mean that a larger number of ASIC units are running, and/or that more efficient ASIC units are being created and used. A more efficient ASIC would perform more hashes per second, for a lower cost per hash per second.

Every miner will have their own costs, motivations, etc, so it’s hard to speak broadly about ‘what miners will do if price is x and the hashrate is y’. For example, a price drop means some miners with the highest costs may no longer be able to operate profitably, but perhaps those miners are ideologically driven, and will take a loss with the hope that the bitcoin they mine will one day be worth more than it is at that time. Etc.


Blockchain size problem According to my understanding, the ledger/blockchain is stored on every computer (node) that partakes in the network. The beauty of this system is that it is decentralised and backed up by every single participant in the network. Furthermore, the security of the blockchain comes from there being so many copies, as long as there are many copies, then it's unfeasible for anyone to try to "hack" it, as too many other people have copies which would be automatically checked against your fake one to reveal the deception. On average a new block is created every 10 minutes. Right now there is a limit of 1 MB per block. So, if the limit isn't changed, then the growth rate is limited at:

1 MB every 10 minutes (on average)
6 MB every hour (on average)
Approximately 144 MB per day
Just a bit over 1 GB per week
A bit less than 4.4 GB per month
A bit less than 52.6 GB per year

How is it feasible for someone with capped internet to participate in the blockchain network as it starts to grow over time? For example, the Internet in third world countries is limited, expensive and slow. Are there any solutions out there or research being carried out which resolve the scalability problem which is currently an inherent property of Bitcoin?

SPV clients are thin clients that do not need to hold the full blockchain. They use other nodes on the network to validate transactions. SPV clients are available for Android and require a lot less disk space.
Of course it is more secure for you and for the network to run a full node.


Lightning incentive for micro-cheating? New to Lightning, and I'm having a hard time understanding something about the incentive system.
So, if block sizes remain fixed, and transaction fees become prohibitively expensive one day, owing to future btc popularity, won’t there be an incentive to cheat in channels, knowing that the cost to settle on chain is prohibitive?

Who’s going to broadcast a refund transaction that costs (one day, e.g.) $100 in fees, just to claw back a few cents from an uncooperative channel node? Isn’t that an incentive for massive micro-cheating?

Sorry if i’m massively misunderstanding how this works. Is there a way to create a channel that guarantees any side can broadcast the refund without incurring extra costs?

When the total capacity of the channel is less than it costs to close the channel, neither party has an incentive to close the channel.

If broadcasting an outdated commitment transaction returns some funds to the cheating party, the cheated party can create a transaction to claim all funds from the cheater. In the worst case, the justice transaction can just burn all funds by sending them to fees. In no case would the cheating party be able to get any gain from broadcasting an outdated commitment transaction as long as the cheated party recognizes the attack.

Thus, the potential cheater is limited to choosing to hurt both parties. This seems strictly less beneficial than just keeping the channel open.

Especially, if you consider that other channel partners of the attacker would see the channel closure on-chain and may choose to ostracize the attacker.


Trying to download miner but Google Chrome marks them as malicious/malware First I tried GUIMiner-scrypt and then cgminer-3.9.0-windows.zip

Both archives are marked as malicious in Google Chrome. I googled and have not found articles about that. Do other people get such warnings while downloading miner?

UPDATE

My links are 2 top google results
@TinS gave another download link and file is name is same guiminer-scrypt_win32_binaries_v0.04.zip but size is different.

One file is marked as malicious by Google Chrome and another not.

Don't worry, Google has added this feature into Chrome : http://www.pcworld.com/article/2059579/googles-chrome-will-automatically-block-malware.html

But it seems that sometimes Chrome marked as malicious something which is not. If you have downloaded it from the official website you don't have to worry.

If you want to be sure you can get a checksum of the file (there is not the checksum on the official page so just ask someone you trust).


What actions trigger the need to obtain a new backup with Blockchain.info/wallet? Other clients, including Bitcoin-Qt, use a key pool so that a backup is still valid for a while.

Blockchain.info/wallet doesn't use a key pool.

After a backup of the wallet is obtained and archived, when would a new backup be needed?

[Specifically, does Quick Send send change to only existing addresses?]

A new backup is required after every Custom transaction in which the change is set to go to a New Address.

If you have configured your account with an e-mail address and have marked the checkbox for Automatic Email Backups a backup will be sent automatically via e-mail for each occurrence where a new backup is required.


How are bitcoin trade profits taxed in Poland? I turned some profit when trading bitcoin on Bitcurex - likely enough to exceed the tax-free income value in Poland. That likely would mean I should declare the profits in my tax return forms and pay income tax on them, but I have no clue how they are classified and taxed in Poland. Do I have to pay tax on my profits? If so, how do I calculate how much to pay? Where do I fill it in, on my PIT forms?

Although I am no polish or live in Poland, I would recommend to claim it as you would do for a investment. If the government finds out your not paying tax, the consequences are far greater than the tax you would pay.

If your not sure then just call the tax department of the Polish government.
On Forbes Cameron Keng has written this  article, check it out and see if it answers your question. I've red it and it does give me a vague answer.

Hope this has helped


How can one see if an address is multisig? Some addresses on this page indicate whether the address is a multisig, and what the threshold signature scheme is. How do they detect this?

There are different types of addresses in Bitcoin. The simplest format is called pay-to-public-key-hash (p2pkh) which locks funds to a single private key. Another is called pay-to-script-hash (p2sh), which allows to lock funds to a script that encodes the spending conditions.

The recipient(s) of a p2sh output must reveal the redeemscript upon spending and must fulfill the encoded conditions to prove their ownership. P2sh addresses are recognized by having a 3… prefix. The most popular application of p2sh is to encode a payment to multiple co-owners, i.e. multisignature addresses. For example in the case of a 2-of-3 multisig, said redeemscript would be composed from 2 pubkey1 pubkey2 pubkey3 3 OP_CHECKMULTISIG where the "2" is the required signatures and the "3" the number of eligible public keys. The proof of ownership is then provided by two signatures corresponding to two of the listed public keys. In other words, once a p2sh output is spent, all that needs to happen is that you read the m-of-n directly from the redeemscript. ;)

Also, since the p2sh address is derived from a hash of the redeemscript, you cannot tell anything whatsoever about the content of the redeemscript until it is revealed in spending (unless you're part of the recipients that created it in the first place).

For a complete walkthrough, see CHECKMULTISIG a worked out example.


Why is a minRelayTxFee of 1000 sat/kb not equivalent to 250 sat/kw? Naively, we would expect a minRelayTxFee of 1000 sat/kb to correspond to 250 sat/kw. However, apparently this is not so according to this issue (ACINQ), which also references this issue (c-lightning).

  /**
    * why 253 and not 250 since feerate-per-kw is feerate-per-kb / 250 and the minimum relay fee rate is 1000 satoshi/Kb ?
    *
    * because bitcoin core uses neither the actual tx size in bytes or the tx weight to check fees, but a "virtual size"
    * which is (3 * weight) / 4 ...
    * so we want :
    * fee > 1000 * virtual size
    * feerate-per-kw * weight > 1000 * (3 * weight / 4)
    * feerate_per-kw > 250 + 3000 / (4 * weight)
    * with a conservative minimum weight of 400, we get a minimum feerate_per-kw of 253
    *
    * see https://github.com/ElementsProject/lightning/pull/1251
    **/
   val MinimumFeeratePerKw = 253

I thought vbytes were equal to weight units divided by 4 and rounded up, so I don't understand where (3 * weight) / 4 comes from.

I thought vbytes were equal to weight units divided by 4

It is [1], but rounded up to the next integer, so the implementation in bitcoind is :
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost, unsigned int bytes_per_sigop)
{
    return (std::max(nWeight, nSigOpCost * bytes_per_sigop) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR;
}

(Where WITNESS_SCALE_FACTOR = 4).
In addition, bitcoind not only uses vbytes for user interface but also for mempool logic and the DEFAULT_MIN_RELAY_TX_FEE constant is set in vbytes :
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;

In order to check it for standardness bitcoind will compute your transaction size as rounded up (if not a multiple of 4), and will record your transaction feerate as rounded down.
It will then compare this to the minimum relay feerate (1000) : a feerate of 250sat per KW will pass only if the size of your transaction (in weight units) is a multiple of 4.
It might be clearer with code, here is a Python function which illustrates this behaviour :
>>> def bitcoind_fun(tx_weight, feerate_perkw):
...     fees = tx_weight * feerate_perkw // 1000
...     print("Your transaction will pay {} sats of fees, is {} WU large (a feerate of {}sat/Kw)".format(fees, tx_weight, feerate_perkw))
...     tx_vbytes_for_bitcoind = (tx_weight + 3) // 4
...     tx_feerate_vbytes_for_bitcoind = fees * 1000 // tx_vbytes_for_bitcoind
...     print("bitcoind reads your transaction as paying {} sats of fees for a transaction of {} vbytes, so a {}sat/perKvb feerate".format(fees, tx_vbytes_for_bitcoind, tx_feerate_vbytes_for_bitcoind))

Which if you run with a tx_weight which is a multiple of 4 will pass, otherwise it won't :
>>> bitcoind_fun(1600, 250)
Your transaction will pay 400 sats of fees, is 1600 WU large (a feerate of 250sat/Kw)
bitcoind reads your transaction as paying 400 sats of fees for a transaction of 400 vbytes, so a 1000sat/perKvb feerate
>>> bitcoind_fun(1601, 250)
Your transaction will pay 400 sats of fees, is 1601 WU large (a feerate of 250sat/Kw)
bitcoind reads your transaction as paying 400 sats of fees for a transaction of 401 vbytes, so a 997sat/perKvb feerate
>>> bitcoind_fun(1602, 250)
Your transaction will pay 400 sats of fees, is 1602 WU large (a feerate of 250sat/Kw)
bitcoind reads your transaction as paying 400 sats of fees for a transaction of 401 vbytes, so a 997sat/perKvb feerate

So we use 253 as the feerate floor to always be safe :
>>> bitcoind_fun(1600, 253)
Your transaction will pay 404 sats of fees, is 1600 WU large (a feerate of 253sat/Kw)
bitcoind reads your transaction as paying 404 sats of fees for a transaction of 400 vbytes, so a 1010sat/perKvb feerate
>>> bitcoind_fun(1601, 253)
Your transaction will pay 405 sats of fees, is 1601 WU large (a feerate of 253sat/Kw)
bitcoind reads your transaction as paying 405 sats of fees for a transaction of 401 vbytes, so a 1009sat/perKvb feerate
>>> bitcoind_fun(1602, 253)
Your transaction will pay 405 sats of fees, is 1602 WU large (a feerate of 253sat/Kw)
bitcoind reads your transaction as paying 405 sats of fees for a transaction of 401 vbytes, so a 1009sat/perKvb feerate

By the way the comment in the code you put is wrong : it's not (3 * weight) / 4  but (3 + weight) / 4.

[1] Excluding sig OPs limits that artificially increases the virtual size to further prevent DOS.
PS: In the same vein, see https://github.com/bitcoin/bitcoin/issues/13283.


What if all nodes stopped working Based on my understanding, blockchains are stored on each node. Each node has a copy of the current blockchain and are updated whenever there is a new valid transaction. But what if all nodes stopped working? For example, there are 1,000 people currently using bitcoin. What if the computers of these 1,000 people stopped working? What will happen to the network? What if there is a new person not included in that original group of 1,000 people tried to run a blockchain client?

Without nodes in a network, there is no network.

In the situation where the 1000 nodes (or even a subset of them) suddenly came back online, the network would simply continue where it left off.

In the situation where all nodes went offline, and all existing data was lost, then the network would begin from scratch with a new blockchain whenever the nodes came back online.

Keep in mind that data loss of the blockchain is highly unlikely.  Since there are so many copies, it would take a fairly catastrophic event to destroy all copies.  In all seriousness, it's more likely that all members of the human race will be destroyed than it is for all copies of the blockchain to be destroyed.  Assuming that a copy exists, the network can always be restarted from one or more backups, and conflicting backups will follow the consensus algorithm to determine which version is more "correct".

Bitcoin is extremely resilient.


bitcoind and figuring out if it's still downloading blocks I've asked around, and it seems that to figure out that bitcoind is still downloading blocks is to run ./bitcoind getinfo and see if the "block count" is increasing.

Is there an easier way to do this, or is there a better way? How do those clients figure out that there's "30 blocks left" to download etc?

There are several ways to estimate the number of blocks left to download. The easiest is likely that the client takes a look around at what its peers are saying their longest chain currently looks like. So if you connect to 8 peers in the network it is very unlikely that all of them are still catching up with the rest of the network and therefore it will tell you what the current state, or something close to it is.

Another way of estimating the number of blocks is by looking at the timestamp included in the block that you just downloaded. In expectation a block should arrive every 10 minutes. The timestamp in the block is not allowed to deviate from the actual time it was mined by more than a fixed number of minutes (otherwise it would be rejected when it is first seen). So if you subtract the time of the last block you downloaded from the current time and then divide by 10 minute intervals you get an estimate of the total number of blocks in the network.

Notice that the second method may not be incredibly precise, especially in times the commputational power in the network grows quickly, like it is currently doing, or is reduced quickly.

As for you checking how many blocks are left, it's a simple matter of going to a trusted block explorer and comparing your blockchain height with the height they display.


Setting up Bitcoin Miner in a data center I have been running Antminer S9 in my apartment. It is too noisy, to hot, and it ruins the ambiance of my home. So I did some research and found a data center that can host my miner.

At home I access Antminer through my private IP through my router. However, in the data center I will have to get a public IP. I will have a strong password for the Antminer but I am still worried for having my ASIC publicly exposed to the world (DoS attacks etc).

I talked to a person in the data center, setting up VPN will further erode my profit margins. It is already expensive.

My questions to the community are:

Is it dangerous to set up a remote Antminer in a data center with a public IP?
What is a typical network set up when I want to host my equipment remotely?

Yes. I definitely wouldn't take the chance. Minimum is a possibility of a DoS attack. I'm not familiar with the Antminer firmware and how that's setup, but you could possibly get hacked in your WebUI. Then they could point your miner at their pool.
Yes, a firewall with VPN capabilities and a switch are your typical data center networking setups. You don't really need to set it up that way. You could use a simple home router and turn the WiFi off. Then attach your Antminers to the router. If the router has VPN capabilities, then use that. Otherwise you can setup a computer in the data center to with TeamViewer or LogMeIn. Then you can remotely access your devices through that.


Can a raspberry pi zero run bitcoin core 0.16.1 and sync up without downloading the entire blockchain? I'm looking to run a bitcoin core 0.16.1 node on a raspberry pi zero, but I don't have a 200gb+ microsd. Would I even be able to sync up with the blockchain without downloading the entire thing? Is there a lite version mode of bitcoin core 0.16.1 just for raspberry pi zero? I want to just use it to sweep private keys and make transactions.

You can't avoid downloading the block chain with Bitcoin Core  or any other full node.  That is inherent to their functioning.

You don't have to store it, however, if you enable pruning.  This would reduce your storage needs to 1 GB or less.

If all you want is to make transactions, and you're satisfied with having to trust other servers a bit more, you could use a wallet that uses SPV or gets transaction data from a centralized server.  See https://bitcoin.org/en/choose-your-wallet and look for those listing "simplified validation" or "centralized validation" as a feature.


What information is available in the blockchain How does coinmarketcap see who has how much of the market? In other words what information exists in the blockchain? Is there a link to which someone could point me to as to whether we can get this information from the block chain

This information does not exist on the blockchain. It is gathered from exchanges. The blockchain has no idea what fiat is nor does it care. The only information that exists on the blockchain that sites like coinmarketcap uses is the total number of coins in existence which is then used to calculate the market cap. Everything else is from exchanges.


How do I reverse a transaction? Ok here is the thing I lost coins on this computer trying to send them to my laptop this is what it said

Status: 0/unconfirmed
Date: 2/6/2013 14:53
To: 1PrM4QW3UtkGhi1uXFjvtDhn3h3x3pMipn
Debit: -3.98
Net amount: -3.98

How do I reverse it or stop it its been over a month and I cant seem to find how to do it.

You didn't lose them, they were successfully sent. You can see the confirmed transaction here, included in block 219,976.

In fact, the recipient spent them (sending them to 1ESTZpJUkqSQDkjyQHYAFecasEykhFWmMj) about 9 hours later.


Download single and specific block for study purposes I just started studying bitcoin.

I would like to be able to download a single block from the Bitcoin network.

This should be an old block, already mined, and which I can know the nonce.

Then I would like, via bash linux commands, to verify that such nonce solves the block.

Thanks to a question asked here, I know I could look at

https://blockchain.info/block-height/474044?format=json

However this is JSON, I imagine I can't use it to verify the nonce.

Hence my question is:

How can I download a block?
What is the file format of such block?
At what bytes start the nonce field I can increment, for example with a Python script?
Once I get to put the right (and known :) ) nonce how can verify that the block is solved? I mean, its hash should starts with lots of zeros, could I treat the block as a string and pass directly to the python hashlib function?

Thanks in advance.

However this is JSON, I imagine I can't use it to verify the nonce.

You can. You can build the block header using the data at the beginning of the JSON object and then hash that. Of course it would be easier to get the block hex, which you can get by going to the block hash on blockchain.info and appending ?format=hex to the url. For example, for the block height you linked, the hex of that block can be found here: https://blockchain.info/block/000000000000000000ff265a641721e79bbc559d8b0e4894332732109f1a3383?format=hex

  How can I download a block?

Get the block hex. That is the raw data for the block itself. You could make it a file by putting the hex in a hex editor or just save the hex as a string in a text file.

  What is the file format of such block?

Blocks don't have a file format. They are just blobs of binary data which you will need to understand how to parse. https://bitcoin.org/en/developer-reference#serialized-blocks explains the block serialization.

  At what bytes start the nonce field I can increment, for example with a Python script?

The part that is hashed is the block header, the first 80 bytes of the block. The nonce is the last 4 bytes of that header. You can read about the format of the block header here: https://bitcoin.org/en/developer-reference#block-headers

  Once I get to put the right (and known :) ) nonce how can verify that the block is solved? I mean, its hash should starts with lots of zeros, could I treat the block as a string and pass directly to the python hashlib function?

No. The block header is not a string. It is a blob of binary data. In python, the easiest thing to do is to make it a bytes object and then pass it in to hashlib.

If a block's proof of work is valid (note that does not mean the block itself is valid), then after you hash it with SHA256 Double, you treat the output as an integer and compare it to the nBits field of the header. The nBits field a 4 byte field beginning 8 bytes from the end of the header and is a compact representation of the target. You can read about how to interpret it here: https://bitcoin.org/en/developer-reference#target-nbits. The block hash (treated as a large integer) must be less than the target specified by the nBits field.


In Blue Wallet 6.0.2 for iOS, pressing on Bump Fee causes an infinite wait. Any idea why? Think there might be a bug in Blue Wallet, I imported the said wallet to BlockChain.com iOS App, but the unconfirmed transaction was not even shown there.
In short, how can I CPFP my transaction now?

It is a bug. I concluded that when it worked correctly on a different transaction.


what is blockchain.info testnet api url? there is a testnet for blockchain.info here but I can't find a url for calling api(s) in testnet as such we have in main network

on main network
https://api.blockchain.info/v2/receive?xpub=$xpub&callback=$callback_url&key=$key

and for example on testnet
https://api.testnet.blockchain.info/v2/receive?xpub=$xpub&callback=$callback_url&key=$key

is there anybody know where the testnet api url is?
Thanks,

Have you checked https://testnet.blockchain.info/api?

For instance, to get a raw tx:

https://testnet.blockchain.info/rawtx/tx_id


How can I find a transaction on my Bittrex Ripple address with tag? Bittrex didn't deposit the XRP due to some technical issues and now asking for transaction Id. How can I find the transactions on my Ripple address and tag that happened a few days back?

I tried looking up on Bithomp, XRP Charts, but nothing is that helpful. If there's an API which I can program, I can do that as well.

Please help, thank you!

Bithomp now shows transaction hash (id), in the transaction block. You need to press on the orange i. The problem that is shows only first or last 200 transactions. You can use ripple api, to get the info as well.
https://ripple.com/build/data-api-v2/


Problem getting bitcoins into Bitcoin Core on Mac I'm using Bitcoin Core on a MacBook Pro. A few month ago my computer crashed and I lost everything, so when I got a new computer I reinstalled Bitcoin Core but now I'm having an issue getting my bitcoins to show up in the newly installed Bitcoin Core. I have both the BTC address and the transaction ID under which the bitcoin were transferred to me when I purchased them and I have tried to add both of these on the page where you request payment, without any luck. Not sure what to do to get my bitcoin back as Bitcoin Core has even finished its synchronisation with the network and they are still not showing up...

M

You would need a backup of the old wallet.dat from bitcoind, the bitcoin address and transaction information are available to the public. If you were able to recover funds with that information then anyone would be able to 'recover' your coins. Unless you have made a backup you have most likely lost your coins. In the future make sure you always have a backup of your wallet.dat or private keys/seed words (depending on wallet).


Am I really understanding how the "Trezor Model T", and hardware wallets in general, work? Getting increasingly paranoid about losing my coins, I've yet again (for probably the 20th time by now) went looking for hardware wallets. The only semi-reasonable one seems to be the two Trezors. All the others seem fishy/unreliable to me.
But as I read and watch and listen, it seems like even the "premium" Trezor Model T requires "OS support" and even to go to a webpage (not hosted on the device itself) to actually use it. Its operations are not at all self-contained in the device itself.
Up until now, I always had the idea that the Trezors (even the first model) is entirely self-contained, and only plugs into a computer in order to use its network capabilities to be able to send coins and update its data. (Of course, doing all the validations and verifications on the device, so it doesn't have to trust the network or the computer it's plugged in to.)
Actually, I vaguely had the idea that I would be able to buy one and then physically take it with me somewhere, without any computer around, and sort of "beam" any amount of my coins into another person's Trezor or even other hardware wallet...
None of this seems to be the case. Even the expensive model with the touch screen appears to be entirely reliant on the "host computer" to do anything besides storing the coins. I bet the special Trezor "coin control panel" webpage doesn't even support my browser (I don't run spyware), and who knows how long that will stay online? I don't want to rely on some company's website, or require special "OS support" for my hardware wallet. That's why it's a hardware wallet! For it to be stand-alone.
Am I missing something fundamental? Are there no "actual" hardware Bitcoin wallets which can do everything by themselves: send and receive coins without any computer? I don't even have wireless Internet at home, but most people apparently have, so I definitely expected it to be using "wifi" on its own, but this doesn't seem to be the case?!
I really tried to find this out by myself before asking.

Hardware wallets such as the Trezor ones you mentioned are only a secure method of storing and using your private keys.  When you want to send BTC, that transaction will be signed mathematically completely within the confines of the key itself.
One could design a hardware wallet with a full user interface, negating the need for a separate computer all together, but that would be far more expensive; in the realm of the price of a modern mobile phone.  Keeping the code inside a Trezor to the utter minimum reduces the potential for security weaknesses and improves reliability, too.


(Shouldn't be too hard) Where vanitygen checks if the random address starts with the expected pattern? I've been trying the find the code in Vanitygen that does checks whether the generated address starts with the expected pattern.

Vanitygen repo: https://github.com/samr7/vanitygen

What I currently know:

vg_output_match_console is called when the generated address starts with the expected pattern.
vg_exec_context_calc_address generates the address as a byte array, which is probably used.
get_prefix_ranges finds the range of the bignum of the address we want to generate, such that all bignums in that range start with the expected prefix.
vg_encode_address generates the address in Base58, however is run only at the end.
vg_prefix_avl_search seems to be an important part (that does what?)

Recall that vanitygen allows you to list several patterns and search for addresses that match any of them.  It looks to me like for each prefix, we compute the range of hash160 values that, after base58 encoding, would match the desired prefix.  (Conveniently, the checksum only affects the end of the address, so we don't have to worry about it.) These ranges are put into an AVL tree.  Then vg_prefix_avl_search takes a generated hash160 and searches the tree to see whether it matches any of the desired ranges.  Note this means that base58 encoding doesn't actually have to be done at all for addresses that won't match.

If we are in regex matching mode instead, then the relevant code is in vg_regex_test which is pretty straightforward: compute the base58 encoding and match against the given regexes.


Who decides that the new block is ready to hash? I know that new blocks are relayed one block per 10 minutes but that time is not exact but average so: Who decides that the new block is ready to hash?

A new block is ready to hash as soon as the last block has been solved. Miners immediately start to try solving the next block. As soon as one of them succeeds, that block is published and all the miners move to work on the following one.

The difficulty is adjusted so that a solution is found by somebody, out of all the active miners, on average about once every 10 minutes.


Unconfirmed transaction sitting in blockchain.info for 10 days I have this unconfirmed transaction:
https://blockchain.info/tx/b0d2e665a4c32deebac93ddd8e457bad6d3906834d908efecbf81a858ac92ae2

sitting in blockchain.info wallet for 10 days. When will the network drop it?

At the time of sending it, I did not change any fee and left it on blockchain.info wallet to calculate fee..

When will the network drop it?

Never. Why should network drop your transaction without an action from your side?


Question solved by bitcoin miners What computational questions are solved by bitcoin miners and what is the computational complexity of one instance of this question. Essentially, how would someone program an application for bitcoin mining.

If you want a bitcoin miner of your own, don't reinvent the wheel and instead use efficient software. You're wasting your time if you aren't mining with ASICs anyways.

I like to think of mining Bitcoins as a way of bruteforcing SHA-256. Basically the difficulty of the Bitcoin network determines how long it should take the total computing power of the entire Bitcoin network to brute force or 'guess' the input to a SHA-256 function. By making the input sufficiently complex, the Bitcoin network can control how often new blocks are awarded. This concept decentralizes the currencies by enforcing a proof of work system. It comes down to the math behind computing algorithms and time.


How do I get wallet balance using xPub address with blockain.info api? I am using blockchain.info api. I know how to get wallet balance using wallet id and password.

Couldn't find how to find wallet balance using my xPub address.

See this link:

Multi Address
https://blockchain.info/multiaddr?active=$address|$address
Multiple addresses divided by |
Address can be base58 or xpub
Optional limit parameter to show n transactions e.g. &n=50 (Default: 50, Max: 100)
Optional offset parameter to skip the first n transactions e.g. &offset=100 (Page 2 for limit 50)


How my network will differ from bitcoin I read a lot about how bitcoin clients find each other. I would like to do a fork from bitcoin and I have a question. How my network will differ from bitcoin? How the client will understand if this is bitcoin's client or mine?

This seems like a silly question. If you're going to create new software, it will work as you program it.

It will differ in exactly the ways you make it.


Does the chainstate leveldb only contain "addresses" for P2PKH and P2SH? I'm writing a small script that will dump the utxo database to a text file. As far as I'm aware, these are the most common script patterns indicated by the type field inside each value:

e.g. value:    b98276a2ec7700cbc2986ff9aed6825920aece14aa6f5382ca5580
               <----><----><><-------------------------------------->
                /      /    \                   \
 height/coinbase  value      type                script data

0x00 = P2PKH (hash160 public key)
0x01 = P2SH  (hash160 script)
0x02 = P2PK
0x03 = P2PK
0x04 = P2PK (uncompressed)
0x05 = P2PK (uncompressed)

It seems as though the script type is there so that you only need to store the minimal amount of script data inside the database (e.g. the unique public keys and script hashes inside P2PK, P2PKH, and P2SH).

Anyway, would I be correct in assuming that you could only get an address from script types 0 and 1 (by base58 encoding the script data)?

In other words, the chainstate leveldb does not include any witness data to allow you get addresses for utxos using P2WPKH and P2WSH scripts?

EDIT: Here's the finished tool: https://github.com/in3rsha/bitcoin-utxo-dump

Yes, Bitcoin Core does do some compression of standard output scripts in order to store the minimal amount of data needed.

  Anyway, would I be correct in assuming that you could only get an address from script types 0 and 1 (by base58 encoding the script data)?

Yes

  In other words, the chainstate leveldb does not include any witness data to allow you get addresses for utxos using P2WPKH and P2WSH scripts?

If by witness data you mean Segwit outputs, no. ALL output's scriptPubKeys are stored in the database, otherwise it would be unable to verify transactions that spend arbitrary scripts and segwit scripts. These scripts are stored without special compression (i.e. the type stuff going on here) and just serialized as is. Segwit outputs are already in a minimal form so there is no need for a type here.

Since all scriptPubKeys are stored in the database, you can compute the address for every UTXO if it has one, including segwit UTXOs.

Also, the term witness data refers to the signatures and input data for a transaction that spends a segwit output. It does not refer to anything that is segwit related. Using the term "witness data" in your question is confusing.


Batching transactions - calculating batch transaction fee I want to use transaction batching to make BTC payments to multiple recipients.

In order to optimize transaction amount \ size, lets I'm making equal transfers of x BTC to N recipients, and that F(x, N) is the function representing the transaction fees.

How would this function look like?
How can I calculate it in any given time, to optimize transaction fees?

The function would not work because the transaction fee is based upon the size of the transaction in bytes (well really its weight, which is based on the bytes). While the number of outputs is a factor in this, the other factor is the number of inputs, and what type of inputs they are. So given just the outputs (the value of the outputs doesn't even matter), you still cannot determine how much in transaction fees that you will need to pay. Thus your function F(x, N) would not work.


How can I participate in a mining pool that is mining Litecoins? To date I've only participated in mining GPU-optimised crypto currencies. I wondered what happens when I pointed my GPU miner to a Litecoin mining pool worker, Litecoin being designed to be optimised for CPU mining.

I tried do this for just three shares on coinotron.com and according to guiminer (running Phoenix) two of them were rejected as stale and one was accepted. However, my worker on coinotron.com registered no shares submitted at all (which is probably correct, since it's likely a GPU miner won't work at all for Litecoin).

If I can't use Phoenix, then what do I use to participate in a Litecoin mining pool?

Litecoin doesn't use the same algorithm as Bitcoin. Bitcoin hashes are SHA-256 based.
Litecoin hashes are Scrypt based. You must use a miner capable of understanding scrypt.  Early in Litecoin history there were no GPU capable miners as the performance of GPU relative to CPU was very poor.  In time GPU performance increased and today most mining software supports both SHA-256 and Scrypt.  Part of the reason that GPU mining is possible is that the Scrypt parameters used in Litecoin (and other clones) have been selected to reduce the "memory hardness" of the algorithm.  The default parameters for scrypt are n=2^20, r=8, p=1.  The Scrypt used by Litecoin uses the parameters n=2^10, r=1, p=1 making it roughly 100x less memory hard and allowing GPUs to out perform CPUs while they are unable at n=2^20, r=8, p=1.


why is the blockchain necessary if bitcoins utilize cryptography Mainly I am proposing the idea below because I feel that the blockchain is overkill, but I assume I must be missing something. So if someone could pick out the flaw below, I would greatly appreciate it.

Suppose there is an alternative architecture:

Every user holds a complete ledger, not of all historical transactions, but the current balance of every other user. To send a coin, I would simply send out a message to every node saying who the money is going to and how much. Then using my address (public key), all other nodes can determine if the message actually came from me, and if so alter their copy of the ledger. As a fail safe against double spending, before this alteration takes place, every node would then query other nodes and see if if the majority have received the same message. If two transactions are present, it would enact the earliest timestamped trade (or whoever the majority thinks is first), then accept or reject the later based on balance.

Problems:

1) Sybil attack (this is actually a huge one and has been for decades and decades in all kinds of applications). Other answers already mentioned this too. What is a majority if one attacker can easily pretend to be 10 million nodes?

Bitcoin makes (mining) nodes do Proof of Work and it's the amount of (unfakeable) work done that counts, not the number of (easily fakeable) nodes.

2) Timestamp? There is no such thing as an "earliest timestamped trade". Transactions arrive at different nodes at different times. Do you trust the timestamp that the attached put inside the transaction or do you listen to the majority (see 1).

Note that Bitcoin decides what is "earliest" by constructing a global clock that beats very irregularly, but on average every 10 minutes.

3) Initial download. Where in your system is a brand new node going to get the current ledger? From the majority? (See 1) Bitcoin solves this by keeping the history so as long as you start with the initial genesis block, you'll arrive at the current ledger without having to trust anyone.

4) Keeping balances is actually not more efficient at all if you care anything for the pseudonymous nature of Bitcoin. Every address is supposed to be unique so if you keep a balance for every address it's still going to be big. Sure you can drop zero balances but Bitcoin does that too in the UTXO set. Once validated old blocks don't matter anymore at all. They get archived on disk or even deleted (pruned). So the 50GB of blocks don't matter anymore anyway.


System requirements for running a Bitcoin Core node on testnet What are the minimum systems requirements for running a Bitcoin Core full node on testnet?

According to https://tbtc.bitaps.com/ today it's ~20GB. The RAM usage is similar to that of running a Bitcoin node on the main net.


Is there a way to get all addresses from an Wallet? If I was to search the blockchain for address X, then I see that it has two inputs in a transaction, X and Y.

I can safely assume that X and Y are owned by the same person?

Now if I look at all of the transactions for Y, and I see that it has a transaction with two outputs, Y and Z.

Then I can now assume that X, Y and Z are all owned by the same person, right?

If a wallet has 10 addresses, then could I not get all of those addresses using the above method?

So I essentially assume that, all inputs and outputs belong to the same person for a given address lookup.

Also, if X is both on the input and the output, then it is safe to assume that X being on the output was just used as a change address.

If I was to search the blockchain for address X, then I see that it has two inputs in a transaction, X and Y.
I can safely assume that X and Y are owned by the same person?

That's usually the case, but not always.  They could be owned by different people who have cooperated.  It is possible to do this in such a way that neither party reveals their private key to the other.

Now if I look at all of the transactions for Y, and I see that it has a transaction with two outputs, Y and Z.
Then I can now assume that X, Y and Z are all owned by the same person, right?

No, that's not a good assumption.  When a transaction has two outputs, there is no reason to think they both belong to the same person.  In fact, a more common case for two-output transactions is that one of the outputs is the "real" payment, and the other is "change" that goes back to another address belonging to the same person who sent the payment.  (See How does change work in a bitcoin transaction?)  However, there is no way to be sure which is which.

If a wallet has 10 addresses, then could I not get all of those addresses using the above method?

Nope.  If you continue in this way, you'll pull in a vast number of addresses belonging to different people who were paid by your initial target (and people who were paid by them, etc, etc).  You'll also miss any addresses from the wallet that have been used independently, if they've never appeared together in a transaction with any of the other ones you saw.


Are there any other ways of speeding up the building of Bitcoin Core PRs other than ccache? I am already using ccache to speed up recompilation when building Bitcoin Core PRs. Are there any other ways of speeding up the process?

Will Clark answered this question on IRC.
You can reduce the time it takes to run ./configure by using ./configure -q -C. -q is quiet and -C removes terminal printing and uses a cache (like ccache). It reduced Will's configure time from 29 seconds to 10 seconds. For more details see this info page.


How bitcoin distributed to more than 1 miner as bitcoin-mining lottery only choose 1 miner? newbie here.

As my understanding, many miners are working on hashing a block, any more than 1 miners could get the correct solution. But according to the "lottery" principle, only 1 miners will found the block, add it to blockchain and receive the reward.

My question is, why do a single miner with a single CPU can get small amount of BTC (like 0.00000x btc/day) since we cant compute with strong computing power and there is only 1 winner, he/she should receive completely 25 btc.

Is my understanding on "mining" incorrect?
Appreciate if anyone could answer :)

Your understanding of mining is correct. Using standard mining, you work on your own trying to hash a block trying random nonces until you find one that works.

When you find a block, you write in your bitcoin address into the coinbase transaction in the block and you receive the block reward (currently 12.5 BTC).

However, like you say because of the lottery principle, the probability that any single miner will find a block is tiny, so how do people make 0.00x BTC a day instead of making 12.5BTC every few decades? (when they find a block by chance).

This happens because of mining pools. A mining pool is a group of people that work together to mine, and when one of them finds a block they split the reward based on how much work each miner did. This means that you earn the same amount of BTC every time the pool mines a block, regardless of who in the pool mined it (giving you stable income).

When mining in a pool, you don't mine blocks directly, but you mine a subproblem created by the pool (esentially much easier blocks). This means that the pool can actually verify how much work you did by checking your solutions to the subproblems, instead of just trusting every miner to correctly report how much work they contributed.

This also means that a miner can't just take the block for themselves, as only the pool has the information to actually construct a block. Thus, many people can mine together without every miner needing to trust every other miner. They just need to trust the pool. The pool usually takes a 1% cut or similar of the mining reward.


Accidentally Sent BTC to bitcoin core watch-only wallet with private keys disabled I think I already know the answer to this, but I just want to make sure as it will result in a loss of funds. I have Specter desktop connected to my bitcoin-core. But because I also sometimes use the core wallet as a hot wallet as well, I accidentally generated the address in the core wallet that is linked to my specter wallet, but the core wallet is a watch-only wallet with the priv keys disabled and then I sent funds to this address and not the address generated by specter or my default core hot wallet. But because this is watch-only my core wallet does not have the priv keys. I am doubtful but is their anyway for the wallet to know it generated this key by enabling priv key.

The Bitcoin would then be whatever addresses your watch only wallet is watching. Bitcoin Core won't just generate a keypair and throw away the private key, that would result in fund loss. In a wallet with private keys disabled, it will only use what has been imported into it in order to create addresses. If nothing has been imported into it, then it won't be able to make new addresses at all.
If the watch only wallet was created by Specter and it imported keys into that wallet, then you should expect to see your Bitcoin in Specter as well.


Are BTC Private Keys evenly distributed in 256bit space? If we assume that there are ~2^96 private keys for EACH bitcoin address (2^256-160) and we assume that in cryptography it is considered good property of every hash function if it evenly distributes the values in its co-domain (co-domain of the SHA256 function is the domain of the RIPEMD160).

Does that means that HALF of the ~2^96 private keys is in first 2^159 and other HALF is in 2^160 - 2^256 space?

The random number generators that generate private keys should follow a uniform distribution as this is the distribution that maximizes entropy.

As the private keys that are used are not known we can't measure if the keys in use have been statistically speaking distributed uniformly.


What is an "unspent output"? What is the meaning of the term "unspent output" in the Bitcoin protocol?

An unspent output is simply an output of a transaction which isn't yet an input of another transaction.

To take the example from ripper234's answer (in which generated coins are immediately spendable, and we don't have to wait 100 blocks for them to mature), where:

The first block contained 50 mined BTC in address A (A = 50)
The second block contained 50 mined BTC in address A, a transaction sending 20 BTC to address B, and putting the change in address C (A = 50, B = 20, C = 30)
The third block contained 50 mined BTC in address A, a transaction sending the 20 BTC from address B to address D (A = 50 + 50, C = 30, D = 20)

So, after three blocks, there are four unspent outputs:

A has two unspent outputs worth 50 BTC each
C has a single unspent output worth 30 BTC
D has a single unspent output worth 20 BTC

And there are two spent outputs:

the 50 BTC generated in the first block, spent in the 2nd block
the 20 BTC output created in the 2nd block and spent in the 3rd block

Note that unspent outputs don't merge together.  The two unspent 50 BTC outputs at address A are separate, and will remain separate at least until they are spent in a transaction


My Bitcoin Transaction is Unconfirmed from last 10 days Please Help Tx id

  9c9fb0d1c60f6f59196c9c41c1b9eb7ad9caf32397f5264f54149af6ecfd8003

Please Help

Use RBF (Replace By Fee) to increase your fees and expedite your confirmation time.


Transaction to "dynamic" wallet doesn't arrive? about one week ago I tried to make a deposit to a service called "escrowbitcommunidad" (some of you might know it). They are using some kind of "dynamic" wallet addresses, meaning each time one reloads the payment page, the BTC address they display changes (please excuse my lack of professional terms).
Now, I sent the bitcoins to the address they displayed using the etherum BTC client, the transaction ID is:

1968cc2b31b396c3ef0677c69ed68a588f6bdec1ed9e60fcb8500fddda46b068

From this, it seems like the transaction is completed already, however the BTC did not arrive to my account so far and from what I've heard from other users, this is a common problem caused by some delay in the blockchain (?) system.
As you will have noticed, my understanding of how bitcoin transactions work is very rudimentary. Can someone briefly explain me where the problem could be?

It appears the transaction with that id actually exists, you can verify it because Bitcoin transactions are public https://www.blockchain.com/btc/tx/1968cc2b31b396c3ef0677c69ed68a588f6bdec1ed9e60fcb8500fddda46b068. Indeed since it has ~900 confirmations, at an average block time of 10 minutes (Bitcoin protocol rules), it was first confirmed about a week ago.

The only explanations I can think of is related to the service and their application. If they do not choose to acknowledge the transaction or that it was sent to an address you own, that is between you and them.

  from what I've heard from other users, this is a common problem caused by some delay in the blockchain (?) system

To answer this question, when you first submit a transaction to the Bitcoin network, the nodes will validate it, and if it passes, it will propagate throughout the nodes on the network. It is added to each node's mempool, which is where the transactions wait until a miner decides to add them to their block, and attempt to mine that block for a reward. When a miners decide to add your transaction to the next block is entirely up to them, but is generally dependent on the fee you decide to give them. The wallet software you used lets you select this fee, so the higher the fee the faster it will be mined (generally).

Another thing to understand is the application that is waiting for your transaction can decide how many blocks need to be mined after your transaction was submitted. This is known as confirmations. The reason for waiting more than 1 block is that if there is a conflict and 2 miners mine a block at the same time (unlikely), there is a reorganization of the blockchain, and your once confirmed transaction may become unconfirmed. So, it is a way to establish how permanent that transaction must be to be considered final. 6 is a typical minimum confirmation in Bitcoin, but can be higher or lower depending on the service or application. ~900 confirmations is much higher than usual and there should be no problem with confirmations with the service you used.


Can a system of trust be built on top of the current block chain One way to expedite small transactions would be to have all of the miner shun all further transactions by someone who has attempted a double spend, then if someone only wants to transfer less than 50% of their wealth then it can be assumed that it is a valid transaction because their expected return with a successful double spend is exactly what they would do with a valid transaction.

As far as I understand all that would be needed for this to be put into place would be to update the protocol, the blockchain can be preserved. Am I wrong? Is this a bad idea?

This won't work. Consider:

I send you 1 Bitcoin from an account that has 2 Bitcoins to an account of yours that has 99 Bitcoins.
Your account now has 100 Bitcoins. You rely on this new system and consider my transaction to you confirmed. You send the 1 Bitcoin I sent you and 9 other Bitcoins you had before to someone else.
I double spend the 1 Bitcoin I sent you. Your transaction of 10 Bitcoins is now a double spend as well.

Now, there are two choices and they both suck:

Only my account is frozen. But anyone who relied on your transaction is screwed with no recourse. And only my 1 Bitcoin is frozen even though someone got screwed on a 10 Bitcoin transaction from an account holding 100 Bitcoins.
Your account is frozen. But you did nothing wrong but rely on my transaction, and now your 100 Bitcoins are frozen.

You and I may or may not be in collusion, and there's no way to tell which just from looking at the transactions.

You are operating on a set of false assumptions about how double spends actually occur.


How are transactions and blocks relayed? What is the protocol for relaying transactions and/or blocks in bitcoin? I realize that nodes never relay a transactions and blocks with a variety of properties (e.g., invalid transactions). This question is concerned more with the specific broadcast/relay protocol. In particular, are there any issues with broadcast loops and if so, how are they solved? Is it as simple as each node remembering which txs and blocks it has already transferred and never relaying twice? Thanks.

The Bitcoin protocol specification can be found on the Bitcoin Wiki. The Network wiki page has information on how information is relayed using the protocol.

Clients exchange messages over TCP/IP. With this messages, they can express their state of the blockchain and request others to send them parts they do not yet own. When you want to broadcast a new block or transaction, the inv message type is used to let people know you have the new data. Since no other client has that data already, it will request the data element using getdata. You will reply with a block or transaction message.

So basically, to reduce bandwidth usage, only an inv is truly relayed. Each node will then request the new data from one of the other nodes that broadcasted the inv.


Has a consensus algorithm where temporary authorities are fairly “elected” via PoW been discussed? In the usual proof-of-work consensus system, miners constantly compute hashes (“wasting” resources). What if hashing were restricted to a certain time window, e.g., 1 hour per day?

This could act as a leader election for the remainder of the day. These leaders are “representative” of the entire network since they’re sampled using PoW.

The leaders could then use some Byzantine fault tolerant consensus algorithm to decide what blocks to append — without mining — until their “term” is up.

Has such a system — or something (even vaguely) similar — already been discussed?

The obvious question is how vulnerable this system is to colluding attackers. (Clearly it is weaker than the usual “51%” majority rule, but exactly how bad is it?)

If we assume that the BFT consensus algorithm can tolerate a fraction of 1/3 bad leaders, we can calculate the probability of a successful attack as a function of the bad PoW capacity share using some binomial distribution maths. Some back-of-the-envelope Python calculations suggest that perhaps 20% bad PoW share is tolerable, which isn’t absolutely terrible.
Maybe there is no known BFT consensus algorithm that would scale to anything close to the Bitcoin network (e.g., in PBFT the number of “replicas”, i.e., leaders, is << 100).

I’m sure there are plenty of other potential problems, I’m just wondering if it is feasible at all. Perhaps it has been discussed in some other context.

I’ve since found several related concepts in research papers or coin protocol proposals:

Bitcoin-NG separates leader election (key block) and the following “election term” (epoch), in which microblocks are freely added by the leader.
Tendermint (and, before it, Hyperledger) uses BFT consensus (but with PoS as the basis for elections).
Building upon the previous, ByzCoin elects leaders via PoW and uses PBFT to agree on the microblocks.

The article The Road to Scalable Blockchain Designs gives a good intro to and context for ByzCoin. Exploring the citation graph of the ByzCoin paper leads to further similar work at ETHZ and Cornell as “hybrid consensus” or a “strongly consistent” blockchain.

None of these use the energy-savings aspect that motivated me; instead they all aim at improving throughput and/or transaction verification time. But the “PoW leader election + BFT consensus” concept seems to be pretty actively researched.


How many zeroes does the current target have? I'm trying to get my head around the difficulty setting of Bitcoin.
How can I calculate how many zeros the target string needs to start with?

17 judging by the latest blocks published on blockchain.info:
https://blockchain.info/block/0000000000000000057fcc708cf0130d95e27c5819203e9f967ac56e4df598ee


How can block time and block size be fixed when transaction volume is constantly increasing? As I understand it the network rejects blocks over 1MB, and block hash difficulty is set after each block is created as to keep the block time close to 10min.

But if people are constantly joining the network, and the rate at which transactions are sent to the network are constantly rising, then eventually more than 1MB of transactions will be added to the network every 10min.

What happens as the transaction rate approaches and passes 1MB per 10min? Is this a valid issue?

When transactions are received, nodes will hold those transactions in memory (the mempool) whilst mining software attempts to mine a new block. A miner will try to fit as many transactions into a block as they can, so as to earn more fees if they successfully mine a block.

If there are more transactions than will fit in the block, the miner must filter them so as to include enough while keeping under the block size limit. The filtering method typically used is to order transactions by fees paid, and include the highest fee transactions, because this results it the biggest payout if they are successful at mining the block.

Any transactions which were left in the mempool will then be candidates for adding to the next block in the chain, but will be placed under the same filter whilst additional transactions are coming in from the network also. This means that a transaction only paying low fees may be in the mempool for a long time because they are deprioritized over transactions which are paying more.

This creates a fee market for block space. People who require their transactions to be processed in a timely manner - the next few blocks, will pay a higher transaction fee which will promote them to the top of the queue, whereas people who have no urgency for their transactions to be processed will pay a lower fee and be willing to wait until the size of the mempool is reduced.

As transaction volume increases due to more demand, people must either pay more fees, or utilize new technologies to reduce the size requirements of their transactions in order to pay less in fees. Some techniques for achieving this are batching transactions, using payment channels (like the Lightning Network), using sidechains, and using future improvements to the bitcoin itself, which will allow for signature aggregation, and removal of unevaluated branches of bitcoin script.

  As I understand it the network rejects blocks over 1MB, and block hash difficulty is set after each block is created as to keep the block time close to 10min.

The difficulty is adjusted every 2016 blocks (approx 2 weeks), by taking into account the blocks created over that period. Blocks are not necessarily every 10 minutes, because it is a random process of finding a valid hash which is under the target value, and can range from seconds to an hour or more. It averages to approximatetly 10 minutes over extended periods of time due to the regular difficulty adjustment.


Enable Bitcoin payment for a new SaaS I'd like to create a Software as a Service (written in Python, so it would be nice to have good for this language) with some paid content in BTC.
Basically, I would like that users are able to pay:

Directly in BTC. I have identified Coinbase and Bitpay, but I would
also consider using a wallet on my own (in this case, I will use
bitcoinlib).

Through a "broker" with PayPal, Visa, etc. and I receive BTC.

I am interested to know your experiences/opinions and if you can give me some pointers.

Look no further than BTCPayServer - "a self-hosted, open-source cryptocurrency payment processor. It's secure, private, censorship-resistant and free."
The description above taken from their website is absolutely spot on. BTCPayServer allows you to easily accept payments for free, and without an intermediary (unlike Coinbase, BitPay, paypal etc - don't use these, there's absoluteley zero need to pay their exorbitant fees!). It's a fantastic project built and funded by a whole host of awesome bitcoin devs and contributors.
There's a number of very easy deploy options and plugins (e.g. WooCommerce and Wordpress).


BIP39 Manual Phrase Calculations - How are Multiple checksums valid? Need some help understanding the math regarding why multiple checksums work for mnemonic phrase generation (BIP39).

Let's assume a 12 word passphrase. If we divide the 2048 wordlist into groups of 16 ... exactly 1 word out of 16 word "block" will be a valid checksum for the 11 words selected.

With a 24 word passphrase, 1 word out of every 256 would be a correct checksum.

When generating a phrase by hand... I know that the ENT / 32 bits of the sha-256 hash are appended to the entropy to generate the checksum word.. but this generates one specific word.

So I guess my long-winded question is ... what is the math behind other checksum values being valid? I guess my real question is how is the ENT + CS validated as legitimate?

See this example:

Entropy (128 bits): 11010011 01100100 00000010 01011110 01010011 11101100 01010011 01101110 01101010 01111000 11010010 11011000 10111010 00100011 11101100 11110010

SHA-256 Hash of entropy = 14 c5 8b c9 05 11 5e 08 27 49 61 1e 48 d6 04 c0 2a 70 8c 39 ad 6c dc 0c 91 2f 70 62 c3 24 71 23

First 4 bits of SHA-256 Hash = 1 (hex) Binary = 0001

Generated Recovery Phrase: square cactus nurse pond share rescue prepare bottom suffer speed will tomorrow

another valid phrase (with same entropy but different checksum): square cactus nurse pond share rescue prepare bottom suffer speed will account

Account = 13 (on the BIPS39 wordlist) Subtract 1 since word index starts at 0 = 12 12 to binary = 1100 Hex = C

C (hex) != 1 (hex)

another valid phrase (with same entropy but different checksum): square cactus nurse pond share rescue prepare bottom suffer speed will acoustic

Acoustic = 17 (on the BIPS39 wordlist) Subtract 1 since word index starts at 0 = 16 16 to Binary: 10000 Hex = 10

10 (hex) != 1 (hex)

I guess I'm also confused how these checksums are valid when their values do not equal the first 4 bits of the SHA-256 Hash of ENT?  I'm guessing it has to do with how the checksum is validated (and pointing back to my original question)?

You aren't actually encoding the same entropy with different checksums. The last word does not encode just the checksum, it also encodes some portion of the original entropy. For a 12 word mnemonic, the last word encodes 7 bits of the original entropy and 4 bits of the checksum.
In your example, the last 7 bits of the original entropy is 1110010. Combined with the 4 bit checksum of 0001, the corresponding word is tomorrow.
In your second phrase, the last bits of the encoded entropy is actually 0000000 which changes the checksum bits to 1100 so you get a different word, account.
In your third phrase, the last bits of the encoded entropy is actually 0000001 which changes the checksum bits to 0000 so you get another word, acoustic.
So in actuality, BIP 39 mnemonics have unique last word because it is a combination of the original entropy with the checksum which is unique. Changing the entropy bits changes the checksum, and changing the checksum invalidates it.

Original answer which is still correct but not applicable to this question.
A careful reading of BIP 39 shows that there are not multiple words which fit the checksum. Rather the BIP is so broad that invalid checksums are allowed and should only be warned against.
In your example, the second phrase is actually invalid. But BIP 39 says that such invalid phrases should be allowed, and so the wallet software will allow it. The checksum is effectively ignored and not checked (which kind of defeats the purpose of a checksum).


Understanding a Mysterious Bitcoin Transaction I recently sent someone .5 Bitcoins, from the wallet on my Trezor.

My Trezor wallet shows a transaction of -.5 bitcoins (actually slightly more than .5 because of the transaction fee of course).  Moreover, the balance showing on my Trezor is exactly what it should be --- that is, .5 less than it was before. And moreover, the recipient received exactly .5 bitcoins.  So it looks like everything went exactly as it should.

However, when I look up the transaction on the blockchain, I see this:

This appears to show 43.99 Bitcoins leaving my wallet, .5 of them going to the recipient, and the remaining 43.49 going to some mysterious other address.

This almost makes it appear that somebody somehow managed to steal 43.49 of my Bitcoins, but given what's showing on the Trezor I'm not too worried about that. (As I said, the Trezor balance has been decremented by just .5, as it should be.  In case it's relevant, the total balance on the Trezor is substantially more than 43.99.)

I'm guessing that somehow what happened is that for some reason the 43.49 extra Bitcoins were taken from my wallet and returned to me, but then I wonder why that doesn't show up on the list of transactions on my Trezor.  And the address to which the 43.49 were apparently sent does not match any public key that I have any record of ever having used.

Bottom line:  I'm not too concerned, but I'd sure like to understand this.  Can someone help?

if you have 50 BTC in one address and you are about sending 10 BTC to another address, Programmatically left bitcoins(40 BTC) in this address are the transaction fee. so some wallets sent remaining bitcoins minus the fee to a new address for privacy purposes.

Almost all wallets don't show this transaction because its a transaction that you didn't make and it contains bitcoin change.


Sent BTC to Jaxx Wallet Never Received A friend suggested I use Jaxx Wallet so I downloaded the software and sent my BTC using their QR Code from Coinbase. Looking back, I should've left it where it was!

It never arrived. I also sent LTC using the same QR Code method. That has arrived and is in my Jaxx Wallet now.

I see my transaction completed and verified on the blockchain. How do I locate where it is?

How can I trace that this transaction was actually sent (and maybe received) by Jaxx although it doesn't show in my wallet?

try resetting the cache on jaxx and let it re-sync, the coins should show up


How to transfer bitcoins to my Indian bank or PayPal account? I have recently joined free bitcoin and opened an account on Blockchain.info. I have studied the FAQ, but still I am not sure about how to transfer to PayPal and am unable to understand if I can withdraw directly to my PayPal account or whether I need an exchange.

Because this is a very new currency, I am not sure how to transfer my bitcoins in to my paypal account or in my Indian bank account,and please let me know the minimum withdrawal limit.

Bitcoins cannot be "transferred" to any fiat currency or any bank account. If you need to liquidify your bitcoins and you want to get fiat currency in exchange, you can sell your bitcoins in Bitcoin exchanges. Alternative is that you directly spend bitcoins on bought products and services.

If you just want to store your bitcoins you can create your own local Bitcoin wallet independent of online bitcoin services.

No financial institution will touch bitcoins. In fact, most banks and PayPal are openly hostile towards anything having word "bitcoin" on it.

Good options to sell your bitcoins in India is LocalBitcoins where you can sell bitcoins online, or on the street with cash. Be aware that there are some risks, and those risks are especially  when selling bitcoins on PayPal. Unless you are professional you should not be doing Bitcoin sells on PayPal.

What I would do is that I would transfer my bitcoins to LocalBitcoins trade wallet, pick a trader with high reputation (so him/her can be trusted) from LocalBitcoins "Sell bitcoins online" list and make an offer to sell my bitcoins using Indian bank transfer.


Can someone explain why I only received 1 output (24 cents) from my transaction ($3,253.29) Hash 0608854cc459dd9b126b20b9a605ea0ed877500a4a92e31ece6b08e3aaeaf937
I sent ($3,253.29) USDT from cryptonator to my BTC coinbase wallet and I only received 24 cents. Can somebody please explain what happened here? I'm freaking out and it was my entire savings.
Please help!

My friend,
I'm sad to tell you you might have been robbed of your money....
Cryptonator has a 2,5 stars rating. The reviews say it should not be trusted.
It seems it was split into 2 different addresses. The one where you received your cash (20 cents) and another one where they received the whole rest. This address has received well over 588 000 $ USD already. So this isn't the first time it happened. it's as if they sent you the minimum they could just to get the transaction going.
If I'm correct this address is your coinbase wallet: (value 0,20 cents)
This is the robbers wallet: (value: 588k) 163y4H32GbQSM8qgKwsDfyhmmvDnHKKaaa
In the future, use trusted exchanges such as binance, crypto.com, kraken and coinbase....
So sorry for you, sincerely...
(https://i.stack.imgur.com/JPx8W.png)


Is there a way to only sync up to a certain block? I am planning on doing some transaction analysis on the blockchain, however, I only want to do it on a small part of the blockchain first and then run it on the full blockchain later on. I have downloaded the bitcoind client, is there any way to only sync up to a certain block?

bitcoind supports the argument -stopatheight, which takes the number of blocks to download before halting.


Is money that has gone into bitcoin already spent? Is money that has gone into bitcoin already spent? When I buy a bitcoin from someone and they get USD I get bitcoin. They go buy lambos or real estate for their gains. So the underlying currency is spent, but BTC market cap is increased. This would mean that cryptos don't actually have any real money in them and they could collapse without bottom basically. Is this logic correct or is real really currency as value behind crypto?

As @RedGrittyBrick says, change the word "bitcoin" to "euros" and see if that helps you. All currencies work this way, not just cryptos:

Is money that has gone into euros already spent? When I buy a euro from someone and they get USD I get euro. They go buy lambos or real estate for their gains. So the underlying currency is spent, but euro market cap is increased. This would mean that euros don't actually have any real money in them and they could collapse without bottom basically. Is this logic correct or is real really currency as value behind euros?

And someone in Europe probably has the exact same question about USD.
All currencies are fundamentally worthless. Except for things like gold, which you can use to plate the contacts of electrical switches, coins, which can used as paperweights, and paper notes/bills, which can be used as toilet paper.


What is the refresh interval of MtGox ticker API? I'm using the MtGox ticker API (from MtGox API V2) and I want to know the update interval. I think it is less than 3 minutes, but is it possible to know exactly? It is important to me because I'm developing an Android app that shows the current price to the user in notification bar.

if you want fast http ticker use the new fast_ticker :
http://www.reddit.com/r/Bitcoin/comments/1c9npl/mtgox_fast_ticker_last_only_no_rate_limit_1second/

http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast

and you will get 1 second only cached minimalist ticker ( last )

if you need more ( low, high, volume ) you have the normal ticker, most probably cached 30 seconds :

http://data.mtgox.com/api/1/BTCUSD/ticker

the new data.mtgox.com is behind cloudflare now and the only ratelimits you will hit will now be cloudflare anti dos limits

old api urls not using data.mtgox are now deprecated and not guaranteed to work


What is taint analysis? I just came across the term "taint analysis" in a crypto-related conversation.

This came up while discussing "tracking bitcoin transactions" so it's somehow related to that. That's all I know.

The “taint” of a Bitcoin transaction evaluates the association between an address and earlier transaction addresses. The more “‘taint” the stronger the link between the two addresses.

https://bitcoin-class.weebly.com/taint-analysis.html


Replace-by-fee Problem Good Day. Please i have an Account with BlockChain but i notice my account has a withdrawal of all my BTC which was not done by me. It has Replace-By-Fee

What might have happened?
How can i get my Money Back?

Sent BTC
May 21 2020 @ 2:22 AM
Replace-By-Fee
To: bc1q52vem2cnzps34reymhw0v07wgzme8gq92dzc5p
From: My Bitcoin Wallet
$3,461.91
0.38223108 BTC
Description
Add a description
Value When Sent
$3,645.37
Sent From
159qFcZvv46Vz861PFxUNLPzjpTZw2oiPj
17BoVBrrkZ13DWNEBdew8QL3CCq6mv3722
1PnBQwZhiMMtb2XptpTBzBFa658iWm4gzd
1ahi6h2WMaGCpbrs2d7cr2o9Fo1m2Mu4J
1LcXKTF7TwNBw9jH4pTMHJRTMWGxo55syD
1CkJkCBVJt11Cj41SY9SQ7hu8318tcc19s
Received By
bc1q52vem2cnzps34reymhw0v07wgzme8gq92dzc5p
Status
Transaction Confirmed
Transaction Fee
0.00113524 BTC
(
$10.28

Please i have an Account with BlockChain but i notice my account has a withdrawal of all my BTC which was not done by me. It has Replace-By-Fee
  What might have happened?

If you did not initiate this transaction, then it looks as if your account was somehow compromised. Have you ever shared login details for the wallet with anyone else, or did someone create the wallet for you? There are common scams which employ these tactics.

Otherwise, without more information, it isn't really possible to discern how your account was compromised. In any case, that wallet (and possibly compute you used to access it) should be considered compromised, and should not be used for any further BTC transactions.

  How can i get my Money Back?

You likely cannot. Bitcoin transactions are not reversible, your only hope would be to find the person who stole your coins, and ask for them back.

Sorry for your loss :(


Why is Bitcoin gaining value while so many other cryptocurrencies are not? Every time I find a new cryptocurrency, I look at the price charts and almost every time it's constantly losing value. Ether and Bitcoin are the only exceptions, and have gained value on the long term. Why is that?

There is this classic bootstrapping problem. To make a successful cryptocurrency it needs:

Miners (so that it's secure)
Users (to attract miners, users also want it to be secure)
Value (to attract users and miners)

So new cryptocurrencies need to find a way to jump-start all those things at the same time, which it turns out- is not easy.

Here's a great description of it from Bitcoin and Cryptocurrency Technologies by Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller & Steven Goldfeder:

Getting a cryptocurrency off the ground

Another subtle concept is that of bootstrapping. There is a
tricky interplay between three different ideas in Bitcoin: the security of the block chain, the health of the mining ecosystem, and the value of the currency. We obviously want the block chain to be secure for Bitcoin to be a viable currency. For the block chain to be secure, an adversary must not be able to overwhelm the consensus process. This in turn means that an adversary cannot create a lot of mining nodes and take over 50 percent or more of the new block creation.

But when will that be true? A prerequisite is having a healthy mining ecosystem made up of largely honest, protocol‐following nodes. But what’s a prerequisite for that — when can we be sure that a lot of miners will put a lot of computing power into participating in this hash puzzle solving competition?

Well, they’re only going to do that if the exchange rate of Bitcoin is pretty high because the rewards that they receive are denominated in Bitcoins whereas their expenditure is in dollars. So the more the
value of the currency goes up, the more incentivized these miners are going to be.

But what ensures a high and stable value of the currency? That can only happen if users in general have trust in the security of the block chain. If they believe that the network could be overwhelmed at any moment by an attacker, then Bitcoin is not going to have a lot of value as a currency. So you have this interlocking interdependence between the security of the block chain, a healthy mining ecosystem and the exchange rate.
Because of the cyclical nature of this three‐way dependence, the existence of each of these is predicated on the existence of the others. When Bitcoin was first created, none of these three existed. There were no miners other than Nakamoto himself running the mining software. Bitcoin didn’t have a lot of value as a currency. And the block chain was, in fact, insecure because there was not a lot of mining going on and anybody could have easily overwhelmed this process.

There’s no simple explanation for how Bitcoin went from not having any of these properties to having all three of them. Media attention was part of the story — the more people hear about Bitcoin, the more they’re going to get interested in mining. And the more they get interested in mining, the more confidence people will have in the security of the block chain because there’s now more mining activity going on, and so forth. Incidentally, every new Altcoin that wants to succeed also has to
somehow solve this problem of pulling itself up by its bootstraps.


BTC - Block Index - Reading the flag values in Level DB Following the article I tried reading the flag value for txindex in the Block Index database but was not able to fetch the values. I tried fetching value for all below but its NULL always. Am I doing something wrong?
    private readonly byte[] TRANSACTIONINDEX_ENABLED = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 1 }; // F8txindex
    private readonly byte[] TRANSACTIONINDEX_ENABLED1 = new byte[] { 70, 7, 116, 120, 105, 110, 100, 101, 120, 1 }; // F7txindex
    private readonly byte[] TRANSACTIONINDEX_ENABLED2 = new byte[] { 70, 7, 1, 120, 101, 100, 110, 105, 120, 116 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED21 = new byte[] { 70, 7, 120, 101, 100, 110, 105, 120, 116, 1 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED3 = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 1 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_ENABLED31 = new byte[] { 70, 8, 120, 101, 100, 110, 105, 120, 116, 1 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 0 }; // F8txindex
    private readonly byte[] TRANSACTIONINDEX_DISABLED1 = new byte[] { 70, 7, 116, 120, 105, 110, 100, 101, 120, 0 }; // F7txindex
    private readonly byte[] TRANSACTIONINDEX_DISABLED2 = new byte[] { 70, 7, 0, 120, 101, 100, 110, 105, 120, 116 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED21 = new byte[] { 70, 7, 120, 101, 100, 110, 105, 120, 116, 0 }; // F7txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED3 = new byte[] { 70, 8, 116, 120, 105, 110, 100, 101, 120, 0 }; // F8txindex little endian
    private readonly byte[] TRANSACTIONINDEX_DISABLED31 = new byte[] { 70, 8, 120, 101, 100, 110, 105, 120, 116, 0 }; // F8txindex little endian

Additionally, how to fetch the mapping between data fetched from block index and the bat file where details of the block are. I assumed that Block Index record will have details of the file (blk000????.dat) where to look for the block but it doesnt have anything

I assumed that Block Index record will have details of the file (blk000????.dat) where to look for the block but it doesn't have anything

As described in the answer by a Bitcoin Core developer, the Block Index database contains all the information of the block and where the block is located (in which file blk). This is required because the is no order of the blocks received from the bitcoin network.

I tried fetching value for all below but its NULL always. Am I doing something wrong?

Read the information from the level DB is a little bit tricky because there is a special format as described in the link post. However, with your example, there is no way to find the problem in your code, because there is no code posted.