Who really controls Bitcoin? Surely if there was a major bug discovered in the Bitcoin architecture, there is someone who would have the power to push an update and fix it.
Then I assume that they could also make changes for malicious purposes.
Who has the power to make changes to the Bitcoin architecture and what is the scope of their power?
Could they turn off the Bitcoin system completely?

Bitcoin has rules without rulers.
Bitcoin has many groups of people who independently write software that implements those rules.
Software
There are many different groups of people who independently create Bitcoin software. For example there are many different wallet programs/apps.
The developers of any piece of software usually don't have the ability to force users of that software to upgrade. However such users are reliant on the honesty of the developers if they can't download and inspect the source code themselves. Many people rely on open-source software because it does mean ordinary users can inspect the code and verify that the software can be compiled from that code. Most users probably do assume that someone else will have done this and will let the world know of any malicious code.
When you choose to use a website or choose to install a Bitcoin program or app it is important that you are vigilant and diligently check the credibility of the source and the authenticity of the websites or programs.
Rules
There is no single person or organisation with the power to make changes to the Bitcoin network.
There is an open process for proposing changes to the Bitcoin rules but no-one has the power to force other people to adopt those proposed changes.

if there was a major bug discovered in the Bitcoin architecture, there is someone who would have the power to push an update and fix it.

No.
There are a group of people who could propose a fix. They cannot force anyone to implement the fix and cannot force people to upgrade to the fixed version.

I assume that they could also make changes for malicious purposes.

Proposals for rule changes that are malicious would quickly be seen because the whole proposal process is public. There are many different participants with a huge financial incentive to see that the rules are not malicious.
The developers of a closed-source wallet program or custodial-wallet service could make malicious changes. They could only affect their own software and not directly affect people using other software. This is one reason why those categories of software (closed-source and custodial) are regarded as the least trustworthy.
The nearest cases to this that I know of are

Multiple failures of custodial services (exchanges etc) where theft or fraud has occurred. MtGox, Quadriga-CX etc.
Fake wallets such as the Electrum hack a few years ago.

Who has the power to make changes to the Bitcoin architecture

You or I could propose a change. We would have to provide a well-reasoned case supported by evidence in order to convince many other independent groups of people in many countries to support and adopt that change.

Could they turn of the Bitcoin system completely?

No.
Even if you could somehow infiltrate and make several software products stop
working, people with other software would be unaffected and affected people would switch to unaffected software. Any damage made by malicious software to the "blockchain" public replicated journal of transactions would be ignored or undone by unaffected software. The malicious software and its damaged blockchain would form an unused fork.


unconfirmed transaction more than 1 month 17 days? someone please help, unconfirmed transaction for more than 1 month 17 days - https://blockchain.info/tx/3d314e7ffc03fdefba99ce02a33552e0479e1af7cc32cdf70483f4b0405f9f94

Your transaction does not contain commission.

The value of inputs equal to the output values.

May be that's why nobody confirm your TX for a long time.


Is mining using with cpu(some web sites) fake or not There is a rule about every browser :
Browser can not access client's RAM-CPU-HARD DRIVE-WEB CAMERA-And other resources of client's machine.
Am i right?
So how some web sites do mining using client's cpu?
Are they scam or they are real?

There are two things mining requires in general:

Processing power (CPU/GPU)
RAM

For Bitcoin, a tiny RAM is OK, but for Ethereum, a few GBs of RAM is needed.

  So how some web sites do mining using client's cpu?

Using Javascript (unfortunately. There are more efficient ways, such as TurboJS or GPUJS or WebAssembly). Basically, they're trying xs with different nonce fields until Hash(x) is smaller than a target value.

Bitcoin mining is possible wherever there's general-purpose processing power. Is it feasible? No. Because of ASIC miners, CPU or even GPU mining have higher electricity costs compared to mining revenue.

On the other hand, it might be different for other coins, such as Monero. You might have heard of CoinHive, which had Proof-Of-Work captchas that required mining Monero for a few seconds. Because Monero is ASIC-resistant, CPU mining used to be efficient. (Until February 2019, when CoinHive miner was discontinued due to the falling value of Monero).

It's likely that they might be scam, otherwise it's unprofitable for you (assuming you pay for electricity).


Best way to anonymize bitcoin transactions? https://en.bitcoin.it/wiki/Mixing_service

How do sites like this work? "Mixing services". I know it can be broken and traced back with coinsuduko but how exactly does it wash your coins. I doubt they just wait for somebody else to send in enough funds to reimburse with new coins, how would they go about doing it? Do they send the 1 BTC or whatever amount through 50 or so different wallets in different amounts on a bitcoind and then return the 1 BTC to your set wallet? I've heard of coinjoin, how does it work?

If I was going to send 1 bitcoin from one wallet to another from my website but have the bitcoins "washed" what would I need to do to keep the transactions hidden or at least "Mixed" so it would be harder for the bitcoin receiver to figure out what address exactly sent the coins.

Here is another example of open source coin washing blockchain.info uses:
https://github.com/blockchain/Sharedcoin is all this javascript on user side really necessary (speaking from using their setup sharedcoin.com, not reading over the source which is also javascript.)

Thanks.

The idea behind Coinjoin or Sharedcoin is that funds can be pooled and mixed with several other Bitcoin users to fund new transactions that can't be easily traced back to you.

Here is a trivial example: imagine 3 users, that want the funds from 3 addresses the each control A (0.5 BTC), B (0.5 BTC) and C (1 BTC) to be sent to addresses X, Y and Z respectively. Instead of transferring the funds directly a service could do the following, assuming intermediary addresses:

A(0.5) --> L(0.5) --\
B(0.5) --> M(0.5) -- +
C(1)   --> N(1) --\   \-- Z(1)
                   \
                    \--- X(0.5)
                     \--- Y(0.5)

So the money originally from C gets split and sent to X and Y while the money from A and B gets added and sent to Z. Mixing services do the equivalent but across much more transactions.


Cannot connect to bitcoin-qt server # server=1 tells Bitcoin-QT to accept JSON-RPC commands.
 server=1

 # You must set rpcuser and rpcpassword to secure the JSON-RPC api
 rpcuser=bhhtufhrt
 rpcpassword=ferhrhh

im trying to connect to my bitcoin thats my conf file but i cant connect to

http://127.0.0.1:8832/

im running on my local machine

The default port I think should be 8332 not 8832, however if you modify your config file to include:

RPCPort=8832

Then restart server and it should work


Provide Services to many Lightweigh Nodes (SPVs) and Save The Communication History I am investigating on privacy violations of the current communication protocol between lightweight clients and full nodes in the Bitcoin network, which utilizes Bloom filters. I run a full node on my Machine.
First, I want to make sure that a sufficient number of lightweight wallets are connected to the node. Second I want to save the communication history of each session between the full node and an SPV node. Specifically, filterload, filteradd, transactions, merkleblock, etc. (According to bip-0037)
Many Thanks!

First, I want to make sure that a sufficient number of lightweight wallets are connected to the node.

There's very little use of BIP37 today, and it's not even served by default by modern versions of Bitcoin Core. The chance that anybody would even connect to you and supply filters to you is extremely low. It was always a terrible idea to begin with, giving poor performance for users, poor privacy, and exposing the software to a denial of service hole the size of Norway.

Second I want to save the communication history of each session between the full node and an SPV node. Specifically, filterload, filteradd, transactions, merkleblock, etc. (According to bip-0037)

This is trivial with basic development skills, if a little frowned upon. The software naturally doesn't support anything of the sort out of the box, even when bloom filters are manually enabled in the configuration.


How popular are alternative clients? Is there any data available on how many people use an alternative client in contrast to the Satoshi client? Alternatively, is there any data on how many times such clients have been downloaded?

Multibit download stats

MultiBit is a thin-client based on the BitCoinJ library. It is written in Java and comes with installer packages for Mac, Windows and Linux. It is intended to be used by the general public who don't have a great deal of knowledge about Bitcoin and just want to send and receive payments in the simplest manner possible.


Need help to understand where bitcoin transaction has gone I am new with bitcoin and I need some help from experienced members.

I have a server with bitcoin core where we accept some payments and use bitcoin core as mercant.

The problem is that we have got an incoming transaction which we didn't see in our wallet.

Here is the hash of the transaction: 460c0dc70ef52fd66142d1798a1735b4613c9ffec478efe5997d1ede0d16f28a

In our bitcoin core through the bitcoin-cli command line I can see the following:

bitcoin-cli listtransactions 1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ
[
  {
    "account": "1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ",
    "address": "1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ",
    "category": "receive",
    "amount": 7.02278014,
    "label": "1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ",
    "vout": 1,
    "confirmations": 128,
    "blockhash": "000000000000000002ef00cf04d1a6197cd07d5b7826d2dc8cd8a86fd41d578f",
    "blockindex": 425,
    "blocktime": 1463303078,
    "txid": "460c0dc70ef52fd66142d1798a1735b4613c9ffec478efe5997d1ede0d16f28a",
    "walletconflicts": [
    ],
    "time": 1463299775,
    "timereceived": 1463299775,
    "bip125-replaceable": "no"
  },
  {
    "account": "1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ",
    "category": "move",
    "time": 1463303102,
    "amount": -0.00007000,
    "otheraccount": "1M1LTHjc1JAcVfCoyhSkoP1VH8B9RLY8tg",
    "comment": "merchant fee"
  },
  {
    "account": "1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ",
    "category": "move",
    "time": 1463303102,
    "amount": -7.02278014,
    "otheraccount": "1LBa3bAVF5RSfnFnm3sX1Zm5R8WU1J8xnK",
    "comment": "invoice forward"
  }
]

As I see funds were successfully moved to 1LBa3bAVF5RSfnFnm3sX1Zm5R8WU1J8xnK, which is correct, but on blockchain, for example, if I go here
https://blockchain.info/address/1K7Pci1re92vQuTSXbirmvQsmYMpXHQWbQ
I see that were sent to another address!

How to understand that, and how to find where these bitcoins have gone?

Any help will be appreciated, thank you very much!

Assuming the address you provided is really your address and not just watch only one there are basically two possibilities:

You have sent the money to another address and forgotten about that (or misunderstood what you are doing),
Your wallet got compromised either by giving private key to some malicious third part or via computer virus which stolen it without your knowledge.

In either way the address you mentioned is now empty and you cannot take the money back unless you control the addresses it is now on.


Error trying to mine with stratum_proxy I'm giving a specific case here, but I think I have seen the same error trying to use stratum_proxy for any pool and coin I have tried.

When wemineltc.com briefly had a getwork server up, cudaminer worked great! But now that they're back to stratum only, I'm trying to get that to work.

I run the stratum proxy that I get from wemineltc and see this:

C:\dev\cudaminer-2013-04-14\stratum_proxy.exe\twisted\web\util.py:372: Deprecati
onWarning: Passing filenames or file objects to XMLFile is deprecated since Twis
ted 12.1.  Pass a FilePath instead.
2013-04-16 08:24:07,302 WARNING proxy jobs.<module> # C extension for midstate n
ot available. Using default implementation instead.
2013-04-16 08:24:07,302 INFO proxy mining_proxy.main # Stratum proxy version: 1.
3.0
2013-04-16 08:24:07,302 INFO proxy mining_proxy.main # Trying to connect to Stra
tum pool at eu.wemineltc.com:3333
2013-04-16 08:24:07,302 INFO proxy mining_proxy.main # Setting PoW algo: scrypt
2013-04-16 08:24:07,621 INFO stats stats.print_stats # 1 peers connected, state
changed 1 times
2013-04-16 08:24:07,621 INFO proxy mining_proxy.on_connect # Connected to Stratu
m pool at eu.wemineltc.com:3333
2013-04-16 08:24:07,621 INFO proxy mining_proxy.on_connect # Subscribing for min
ing jobs
2013-04-16 08:24:07,838 INFO proxy mining_proxy.main # -------------------------
----------------------------------------------
2013-04-16 08:24:07,838 INFO proxy mining_proxy.main # PROXY IS LISTENING ON ALL
 IPs ON PORT 3333 (stratum) AND 8332 (getwork)
2013-04-16 08:24:07,838 INFO proxy mining_proxy.main # -------------------------
----------------------------------------------
2013-04-16 08:24:07,838 INFO proxy client_service.handle_event # Setting new dif
ficulty: 128
2013-04-16 08:24:07,839 INFO proxy client_service.handle_event # New job c9 for
prevhash d2c7e1c2, clean_jobs=True

Then I run cudaminer with the following batch file (on windows 7 64 bit):

cudaminer.exe -o 127.0.0.1:8332 -O user:password

And see this:

C:\dev\cudaminer-2013-04-14>cudaminer.exe -o http://127.0.0.1:8332 -O user:
password
           *** CudaMiner for nVidia GPUs by Christian Buchner ***
                     This is version 2013-04-14 (alpha)
        based on pooler-cpuminer 2.2.3 (c) 2010 Jeff Garzik, 2012 pooler
               Cuda additions Copyright 2013 Christian Buchner
           My donation address: LKS1WDKGED647msBQfLBHV3Ls8sveGncnm

[2013-04-16 08:29:52] 1 miner threads started, using 'scrypt' algorithm.
[2013-04-16 08:29:52] HTTP request failed: The requested URL returned error: 401

[2013-04-16 08:29:52] json_rpc_call failed, retry after 15 seconds

I have tried a few different things but I always get that 401 error. Any ideas on resolving this?

The problem was with windows firewall. Turned it off, tried again, it worked. Turned it back on and set the appropriate windows firewall exceptions for stratum_proxy and cudaminer and it worked.

I had this problem suddenly appear again this morning. Turning off firewall made no difference. I changed cudaminer to point to my machine ip address instead of 127.0.0.1 and then it started working.


Where can I find historical exchange rate data for Dash (ex DarkCoin)/USD? Is there a public data provider that allows to download the full history of Dash (ex DarkCoin) vs. US Dollar exchange rates?

CoinMarketCap provide charts since February 2014 and IIRC, the name was Darkcoin back then. It include the price in both Satoshi & USD.


How to generate a block header? good afternoon

I set myself a task to understand the work of the miner, but as you understand it is difficult for a beginner. Constantly there are questions.
Without conditionally, I turn to Google search and find the answers but not always.

Guys help sort out a few points

How to compose a block header?
I appeal to the instructions on such sites as:

I understand the headline is formed by the principle:
Version + prevhash + merkle_root + ntime + nbits + '00000000' +
'000000800000000000000000000000000000000000000000000000000000000000000000000080020000'

Where merkle_root should be in the reverse order of the byte and only it.
But other sources and sources give different examples of header formation. Someone does not translate merkle_root in the reverse order of a byte, but translates ntime and nbits

The question is how to properly form the header of the block and what incoming data should be specified in the reverse order of the byte. Most likely something I do not understand until the end and I hope for help.

And can someone tell me a good manual

check this:

https://en.bitcoin.it/wiki/Block_hashing_algorithm

How is a block header hash compared to the target (bits)?

[EDIT]
Also this Calculate hash of block header


When is the halvening? What are the dates of past halvenings? When a miner finds a new block, they receive a block reward that is comprised of the transaction fees from that block, plus a set amount of newly minted BTC. When the network started, this block reward was 50 BTC, but that amount is cut in half every 210,000 blocks, slowly approaching zero. This reduction is commonly referred to as a 'halvening'.

210,000 blocks is equivalent to about 4 years, but what were the actual calendar dates of the previous block reward halvenings? What are the expected dates of future halvenings? How accurately can they be predicted?

Here are the approximate dates for the halvenings of the BTC block reward, as evidenced by the timestamp on those blocks. Note that the timestamp is not a perfect measure of when the block was found, but it is reasonably accurate, with an assumed margin of error of a couple hours (for more info on this see this question). The time stamp is a component of the block's header, and it is reported in unix time.

Genesis block - 50 BTC - Unix time 1231006505 (Sat, 03 Jan 2009 18:15:05 GMT)
Block 210,000 -  25 BTC - Unix time 1354116278 (Wed, 28 Nov 2012 15:24:38 GMT)
Block 420,000 - 12.5 BTC - Unix time 1468082773 (Sat, 09 Jul 2016 16:46:13 GMT)
Block 630,000 - 6.25 BTC - Expected ~May 2020
Block 840,000 - 3.125 BTC - Expected ~May 2024
Block 1,050,000 - 1.5625 BTC - Expected ~May 2028

You may notice that the past halvenings have occurred sooner than the expected ~4 year time frame. This is because the network's hashrate has been steadily increasing on average, but the difficulty adjustment only happens every two weeks. This latency means that by the end of the two week difficulty adjustment window, there will be more hashrate pointed at the network, so blocks will be found a little quicker than the 10 minute goal. This effect compounds over time, so each past halvening has occurred a few months ahead of the implied schedule.

Likewise, if the network hashrate were seen to steadily decrease over the next years, we would expect future halvenings to occur at a rate of > 4 years, as blocks would be founds slightly slower than the 10 minute goal.

The estimates given for future halvenings were calculated assuming a ~constant hashrate. A more accurate estimate could perhaps include a range of +/- a few months, based on historical observations of the network's hashrate.


Antminer 22nm or 14nm? I currently have two offers for buying antminer s9. One with a 22nm chip and the other with 14nm. Can somebody give be the pros and cons for both, because i understand that the power consumption would be bigger with the 22nm, but will that mean that i will be mining less than the 14th/s -+ 5% ? or will the electricity be only different. Hoping to have a good response and answer from you, thanks.

14nm will hash more with the same power consumption of a 22nm assuming your basing it on power only. But if both were 1/ths the 14nm would save more electricity. Obviously the 14nm would cost more as its newer tech. You'd have to weigh your electric cost vs hashing power.


How much disk space do I need to run Bitcoin Core with txindex on? Currently the blockchain is at 36 GB, but with txindex turn on, how big is it? And how much disk space should I get to run a Bitcoin Core node with txindex on for say a year?

Currently 48GB. Its hard to say how much the chain will grow in the future, but the 1MB block size limit caps the growth of the chain itself to 50GB per year. Building services that rely on a fully indexed block chain is probably quite inadvisable, you should aim to construct systems that don't require it.


What happens if the block's generated are exactly 10 minutes? My understanding is that every 2016 blocks, the average block time is taken. If it is less than 10 minutes, network ramps up the difficulty. Is there a possibility where the average block time is exactly 10 minutes. What happens in such case?

Exactly nothing. The difficulty would remain the same.


What is a Finney attack? What is a Finney attack? Extra points for explaining its purpose, the prerequisites for it to be possible, how the attack can be performed and the origin of the name "Finney attack".

The Finney attack is named after Hal Finney, who suggested it in this comment. (Hal happens to be the first recipient of a Bitcoin transaction, and the first person to comment on the release of the Bitcoin source code.)

It is a double spending attack with the following features:

It only works if the merchant accepts unconfirmed transactions.
It still works, however, if the merchant waits a few seconds to
verify that everyone in the network agrees he was paid.
It requires the attacker to be mining and controlling the content of
his blocks; however, he can in theory do this with any hashrate, in particular significantly less than 50% of the network hashrate.

It proceeds as follows:

The attacker mines blocks normally; in the block he is trying to find, he includes a transaction which sends some of his coins back to himself, without broadcasting this transaction.
When he finds a block, he does not broadcast it; instead, he sends the same coins to a merchant for some goods or service.
After the merchants accepts the payment and irreversibly provides the service, the attacker broadcasts his block; the transaction that sends the coins to himself, included in this block, will override the unconfirmed payment to the merchant.

If the time from finding the block until the attacker sends payment and the merchant accepts it is t, and the average time to find a block is T, there is a probability of t/T that another block will be found on the network in this time; in this case the attack will fail, and the attacker will lose the block reward of B.

This means that the average cost of attempting the attack is about (t/T) * B; as a rule of thumb the merchant should wait at least t=V*T/B (V is the value of the transaction), to make sure that trying to carry out this attack against him isn't profitable; this may not be sufficient though, as a nimble attacker can use the same block for multiple attacks, potentially gaining the total of their value.

Clearly, the lower the attacker's hashrate, the less opportunities he has to carry out the attack. If the attack is for obtaining some illiquid good, it is difficult to make the need for this good coincide with finding a block. If the attack is for obtaining something liquid (e.g. exchanging bitcoins for other money), an opportunity is ever-present but the merchant is likely to require a few confirmations. This makes the attack difficult to use in practice.


ECKey.ECDSASignature creation I have my ECKey key. In order to create an ECDSASignature object with BitcoinJ, we have to call ECDSASignature mySignature = key.sign(Sha256Hash input).

Is the Sha256Hash input my message? Or is it the result of Sha256(byte[] myArray)?

What if I don't have a message to sign? Is it acceptable to sign the key.getPrivKeyBytes() in order to create an ECDSASignature, or it is unacceptable because it reveals information including in getPrivKeyBytes() and as a result reveal my private key?

And if it is unacceptable what must be my message? Can I can sign whatever I want in order to create my ECDSASignature?

Signing the bytes of the private key of ECKey key is unacceptable because you are vulnerable for realeasing information about your private key.

In the case of signing a message(as a String) you have to estimate the :

 byte[] result= sha256(message)

The result will be a byte[] and this array finally will insert to the :

 Sha256Hash input= new Sha256Hash(result);

Then the procedure is simple in order to produce the ECDSASignature.
You have to do the following:

ECDSASignature signature= key.sign(input);

and finally in order to validate your signature you have to check the following:

key.verify(input, signature)


Bitcoin Core What default values should I pass for some positional RPC params in sendtoaddress I am trying to use the sendtoaddress rpc method of bitcoin core. From the documentation I read that I can pass "estimate_mode" parameter to estimate a fee. However as I believe json rpc follows positional parameters, so this parameter falls in the 8th position, before this there is another optional parameter named "conf_target". What value should I pass for this parameter?

bitcoin-cli bchtest:qp4uw0why90dht7texkv3nnws4cjml844y5ck8rr3q  0.1 "" "" false false ? "CONSERVATIVE"

What value should I pass in place of '?' ?

The fee estimator works by targeting the number of blocks that will occur between the time when you broadcast and when it confirms. So a confirmation target of 6 would mean that the fee estimator is trying to get your transaction confirmed within 6 blocks. The fee estimator does not know within how many blocks you want your transaction to be confirmed, so it asks you as a parameter.

The default value for this is 6, but you can set it to whatever you want.


Why are Transactions sending out randomly? I see in the sourcecode this two lines:

// Do this infrequently and randomly to avoid giving away
// that these are our transactions.

in the method ResendWalletTransactions. Why is this necessary? If a client send out his transactions every 30 minutes and the receiver put these transactions in his own queue and send this transaction list every 30 minutes to all his neigbors I don't see why someone should recover the own transactions of the client.

The full beginning of the method is something like:

void CWallet::ResendWalletTransactions()
{
    // Do this infrequently and randomly to avoid giving away
    // that these are our transactions.
    static int64 nNextTime;
    if (GetTime() < nNextTime)
        return;
    bool fFirst = (nNextTime == 0);
    nNextTime = GetTime() + GetRand(30 * 60);
    if (fFirst)
        return;

Because it doesn't re-broadcast any non confirmed transaction, it re-broadcast only your own non-confirmed transactions. So you will be the only node on the entire network who is doing the re-broadcast every exact 30 minutes and based on this anyone can get what IP is originating that transaction.

A few lines below your code example you find this:

BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
{
...
}

This will loop on the transactions of your own wallet (mapWallet), not all the network transactions.


Is it safe to delete bootstrap.dat.old? Is it safe to delete bootstrap.dat.old? Because my bitcoin-qt is using the internet to synchronize right now ("Importing blocks from disk." stage has finished). But I still am not sure.

Yes, it is marked .old to indicate it is safe to delete. The blocks have been copied and  imported into the main blockchain that you store. The process took time because the client was verifying the blocks.


Can Bitcoins be duplicated if two private keys share the same public key? Although statistically impossible, imagine that two different private keys share the same public key. Would that addresses be able to create new Bitcoins?
Let's say that private keys A1 and A2 have the same public key A. I use wallet B to send 1 Bitcoin to A. Both A1's and A2's wallets would show a 1 Bitcoin balance.
Now both A1 and A2 send 1 Bitcoin to B at approximately the same time. Will B now have 2 Bitcoins, or would one of the transactions fail?

There can only be a single spend of a transaction output, it doesn't matter if there's multiple private keys which correspond to a script. It is functionally the same as one private key signing two transactions, they can't co-exist due to the consensus rules of Bitcoin.


Why doesn't the Bitcoin core team develop official Bitcoin mining software? If I am right, the Bitcoin Core just maintains the software necessary to run a full node. Essentially it's the code for the Bitcoin wallet, which just verifies blocks, but doesn't mine. But mining is an important part of the Bitcoin network, and the most widely used software is the unofficial BFG miner written by Luke DashJr.

So why is it that the Bitcoin Core team does not develop an official Bitcoin miner as well? Also I believe the first version of Bitcoin core released by Satoshi was full node software as well? How did mining happen then?

Bitcoin Core does have mining components in it. In fact most available mining software actually rely on Core (or something abstracting Core's services) in order to get the block built before it attempts to mine it. Bitcoin Core has the capability to serve the information to other software so that they can mine blocks. Furthermore, Bitcoin Core does have the logic necessary to mine blocks. However it only does this via CPU mining, and because CPU mining is no longer viable, this has been disabled on the main Bitcoin network. It is still there in order to mine blocks on testnet and in the regtest networks.

Having a fully fledged mining software (i.e. one that supports all of the various ASIC miners and can connect to mining pools) is outside of the scope of the project. This would enable functionality that the vast majority of Bitcoin Core users never even use and thus would be a waste of time to develop.

Lastly, there is no official node software. There is no official anything in Bitcoin; it is decentralized, official would mean that there is some central authority dictating what is "official" and not.


Does my bitcoin multiply with every fork? Simply put, does your current bitcoin (pre-fork) multiply with every fork that bitcoin may experience?

For example if I have one bitcoin stored in a cold wallet for the next century and Bitcoin experiences 5 forks over that period. Will I have the original bitcoin and 4 new coins (differently named)? Assuming every new coin type is still going.

Also, if you have 1 bitcoin in a hot wallet or exchange, does the exchange then issue you with the new coin with every fork? What if your exchange does not support the new coin?

Sorry, lastly... Say your bitcoin is in cold storage. At what point do you see the new coin? Will an exchange automatically recognize it as a pre-fork bitcoin and issue you the new coin?

Note that the word "fork" can have several meanings. The more common one is a protocol change (either a soft or hard fork) where everyone switches to the new protocol. In this case there will still be only one type of coin.

You are talking specifically about a scenario where both the new and old versions are being used. In this case the network and the currency will split into two separate networks, blockchains and currencies. I will refer to such a scenario as a "split".

In essence, if the split is done properly, then the two networks will be incompatible and not recognize each other. Each will believe it is the one true coin, and will treat any transaction on the other network as invalid garbage.

The two networks do share a common blockchain history up to the point where the split happened. So if you have a bitcoin in address X in cold storage prior to the split, each network will recognize that there is a bitcoin in address X, so you will indeed have a coin of type A and a coin of type B. If there are several splits while the coin remains in the same address, you will have a coin in each of the resulting currencies.

You can "see the new coin" the moment there are block explorers for both networks. You can examine the block explorer for network A and see that you have a bitcoin, and you can examine the block explorer for network B and see that you have a bitcoin. Once you've installed wallet software for both network types, you can import your private key to both and have each display that you have 1 bitcoin.

This means that you are now able to create two transactions - one that sends a bitcoin to an address C of your choosing, which will be recognized as valid by network A; and one that sends a bitcoin to an address D of your choosing, which will be recognized as valid by network B. (This requires that there will actually be software available for both networks A and B, and that it will be careful not to create transactions that might be mistakenly picked up by the wrong network).

What happens next involves interaction with the real world, and the real world is messy. There's no absolute answer to what will happen as it depends on what kind of software and services you are using.

If you "have 1 bitcoin in an exchange", remember that you do not really have a bitcoin, the exchange has a bitcoin and is contractually obligated to give you 1 bitcoin when you demand it. This becomes messy when a split happens and it's not universally agreed what "bitcoin" means.

The exchange will, technically, definitely now have both a bitcoin A and a bitcoin B. What will it do about its contractual obligation is up to it. The exchange could treat both coins as legitimate, support balances of both Bitcoin A and Bitcoin B (the same way it has balances of any other currency), and credit you with 1 bitcoin in both (since your pre-split bitcoin really is equivalent to a bitcoin on both). Then you can either withdraw both, sell both or any other combination.

Or it could decide that only one of the coin types is legitimate. So it will run only nodes of Bitcoin A, recognize only transactions of Bitcoin A, and list a balance only for Bitcoin A (which it will just call "Bitcoin"). When you ask to withdraw your bitcoin, it will send you only a bitcoin A. It is technically capable of sending a bitcoin B as well but it ignores this possibility. The bitcoin B will probably be lost (or at least kept by the exchange).

So, it's in your best interest to keep your coins only in exchanges / hosted wallets that recognize the importance of handling splits properly. (Or, preferably, not keeping your coins in exchanges or hosted wallets at all).

I've analyzed the contingency of a split in more depth at https://fieryspinningsword.com/2015/08/25/how-i-learned-to-stop-worrying-and-love-the-fork/.


datadir compatible between 0.14.0 and 0.14.1 I have a raspberry pi with bitcoin core (0.14.1, self compiled) and a macOS system with bitcoin core (0.14.0, binary from bitcoin.org). I am storing the blockchain (complete datadir) on an external hard drive. Can I expect to plug this hard drive in my macOS system, sync it and later plug it into my raspberry without having any problems?

Switching between different computers/platforms should work. Don't try to use a NAS (network attached storage).

Always make sure you did a clean shutdown before switching the computer(platform.

Make sure you either use the binaries from bitcoin.org or compile with the same berkleyDB version (to ensure to not break the wallet.dat database).


Is it possible to send Bitcoin without the passphrase to the wallet? I’ve been getting back into cryptocurrency lately, and I’ve found one of my  old wallet.dat files with a very small amount of BTC. Unfortunately, I created a random password of characters and put it on a piece of paper, which I have lost by mistake. Is there any way I can send the Bitcoin to my other used wallet without the passphrase, such as by finding the private keys with PyWallet and using them? I’m using Bitcoin Core.

No, you need the password to spend any money in the wallet.
The keys are encrypted with the password you provided.


What are the best JavaScript libraries to accept Bitcoin payments? I used search engine "accept bitcoin payments" and:

https://bitpay.com/ - top result in my google charges 1% fee and requires some verification
Stripe charges 0.8% - https://stripe.com/bitcoin - capped at $5

I'm actually looking for some home-grown solution as described here - How to accept BTC payments - but I cannot find anything...

And I don't want to apply "false economy" - Stripe checkout process is sleek, they must have optimised it a lot... But yeah, still looking for a drop-in library for accepting BTC payments?

A JavaScript library? JavaScript is client-side and accepting bitcoin payments is basically like creating a shopping cart system from scratch. So you're not going to get far with JavaScript alone unless you just want to accept donations by tossing up a QR code. People have tried to generate a thousand addresses on their wallet and then cycle through them using JavaScript (like this), but it's hopelessly insecure and allows for users to possibly pay to the same address.

To create a shopping cart you'll need to use a server-side language like PHP, NodeJS, Python, Perl, etc. The easiest way is using a 3rd party API or you can do everything from scratch with a library. My personal fav is nodejs and bitcore, but this is usually too much for the average user.

If you're looking for something much easier I suggest Mycelium Gear. They basically allow you to fill out a form with your product info and they'll give you a link to post on your site.

Also if you're a wordpress developer I have heard good things about Cryptowoo in conjunction with Woocommerce. I have not tried it myself though.


Which full node implementation(s) supports SegWit I just finished setting up a full node using bitcore.io's guide here. I need my node to support SegWit though and I am not entirely sure whether what I have set up offers SegWit support. Especially after reading this article: What Bitcore Users Need to Know To Be Ready for Segwit Activation.

Is this the correct choice of a full node platform for me to have SegWit? What other options do I have?

Note: I have a wallet based on Copay who's builders also maintain bitcore.io so their full node software was my first/obvious choice

Bitcoin Core has supported segwit for a long time and will have decent segwit support in the GUI/RPC in version 0.16 which is going to be released hopefully within the next couple of weeks. Knots also supports segwit, as does btcd I believe. Others like bcoin probably do too but I'm not sure, someone else might know better

You can look at this page for some general ideas: https://bitcoincore.org/en/segwit_adoption/


On a low level, how are long chains kept secret and later broadcast during 51% attacks? I've been reading about the vulnerabilities of PoW crypto, and there's a part of it that I don't understand.

Suppose I wanted to stage a 51% attack on Bitcoin (not really feasible, but bear with me). This would involve waiting for height n to be achieved, and then immediately working with my superior hashpower to produce blocks at heights n+1, n+2, ..., f without broadcasting said blocks to the network. For simplicity's sake, let's say I'm adding empty blocks to my private chain. When I feel like it, I can then broadcast my chain (which is longer than the trusted chain), which will nullify all transactions starting from block n+1 inclusive (is this correct?).

Firstly, on a semi-low level (i.e. in terms of actual data/file operations), how does one keep and cultivate the secret chain? Would I be saving a sequence of valid hashes for each block, while remaining disconnected from the network?

Secondly, how does one broadcast the bigger chain? My understanding  is that when you connect to the network and submit a block at height k, it will be rejected if the main network is already on block k+1 or greater. So even if I sequentially broadcast my solutions, wouldn't they be rejected before it could be revealed that the number of solutions I have exceeds that of the main network's chain? For example, after starting my 51% attack after block n is found, the main network eventually gets to block n+3 while I am secretly at block n+5. In terms of actual operations, what would I need to do in order to supersede the main chain?

When I feel like it, I can then broadcast my chain (which is longer than the trusted chain), which will nullify all transactions starting from block n+1 inclusive (is this correct?).

Yes, it's correct.

  Firstly, on a semi-low level (i.e. in terms of actual data/file operations), how does one keep and cultivate the secret chain?

The same way your node stores regular blocks.  To build your separate chain you can, as you suggest, just disconnect your node from the regular network.

  Secondly, how does one broadcast the bigger chain?

Just reconnect to the network.

  My understanding is that when you connect to the network and submit a block at height k, it will be rejected if the main network is already on block k+1 or greater. So even if I sequentially broadcast my solutions, wouldn't they be rejected before it could be revealed that the number of solutions I have exceeds that of the main network's chain?

When you reconnect your node to the network, it will establish new connections with new peers and they will exchange messages that say, basically, "what's the best block you know of?".  The other nodes will tell you about the weaker public chain and you'll tell them about the stronger formerly-private chain.  The other nodes will then request all the blocks for the stronger chain and your node will relay them.

As a practical example, during the consensus failure fork documented in BIP50, this is exactly what Bitcoin Core 0.8.0 nodes saw happen.  They followed the strongest chain, which became longer by more than a dozen blocks, but then miners shifted to working on the weaker chain and made it the strongest chain.  The 0.8.0 nodes followed suit just fine.

Something similar happened with the 4 July 2015 fork with most pre-Bitcoin 0.10.0 nodes.  They saw what looked like a valid chain with +6 blocks, but then another chain was extended to become strongest and they switched without problems.


How to get Bittrex trading data for 10 different coins? I am writing MATLAB code to get the trading data from Bittrex. I have 10 different coin trading volume data that I want to know. To do this, I have a few ideas but not work in Bittrex.

Use 'getmarkethistory' for each alt coin trading information for every second and then combine the data (This does not work because it will easily hit the rate limit)
Some other platform have 'heartbeat' functions. If you use the function, it makes sure you download all trade history. (This does not work because I could not find this function in Bittrex)

Would someone give me an idea of collecting data from Bittrex?

Pull the data from
https://bittrex.com/api/v1.1/public/getmarketsummaries

You will get a dictionary including all markets volume data (and a lot other data ).
Just pick the 10 market you need.


What are the perceived advantages of bitcoin as a store of value? This complements What are the perceived advantages of bitcoin as a means of exchange?

To some, Bitcoin today is considered "better" than other stores of value. Why do some people think it's a good store of value, or even investment?

Bitcoin has several advantages over other means as a store of value.

They take no space. This means that you can store them in a USB as well as a backups online for example in an email.
You do not need to pay anything for storing the Bitcoins. There is no need to pay for a secure bank account since they can be stored online or in USB or even in your brain if you use a deterministic wallet. In this case you only need to remember the passwords.
This also means that you can bring them to any country easily without paying any fees.
They are easy to hide. Nobody will know how much you store or how to get them.
This will make them impossible to steal.
Your funds cannot be seized by any bank or government.

The downside is the fluctuation in value.

But if Bitcoins are here to stay they will increase in value over the years,
perhaps outperforming many other assets.
There is also a small risk that they might get replaced by a more efficient cryptocurrency though; so far several have tried but none have succeeded.


Is there any method to extract transactions for an bitcoin address which is not in my wallet using bitcoin core? I have setup Bitcoin core and trying build an API to fetch all transactions under an address ( not in my wallet ).

Bitcoin core RPC documention says that an address which is not in my wallet needs to be imported. So I did the same using importaddress while setting rescan true e.g. importaddress '35z3Re9SgLHBfeg7y1HdR35t9HrTqTsKFV' 'test' true. It took more than a week to rescan the whole blockchain database.

After importing the address, when I issued the getaddressinfo RPC command I got empty set of transactions in response.

Am I missing something ? Can you please help me here with the steps ?

You can use the scantxoutset command to scan for unspent outputs for a given address (or script).

Importing an address adds it to your wallet, and you will see transactions for imported addresses under the listreceivedbyaddress and listtransactions commands.


Bitcoin Wallet for Android/Windows with Full Control of BTC (keys) I used to manage my bitcoin by using MultiBit for Windows. I had full control of them, without any involvement from a 3rd party.

But as a person i know wanted to get bitcoin and a Android wallet, i started to see if there was a MultiBit version for Android, just to realize MultiBit for Windows is discontinued.

I stumbled into Web Wallet difference but it's not exactly the question i am asking.

On Google Play the results aren't familiar at all and the Blockchain app asks for e-mail/etc and the BTC will be stored by them, and i want an app that give me full control of the btc/private keys.

So what apps can be used for Android/Windows that meet the criteria i am asking?

There are a lot of wallets for Android & Windows in which you are on control your private keys. Here you can find a list recommended by Bitcoin Core.

Personally, I recommend Mycelium because is very complete.


How many CPU's work on blockchain today? How many CPU's are working on blockchain now?
How much energy is estimated to be consumed?
I read an article on coindesk saying it may surpass all other energy consumption by 2020..... seriously?

I last recently did this calculation:
An Antminer S9 uses 1,2kW power, which is 1,2 KiloWattHours (kWh). If we multiply with 24 and with 365 I get around 1000kwh. At Blockchain.info there was end of November 10,445,729,472 GH/s, or 10’445’729 TH/s. Divided by the power of an Antminer S9 with 13 TH/s, I’d need 800’000 Antminer S9. They would consume 10’000 KWh, and if I need 800’000, I get 8’000’000’000 KWh, which is  8’000’000 MWh (Mega Watt hours), is 8’000 GWh (Giga Watt hours). Not all are using S9, so it might be a bit higher...

Compare this to a water cooker, or a hair dryer, which uses 2kw. Instead of making tea, or drying your hairs, consider mining a bit!

In summary this means, on the other side of the power plug must be a power system which can supply ~1000 MegaWatts. This is the range of large industrial systems like carbon or atomic power supplies. Or even better, 500 wind power turbines at 2MW.

I cannot predict the future in 2020, but this would be a bit too much...


Bruteforcing a seed with 24 words of a unknown order How much time would it take to brute force a seed that we know all of its words but also that is completely shuffled? I ask this because the old Trezor model asks for seed in a shuffled way but still all the words can be seen. So if a malicious software would intercept all the words, in what time could the adversary crack the key?

This depends a little bit if all words are independent. If yes the will be 24! = 620.448.401.733.239.439.360.000 permutations of the words. Assuming that you computer can check 1 billion permutations per second (which is is way too optimistic as this would assume that a signature / public key could be computed within one clock cycle which he can't) this would mean that your computer still would need 620.448.401.733.239 seconds which is 19674289 (19.6 million) years as the absolut minor / lower bound.
This estimation however does not take into account technological breakthroughs in computing hardware which could very well happen in that time frame (:


Is demurrage already integrated into Ripple? If so, how does one create a demurrage currency? The Ripple wiki has a page about demurrage currencies being a possibility in Ripple. However, it's not entirely clear whether this feature is already implemented in the server or client, and if so, how to properly use it.

Can one create a demurrage currency in Ripple, and if so, how does one do it?

You can find an answer with an example here:
https://gist.github.com/justmoon/8597643

Type 0x01 means demurraging currency:
01 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __
CURCODE- DATE------- RATE------------------- RESERVED---
CURCODE - Three character uppercase ASCII.
DATE - DEPRECATED Demurrage start date (Ripple epoch; seconds since 2000) -> There is no reason to choose one reference date over another so this feature will be removed.
For now just make sure you ALWAYS set the date to 00 00 00 00
RATE - Demurrage rate, defined as e-folding time in seconds
(IEEE 754 double-precision floating-point)
RESERVED - Reserved for
future use, duh
Note: Date and rate are four-byte aligned, rate is eight-byte aligned,
for easy parsing on 32/64 bit CPUs.
Demurrage example:
01 58 41 55 00 00 00 00 C1 F7 6F F6 EC B0 BA C6 00 00 00 00
// Calculating the demurrage rate //
// We want 0.5% per year. There
are 31536000 in a year, so the e-folding time in seconds is:
31536000 / ln(0.995) = -6291418827.045599
// In plain English: The nominal amount of this asset will decrease
(hence the minus sign) e times (≈2.71828) every 6291418827.045599
seconds
// As hex (IEEE double):
http://gregstoll.dyndns.org/~gregstoll/floattohex/
0xc1f76ff6ecb0bac6
// Final currency code 0158415500000000C1F76FF6ECB0BAC600000000
// Example TrustSet
{"Flags":131072,"TransactionType":"TrustSet","Account":"rNb721TdNHN37yoURrMYDiQFmvXmENCZW6","LimitAmount":{"value":"1000","currency":"0158415500000000C1F76FF6ECB0BAC600000000","issuer":"rUyPiNcSFFj6uMR2gEaD8jUerQ59G1qvwN"}}

Create the code for your currency as shown.
Set a Trustline for this currency (As shown in the end of the quote)

Thats it, it's created now.
P.S.: For now I know the only one place where this currencies are shown correctly:
https://bithomp.com/explorer/forabc


Is there a limited number of addresses a wallet can hold? Let's say I have an imported-type electrum wallet, how many private keys can I import to that wallet, if there's a limit to it?

Theoretically, no. A wallet is simply a collection of private keys (or a root key + scheme to derive more private keys, such as with BIP39 wallets).

However, after a certain point, you will start facing issues of scale. Most wallet applications will struggle to index transactions for hundreds of thousand or millions of addresses. Exchanges and other companies that deal with that many addresses will often build out special software tooling to handle tx indexing, coin selection, security, and other use cases that go up in complexity as the number of keys increase.

But from a purely crypto point of view, nothing prevents you from having any number of addresses in a wallet.


How to obtain the content of the field "addr_tag_link" and "addr_tag" without using the api of blockchain.info? This is an output item of JSON result obtained by the API of blockchain.info:

        {
         "addr_tag_link":"https:\/\/bitcointalk.org\/index.php?action=profile;u=47767",
         "addr_tag":"DoubleIcaras",
         "spent":true,
         "tx_index":2751327,
         "type":0,
         "addr":"1F6MCoBMwmfpT5fruvCUjirFEybhLe5c1C",
         "value":100000,
         "n":250,
         "script":"76a9149a94b4a9d14807579aa4f9bd3d6a812adb6f7fbf88ac"
      }

Is it possible to obtain the content of the field "addr_tag_link" and "addr_tag" in java without using the API of blockchain.info (such as with bitcoinj)?

No, the addr_tags are specific to blockchain.info - they are not kept on the Bitcoin blockchain, but rather on blockchain.info's servers.


How can I get the raw tx hex from bitcoind with the txid? Is there any way to get the raw tx hex when I know the txid using bitcoind not third party. Currently I'm using a thirdparty (blockcypher) but now I want to switch to bitcoind.

You can enable the transaction index by using setting txindex=1 in your bitcoin.conf file or starting bitcoind with the -txindex option. This option will allow you to use the getrawtransaction command on any transaction in the Bitcoin blockchain or in the node's mempool.

Note that setting this option will require you to reindex bitcoind if it was not already enabled.


My BCH is marked 'unspendable' in my Blockchain Wallet My BCH is marked 'unspendable' in my blockchain wallet. I entered my public address instead of my private address by mistake when I exported the BCH from my paperwallet. Is that the problem and how do I correct this?

Exactly! Just reset your wallet and then import your private key. It'll work like magic.


In TCP communications it is common to use a technique known as "piggybacking".
Let's say A and B are communicating over TCP. Normally, after receiving a message from A, B should send an ACK message to let A know he received it correctly. In order to minimize the number of messages, B can "encapsulate" the response message into the ACK, so that A will receive the response along with the ACK.

Since Bitcoin works on TCP, it is reasonable that the same technique is applied.


Small altcoin usage effects So I'm working on an altcoin for me and my friends to use.  None of them are familiar with mining.  If my computer is the only one mining, how much would that affect the economy?  Also, how many transactions are needed for a block?  If only 1 transaction per day is made, would the miner just not have any work?  I forgot to mention the block reward is 10 coins.

Blocks can still be found by miners even if there are no (other) transactions. The reason for this is each block must contain a coinbase transaction, which rewards the miner with 10 coins.

(The above is assuming that your coin is sufficiently similar to something like Bitcoin or Litecoin. An altcoin you create could have completely different rules.)

As for how your mining could affect the economy, well obviously you would be the one ending up holding all the coins. If you're giving them to your friends to then trade, no problem. A few friends is of course not a very large economy.


How is difficulty calculated? Can anyone explain me in the plain English how difficulty is calculated. I have a very approximate understanding that it is calculated based on the amount of hash power in all the bitcoin community over a specific period of time. But this is very vague.

Also I understand it can change very rapidly. Can it only increase? Is there any formula how to calculate it or predict it?

Thanks for a detailed answer, Meni Rosenfeld. Just to make sure I got everything right. I am summing up all the time, it took to generate the last 2016 blocks. And then apply the formula.

The Bitcoin difficulty started at 1 (and can never go below that). Then for every 2016 blocks that are found, the timestamps of the blocks are compared to find out how much time it took to find 2016 blocks, call it T. We want 2016 blocks to take 2 weeks, so if T is different, we multiply the difficulty by (2 weeks / T) - this way, if the hashrate continues the way it was, it will now take 2 weeks to find 2016 blocks.

For example, if it took only 10 days it means difficulty is too low and thus will be increased by 40%.

The difficulty can increase or decrease depending on whether it took less or more than 2 weeks to find 2016 blocks. Generally, the difficulty will decrease after the network hashrate drops.

If the correction factor is greater than 4 (or less than 1/4), then 4 or 1/4 are used instead, to prevent the change to be too abrupt.

There is a bug in the implementation, due to which the calculation is based on the time to find the last 2015 blocks rather than 2016. Fixing it would require a hard fork and is thus deferred for now.

It is possible to give a rough estimate for the next difficulty change, based on the time to find the recent blocks. Nobody can make longer-term predictions for the future difficulty reliably, but anyone is free to speculate based on exchange rate trends, Moore's law and other hardware advances.


Is it possible to get ticker of bitcoin.de using an api? I did not found anything in the site. They have an api? It is for my Android App Bitcoin Paranoid.

You could just parse the website. For example to get the current euro and us dollar prices:

curl -s https://www.bitcoin.de/de | sed -n '/EUR/s%.*[^0-9]\([0-9]\+\)\(,\)\([0-9]\+\).*%\1.\3%p'

curl -s https://www.bitcoin.de/de | sed -n '/USD/s%.*[^0-9]\([0-9]\+\)\(,\)\([0-9]\+\).*%\1.\3%p'


Connecting full nodes within a LAN to speed up blockchain sync Bitcoin core v0.14.0 seems to be a lot quicker than previous versions, to the point where syncing the full blockchain now seems to be IO-bound rather than CPU-bound: When running top I used to see my CPU running at full capacity (indicating that network IO was not the limiting factor). This is no longer the case it seems, and the speed of network IO seems to be a relevant factor in the time it takes to sync a full blockchain...

Now we always have some new hardware to set up, or some new OS to try out and invariably we find ourselves in the position of building and installing bitcoind followed by a blockchain sync. Now that network speed matters, it would make a lot of sense to try and source the blockchain data from another full node we happen to be running on the same LAN, rather than fetching the data externally from a random peer connection. So my question is:

Assuming I have another full node running on the same LAN, how do I set up the config file of the new node to ensure it connects to this local node so as to benefit from the increased network speed? (This question assuming both nodes are IPv4). How do I change these settings if the running full node is on Tor while the new node is IPv4, or when the running node is IPv4 and the new node is on Tor?

EDIT: following the suggestions from the comment, I have tried to add the line:

addnode=192.168.0.2:8333

in the config file of the new (ipv4) node where 192.168.0.2 is the local ip of the established (tor) node. My tor node config file is as follows:

txindex=1
debug=mempool
daemon=1
#onlynet=onion # commented out to allow local ipv4 connection
onion=127.0.0.1:9050
port=8333
listen=1
bind=127.0.0.1:8333
externalip=<myexternaltoraddress>.onion
seednode=<seed1>.onion
...
banscore=10000
bantime=11

I have also made sure my firewall on the tor node server is properly set up

$ sudo ufw allow 8333

However, my tor node is refusing the connection request as can be seen from the new node debug:

2017-03-31 13:21:50 connect() to 192.168.0.2:8333 failed after select(): Connection refused (111)

Ok got it, it seems you need to remove the line bind=127.0.0.1:8333 from the config file, and (surprisingly) you can keep the setting onlynet=onion (you still can connect via ipv4 on the LAN). So the existing Tor node can be configured as follows:

txindex=1
debug=mempool
daemon=1
onlynet=onion
onion=127.0.0.1:9050
port=8333
listen=1
externalip=<myexternaltoraddress>.onion
seednode=<seed1>.onion
[...]
seednode=<seedk>.onion
banscore=10000
bantime=11

and the new local ipv4 node can be configured as follows:

txindex=1
debug=mempool
daemon=1
connect=192.168.0.xxx:8333

With these settings, the Tor node works as normal with Tor only connections (inbound and outbound) with the exception of the local ipv4 connection from the new node.


Is this mixing routine secure ? As part of a school project we are asked to create a mixing service. Most of the services right now use coinjoin implemented with more or less privacy.

So a single mixing service wouldn't be enough so here is the mixing routine we thought of :

bitcoin(in) -> mix -> shapeshift( -> Zcash -> monero) -> xmr.to ( btc) -> mix -> joinmarket (not sure though we haven't dug a lot into it) -> bitcoin (out)

Of course everything would be automated via various api offered by the services.

Do you have any remarks about it ? Is it good/bad ?

We are kind of afraid about the fees induced by so many external services but implementing our own mixer would require a user base to mix the coin with in the first place which we don't have.

This mixing service seems solid overall.

You could improve it in several ways:

Don't shapeshift your mixed BTC into Zcash. Shapeshift uses "transparent addresses" - which means the Zcash transaction is exactly as transparent as a regular bitcoin transaction. This is because Zcash requires upwards of 8GB of ram and approximately a minute of processing time to generate the private transaction - which Shapeshift is obviously unwilling to commit to for every transaction.
Why mix your bitcoin received via xmr.to before mixing it with joinmarket? One additional mix (using joinmarket) should be enough to obfuscate xmr.to's snooping should they attempt to track the Bitcoin that was exchanged for your Monero  (although there are questions about the long-term viability of bitcoin mixers in general).

You could also argue that the initial mix before you hit shapeshift is unnecessary  if you do not care that Shapeshift knows how you obtained the Bitcoin that you are trading them for Monero.

Best of luck with your school project!


Will my funds return? so after 3 days , my transaction is still unconfirmed , is it possible that my money is gone ? Cause i've read after a week it would be removed from network but i didn't fully understand this .

does this mean my money would go away or it would be back in my wallet ?

If a transaction is not confirmed, your coins are still in your own "wallet". Money is transferred only when the transaction is confirmed and are part of the blockchain.


Are there any other anonymous developers like Satoshi Nakamoto and BCNext that abandoned their project? I'm doing some research on anonymous developers in the crypto currency space. Satoshi Nakamoto was the first to create a crypto currency and then vanish from existence. Another one was BCNext that create the NXT platform and then vanished.

What other anonymous developers took the same approach?

There is also the CryptoNote creator Nicolas van Saberhagen.

From: https://en.wikipedia.org/wiki/CryptoNote#Controversy_and_criticism:

  The author of the white paper went by the name Nicolas van Saberhagen,
  although like Satoshi Nakamoto (the author of the bitcoin white paper)
  that name is likely a pseudonym. Saberhagen's true identity and
  location remains unknown. Some have claimed that the real creator is
  someone in the bitcoin community.

It gets interesting, because the community found the first CryptoNote (Bytecoin BCN) currency to be a likely scam.
The controversy is regarding the creator himself likely pre-mining the coin in secret before the "official" launch, as well as suspected of having an unfair mining advantage because of publishing a handicapped miner (later fixed by the community).
To give weight to the controversy, seems like the timestamps of the original whitepaper were fabricated as well.

For a longer read, the details have been presented here: https://bitcointalk.org/index.php?topic=740112.0

  tl;dr - CryptoNote developers faked dates in whitepapers. Bytecoin
  faked dates in fake blockchain to facilitate an 82% premine, and
  CryptoNote backed them up.


is every Block of blockchain is connect to each other? like as we create a new block , so it will connected to existing Blockchain or it will create a new blockchain?

Yes, every block (except the first one) gives reference to the previous block, and it's not possible to change a part of the block without invalidating it.

To create an altcoin, you have two options:

1) Fork the blockchain by using invalidateblock, which permanently considers a block and the following blocks invalid, then create your alternative chain.

2) Generate a blockchain starting from the genesis block.


oclvanitygen not showing private key? I am trying to generate my own address using my GPU with oclvanitygen, but it seems like that it only displays the:

CPU hash
GPU hash, and
Found delta

but not a private key?

Any idea why? Vanitygen using CPU is displaying private key but not oclvanitygen.
I am using Windows 7 Ultimate 64 bit and Sapphire 7970

I saw that newer drivers are broken, but some report good behaviour with 11.11.

https://github.com/samr7/vanitygen/issues/19


Is Sharding a Good Alternative to MultiSig? For security purposes, we require that each withdrawal be "approved" by multiple servers so that in the event a single server is compromised the attacker won't be able to siphon funds from the entire wallet. The typical approach to execute this concept is a MultiSig address where a transaction is only approved after it is signed by multiple entities.
However, the fees for a 2/3 MultiSig transaction are nearly twice as high as fees for a regular transaction. If we wanted 3/4 (or higher) MultiSig the fees would be even costlier. This got me thinking of a way to take advantage of the security benefits offered by MultiSig transactions without suffering from excessive fee consumption in the process.
The immediate solution that comes to mind is sharding. In short, instead of using MultiSig we can safely break up the PK using Shamir's Secret Sharing Scheme with unlimited schemes (such as 4-of-7 or 3-of-4 etc) and store the shards on separate servers thereby requiring multiple servers to "sign" a withdrawal request.
Does MultiSig provide any (security) benefit over sharding? Is sharding a viable alternative to MultiSig?
Update:
Perhaps the only problem with this proposal is that each server cannot independently "authorize" the transaction using its "shard". At some point, all shards would need to be known to "reassemble" the PK so the attacker could still use this as the "weakest link" to steal the PK? Is this correct?
Thanks

Advantages of OP_CHECKMULTISIG over Shamir Secret Sharing for k-of-n:

There is no need to reconstruct the actual secret key on one specific machine. With SSS, you're inherently relying on that one machine being able to verify that what it's going to sign is what is intended - otherwise you may e.g. be sending your entire balance instead of just the payment you wanted to make. Also, if that key or (in case BIP32 public derivation is used) any related key is ever reused, that machine being compromised would in fact expose your entire wallet, including future funds. Given that the end goal is reducing the need to rely on the security of a single device, this is not ideal.
Accountability: with an SSS-based signature, the on-chain signature cannot tell you which signer(s) actually signed for spending, while OP_CHECKMULTISIG does. If you want the ability to go after rogue signers.

Advantages of SSS over OP_CHECKMULTISIG:

Cheaper on-chain.
Better policy privacy (you're not revealing on-chain that you were in fact using a multisig policy).

Now, with the hopefully upcoming activation of BIP 341-342 (Taproot) which includes support for BIP 340 Schnorr signatures, there will be more options (disclaimed: I'm a co-author of these proposals):

Native threshold signatures: with Schnorr signatures it is possible to perform something that's effectively equivalent to performing SSS on the public keys, and at signing time on the signatures, and end up with a valid combined signature for the combined public key. This gets you some of the advantages of both, and some additional disadvantages:

No single machine where the private key needs to be combined on (only signatures ever get combined, which are only valid for the specific message the individual signers signed).
Lack of accountability like SSS.
Same on-chain cost as SSS.
Same on-chain policy privacy as SSS.
More complicated protocol that needs multiple interaction rounds between the signers. Also lots of edge cases to take into account to make this secure in practice. For recent work, see FROST. If all you need is n-of-n (rather than k-of-n), it is simpler and less involved; see e.g. MuSig2.

That's not the only option, though. More alternatives are listed in BIP 342, note 5. In a way, SSS and OP_CHECKMULTISIG are two extremes of a spectrum. For example, you can construct an output that contains a Merkle root of a tree for which every leaf is one k-of-k aggregated key. It can be spent by revealing the Merkle branch plus the aggregated signature. This is usually cheaper than OP_CHECKMULTISIG-like constructions that publish all keys and signatures, but not as good as the SSS-like approaches give you. On the other hand, it's simpler too.


I sent Bitcoin to a Bitcoin Cash eWallet by mistake, what can I do? By mistake, I sent some Bitcoin to a Bitcoin Cash eWallet. Is there anything that I can do to get it back?

Do you hold private keys of that Bitcoin Cash eWallet?
If yes, you need to import private key of that Bitcoin Cash address into any Bitcoin wallet and you will be able to get your bitcoins back.


How to get total number of transactions from bitcoin core wallet using rpc I'm trying to implement paginations using :

https://chainquery.com/bitcoin-api/listtransactions

I want to have reverse listing (oldest first), so I need to get total number of transaction returned by listtransactions call.

I know that getwalletinfo returns number of transactions, but listtransactions returns transaction outputs, which are more if sendmany is used.

Is there any method to get listtransactions.length without fetching all transaction in the wallet ?

You can pass the output of listtransactions through a JSON parser which can get that information for you. You can install a command line tool like jq and pipe the output of your commands to it so you can access the JSON fields that you want.


On chain cost of Segwit version 1 versus version 0 How do total blockchain cost for Segwit version 0 compare to version 1 which is being proposed? I'm specifically interested in a single user transactions – both paying to public key (or pk hash) and script (mostly asking about scripts without branching as I understand there are savings in more complex scripts with more branches). By total blockchain cost, I mean the number of bytes, vbytes and weight in both the outputs as well as the inputs that are spending these outputs. In other words, I'm asking if there will be any savings in version 1 scripts compared to the transactions that can be done on version 0.

In general, Segwit v1 is cheaper than segwit v0 to spend but slightly more expensive to create.

Segwit v1 output scripts as defined by the proposed taproot BIP will always be 35 bytes in length. However Segwit v0 output scripts are either 22 bytes (for the single key case) or 34 bytes (script hash case). This means that the person sending to segwit v1 will end up paying a little bit more than for a segwit v0 output. Of course, the recipient can use P2SH wrapped segwit outputs so that cost would actually be pushed to them.

However segwit v1 is cheaper for the recipient when he wants to spend that output. Because segwit v1 is a Pay-to-Pubkey model, the public key does not need to be specified in the input. This saves 34 bytes of witness data (34 weight units, 8.5 vbytes).

Additionally, segwit v0 uses ECDSA signatures which are encoded using the DER encoding. This results in signatures that are typically 71 or 72 bytes (each size has ~50% probability of occurring for any signature unless the software specifically only creates 71 byte signatures like Bitcoin Core does). But segwit v1 uses Schnorr signatures and the encoding specified for that in the BIPs which will typically be 64 bytes in length (can be 65 if something other than SIGHASH_ALL is used but that is rare). For simplicity, we can say that this is a reduction of 8 bytes which is 8 weight units and 2 vbytes.

So for the typical single key case, segwit v1 saves 42 bytes which is 42 weight units or 10.5 vbytes.

Where it gets intereseting is the case of multisigs, the most common type of script used. For multisigs, the MuSig multisignature scheme. MuSig allows a n-of-n multisig or a m-of-n non-accountable multisig (i.e. no one will be able to know who signed) appear to observers as a single key signature. This means that there is only one public key specified in the output and one signature verified in the input. So for all n-of-n multisigs and non-accountable m-of-n multisigs, the cost is exactly the same as for the single key case, but the savings vary depending on the number of signers. The savings for the first signer are the same as the single key case. For every additional signer (i.e. when n > 1), using segwit v1 saves ~107 bytes, which is 107 weight units or 26.75 vbytes.

It gets more complicated for m-of-n signatures where you want accountability.  Such threshold signatures can be achieved by using MuSig and a merkle tree that represents every combination of signing keys. However the size using sewit v1 will ultimately be smaller than segwit v0 because ultimately, the leaves of the merkle tree will always be single pubkeys and the hashes in between will be slightly smaller than public keys in a traditional script. Lastly, the most common of the thresholds can be used as root case in taproot which allows for more savings as then branches of the script don't need to be revealed.


How to check about 10 million bitcoin addresses? A few years ago I deposited a specific amount of bitcoins into an address and wrote that address/private key down. I lost the last four characters of the address. I counted that each character can be 26 upper + 26 lower + 10 digits = 62 characters. So missing 4 characters means that my wallet can be an of 62*62*62*62 = 14,776,336 addresses. How can I programmatically check all those combinations? I will find all the addresses with the same bitcoins as I deposited and then check them one by one as I expect (hope) there to be less than 1,000 matching addresses.

I've checked blockchain.info but they timed me out after a few requests, I checked blockonomics.co but they are expensive.

You don't need to check the whole 62*62*62*62 addresses online through API. That would be an insanely long journey, and you'll get blacklisted at any free service before finding what you seek, no doubt.

In your place I would:

1) download the daily balance snapshot from blockchair.com

2) either in Windows through Cygwin or in Linux shell, or in MacOS terminal type:

zcat blockchair_bitcoin_addresses_latest.tsv.gz|grep "the part of the address you remember"

Example, I took a random address from the list and removed last 4 digits:

root@ubuntu:~# time zcat blockchair_bitcoin_addresses_latest.tsv.gz |grep 1EpfyhhNnwF2Sv53PUzoJGRawiTVy
1EpfyhhNnwF2Sv53PUzoJGRawiTVybuMTz      1

real    0m9.479s
user    0m9.209s
sys     0m0.746s

I've run the command with time in front just for testing purposes, in order to demonstrate that it took less than 10 seconds to parse the list and find the matching address, and this is not a powerful PC. I don't even have SSD here, I bet if you have one it will be even faster.

Please note the number 1 after the address: this BTC address has indeed 1 satoshi.

If you are in doubt about capital letters in your address just add the -i option after grep so it will not run a case-sensitive search and will return the result even with wrong capitals in the search pattern; here I searched all Bitcoin addresses with non-zero balance containing my name despite any capitals, and it still took 10s:

root@ubuntu:~# time zcat blockchair_bitcoin_addresses_latest.tsv.gz |grep -i marco
3NPjX9BFc3hZdXeqjFqMNMARco2gfna9cR      1512000000
1HTsd6dR5qdKUTghRh8VdfDq3marcoVBdZ      4267964
1LCidVxbHzL4maRcoeaYZrevVVz3KTHnqb      3900000
1AF9enGasTBY1zxsMARCotYP9izc2v3Fzs      2028360
17kaMiiyDa11VGYMArCoZM8wD9enpWXc5K      1009417
1EoDrgLovufWp4BjC4iEqyhSHR2MaRcob1      1003055
14UEd1qtHwvWk3tWjkDsZfRXKUDx7mArCo      483996
1At868R9nWceRRpymarCopNhrywPUooDvE      431629
1Marco12CWtLWwAK9eKxqTZmeQgitBwAhg      200000
1marcoUFS2NyCtW7hH2AGxGVbJ9fpZkrR       184000
17Nw3Ed1vnUQpmzKty2MarcoCskKDZQmAp      167192
18odA7ipASdRFkf1gGAspQ8DQmArCoLrsU      99300
1MArcoSBgoNhnypXD7YhE4T9B7eUFSTLA3      26280
1marco52Uta2SKaLPeNiEczbrwCHnV7Jb       17100
1MaRCoEoSZXpupVVtCcs5chdEVwF78FQ9U      10000
1Kf9aZ21UQmrRBpXfMarcoQoj7VgV2e9H2      3660
1FT4mpGZS4Df8WzjWHhDDCezJJKksmARCo      3607
1MarcoStvKXXkeQJhwfcUdUP1NLnHB2bfr      1
1MArCovVsyQ54sRufEvjCrNCmUfgr3ZsvY      1
1MARcoseSo15DysRD9t2GoRm2aaHPKxgeh      1
1DemArcoSrb2D8RCSvsU7gPBvFbT3sdDL1      1
1MarConm2xEoBveieCcGGZvAvKZi6EHvzn      1
1DemArCozufYcpvVqxsXy3ttLh2iN5keHr      1
1MARCoNioFuSbuX7mgAifgBx8hsF8FVFu8      1

real    0m9.921s
user    0m10.829s
sys     0m0.656s

Relevant note: if you have not a premium API account on blockchair.com the list download (today over 700MB) is rate limited to 128KB/s. The DL takes around two hours but it is updated daily, and I find it's still a tremendous booster for all bulk balance lookups issues, unless you need balances to be real time. In this last case, look to a paid API as only solution.


Updating old BitCoin-QT Core client V0.7 - 2017 Approach? I have an old "BitCoin-QT" Core client at version 'V0.7 2-beta' - that is far out of date re Synching. (That client says the program uses Qt version 4.8.4, incase that is useful too).
It was a ‘Full Node’ setup back then, cos that was the only option technology wise.

Am keen to get the client / block updated, so I can go shopping ;-).

Been reading the latest Coinbase “Bitcoin Core 0.15.0.1” release info (Oct 2017) - extract below from the Release Notes : “Note that the block database format also changed in version 0.8.0 and there is no automatic upgrade code from before version 0.8 to version 0.15.0. Upgrading directly from 0.7.x and earlier without redownloading the blockchain is not supported. However, as usual, old wallet versions are still supported”.

Is that text meaning:
(i) I have to separately go get the large blockchain file myself prior to the latest Core Client version install ?
OR
(ii) The latest client version will know to go get that latest blockchain / format and download for me natively itself ?

Assuming its the first point :

Where can I get / torrent the latest compatible blockchain ? been looking and they are from years ago.
Been reading conflicting information about my upgrade scenario (from V0.7 2-beta Core client to V0.15.0.1) with regard to the "bootstrap" ie hearing "this is not the way to go nowadays with the new technology". This was from a few years back. Been generally reading that this approach is not supported nor updated anymore, true?
Are there more detailed '****Release Notes****' against the Coinbase “Bitcoin Core 0.15.0.1” ? I've been looking. This paragraph quoted above is all I got as instruction for my scenario.

Luckily I've lots of disk space / ram / data allowance etc to make the upgrade happen on Mac OS - so am just needing confirmation on the steps so I only have to run this process once.

I’ll only be using the wallet every few months, I just want it for the Wallet.

Any advice here would be very much appreciated.

edit: [removed a part about upgrading. Lower part still remains relevant I think, so I think I will keep it there.]

I don't know of any place where you can download the latest compatible blockchain, but more importantly you should never want to do so! If you download it from some shady site, what guarantees would you have that the chain has not been tampered with, or that it will contain trojans, keyloggers or the like, which could lead to loss of funds/time. Just install the bitcoin client of your choice and let it download the blockchain through its connected nodes. It can verify the contents and make sure you are on the right chain.


Wouldn't a full node use nearly the same space for large or small block sizes? I keep hearing that a larger block size for Bitcoin increases the network weight for full nodes, i.e. more hard drive space required for full nodes.
 And hence it would make less full nodes, and so the network then becomes more centralized.

...but blocks are composed of transactions. And there'd be the same amount of transactions (more or less) either way.  And a full node needs to have all blocks.

Small block sizes:
Full node would download more small blocks.

Large block sizes:
Full node would download less blocks, but they are bigger.

Wouldn't they each take close to the same amount of space either way?
Yet this seems to be the main argument, other than the problems of forking at all for any change, against why not use a bigger block size.

I think the logical issue with that argument is the assumption that larger block sizes = less # of blocks. More likely, the number of blocks would stay the same (a block is "mined" into the blockchain about once every 10 minutes). Thus, the capacity of the blockchain would increase.

Only if you assume that the number of transactions currently being "saved" into the blockchain is the upper level of the demand for such transactions would the storage size not be affected by larger block sizes.


What is the simplest python program that would query the bitcoin core client for a raw tx? I put this one together that claims "no JSON object could be decoded".

  from bitcoinrpc.authproxy import AuthServiceProxy

  access =
  AuthServiceProxy("http://user:password@127.0.0.1:8332")

  printme=access.getrawtransaction("6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4")

  print printme

My bitcoin core wallet is set to "server=1" and "listen=1", but it is currently downloading the blockchain (idk if that would have an impact).

If you are still downloading the blockchain and you haven't downloaded and verified that transaction yet, then of course you will get an error when you try to look it up, Bitcoin Core doesn't know about it yet!

Furthermore, if that transaction is not part of your wallet or in the UTXO set (i.e. one of the outputs is unspent), then getrawtransaction won't work. Bitcoin Core can only retrieve arbitrary transactions if you have enabled the transaction index with txindex=1.


Can the Bitcoin blockchain eliminate the need for Trusted Computing in Smart Contracts? Let me preface this by saying that I'm a novice, but this is my rough understanding of how Bitcoin's blockchain works.  (This is largely based on blog posts like this one.)  If person A wants to transfer a certain amount of Bitcoin to person B, he signs a message authorizing the transfer using his private key.  A minor can examine the message, and using a program that performs a certain mathematical operation, can verify that person A really did sign the message.  But there's the issue of, how do we know that the miner really did do the computational work needed to verify the signature?  This is solved by something called a "proof-of-work" protocol, by which the miner can demonstrate that he did the verification computation.

I was reminded of all this when hearing about the notion of "external state contracts", a type of Smart Contract described briefly at the 35 minute mark of this video and in more detail in this Bitcoin wiki article.  In an external state contract,  certain disputes about objective features of the world can be resolved automatically, instead of trusting a third-party human arbitrator to decide fairly.  For instance, contract could specify that in the event of a dispute about a sports bet, a computer program (with source code specified in the contract) would be automatically run that consults a sports database, determines who won the bet, and the bitcoin is automatically transferred accordingly.  But the Bitcoin wiki article describes an issue with this: how do you determine that the computer program that's supposed to resolve the dispute has actually been run, and if so whether the output of the program is being reported fairly by the computer that ran it?  The article suggests using one or more "Trusted Computers" known as oracles, which both parties trust to run the code properly and not misrepresent the output.

But it occurs to me that the issue with external state contracts is analogous to the issue I described above that's solved with the blockchain.  So why can't you solve it the same way in this case?  That is to say, just as proof-of-work protocols can be used to demonstrate that a miner ran the code that determines whether a signature is authentic, why can't you make miners run dispute-resolution code for external state contracts, and then determine whether they really ran the code using proof-of-work protocols?  That would eliminate the need for a Trusted Computer.

Is there any significant difference between the two cases that would make this unworkable?  Has this been done already?

Any help would be greatly appreciated.

Thank You in Advance.

...how do you determine that the computer program that's supposed to resolve the dispute has actually been run, and if so whether the output of the program is being reported fairly by the computer that ran it? ...
But it occurs to me that the issue with external state contracts is analogous to the issue I described above that's solved with the blockchain. So why can't you solve it the same way in this case?

If I understand you correctly, the question you're asking is: Why can't you extend the blockchain trust/coordination system to handle the problem of resolving disputes about the validity of a computation's output (or validity of an observation, like "who won this game?").  After all, if the blockchain gets everyone to agree on a transaction record, why not on arbitrary claims about the world?
The answer, in short, is that the blockchain restricts the "claims" that it "proves" to ones that, by construction, it can provide (strong) evidence for.  And those claims rely on special cryptographic properties that don't (as far as we know) generalize to arbitrary claims about the world.
More concretely, what the blockchain is claiming (and getting network coordination on) is something like, "These transactions happened in this order."  And it proves it by saying, "Transaction T30 must have been seen by someone who had already seen transactions T29, T28 ..., and spent 9000 units of work (say, computations of SHA-256) on it."  Which in turn is proven by how SHA-256 has a known computation difficulty, and the proof-of-work for Transaction T30 was generated uniquely from the previous transactions.
That's a very different problem than proving that a certain (family of) computation(s) has a certain result.  For that problem (as Nate Eldredge mentions), you will want to use Zero-Knowledge Proofs, an active area of research.  But those a) only apply to "pure functions", not arbitrary questions about the Real World, and b) require a certain asymmetry between computation and verification -- i.e., it must be a lot easier to verify them than to do the computation, or else you've saved nothing: just do the computation yourself instead of trusting others' reports!
And it's ever further off from the problem of "proving" real-world observations.  So yeah, the best we have cryptographically is to designate an address as trusted on certain matters, and then check the validity of their signatures.
In terms of verifying real-world claims, the best we have is to check all the implications of that claim, which is just old-fashioned fact-checking.  For the ballgame example, that would be checking things like "What do the newspapers report about the game?  What do the league records say?  Who played next in the tournament?"  Which is fine in practice -- like resolving things at the bookie.  But it doesn't provide a cryptographic proof, which would have to be robust against attackers e.g. falsifying news reports and such.
Okay, I've rambled enough now.  Did I answer your question?


what are chaff coins in cryptocurrency? I read in several paper about "chaff coins" but I could not find a clear definition for this phenomenon. Does it refer to a specific coin? Is there any "formal" definition for that ?

Reference: https://arxiv.org/abs/1704.04299

The term is used specifically in Monero's ring signature based spending scheme.

Monero transactions do not exactly specify which previous outputs are being spent. Instead, a list of alternative inputs is provided (consisting of the real one, and a number of chaff coins). A ring signature is then used to prove authority to spend from the real one, without revealing which one that is.

This has the advantage of obscuring the transaction graph significantly. It also comes at a very high price - as it means validation cannot use a UTXO set based approach, and must instead maintain an ever-growing database of spent coins to prevent double spending.


What happens to a node if .bitcoin/chainstate is corrupted? I tried to search for answers to my questions, but didn't find any, but please forgive me if this is a duplicate question.

Suppose somehow .bitcoin/chainstate gets corrupted, e.g., a UTXO is deleted. I suppose that this node will then try to reject any blocks that contains a transaction that tries to use the deleted UTXO?

Or will the node somehow detect that its chainstate has been corrupted, and rescan the blockchain? If this is the case, how would the node detect this?

Finally, suppose all of the node's chainstate was corrupted in exactly the same way, a UTXO was deleted. Then is this UTXO effectively gone, even though it remains in the blockchain.

Thank you.

I found an answer by Pieter Wuille to another question that seems to be relevant here. The relevant part states:

  "Please don't go download a chainstate from a random place on the Internet though. They can introduce arbitrarily many coins assigned to themselves, and your client would accept them. If many people started running nodes using the same chainstate 'copy' such transactions could even get into blocks, and cause forks in the best case, and theft in the worst case."

So, this seems to indicate that a node will simply not realize that its chainstate is modified.


Pay to Script Hash Execution Combining the spending transaction scriptSig and funding transaction scriptPubKey, we get:

<OP_0> <sig A> <sig C> <redeemScript> <OP_HASH160> <redeemScriptHash> <OP_EQUAL>

Stepping through this script:

1)OP_0 and the two signatures are added to the stack, kept for later.

2)The redeemScript is added to the stack.

3)OP_HASH160 hashes our redeemScript.

4)redeemScriptHash is added to the stack.

5)OP_EQUAL will compare OP_HASH160(redeemScript) and redeemScriptHash and check for equality. This confirms that our spending transaction is providing the correct redeemScript.

6)Now our redeemScript can be evaluated:

<OP_2> <A pubkey> <B pubkey> <C pubkey> <OP_3> <OP_CHECKMULTISIG>

7)OP_CHECKMULTISIG will look at the 3 public keys and 2 signatures in the stack, and compare them one by one. As stated earlier, the order of signatures matters here and must match the order that the public keys were provided in.

8)OP_0 is included only to deal with an off-by-one error in Bitcoin Core when using OP_CHECKMULTISIG.

i read several answers related to this topic and i read also the BIP16 but i still can not understand how after validation with <OP_EQUAL>of <redeemScript> calculated with <OP_HASH160> and <redeemScriptHash> the script continues with the validation of <sig A> <sig C>

After the procedure which i have already described the only portions left in the stack are : <OP_0> <sig A> <sig C> How these signatures will be verified since the fact that <redeemScript> is poped out of the stack?

My question in other words has to do with step 6.
Now our redeemScript can be evaluated: how since it has been removed from the stack...

I've been hunting for this information myself, and had to dig to the bitcoin source code to find the answer - couldn't find it anywhere else.

There is a hardcoded logic in bitcoin for P2SH validation:

The stack is backed up between the steps 2 and 3 (generally - between scriptSig and scriptPubKey execution).

After both scripts are executed and verified, the stack is restored from the earlier backup, the redeem script is popped from the stack, deserialized, executed and verified. This is done by internal bitcoin code, not by any script.

Corresponding source code:
https://github.com/bitcoin/bitcoin/blob/6fef85bfa3cd7f76e83b8b57f9e4acd63eb664ec/src/script/interpreter.cpp

Stack is backed up at 1493, and restored at 1529, where all the magic begins.


In what order do new blocks get processed? Node A receives a newest block with height h1, which it determines to be valid, and therefore stores the block on disk. A little later, it receives another block with the same height h1 but a greater amount of proof of work than the previous one. What would node A do?

Also I am confused about the order of processing a new block. The order in the source code:

              success                          success
Check(block)----------->store block on disk------------------>ReceivedBlockTransaction-------->ActivateBestChain

If ReceivedBlockTransaction or ActivateBestChain were to fail, would the disk be rolled back or not? If it would rollback, why not put the receivedBlockTransaction and ActivateBestchain before store block on disk?

First to clarify:
Two competing blocks at the same height that build on the same parent block always have the same amount of proof of work, as that depends on the difficulty, which will be the same for both competitors.

Thus, a chain reorganization will only occur in practice if a competing chain tip pulls ahead of a previously accepted chain tip by accumulating a greater length.*

Bitcoin Core stores competing blocks it receives as a sidebranch, if the headers would potentially make it the best chain. Otherwise it discards them.

When chain reorganization occurs, Bitcoin Core will undo each block from the tip one at a time, reverting back to the common ancestor with the new best chain, then will apply the blocks in the new best chain one at a time until it is at the new tip.

* It is possible to construct a case around a difficulty change where competing chain tips have different difficulties at the same height. Then, the one with the higher difficulty would replace the one with lower difficulty at the same height. However, that would require a chain split of more than one block length.


I want to display information about my bitcoin node on a webpage (php or html) I want to show information about my bitcoin node on a website.. how can I do this with windows + php + html + javascript + rpc?

I want something like that but with more information and perhaps more dynamic:

Example page:   http://199.58.210.124/

The node example is my node, this is the script that I'm using.

Download this script
http://pastebin.com/wKytLZmc

Put it anywhere on your server and change the RPCUSER/PASS, NODEADDR and BITCOINADDR.

Run the script to update every time. You can also use it to create a chron job.

To run the script, after editing the values above, put it anywhere and type:
python btc-update.py

If it just returns, that means it works :)

Note: If you get an error, you’ll need to install BitcoinRPC for the script to work.
Go here: https://github.com/jgarzik/python-bitcoinrpc
Follow Jeffs simple instructions. Once BitcoinRPC is installed, run the node script again and it will update!

Good luck!


Pay with BTC in online stores accepting only CCs I'm looking for a way to spend BTC to buy products / services in stores that accept only credit cards. I know it's possible with virtual credit cards. Any examples of such services? Or something like all4btc -- it was a company where one could send btc and an URL of the product to buy and they took care of the rest.

so depends on what you are looking to buy. I know someone that used XCH4NGE lifestyle to buy a car recently. you can find them on twitter. @xch4ngelifestyle.


What happens when invoices get paid more than once? Until today I thought, that lightning invoices can only be paid once. Where do the funds go when an invoice is paid more than once? Will every payment reach the destination node or can reusage be detected and nodes within the route can keep the funds?
Edit: The same invoice is paid with different wallets and the users get confirmation.

It is possible that intermediate nodes on the route between you and the payee may track previous payments they have forwarded. If this happens, then the first time the payment_preimage for a payment_hash is revealed, any node along the route could remember it, and if they see the same payment_hash used again in another payment, they would be able to respond with the corresponding payment_preimage before forwarding the payment along the route, and this would allow them to claim the funds which are being spent without the intended recipient ever receiving them.


How to preserve anonymity within Ripple? The common practice for cryptocoins like Bitcoin is to limit address reuse to preserve anonymity. This is achieved by sending the "change" of a transaction to another address and using a unused address for every transaction. (Research showed that even when best practices are used identities could be derived but that's not the point here).

The Ripple wiki documents something about an Account Familiy which seems comparable with Bitcoins deterministic wallets as decribed in BIP0032. However the Ripple system requires a fee for account-activation.

When using an account family how does one activate such account and how does (I presume) rippled know that an account from a family is activated?

Note, anonymity isn't a design goal for ripple. Depending on the level of pseudo-anonymity required, gateway and future features of Ripple would likely be easier (and more cost effective) than using many Ripple addresses (aka Ripple accounts).

To tell if two (or more) Ripple addresses are in the same family you need the public generator (which is named for generating the public keys, it should not be made public). Without that no one can tell if they are part of the same family and therefore they are funded/activated independently exactly like any other address is (someone sends it the XRP account reserve).

I'm not aware of any Ripple client that currently implements account families (the existing clients just use the public and private ECDSA key corresponding to index 0 within the account family).