What would be an estimate of the value gained if the whole world started using Bitcoins? I remember that before the Euro was first introduced, I read estimates on how much economical benefit every person would get (GDP per capita) once the Euro was fully implemented. Estimates like these were used in the cost/benefit analysis used for deciding whether or not it was worth the trouble of creating the Euro at all.

I guess they didn't include the risk of a Euro-collapse and the related costs, but nevertheless, it was an estimate. I do not know whether this question is too speculative, but it is truly the most interesting question I can think of. If it would be too difficult to estimate for the whole world, then an estimate for a region would also be interesting.

According to xkcd: Money Chart estimated total economic production of the human race as of 2011 is $2,396,950,000,000,000 . Divide it by 21 million and the theoretical maximum price per bitcoin would be $114,140,476, but that figure is impossible, because for one, even in best case scenario Bitcoin will co-exist and compete with other currencies and would have only a small share of the pie. Second, Bitcoin is more efficient medium of exchange then USD, in other words, to complete transaction a someone required to hold bitcoins for shorter period of time therefore less total amount of bitcoins would be required for circulation and that also means lower price.


Why is a hardfork a problem? My understanding of "hardfork" was that it referred to anything that requires re-building the blockchain from the genesis block. But now, I understand that anything that requires a Bitcoin-Qt client upgrade is a hardfork, too. Why is a hardfork considered a problem in the Bitcoin community?

User wallets and stored keys are more important, so all upgrades must ensure they wouldn't break these, but does it matter at all that it's required to upgrade old clients to use new features?

All the nodes in the Bitcoin Network have agreed on a certain set of rules. These rules are coded into the client and everything that changes the state of the ledger is checked against those rules.

Hardforks happen when a change in those rules (for example the reward halving rule or the difficulty adjustment rule) causes the new clients to make different decisions about the validity of transactions and blocks. This basically means that over time the state of the ledger on older clients would diverge from the state at new clients, creating two incompatible networks, as transactions would be valid in one but not in the other.

As transactions and blocks are chained together, even a single disagreement about the validity of a transaction or block can cause large parts of the state to become inconsistent over time, it is therefore crucial that the network as a whole agrees on the rules.

The developers keep a wishlist of changes for hardforks, because hardforks should be a rare event, breaking changes be bundled into on hardfork. The changes decided in hardforks have a trigger height after which they are applied, which is usually several months in the future in order to let developers of alternative clients and the users update their nodes before the switch, minimizing the number of incompatible nodes left behind.


How does blockchain.info access my wallet in MyWallet I made a wallet at blockchain.info and enabled two-step authentication using Google Authenticator.

As I understand it, the operator of blockchain.info cannot access your wallet (unlike e.g. MtGox). Yet somehow blockchain.info can deposit coins in my wallet.

Also, I assume the two-step does not work for the offline backup files, but the password does?

Your wallet is only used to send coins. To receive coins you don't need access to the wallet.


Can my bitcoins get stolen? I posted a question on here about my bitcoins being stuck, they are no longer stuck but someone has taken all of my bitcoins from that wallet and I don't know how

To answer the question , yes. If some one has access to your private keys, then it is easy to steal them and more or less there is no way to get them back.


C# parse bitcoin blockchain to get balance of an address Is there a way to scan the Bitcoin blockchain in C# without using an external API? I am looking for the amount of spendable money of a Bitcoin address.

I am using NBitcoin.

// create new key pair based on private key
NBitcoin.Key key = new NBitcoin.Key(privateKey, privateKey.Length, false);

// parse blk*.dat
// get balance for address key.PubKey.Hash
// How to do that?

How about running a QBitNinja server locally?

var client = new QBitNinjaClient(baseAddress:"specify host here, you probably want localhost", Network.TestNet);
var balanceModel = client.GetBalance(dest: [Add any IDestination here, like new BitcoinAddress("mivD5GHroixrzgjv6Ww73pV5R55PcL8JdM", Network.TestNet)], unspentOnly: true).Result;
if (balanceModel.Operations.Count == 0)
    throw new Exception("No coins to spend");
var unspentCoins = new List<Coin>();
foreach (var operation in balanceModel.Operations)
            unspentCoins.AddRange(operation.ReceivedCoins.Select(coin => coin as Coin));
var balance = unspentCoins.Sum(x => x.Amount.ToDecimal(MoneyUnit.BTC));


What was the design decision behind that the coinbase field can have arbitrary data? From what I learned, the coinbase field in the block reward transaction can carry any data (As long as smaller than 100b).

Why that actually? Was it easier to implement in the beginning? I would just have defined that the coinbase transaction may have no input. I know it is useful now to carry more information (see BIP34). I'm just not sure what was Satoshi's intention here, although he included himself the famous

  The Times 03/Jan/2009 Chancellor on brink of second bailout for banks

Further it seems that this is missing in the transaction db and is unspendable, but I may confuse things here.

They wanted to rule out possibility that the same transaction ID would appear in different block, as a different coinbase.

There have been such in the history, but only twice, and it complicates the unspent DB application, so they just decided one day that same ID would not be distinguishable as a different transaction anymore. Thus added a protection against it, in block format version 2, so no miner can accidentally end up anymore with a non-unique ID for his coinbase transaction.


Transaction marked as "Newly generated coins" on Blockchain.info On blockchain.info I saw a transaction labeled as "No inputs (newly generated coins)". Are these new coins generated from mining?

How come that such a transaction can have 30 confirmations, while others only have six confirmations?

No inputs means that the coins are coming from a coinbase transaction, that is, they were only moved "once", when they were created.

Transactions will have different numbers of confirmations based on how recently the funds were moved.


Bitcoin Cash Sent to Vaultoro I accidentally sent Bitcoin Cash from my Coinbase wallet to my wallet at Vaultoro. The problem is it didn't show up because Vaultoro only takes Bitcoin.

Can anyone give me a step by step on how to retrieve this? I tried to get Vaultoro to help but they didn't seem to care.

Please help.

The only way to recover your coins is to get Vaultoro to do it as they own the private key. Some other services charge a recovery fee for this, others don't even offer a way to recover such funds.


Stratum Mining Proxy - Error decoding message on startup I'm attempting to run stratum-mining-proxy with minerd. Proxy starts and runs with the following command:

python ./mining_proxy.py -o ltc-stratum.kattare.com -p 3333 -pa scrypt

Proxy starts fine. Run Minerd (U/P removed):

minerd -a scrypt -r 1 -s 6 -o http://127.0.0.1:3333 -O USERNAME.1:PASSWORD

Following errors are received. This one from the proxy:

2013-07-18 01:33:59,981 ERROR protocol protocol.dataReceived # Processing of message failed
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 185, in dataReceived
    self.lineReceived(line, request_counter)
  File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 216, in lineReceived
    raise custom_exceptions.ProtocolException("Cannot decode message '%s'" % line)
'rotocolException: Cannot decode message 'POST / HTTP/1.1

And this from minerd. What am I doing wrong? Any help is appreciated!

[2013-07-18 01:33:59] HTTP request failed: Empty reply from server
[2013-07-18 01:33:59] json_rpc_call failed, retry after 30 seconds

I use 2 .sh files from teh desktop, one for the proxy to start for Burnside's pool, the other to start the miner.  The basic command is this one line ( as it runs in terminal in Ubuntu 12.04 ) after using CD ( directory ) to get to where I unpacked the proxy.

./mining_proxy.py -o ltc-stratum.kattare.com -p 3333

The next .SH file also used cd .... to get to where I unpaced my miner, teh minerd command is as follows

minerd -a scrypt -o 127.0.0.1:8333 -O nybbler905.1:x

Port 8332 ( local ) is getwork unless otherwise set for the proxy.  The other errors are related to not fully installing python and then the proxy.

 sudo python setup.py install
./mining_proxy.py --help

If you do not get the help info, look in to re-re-re-installing python and the proxy.


Why does Account Controls not work on the Ardor parent chain but only for child chains? Account controls that let you do account locking doesnt seem to show up on the Ardor parent chain. Why is this disabled while it works for the child chains? How does one secure their Ardor, if account control doesn't work.

According to NXT wiki:

  In Ardor, only child chain transactions can be phased. Therefore, when account control is set for an account, it can no longer submit Ardor chain transactions.

In other words: account locked for child chain is locked for Ardor chain to.

See for details: Account_Control


How Many Clients Could Not Send to Bech32 Addresses? For my client, I have set up a custom BTC payment solution using BTCPay Server.  The wallets I have configured in BTCPay Server produce only bech32 (bc1xxx) addresses for payments (cheapest transaction fees).
My client (who ordered the solution) has asked me how many of his customers would be unable to send a payment to a bech32 address?
His concern is that his clients will be unable to pay their invoices in BTC because their wallets will be unable to send payments to the bech32 addresses.
As I can see it, I can go back to my client with one of the following two answers:

Nearly all (??%) of wallets can send to bech32 including all\most commercial wallet providers so you don't need to worry, or
This is a problem and instead of bech32 addresses I need to set up a payment wallet that supports legacy addresses (either 1xxx or 3xxx).

Could someone please tell me whether I can reassure him that the solution is fine as is, or whether I need to add legacy address support into it?

As an answer didn't appear to be forthcoming, I did my own research in order to address this question.
Based on the information provided by the Bitcoin Wiki on Bech32 adoption, I surmised the following information.

All mainstream software wallets support sending to Bech32.
All mainstream hardware wallets support sending to Bech32 (either directly or via Electrum).
All major web wallets support sending to Bech32.
Most exchanges support sending to Bech32 (although notably Bitrex and LBC don't).

Note that I have specified sending because a lot of these do not support receiving funds via a Bech32 address as of yet.  However, for my particular requirement that is unimportant as it is about sending only.
With the above facts confirmed, the answer I actually gave to my client was:
Nearly all wallets can send to bech32 including most commercial wallet providers so you don't need to worry.
When he asked what percentage, I was unable to answer it.  I would need to know what percentage of daily volume went through the exchanges that didn't support Bech32.  However, given then pretty much every wallet does support it I felt that this was less relevant.


What is the relation between a Hash Time Lock Contract(HTLC) and a Commitment transaction? I want to know about what happens to the commitment transactions as the HTLC's are sent and cleared along to peers in a route.

When a HTLC is created, a new commitment transaction is created. The HTLC is an additional output (script) in this new commitment transaction, in addition to the RSMC and “regular” outputs, and represents the amount that is pending “routing confirmation”.

When the HTLC is cleared, another commitment transaction is created, absorbing the HTLC output amount into the RSMC/“regular” outputs.


How does the most recently found critical vulnerability (CVE-2018-17144) work? If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin?

Where in the source code is this exactly (link)?

Why can't this be done by a non-miner?

Also, which forks are/were vulnerable?

If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin?
Where in the source code is this exactly (link)?

There are two components to CVE-2018-17144. There is a crash bug and an inflation bug. Both are triggered by almost the same scenario: a transaction contains an input multiple times.
In general, how this would work is as follows: lets suppose a miner has an unspent output A for 1 BTC. They create a transaction with that input in twice, so input 1 spends from output A and input 2 also spends from output A. The output of that transaction has a value of 2 BTC. Note how the output's value is larger than the value of output A, but if you had output A twice, the value is correct.
The miner would then take this transaction and include it in a block that he is mining. Once the miner find a block with his transaction included in it, he broadcasts it to the Bitcoin network.
When a Bitcoin Core 0.14.x node receives this block, it will validate the block, but it will skip the duplicate input check because of the false parameter on this line. So the transaction the miner made will pass this step of validation, and the other transaction validation steps, including input script validation, until it reaches this loop. In this loop, the inputs to the transaction are being marked as spent in the UTXO database. The first time the duplicated input is seen, it is marked as spent. But the second time it is seen, the coin is already marked as spent so coins->vout[nPos].IsNull() will be true. This means that it will go into this if statement and subsequently hit the assert statement that follows. The assert causes the software to crash.
For Bitcoin Core 0.15.0 - 0.16.2, the behavior is different. This is due to the change in how the UTXO database is structured. Everything is largely the same until the same loop is reached. Here, instead of returning whether the output was spent, SpendCoin actually returns whether the input exists in the database. So the first time, it will pass as expected, but the second time, instead of returning false, it still returns true.
Looking at SpendCoin, you can see that it only returns false when it is unable to fetch the coin (object representing a UTXO) from the database. With the new database structure, this makes sense as the output should be removed from the database when it is spent. But, if you look a few lines down, you see that it only deletes the coin when it is marked as FRESH. In the case the coin was FRESH, SpendCoin would delete the object on the first pass so the second pass the coin would not be found and thus it would return false. This triggers the assert following the function call causing the node to shutdown.
If the coin was not FRESH, the coin object itself is not deleted, but its contents are cleared. This means that the second time the input is seen, if the coin was not FRESH, SpendCoin would still return true as the object still exists in memory, which means that it passes the assert that follows the SpendCoin (which caused the crash when the coin was not FRESH). Then validation continues as normal, and the output this transaction created is added to the UTXO database, which means that money that shouldn't exist now exists in the UTXO database.
So now the question is, when are UTXOs marked as FRESH? They are marked FRESH when they are added to the UTXO database. But the UTXO database is still only in memory (as a cache). When it is saved to disk, the entries in memory are then no longer marked as FRESH. This saving to disk happens after every block (as well as at other times, but that is not important).
Thus, if a miner has an output that was part of a transaction that has already confirmed, and he spends the output twice in the same transaction (so the transaction has two inputs that refer to the same output), and this transaction is not broadcast to the network but instead included in a block that he mines, he is able to create a new output that has twice the value of the output that he spent, thereby creating coins.

Why can't this be done by a non-miner?

The reason that this cannot be done by a non-miner is because transactions that are received outside of blocks are still checked for duplicate inputs. The transaction will be rejected as invalid and not added to the node's mempool, so the transaction will never get into a block. It is only transactions with duplicate inputs that get into blocks that trigger this vulnerability, and thus only miners can do this as they must knowingly insert an invalid transaction into their block.

Also, which forks are/were vulnerable?

Any fork whose software includes commit eecffe50efc3944d713c701fa375dacbf17fb7cf. This would mean any software forked from or pulled in changes from Bitcoin Core after November 10th, 2016.


Why is trading behaviour so similar across all (mainstream) exchanges? I don't know much about stocks and investing, but lately I have been keeping a close eye on crypto exchanges and I noticed something I can't explain.
No matter what news is announced good or bad, or what ripple effect whales cause when they buy or sell, all exchanges behave nearly identically in real time. I would have expected at least some delays between exchange spot rates changes. Or perhaps geologically based differences, like Chinese people sleeping affecting exchanges based in China. Instead the trading graphs all move together.
What causes the exchanges to mirror each other so much?

You, as in the collective you that makes up the trading market.
Whenever the price differs enough between two exchanges, a trader who has an account (and funds) on both can profit by selling on the cheaper one, selling on the more expensive one, and then possibly transferring fiat/BTC to compensate. Of course, there are trading/withdrawal/transfer fees involved in all of these, but if the rates differ enough, it will at some point inevitably be worth it. This is called arbitrage.
Sophisticated traders likely keep funds specifically spread across exchanges to take advantage of this, and may have automated trading bots that trigger buy/sell orders whenever arbitrage opportunities arise.
The result of people exploiting arbitrage is that the price starts to balance out across exchanges.


clDevicesNum returned error, no GPUs usable I get this error with BFGMiner, when running "bfgminer -D -d?:"

 [2013-04-25 09:47:31] ft232r_scan: Found 093a:2510 - not a ft232r
 [2013-04-25 09:47:31] ft232r_scan: Found 1d6b:0002 - not a ft232r
 [2013-04-25 09:47:31] ft232r_scan: Found 1d6b:0002 - not a ft232r
 [2013-04-25 09:47:31] ft232r_scan: Found 8087:0020 - not a ft232r
 [2013-04-25 09:47:31] ft232r_scan: Found 8087:0020 - not a ft232r
 [2013-04-25 09:47:31] Started bfgminer 3.0.1
 [2013-04-25 09:47:31] Loaded configuration file /home/geremia/.bfgminer/bfgminer.conf
 [2013-04-25 09:47:31] CL Platform 0 vendor: Intel(R) Corporation
 [2013-04-25 09:47:31] CL Platform 0 name: Intel(R) OpenCL
 [2013-04-25 09:47:31] CL Platform 0 version: OpenCL 1.1 LINUX
 [2013-04-25 09:47:31] Error -1: Getting Device IDs (num)
 **[2013-04-25 09:47:31] clDevicesNum returned error, no GPUs usable**
 [2013-04-25 09:47:31] Not a ZTEX device 093a:2510
 [2013-04-25 09:47:31] Not a ZTEX device 1d6b:0002
 [2013-04-25 09:47:31] Not a ZTEX device 1d6b:0002
 [2013-04-25 09:47:31] Not a ZTEX device 8087:0020
 [2013-04-25 09:47:31] Not a ZTEX device 8087:0020
 [2013-04-25 09:47:31] Devices detected:
 [2013-04-25 09:47:31]   0. CPU 0  (driver: cpu)
 [2013-04-25 09:47:31]   1. CPU 1  (driver: cpu)
 [2013-04-25 09:47:31]   2. CPU 2  (driver: cpu)
 [2013-04-25 09:47:31]   3. CPU 3  (driver: cpu)
 4 devices listed

Here is my output of "lspci -nn | grep VGA":

00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [**8086:0046**] (rev 18)

Can I not mine with an Intel Integrated Graphics Controller? thanks

Bitcoin mining is principally an integer maths task, not a graphics task.  It just so happens that the hundreds of processors found on modern graphics cards can sometimes be suitable for parallel calculation of the bitcoin task, at upwards of a hundred times the best available rate from four cpu calculations.

See wiki reports on bitcoin hardware for comparison figures.

Unfortunately for you, Intel copied some parts of modern GPU designs into their system on a chip, but to save money they left out some transistors here and there which might not get used in direct X 11 graphics but would be necessary for parallel calculations for bitcoin.

So, you have on-chip graphics suitable for screen display and a few other specifically graphics tasks, but you do not have a general purpose massively parallel GPU for bitcoin calculations.

The error message "clDevicesNum returned error, no GPUs usable" appears on one of my systems which does have a suitable graphics card for bitcoin mining and does find openCL drivers for it when configured before compile.  I'm trying to find out what is incorrect in my configuration.


How does one mine a fraction of a bitcoin? I'm new to the whole bitcoin stuff.
The stuff I've read about mining so far told me that when a node in blockchain finally finds the correct nonce for a block that can be accepted in blockchain, it then advertises it to others and they verify and put the block to the blockchain (at least this is what i understood from the explainations). I have also read that prize for mining a block is 12.5 BTC. My question here is how do nodes mine a fraction of a bitcoin when mining?(shouldn't it be 12.5 BTC per mined block for each node? is it even possible?)

  Example: this

Answer to this question mentions 0.04 BTC,but how?

You either mine a full block...

-> Then you're free to take the full 12.5 BTC reward or less, at your choice.

Or..

-> You can mine with a pool. Everyone in that pool calculate hashes of trivial amounts, but their sum will be enough to mine blocks. Then, the pool will reward your work. (Search for PPS or PPLNS)


Possibility of fractions less than 1 satoshi in transaction fees I know that I can't send even 1 satoshi due to dust transaction prevention, but the question is - might the transaction fee be not e.g. 160 satoshis, but 160.1 satoshis?

No, it's not possible. Transaction fees are not explicitly included in transactions: they are computed from the difference between the sum of the amounts of the outputs and the sum of the amount of the inputs [1]. Since the smallest value that can be represented in an output amount is a satoshi [2], it's not possible to generate fees less than that.

[1] http://chimera.labs.oreilly.com/books/1234000001802/ch05.html#tx_fees

[2] http://chimera.labs.oreilly.com/books/1234000001802/ch02.html#cup_of_coffee


Schildbach Wallet complains: not enough mBTC for transation this app was shown to me by a friend.
now wanted to test it, so send some BTC into the wallet-app some time ago.
that worked. now got 46.94€ worth of mBTC
("An mBTC, or MilliBitcoin, is equivalent to 0.001BTC"
is this a fixed "forever" exchange rate (BTC)1:1000(mBTC)?
https://support.coins.co.th/hc/en-us/articles/202087736-What-s-the-difference-between-mBTC-and-BTC-
is technology wise mBTC and BTC working the same?)
and it complains "not enough funds" for transfer.
how in the world, should this be usable to buy a cappuccino worth 3.10€?

An mBTC, or MilliBitcoin, is equivalent to 0.001BTC" is this a fixed "forever" exchange rate (BTC)1:1000(mBTC)?

This is not an exchange rate, it is just a unit prefix. There are 1000 millibitcoin in a bitcoin, in the same way there are 1000 millimetres in a meter. Some wallets will allow the user to change the unit that their balance is displayed in (eg BTC, mBTC, sats, etc). Functionally, there is no difference between BTC and mBTC, it is just a display preference.

and it complains "not enough funds" for transfer.

The bitcoin network has been extremely busy for the last few days, so transaction fees are currently very high compared to the what we've seen for the last year. Your wallet may be attempting to construct a transaction which includes a very high fee (more than the wallet contains - which seems kinda crazy, but I've seen some very poorly designed fee management algorithms in some wallets before), but without additional information, its not really possible to fully diagnose the issue. It is probably worth contacting the developer of the wallet if the problem persists. You can also search for 'mempool visualizer' online to watch how busy the network is, and then make transactions during less busy times.
Keep in mind as well, some scam wallets will ask you to deposit coins in order to 'unlock a deposit', 'pay a transaction fee', or some other similar nonsense. I am not saying that the wallet you are using is indeed a scam, but I have not heard of it before, so I mention this just to make you aware of the possibility. The prudent bitcoin user stays alert for such scams.

Schildbach Wallet (...) this app was shown to me by a friend.

I̶ ̶h̶a̶v̶e̶ ̶n̶e̶v̶e̶r̶ ̶h̶e̶a̶r̶d̶ ̶o̶f̶ ̶t̶h̶e̶ ̶w̶a̶l̶l̶e̶t̶ ̶s̶o̶f̶t̶w̶a̶r̶e̶ ̶y̶o̶u̶ ̶a̶r̶e̶ ̶u̶s̶i̶n̶g̶ (EDIT: this wallet is indeed listed on bitcoin.org, as RedGrittyBrick pointed out in a comment below). To help ensure you are using software which is not malicious, I would suggest starting from this page: https://bitcoin.org/en/choose-your-wallet. There are a lot of malicious wallets out there that will steal/scam you.

how in the world, should this be usable to buy a cappuccino worth 3.10€?

When the network is busy and fees are high, it really isn't. During low fee times it is more reasonable, though it is worth mentioning that a ledger which computes and stores every person's coffee transaction information for all time (on tens of thousands of nodes) is a grossly inefficient way to expect a monetary network to work.
If I had to make a small value purchase using BTC, I would instead use the lightning network, which is quite well suited to the job. Doing so will generally require setting up a lightning node/wallet before transaction fees skyrocket though.


In 2009, where were Bitcoin source codes stored? Now I can see the Bitcoin Core source code in Github but I wonder where the original source code of Bitcoin were stored back in 2009? Was it managed under SVN? How did contributors or programmers work together back then?

Thanks,
Pil

2008
We don't know if Satoshi Nakamoto is an individual or a group, but Satoshi Nakamoto asked for professional crypto geeks to review his project in 2008.
The original source files were therefore distributed privately through email.

2009
Unsure if Satoshi Nakamoto used any kind of source control before the source codes were available to the public. You probably have to ask the developers that were involved.
First available on Sourceforge.
Initial commits on GitHub were converted from svn on Sourceforge.


What qualifies as proof of residency for AML in the USA? I am in a unique situation of not owning or renting property and no need for utilities.  I've tried to contact several exchanges to find out what are all the acceptable forms of proof of residency, but none of them respond.  I don't want to send money until I am sure I can meet the AML requirements, but I can't figure out if I can meet them.  And I don't want to deal with exchanges that are not AML compliant.

Is there a definitive list of documentation?

EDIT:  It's been almost two weeks with no response from 3 different exchanges.  Is there really no list of acceptable standards?  Is it save to send money and just find out if they accept what I can provide?

There is not. You will not find a definitive list of allowable documents, endorsed by a government, regulatory body, trade group etc. You may find lists of generally accepted documents, however there is no guarantee that their acceptance is either uniform or universal.

Documents typically considered acceptable for the purposes of establishing residency at a given dress i.e. rental agreements, mortgage documentation and utility bills (such as gas, electric, water) are generally utilized (and accepted) by the financial institution as they tie the individual directly to the address thereby satisfying elements of AML/CFT, specifically the Know Your Customer and Customer Identification Programs.

Your only option is to await a response from the specific institution (in this case exchange) and inquire as to what documents they will accept in lieu of the aforementioned, if you are unable to provide them.


What would be the effect on the number of leading zeros hash generation if bitcoin increase its nonce size from 32 to 60 or 100 bits? If Bitcoin increases its nonce size from 32 bits to double or triple the size, how will it affect the speed of getting the right hash with the required number of zeros?

Increasing the nonce size would not increase or decrease the expected block time.

The block time is maintained via the difficulty adjustment algorithm, which adjusts the network difficulty according to the apparent time it took for the last 2016 blocks to be found. How quickly blocks are found can thus be used to estimate how many hashes/second the network's miners are collectively performing. The limitation for how many hashes/second a miner can perform is hardware-based (ie. "I own an ASIC miner that can do some amount of hashes per second"), not nonce-based (ie. "I'm running out of possible input values").

This is because if the nonce-space is exhausted, then the timestamp can be incremented, and the nonce-space can be searched through again. A miner can alter the transaction content of the block, or even just the coinbase transaction, and then the nonce-space can be searched through again. So while the nonce-space for a specific block template may be exhausted more quickly with a smaller nonce size, we can effectively 'increase the nonce' infinitely, by adjusting other input variables and then incrementing through the nonce-space again.

Since mining utilizes the SHA256 hash function, the number of input bytes that you can arbitrarily alter (ie increment as a nonce) will not affect your ability to generate a desirable output (ie, a valid block hash). So as long as you can alter some parts of the input arbitrarily, so as to not run out of possible input values, it seems to me that the bottleneck to finding a valid hash will be hardware-based, not algorithmic-based.


Is it possible to use Bitcoins from an old or changed adress confirmed on the blockchain? I sent & Confirmed bitcoins from my Luno Wallet using the adress from a binary miner. Next day the Binary miner said they received the Bitcoins BUT are UNABLE to use them to facilitate payment due to me because of
1). Delay of network
2). the the adress was old & it changed so the bitcoins are no longer active/cannot be used.

You are likely being scammed.

An address remains valid and usable forever as long as its private key is accessible. If any service is generating and deleting private keys, it is run by completely incompetent people and should not be used.

The "Delay of network" argument is equally baseless - if they have received the coins, they are in sync with the network, and can spend those coins trivially.

Do not send these people any more money. Essentially all mining services short of buying and operating your own mining hardware are scams.


Are incoming connections required for mining? I am setting up a RPi3 Mining node for fun. I know that it will have less than 8 connections that are outgoing.

I know that if I was able to configure my network and router to allow incoming connections on port 8333 it would make my node work better.

My question is whether the incoming connections is required in order for the node to mine at all.

Will the outgoing connections that I make allow those peers to send my node transactions as those nodes get them, or is incoming connections the only way to get transactions that can then allow my node to mine blocks?

Incoming connections are not required for mining. You only need some connectivity with the rest of the network. It does not matter how that connectivity is established.

You would need to use the getblocktemplate based mining interface, with dedicated mining software, as Bitcoin Core no longer has any built-in miner support since v0.13.


How to get the block hash in the chainstate leveldb? From this link What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?,
to get the block hash I use the obfuscation key and xor it with the result I get from the db. So I look up the block hash I got on blockchain.com,
but the block hash doesn't exist. So I check if I'm xoring right by using the website http://xor.pw/#. My xored value matched the website.

Then I look back to the example on How does Bitcoin read from/write to LevelDB and xored their example
26c326d7353661dc7005d274976f458691f24f0f05d141335f4ad5927e41 and 27c78118b731610527c78118b731610527c78118b731610527c78118b731 on http://xor.pw/#
and I got 104a7cf820700d957c2536c205e2483b635ce17b2e02036788d548ac970 not 01028820010b2a00367244680f6da18acd861a08f0a89cb3b49ab50e.

Me and and the website can't get the same result and be wrong right? What am I missing?

import plyvel

def get_xor_key(o_key, result):
    xor_key = ''
    while len(xor_key) < len(result):
        if len(xor_key) + len(o_key) <= len(result): xor_key += o_key
        else: xor_key += o_key[:len(result)-len(xor_key)]
    return xor_key
def xor_two_str(s, t): return hex(int(s, 16) ^ int(t, 16))

db = plyvel.DB('/home/chris/.bitcoin/chainstate')
o_key = db.get(b'\x0e\x00obfuscate_key')
print('o_key', o_key.encode('hex')) # my o_key is 0899b9c2314a85c9b6

result = db.get(b'B')
result_hex = result.encode('hex')
print('result_hex', result_hex) # b6c9854a31c2b999b6da5ee266a8047f3c8c5fc82479ab03af9272a3a57372a2
xor_key = get_xor_key(o_key, result)
xored = xor_two_str(xor_key.encode('hex'), result_hex)
block_hash = xored[2:-1].decode('hex')[::-1].encode('hex')
print(block_hash) # 870b3cd33974701cfceb9c5bffa0b2b6b9c66e0a9de0a3b56617389267caebaa

This is a bit late, but I've been struggling with this myself so hopefully I can help out anyone who comes across this thread with a similar question:

Looks like the chainstate obfuscation key begins with an 08, which probably refers to the length of the key. If you remove the 08, you get an obfuscation key of (for the above example) 99b9c2314a85c9b6, which you'll note is the reverse endian-ness of the beginning of result_hex (as it should, since the beginning of block hashes are zeros).

So to get these pieces of data to match endian-ness, you can reverse the key above and you'll get b6c9854a31c2b999. Per this answer, to de-obfuscate data you need to append the obfuscation key to itself until it matches the length of the data, leaving us with:

result_hex = b6c9854a31c2b999b6da5ee266a8047f3c8c5fc82479ab03af9272a3a57372a2
xor_key    = b6c9854a31c2b999b6c9854a31c2b999b6c9854a31c2b999b6c9854a31c2b999

If you enter those two values on https://xor.pw/# (as the OP did) you get 13dba8576abde68a45da8215bb129a195bf7e994b1cb3b, which you'll notice is quite a bit shorter than the inputs. This is because that site omits leading zeros. Add the missing zeros in and you get 00000000000000000013dba8576abde68a45da8215bb129a195bf7e994b1cb3b, which is a block hash from around the time this question was asked.


Where can i buy zcash coins, named as ZEC? I tried to  buy from https://www.buy-zcash.com/ but the application does not seem to work: the buy button is never activated even if i fill in a valid zcash wallet address

Try trading on exchanges for ZEC. Some of the exchanges are bitmex, poloniex, kraken, etc. Most exchanges will allow you to buy zcash in exchange for bitcoins.


Loosing your bitcoins due to a glitch on your mycelium app, and how do you get the back without a backup? I went and purchased some bitcoins on my mycelium wallet. Once I went back to my car and opened the app to do a backup for it the app just stopped working and it wouldn't open back up. I couldn't do the back up to it, so I sent an email and asked if I uninstall and reinstall will I loose the coins that I just purchased? it took them an hour to respond to my email and by that time I had already uninstalled and reinstalled my wallet. The coins are gone but I looked up my transaction on Blockchain and they are there. How can I recover my coins when Mycelium had the glitch (that was fixed with an update) and there email was an hour late to respond to my question, how can I recover those coins?

If you do not have a backup of the wallet, either in the form of seed words or a exported file from Mycelium, then your coins are permanently lost.

Ideally, one should be backing up and restoring their wallet to make sure they've got all the necessary information before sending a significant amount of coins to it.


Bitcoin block index synchronization What is the work done by the bitcoin core client during the initialization process? Is the block index created locally or downloaded at other partner nodes?

The raw block data is downloaded, and nothing else.  All block and transaction indexes are created locally.  In the process, block hashes are checked and transactions are verified (to various degrees) as to whether they spend valid inputs, are properly signed, and so on.

Each block is checked and added to the index immediately after being downloaded.    The software doesn't wait to download all the blocks before starting to index them.

The files in blocks/index contain information to help locate blocks.  For instance, it would contain an entry for each block with its hash, other relevant header data, the number of the blk*.dat file where it is stored, and the position within that file.  If txindex is enabled, these files also contain one entry per transaction, pointing to the location of the block which contains the transaction, and the position of the transaction within that block.

The index of unspent transaction outputs is found in the chainstate directory.

The best resource to learn about these indexes is to read the Bitcoin Core source code.  There is an older writeup at https://en.bitcoin.it/wiki/Bitcoin_Core_0.11_(ch_2):_Data_Storage, but as of 0.15.0 at least the chainstate index has changed significantly (thanks  Pieter Wuille).  It is also explained at What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?.


How does "Sign Message" work? How does "Sign Message" option in the Bitcoin QT client work? I can't find any description or documentation of it.

Do I have to use this option to sign some message when I receive bitcoins? If so, how do I do that and what should I write?

This is how it looks (Sorry for danish client language):

You don't have to manually verify Bitcoins you receive - the according transaction is verified automatically by your Bitcoin client. If you see a green checkmark left to the transaction you received (in the Transactions view) then it means that the rest of the Bitcoin network has confirmed the payment as well and you can safely consider the coins yours.

The "Sign Message" feature is an advanced functionality of the Bitcoin client which allows you to sign arbitrary messages to prove to somebody that you are (were) in control of the funds of some Bitcoin address. For a usage example see this answer. You normally don't need this feature for day-to-day use of Bitcoin.


What is the protection against a malicious node with a bad block chain? How does a bitcoin node protects against connecting to a node with a forged block chain? How does it say: "Ok, I just got this block chain and it is a valid/legit one" ?

Any chain that's not valid according to the agreed rules of Bitcoin is outright rejected. So any chain that created Bitcoins out of nowhere, spent the same Bitcoins twice, or anything like that is rejected just by testing the chain against those rules.

So the next question is among the many possible valid chains, how do you pick the one to consider authoritative. And the answer is two-fold:

You consider valid the chain that would require the most computational work to create.
You don't rely on the results of blocks that are too close to the end of the chain.

So that means that an attacker who wants to convince you that the wrong chain is valid has to do more computational work than all the Bitcoin miners put together, and must continue to do so until the blocks he's trying to convince you to accept are deep in the chain.

So say you require six confirmations to accept a transaction. An attacker has to produce a chain with six blocks after the block including that transaction that's longer than the chain that doesn't include that transaction. To do so, he'd have to give up the opportunity to mine six blocks (around $35,000) and he'd have to outpace all the Bitcoin miners in the world put together for about an hour.


How does not practicing address reuse hurt my privacy? If I never conduct transactions from an IP address associated with my real life identity and never conduct a transaction with someone who knows me in real life how can using the same address all the time (for the sake of simplicity) hurt my privacy?

There's a bigger attack surface for someone that wants to doxx you. They only need to link a single transaction to your real life person to know all the transactions you've participated in. A single payment to newegg, for instance, will identify you across all transactions.

Very few transactions are completely anonymous. But yes, if they're all completely anonymous, then you won't be hurting your privacy. However, that's much more the exception than the rule and you're probably leaking much more information than you think you are.


Is there an approach to exchange Bitcoin with formal currency with keeping anonymity? Apparently, Bitcoin preserves anonymity of users such that nobody is able to know who is behind of an account address. But If this user intends to exchange a bitcoin with a formal currency, eventually they need to reveal their personal information, isn't it? Or is there a way to keep anonymity even at time of exchanging with formal currency?

You are possibly looking for a Bitcoin ATM or a private transaction with a cold wallet. There is no real anonymous way to exchange for fiat over the internet. Most exchanges have regulations from the government in place that require you to verify to fight money laundering. Also it would force you to verify a bank account that needs a name.


Javascript Bitcoin miner is it even worth it? I know that mining bitcoins via JavaScript is just pointless at this point in time, but is there any other altcoin that is worthwhile mining via a GPU/CPU via a JavaScript embedded into a web page?

Our website gets over 2 million unique visitors per day, with an average time of 5 minutes on site.

Is there anything we could do to get them to mine something in order to get even $0.005 per visitor? or is it basically impossible?

It is true that mining Bitcoins like this is impossible. (I can't speak for altcoins though.)
Let us run through a back-of-envelope calculation based on some facts and assumptions.

Network hash rate is 800 000 terahashes per second as of 2016-01-18 [source].
Remember that currently 25 BTC are rewarded every 10 minutes.
A modern consumer-grade CPU has 4 cores, and can calculate about 400 MB/s of SHA-256 per core in C. (More generous than JavaScript, but ignoring the upcoming Intel SHA Extensions instructions.)
One Bitcoin hash trial uses 2 blocks of the SHA-256 compression function (each block is 64 bytes), so this translates to 8 million hashes per second per core, and 30 million hashes per second per CPU.
One visitor donating 5 minutes of full-CPU time gives 9 gigahashes.
Multiplied by 2 million visitors per day gives 18 petahashes per day.
Meanwhile the rest of the Bitcoin network has produced 70 000 000 petahashes in a day and mined 3600 BTC.
The current price is 1 BTC = $400 USD. Your 18 PH out of 70 000 000 PH is 0.000026%, so this yields 0.0009 BTC reward, equaling $0.37 USD per day in total. But divided among everyone, this equals $0.0000002 per visitor.

With 2 million visitors a day though, why not optimize the ad revenue, user retention, conversion funnels, and other traditional online business techniques?


What is the safest physical to store a private key only to be accessed after death? Assume that my friend would like to encrypt his Bitcoin private key(s) and safely store them in a secret location. This located would only be identified to heirs after death in his will. Should he put the key:

In a safety deposit box
Buried in a weatherrpoof container somewhere on my property?
In the possession of my attorney?
Somewhere else

Please answer the same question above for my encryption key which I would of course store separately.

As an alternative would a mult-sig solution be helpful? If so how would you design it?

If you are comfortable with a command line, I have used ssss-split and ssss-combine for sharding encryption keys in a n-of-m scheme.  These utilities use Shamir's Secret Sharing Scheme to safely break up secrets for later reassembly.

For example, you could create a 4-of-7 scheme, where you would hide shards in 7 different locations (personal safe, safety deposit box, trusted lawyer, etc...).  Any 4 shards could be used to re-create the original secret.  It has the property where only having 3 shards gives an attacker no more chance of cracking the secret than if they had 0 shards.

One benefit to this scheme is that up to 3 shards could be lost, and the original secret could still be recovered.  The other benefit is that up to 3 shards could be stolen, and the attacker still doesn't have enough to obtain the secret.

One important thing to note, however, is that you still need to make sure that the collection of private keys is not lost, even if it is encrypted.  BIP32 wallets are a great place to start (so you only need to shard a single key), but otherwise make sure that you have redundant copies of your encrypted wallet file.  The decryption key won't be any use if you lose the data that it decrypts.  Again, avoid that trouble by using a BIP32 wallet.


How to solve Blockchain 20 address gap-limit problem? We currently offer Bitcoin withdrawals and deposits on our website. Blockchain API is used to handle all operations.

Only problem is Blockchain Receive API's 20 address gap limit, as mentioned here: http://bitcoinx.io/news/articles/blockchain-info-updates-receive-payments-api-version-to-address-edge-cases/

Now we get a lot of curious users who click on Bitcoin deposit button and commit to it without actually sending any transaction, which easily build up to 20 addresses. What are some ways of removing this limitation? I have few ideas but they are rather bulky and some require complete re-write of code and replacement of Blockchain API. Can you guys offer any insight and/or advice? How can this problem be solved in elegant and efficient way?

Yes the gap is an issue with the HD wallet.  Blockchain made a blog post about working with this issue. See here: https://blog.blockchain.com/2016/06/15/receive-payments-api-update-address-gap-limits/#more-9024

Let’s say you get paid to the first address, address 1 — the wallet will look ahead 2-21 addresses to see if there are any additional funds or transaction history in those addresses. If it doesn’t find anything, it will stop looking. So, if you get paid to address 22, the wallet software will not see the funds because it stopped at 21. However, if you get paid to address 2, the wallet software will look ahead addresses 3-22, see the funds that were sent to the address 22, and then look an additional 20 ahead (addresses 23 – 43).

Starting from August 1st, 2016, we will respond to API requests that would push you past the 20-address gap limit with an HTTP error, and we will not generate any new addresses for your xpub until we detect a payment that would close the gap below that limit. This ensures that you will never have unreachable funds through the use of Receive Payments API V2, but might lead to not generating addresses when your users request them.

You can call the checkgap API via the following endpoint:

https://api.blockchain.info/v2/receive/checkgap?xpub={xpub}&key={apikey}

You’ll get a JSON response that looks like:

{ "gap": 1 }

This gap value represents the difference between the index of the most recent address paid to, and the most recently-requested address. If that value is 20 or greater, funds paid to any further addresses created will be hard to access until earlier addresses receive funds.


Bitcoin wallet balance doesn't add up to what my addresses have I have had a bitcoin core wallet on windows for a long time. For most of this time I have been inactive. My client has gone out of sync and  my wallet sat on my computer as well as a backup on a usb stick. Recently I decided to get back into crypto, so I re-synced my client to the blockchain. Dropped my old wallet back into the client. It went through the rescan process, and to my surprise I had more bitcoin than my addressees say they have on blockchain.info.

I even decided to dump all my private keys from my core wallet, and import them into an electrum wallet to see what it would yeild. And upon doing so, my electrum wallet has less bitcoin than my core wallet.

How is this possible, considering both wallets are built off the same private keys?

I struggled with this too. There are many other addresses created when you send/receive funds from bitcoin.

Don't just run dumpprivkey with your receiving BTC addresses; run dumpwallet to a file instead and import all keys (left-hand side of the dump file) prior to 1 Aug 2014 to Electrum.cash wallet.


Double Spending - Does each node maintain a list of unspent transaction references? My Understanding Of How Bitcoin Prevents Double Spending

Each transaction contains references to the input transactions and ever node has to verify all transactions from time immemorial to ensure that the inputs are in fact unspent. Once this is confirmed, and subject to other conditions, the transaction can be added to the block chain.

I can not fathom the practicality of  what this means, lets say there have already been 50 million transactions on bit coin, for the transaction after the 50 millionth, each input transaction reference will have been looked against 50 million rows to see if it appears anywhere as an input transactions (it shouldn't) and it was in fact an output transaction then benefiting the now spender. This is done for all transactions being broadcast in an interval of time before miners can start working for that good looking cipher.

However to make this simple, each nodes maintains a list of unspent transaction references of all nodes (say U list), when is used as a starting point and updated every time a transaction is added and these updates are committed across the network  after a transaction block is confirmed giving the starting point of the next block.

My Questions

Sounds too much hard work for this to be practical.

Does it mean that every miner will have a database of those 50 million records? Isn't that a massive and expensive requirement?
Every miner will compare each input transaction references  to each of those 50 million before including the new transaction in a  block to ensure that it has not been spent already and was in fact valid?
Quoting myself,

  however to make this simple, each nodes maintains a list of unspent transaction references of all nodes (say U list), when is used as a starting point and updated every time a transaction is added and these updates are committed across the network  after a transaction block is confirmed giving the starting point of the next block

Doesn't this go against the principle of not having a book showing each node's balance? In case a node has only 2, 3, 5, or 5000 unspent input transaction references. This more or less boils down to a book of balances  that needs to be referred to for each transaction before block inclusion and the new block is committed over it on confirmation (i.e. when a proof of work is found). Does it not?
Given the above post, how close am I to understanding controls over double spending? I am a CPA trying to get my head around this.

Preliminary Doubt

Only miners need bother about assembling transactions in blocks. Shoppers and Payers may execute transactions and simply await block confirmation. All transactions shall be broadcast to them and they need not bother recording those unless they are involved or a block confirmation is broadcast.

Each full node must maintain a list of all unspent outputs. Currently there are 15 million unspent outputs with a total size of 525 MB. To check whether a new transaction is a double-spend, Bitcoin sees whether the outputs being spent are in this unspent transaction output (UTXO) database. If they are, the new transaction is not a double-spend, and if the transaction meets the other validity requirements, the spent outputs will be removed from the UTXO database.

Searching for a transaction in the UTXO database is extremely fast because the outputs are ordered by transaction hash, so searching can be done using binary search. That means that even though there are more than 15 million UTXOs, finding a particular UTXO given its transaction hash requires looking at only ~24 database locations in the worst case, which a computer can do very quickly.

This is complicated somewhat by the fact that transactions can rarely become invalid after initially being valid (after a reorganization), so full nodes must be able to roll back at least the last few weeks of changes to the UTXO database. Bitcoin Core implements this by keeping a log of each change to the UTXO database and reversing each change in the log in reverse order when a rollback is necessary.

Every full node does have enough information to compute the current balance of any address, though Bitcoin never actually deals in balances directly.


multiple parties to sign a transaction before being broadcast (or after, but either way be associated with) Lets say someone was writing a transaction solely to denote the existence of something, or a timestamp, or writing something in OP_RETURN

Could that transaction be signed by other addresses, kind of as a "I agree with this statement" way, or a way that future analysis of that transaction showed that particular parties agreed with the transaction

(I'm imagining something that does not require the sender to have a multisignature address created with other parties. Or some way of having multiple outputs from different parties going to one input)

For example, Tom requested the location of Atlantis, many parties are watching these requests on the blockchain and can collaborate on the answer. Eventually Tom received a transaction containing the location in the OP_RETURN and it came from NOAA. Tom doesn't trust NOAA's use of GPS and much prefers GLONASS, so this transaction was also 'signed' or endorsed in some way by the Hydrometeorological Center of Russia. "Wow both agencies agree on this, I'm convinced now"

You could do something along those lines:

Create a transaction to a multisig address with private keys that the different parties control.
The parties sign a transaction having for input that multisig (which shows they agreed and signed) and for output the OP_RETURN.


Is https://www.bitaddress.org/ safe to create a paperwallet? I want to create a paper wallet for cold storage and am not sure of the best way to do that. I heard of https://www.bitaddress.org/, but is it safe if booted from an offline PC?

Thank you!

Yes it is, because the 100% of entropy (randomness) is generated by the user.

Just make sure you're downloading it from https://github.com/pointbiz/bitaddress.org > green "clone and download" button > download as zip.


How do I specify in which directory Bitcoin blocks and other data should be stored? I am on Windows and installed the Bitcoin wallet. The block folder seems to grow bigger everyday and is stored on my C drive in the roaming directory. I would like to set this to some other folder on another drive, which has more place. How would I go about doing this?

I believe you can specify this directory using the datadir configuration in bitcoin.conf.

-datadir=<dir>         Specify data directory

See Running Bitcoin.


How to monitor Bitcoin address for new transactions? I have some generated Bitcoin addresses which I want to monitor for newly received transactions, I have a full node but I don't want to import those addresses to the node's wallet. I don't want to use any external service API like block.io or blockchain.com, I am working on my own code.

I want to keep this list of addresses in an external DB (MySql or Mongo) and I want to keep track of them until they receive let's say n confirmations.

I know I can user -blocknotify to receive information of newly mined blocks and with this new block I can scrape the transactions and look for the addresses I monitor. But how can I guarantee I will have all the UTXOs?

If the address is newly generated with the last block I can create my local DB with addresses information. But what should I do if I import (on my database, not Bitcoin Core wallet) an old address which had already been used, how can I check for UTXOs?

Also, how can I check if any of these monitored addresses have unconfirmed transactions?

It's possible to do this externally, but it's tricky to get right and a cause of loss of funds if you do.

You need to correctly identify transactions you can spend. This is relatively trivial with P2PKH addresses, but a little more involved if using more exotic script types. You need to understand rules like transaction maturity before considering a UTXO to be spendable.
You need to correctly handle reorganizations if a transaction changes its confirmation state or is invalidated by a change in its confirmation state and an alternative is included.
You need to manually walk every single block to find old transactions, or use the UTXO scanning feature to find ones which may be unspent. This is very time consuming and requires full retention of all blocks since genesis (or at the very least, the birthdate of the wallet). Repeating this if you want to monitor a new address with potentially old entries.
You need confidence that your code is correctly accounting, which is only something you can ensure.

It's easier to use the built in wallet which handles all of this correctly, really.


litecoin minerd errors i have run through this tutorial but when i run:

c:\ltcminer\minerd.exe -a scrypt -r 1 -t 4 -s 6 -o http://127.0.0.1:9332 -O pete345234.2:1

i get errors:

json_rpc_call failed, retry after 30 seconds

do i need to use the litecoinpool.org url instead of 127.0.0.1? also does the password matter for minerd.exe

i'm a bit stuck...

edit 1

i changed the command to this:

c:\ltcminer\minerd.exe -a scrypt -r 1 -t 4 -s 6 -o us2.litecoinpool.org:9332 -O pete345234.2:1

but still the response is the same error message.

Yes, use your pool adress instead of yours.
Password usually doesn't matter, however you can set it on pool website.

This tutorial shows creating your own pool, but since this question also shows that you are a begginer, start by mining by someone else.


Blockchain to store private data and ownership As far as I know Bitcoin Blockchain can be accessed via API to enter data.
In this case I want to generate a hash/ Checksum MD5, that cannot be understood by anyone that doesn't have the private key, and store it blockchain.

Give to the client the ID of the blockchain's record where hash is stored and the private key of the hash, would be ok, to ensure the ownership, immutability, and also the privacy of the stored data (a hashed .pdf file mostly)?

Thanks!

I think these links should be more useful for you than direct answer

http://www.cryptograffiti.info/
https://app.originstamp.org/home
https://bitcointalk.org/index.php?topic=1023190.0
https://github.com/petertodd/python-bitcoinlib/blob/master/examples/publish-text.py
http://www.righto.com/2014/02/ascii-bernanke-wikileaks-photographs.html


Does slippage occur on MtGox when 'Market Order' is unchecked? If you were to uncheck the 'Market Order' box and buy 10 at 110USD, the order can be partially filled by 1 at 110USD and there are 9 more for sale at 113USD, the matching system would partially fill your order and then wait, right?

Does "slippage" only occur because of market orders?

No, slippage also occurs because the price can move adversely between your decision to sell and your order's execution on the market. Typically in financial markets the other participants can see a large order and move their limit orders accordingly.

What you're talking about is called "sweeping". This is simply the fact that there are not enough orders at the best price to match a sufficiently large order. If you have a market order you will then end up filling the next price, which will be worse.


How to generate addresses in PHP I need some PHP code to generate bitcoin addresses from a given public key.

I can only find algorithms to generate addresses from the master private key but according to https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
the private key is not required at all.

Use BitWasp Bitcoin-php library
https://github.com/Bit-Wasp/bitcoin-php

<?php
use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Key\PrivateKeyFactory;

$network = Bitcoin::getNetwork();
$privateKey = PrivateKeyFactory::create(true);
$publicKey = $privateKey->getPublicKey();
$address = $publicKey->getAddress(); // returns AddressInterface
echo $address->getAddress($network); // prints address for $network as string

If you want to create Bitcoin address from Public key string check documentation for Factory classes

or newer versions:

<?php
use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Address\AddressCreator;
use BitWasp\Bitcoin\Key\PrivateKeyFactory;
use BitWasp\Bitcoin\Key\KeyToScript\Factory\P2pkhScriptDataFactory;

$network = Bitcoin::getNetwork();
$privateKey = PrivateKeyFactory::create(true);
$publicKey = $privateKey->getPublicKey();

$addrCreator = new AddressCreator();
$factory = new P2pkhScriptDataFactory();
$scriptPubKey = $factory->convertKey($publicKey)->getScriptPubKey();
$address = $addrCreator->fromOutputScript($scriptPubKey); // returns AddressInterface
echo $address->getAddress($network); // prints address for $network as string


Can coloured coins be given to miners? Does the coloured coins spec (or an informal convention amongst its implementers) track coloured coins left to the miner of a transaction's block in the standard manner?

Obviously the miner would have to be running a coloured-coin-friendly mining implementation, but I was wondering if anyone knows whether there is intended to be a way for a coloured-coin-recognising miner to do this.

The coloured coin spec document at

https://github.com/killerstorm/colored-coin-tools/blob/master/colors.md

Makes no mention of mining except to say that

  Fee[s] should be paid using uncolored coins. If it is absolutely necessary to pay [a] fee with colored coins, that color should go...last.

Is it intended that in this scenario the miner can "collect" the coins while retaining their colour?

Although it's not covered by the specification, it seems logical to match all transaction fees (in the order in which the transactions appear in the block) against the block reward the same way other transactions are matched. The leaves only whether the block reward comes before or after the transaction fees. I think it makes the most sense to put the block reward after the transaction fees, since the block reward will always consist of uncolored coins (unless someone "pre-colors" them, which seems strange), and the convention is that uncolored coins go last.


Can I do transactions while Bitcoin Core is being synchronized? How long does this process take? It is telling me 46 weeks left but its doing this for months. How do I speed of the synchronization?

I downloaded it from their website. It is the latest version of Bitcoin Core. Windows 10, 4.00GB 64 Bit

I assume, you are using bitcoin QT client, then the general answer to move coins without bitcoin core being sync'd is yes :-) Simply use another wallet software. You could export your keys from the current bitcoin core system, and import it into another wallet software. I am doing this often, and I have written my own unix shell scripts to then create a transaction manually. However I recognize, that you are a new member here, and I assume, you do not have the experience yet to do so. So it is quite difficult to explain the process, without having a sound understanding, what you do.

Why it is so slow in sync'ing the blockchain? There can be many reasons:
I explained it here: https://bitcointalk.org/index.php?topic=4500995.msg40584294#msg40584294
There is no easy way to speed up things, but if you have a decent QUAD CORE CPU and 4 gig memory, with an SSD, you're good to go a few days.

For the sake of quickly getting things done, playing with low volumes (low values of funds), I guess the best option for you would be to export the PRIVATE keys from bitcoin wallet (there is plenty of messages in the forum her, just search for it, keywords QT wallet and dumpprivkeys), and then import into some SPV wallet, or some online wallet. However, there are different representations of keys to import and export (keys can be hexadecimal, or WIF or even WIF-compressed). So there is a learning curve involved! You would need to find a matching pair. Perhaps the question should be rephrased a bit, and someone in the community can help out on compatible export/import wallets...


`bitcoind` must be different from `bitcoin -server` because one gives an error message the other doesnt Although the API reference implies that running bitcoin -server is the same as running bitcoind, I get no error message when running bitcoin -server with no bitcoin.conf file but I get teh following error message when invoking bitcoind -

  C:\Program Files (x86)\Bitcoin\daemon>bitcoind.exe Warning: To use
  bitcoind, you must set rpcpassword= in the configuration
  file: C:\Users\thequietcenter\AppData\Roaming\Bitcoin\bitcoin.conf If
  the file does not exist, create it with owner-readable-only file
  permissions.

  C:\Program Files (x86)\Bitcoin\daemon>

They're not exactly the same -- they're two different programs. The bitcoind program is a pure server (or pure RPC client), it contains no GUI at all. The bitcoin program contains a GUI and can also run in server mode. So being unable to operate as a server is fatal to the server-only version, because there's nothing else it can do.

When you ask the GUI client to run in server mode, it interprets this as an additional request. If it is not configured properly to run in server mode, it will still start up and run the GUI. So for bitcoind, an improperly configured server mode is fatal -- what else could it do? For bitcoin, an improperly configured server mode just makes server mode not work; it will still run as a GUI client.


Will mining be viable after the halving? So I don't understand the halving very well, will miners just make half as much? Will the price double or the difficulty change? Will bitcoin mining just become so hard it ceases to be cost effective? Am I making a mistake getting into bitcoin mining? Will people just switch to a altcoin?

The block subsidy, i.e. the amount of newly created bitcoins per block, will half. Transaction fees are not affected by the halving. The exchange price of Bitcoin is up to market mechanisms. The halving doesn't change the difficulty. So, yes, probably the value of the mining reward will drop significantly between block 419,999 and 420,000.
Mining already is infeasible at home.
Yes, you're making a mistake getting into Bitcoin mining.
Personally, I doubt that any altcoin will be successful.


First time buyer, questions before I screw up I am wanting to buy BTC to buy goods but things are a bit confusing to me.

First off, would I be better off buying from someone or a website, or use an atm? Once I purchase the BTC what is the best place to store it? I don't want to link bank accounts and all that which is why I think using an atm would be best.

If I do use the atm here locally do they just give me a QR code and if so what's the best mobile app to use to get my coins where I can spend them? I've read the FAQs around I'm just still a bit confused.

All help is greatly appreciated

Yes, if you don't want the hassle of registering or giving your details to a website an ATM would be the better choice. Note that ATMs usually charge more than an online exchange.

They give you a bitcoin address and its QR code as well as a private key and its QR code.

The private key is all you need to have control and access of your coins on that address. The private key can be used to calculate the public key and the latter can be used to calculate the bitcoin address (which as I mentioned is given already for convenience).

Two very good mobile wallet apps are Mycelium and Airbitz. You can use the wallet app to scan the private key QR code and have complete access to that address (ie. send coins elsewhere). If you scan the address QR code you can check the balance of that address but not spend any coins from it.


Estimated h/s with a specific processor I was just wondering how well this processor would do at bitcoin mining on cpuminer.


With Ripple, how do Gateway IOUs work? A Gateway must do two things

  accept some form of deposit from a user and give the user Gateway
  IOUs. (Other -> ripple)
  accept Gateway IOUs from a user and send that
  user payment. (ripple -> Other)

How does Gateway IOUs work? I have three basic questions:

Which one happens first in a gateway, (a) users pay money to gateway, or (b) gateways transfer IOUs to user? What guarantees that step 2 happens?
What will happen when a gateway refuses to accept IOUs, and transfer money back to user?
Is there anything similar to 'interest rate' for holding IOUs for long time?

which one happens first in a gateway, (a) users pay money to gateway, or (b) gateways transfer IOUs to user? what guaranties step 2 happens?

The gateway gets to set its own policies. However, the general consensus is that gateways should avoid risk because they'd have to pass losses onto their customers in the form of higher fees. So you probably shouldn't trust a gateway that extends IOUs to people whose money it doesn't hold.

If the gateway breaches its contract with you, you should complain publicly, sue them, or take whatever action you consider appropriate. Gateways are only worth their reputations.

  what will happen when a gateway refuses to accept IOUs, and transfer money back to user?

The user can just exchange the IOU for another IOU at a gateway that will do business with them. A gateway can't can't really refuse to redeem IOUs for one user specifically because the IOUs are tradeable and fungible. Once at least one outbound Bitcoin gateway is running, you could exchange the IOU for Bitcoins.

If a gateway begins reneging on its redemption agreements generally, then the value of those IOUs will fall and people will stop accepting them. This is the counter-party risk you take when you extend trust in the Ripple system. Using Ripple as a store of value for fiat currencies requires reliable gateways. There's no getting around this.

  is there anything similar to 'interest rate' exists for holding IOUs for long time?

No. Once interest rates increase from their current near-zero level, this could be a major profit center for gateways. Of course, if being a gateway is very profitable, lots of companies will do it and then competition will either drive down rates or drive up services. (Remember when banks gave away toasters?) Nothing stops a gateway from giving rewards to people who hold their IOUs.


I'm trying to confirm my BCH is being held on my trezor When I go to https://trezor.io/claim-bch/ I'm being told my trezor needs a firmware update. However, I have updated my firmware on wallet.trezor.io. Is there an issue with claiming BCH? If not, why am I being told I need new firmware? My firmware version is 1.5.0.

TREZOR says that Bcash (Bitcoin Cash) will only be available in TREZOR Beta Wallet for now. They chose this strategy, as they don't want to force a firmware update on users that are not interested in Bcash. Mode details on Claim your Bcash (BCH) in TREZOR Wallet


Is there an API with which I could obtain the exchange rate of bitcoin to dollar some time in the past by giving the desired time as parameter? I would also like the the result to be precise to hour (or minute).

It is for a java program.

I have looked around, but the service I have found could not satisfy my need:
http://www.coindesk.com/api/: only precise to date

https://api.coinbase.com/v1/prices/historical?page=1 (from https://community.coinbase.com/t/past-bitcoin-exchange-rates/1725): need to adjust page number to find the desired time (at which one wants the value of exchange rate)

http://api.bitcoincharts.com/v1/csv/: I am not exactly sure what it does, but it seems that one needs to download different files from this site containing "USD" in the file names, check in all the files before finding the desired time

You can use winkdex.com api, it accepts a unix timestamp as a parameter.
http://docs.winkdex.com/#price


Does every miner verify blocks that are already in the Blockchain Once a miner adds a block to the chain, does every other miner have to check that block to make sure that its transactions don't violate any rules? For instance, if a miner added a block with an invalid transaction, is every other miner expected to check that block (and perhaps compare each transaction in it with every other transaction in every other block, to prevent, say, double spending)?

I'd advise you to use the search function a bit more, as you are asking a lot of questions which have already been answered.

When it is broadcast, other full nodes will ignore it as spam, and typically disconnect from the node that sent it. A bad block is unlikely to propagate very far on the network.
When other miners see it, they will also ignore it. If they mine on top of it, they will be wasting their hashing power. This also means that the miner who did the proof of work on the invalid block has wasted their own hashing power. This is why it's important that miners validate the transactions they include in blocks.

What happens if a miner publishes a block which contains an invalid transaction?


What wallet should I use to collect the mining payout from multiple machines? I am trying to set up my Debian Server so that I can join a mining pool.

I already know that I am going to use cgminer for the mining software because it will work with the server format (command line).

What I am not sure about is what type of wallet I should use and how I would link multiple machines to one wallet (I want to use my home computer as well).

Regardless of what wallet you use, it's entirely unrelated to your mining except as a payout. The address you withdraw to can be in a wallet anywhere (even offline).

P.S. You should really consider upgrading to BFGMiner instead.


Why do we need public key as part of Witness in P2WPKH transactions? As we want to minimize the data payload in a blockchain, which also led to concepts like SegWit, and is matter of discussion in Signature aggregation etc, I wonder why do we actually need to supply public key in order to spend? It's needless 33B of data. ScriptPubKey could look like this <HASH160> OP_CHECKSIG2 and ScriptSig <Signature>. I know this requires Softfork, but as we introduced SegWit, why wasn't this the design? Is it because mapping signature -> public key is not unambiguous?

Edit:
As in the comments suggested: the issue with public key recovery from EC signature is simply trade-off between fast verifiability and space requirements. The public key recovery from signature (r,s) involves conversion of scalar r = xr into a curve point R = (xr, yr), i. e. modular square root. This raises another question:

What's the idea of segwit transaction verification? Do we have multiple levels of consensus rules validation? E.g. basic validation evaluates all transaction scripts according to pre-segwit rules (which is just push of 2 stack items, which is always True), and deep validation that triggers the witness validation logic. I'm not sure whether I should look at segwit as "We moved the data away from transaction that represent just some ownership proof which is relevant at the time of confirmation but not years thereafter" or maybe rather like "Witness data is inherent part of transaction, just as it has always been, and was actually meant as tx-malleability fix and Script language generalization allowing future protocol extension."?

This was discussed today on the #bitcoin-wizards IRC channel.  The reasons offered by Andrew Poelstra (andytoshi) were:

"Segwit had enough scope already."  That is, it was already a large change that some people considered controversial, so minimizing further changes was considered desirable.
"Pubkey recovery is incompatible with batch validation."  Poelstra goes on to explain that Bitcoin doesn't currently have batch validation for ECDSA and the reasons why, but it doesn't sound to me like batch validation would be impossible to add at a later point (though perhaps it would require a soft fork); presumably devs would prefer to work on batch validation and signature aggregation using Schnorr signatures instead.

Later, Gregory Maxwell (gmaxwell) added that "Certicom has a patent on key recovery that could potentially apply" to a possible construction, which could've made using that construction controversial.

FYI: your second question asked in edits should probably be asked separately as it's a completely different issue.


How to get balance from a specific address in bitcoinj? I'm trying to get the balance of a specific address in a wallet by using bitcoinj, but I don't know how. Can someone help me? Thanks in advance!!

I found the solution for this question. I used this class:

/**
 * This class implements a {@link org.bitcoinj.wallet.CoinSelector} which attempts to select all outputs
 * from a designated address. Outputs are selected in order of highest priority.  Note that this means we may
 * end up "spending" more priority than would be required to get the transaction we are creating confirmed.
 */

public class AddressBalance implements CoinSelector {

    private Address addressToQuery;

    public AddressBalance(Address addressToQuery) {
        this.addressToQuery = addressToQuery;
    }

    @Override
    public CoinSelection select(Coin biTarget, List<TransactionOutput> candidates) {
        long target = biTarget.longValue();
        HashSet<TransactionOutput> selected = new HashSet<TransactionOutput>();
        // Sort the inputs by age*value so we get the highest "coindays" spent.
        // TODO: Consider changing the wallets internal format to track just outputs and keep them ordered.
        ArrayList<TransactionOutput> sortedOutputs = new ArrayList<TransactionOutput>(candidates);
        // When calculating the wallet balance, we may be asked to select all possible coins, if so, avoid sorting
        // them in order to improve performance.
        if (!biTarget.equals(NetworkParameters.MAX_MONEY)) {
            sortOutputs(sortedOutputs);
        }
        // Now iterate over the sorted outputs until we have got as close to the target as possible or a little
        // bit over (excessive value will be change).
        long totalOutputValue = 0;
        for (TransactionOutput output : sortedOutputs) {
            if (totalOutputValue >= target) break;
            // Only pick chain-included transactions, or transactions that are ours and pending.
            if (!shouldSelect(output)) continue;
            selected.add(output);
            totalOutputValue += output.getValue().longValue();
         }
        // Total may be lower than target here, if the given candidates were insufficient to create to requested
        // transaction.
        return new CoinSelection(Coin.valueOf(totalOutputValue), selected);
    }

    static void sortOutputs(ArrayList<TransactionOutput> outputs) {
        Collections.sort(outputs, new Comparator<TransactionOutput>() {
            public int compare(TransactionOutput a, TransactionOutput b) {
                int depth1 = 0;
                int depth2 = 0;
                TransactionConfidence conf1 = a.getParentTransaction().getConfidence();
                TransactionConfidence conf2 = b.getParentTransaction().getConfidence();
                if (conf1.getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING)
                    depth1 = conf1.getDepthInBlocks();
                if (conf2.getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING)
                    depth2 = conf2.getDepthInBlocks();
                Coin aValue = a.getValue();
                Coin bValue = b.getValue();
                BigInteger aCoinDepth = BigInteger.valueOf(aValue.value).multiply(BigInteger.valueOf(depth1));
                BigInteger bCoinDepth = BigInteger.valueOf(bValue.value).multiply(BigInteger.valueOf(depth2));
                int c1 = bCoinDepth.compareTo(aCoinDepth);
                if (c1 != 0) return c1;
                // The "coin*days" destroyed are equal, sort by value alone to get the lowest transaction size.
                int c2 = bValue.compareTo(aValue);
                if (c2 != 0) return c2;
                // They are entirely equivalent (possibly pending) so sort by hash to ensure a total ordering.
                BigInteger aHash = a.getParentTransaction().getHash().toBigInteger();
                BigInteger bHash = b.getParentTransaction().getHash().toBigInteger();
                return aHash.compareTo(bHash);
            }
        });
    }

    /** Sub-classes can override this to just customize whether transactions are usable, but keep age sorting. */
    protected boolean shouldSelect(TransactionOutput output) {
        Address outputToAddress = output.getScriptPubKey().getToAddress(addressToQuery.getParameters());
        try {
            // Check if output address matches addressToQuery and check if it can be spent.
            if(outputToAddress.equals(addressToQuery)) {
                if(output.isAvailableForSpending()) {
                    return isSelectable(output.getParentTransaction());
                }
            }
         } catch (Exception e) {
            e.printStackTrace();
         }

         return false;
    }

    public static boolean isSelectable(Transaction tx) {
        // Only pick chain-included transactions, or transactions that are ours and pending.
        TransactionConfidence confidence = tx.getConfidence();
        TransactionConfidence.ConfidenceType type = confidence.getConfidenceType();
        return type.equals(TransactionConfidence.ConfidenceType.BUILDING) || type.equals(TransactionConfidence.ConfidenceType.PENDING) && confidence.getSource().equals(TransactionConfidence.Source.SELF) && confidence.numBroadcastPeers() > 1;
    }
}

EDIT: Use Wallet.getBalance(CoinSelector). Example:

Coin addressBalance = wallet.getBalance(new AddressBalance(myBtcAddress));


How to report the tax if I trade BTC to LTC? Assume I traded 100 times between BTC and LTC and I earned $100 IF I sell all coins at market price.

However, I don't want to sell my coins yet. How I can report to the US tax?

The IRS treats digital currencies as capital assets and are therefore subject to capital gains taxes. Any disposition of these digital currencies, including trading and spending, is a tax event and capital gains must be calculated in USD.

References:
https://en.bitcoin.it/wiki/Tax_compliance


How can I process bitcoin payments from a hidden service on Tor? I had a very simple question for which I seem unable to find an answer. I want to set up a Tor hidden service and on it allow Bitcoin transactions. How can I make this happen? The server would be running Windows IIS and is mostly for personal use.

I had a look around at BitcoinD and Blockchain.info but somehow the information there does not resonate (or I am just too daft to grasp what they are saying)

My suggestion: Don't use windows AT ALL. Easiest way to get hacked.

also here's the answers you are looking for https://en.bitcoin.it/wiki/Tor

specifically this line:
"(after starting tor) Run bitcoind with -proxy=127.0.0.1:9050"


Using the bitcoin wallet PKI for message encryption Is it possible for a message sender to encrypt a message string with a receiver's public wallet address, email this ciphertext to the receiver and then have the receiver decrypt the message using their wallet (private key)?

I'm not talking about spamming the blockchain, the message could be sent using IM/Email once encrypted.

So it's sort of like using gpg but with the wallet public/private key.

Is this possible?

The cryptography Bitcoin uses for wallet private keys is ECDSA, using curve secp256k1:

http://en.bitcoin.it/wiki/Elliptic_Curve_Digital_Signature_Algorithm

It is for signing messages, and does not useful for any method of encryption.

There are other methods of encrypting and communicating a message, ... Gli.ph, BitMessage, GPG/OpenPGP, and more.

If you trusted the party you are sending funds to, that party could use the message signing capability in the client to sign a message that tells you what GPG key to use in encrypting a message to that party, for instance.  That would give you the assurance that you are encrypting a message truly only readable by the party that has control of that Bitcoin address and signed the message.


Will the Liquid sidechain be open to any user? With the recent start of the private beta of Liquid, the first sidechain is now in production on the Bitcoin network.

One of the features advertised is:

  User Control – Users can hold their Liquid funds off of exchanges and in a wallet they control, enabling them to rapidly transfer funds to and from any participating exchange in the network.

It was my understanding that Liquid was primarily to facilitate payments betweent larger users in the Bitcoin network such as exchanges and payment processors.

The above feature seems contradictory with the company focus. Will everybody be able to have a wallet on Liquid?

Liquid wallets are open and accessible to anyone. This could either be SPV wallets such as Blockstream Green or the Elements Liquid node.

With these wallets you can verify transactions (your own transactions with Green, all transactions with the node). However, you can't produce blocks. To do that, you need to be one of the Liquid members. To become such a member, you need to go through Blockstream. At the time of writing, there are 33 members full list available here.


Fine tunning a Rapsberri Pi 2 B+ full 0.12 node I'm running a 0.12 Raspnode (raspberri Pi 2 B+ full node)

I've made the full node syncing in a laptop to speed up the process. Then, after moving all the files successfully and starting the full node in the rPi I have noted that it cannot completely sync and it is most of the time a few blocks away from 100% height.

The rPi is running only bitcoind and I've modified with renice the priority to its assigned PID.

I would like to know what are the parameters and values I need to change in order to get a fully synchronized node (100% height).

The following options comes to mind:

Increase the relayfee parameter? (current value
minrelaytxfee=0.00005)
Decrease the memory assigned to the UXTO? (current value
maxmempool=150)
Increase or decrease the prune value? (current is
prune=30000)
Decrease the free-tx limit? (current at limitfreerelay=10)

If you need any additional info feel free to ask for it, I would gladly provide it.

Edit: seems that blocks are being produced faster than the processing power of the Rpi 2 B+ can handle.. so it never gets sync'ed.. its always behind the last block.

You do need to store data on an external SSD disk (USB).

If your data and swap are on SSD media, you can use all those options (they won't matter much).

I don't recommend to use Pi 2 (any version), it's a waste of time. It can barely keep up, it becomes useless for anything else and each time you restart the OS or bitcoind you need to wait several hours for it to catch up.


How to install a Bitcoin client on Ubuntu Server I've googled a lot for this issue. Hehe. I have found some tutorials, but they were of no use because they are for systems that do have a GUI. I have no plans to install a GUI on that system, and I want to use bitcoin from the command line, or via RPC API. This is the system I run:

  Linux redacted 3.2.0-40-generic-pae #64-Ubuntu SMP Mon Mar 25 21:44:41 UTC 2013 i686 athlon i386 GNU/Linux

I found I can do this:

  sudo apt-get install bitcoind

But hardly I know what to do with it after that. It installs successfully. If you are going to ask a reason why I want this, it's because I want to communicate with it via PHP or I'll see how, but mostly it's for automating services with it. Please help. :-(

Once you've installed bitcoind, you should create a configuration file (stored in ~/.bitcoin/bitcoin.conf) containing at least an RPC username and password, and then you just run bitcoind to start the server.


Blockchain.info, How to receive new transactions (not websocket) I'm trying to build safe transaction-confirmation app and need to synchronize new not-processed transactions.

For example I monitor address A and have processed last transaction B,
how can I ask blockchain "give me all new transactions for address A, which occurred after transaction B",

or the only way here is to use

  /address/[***]?format=json

url with offset and limit options ? Thanks

Blockchain.info's API doesn't operate like a stream like the Twitter feed.  You can't page back and forth through the API like that.

For taking payments, it's best to generate a fresh address to receive the coins than to reuse an address over and over.  It becomes too much trouble to keep track of where/who each coin came from outside of bitcoin (the software running the wallet).  The software does it automatically if you just let it by using a new address for each incoming transaction.  Save the unique receiving address in the db and when it receives funds, you can easily find the order to complete.

Try their Receive Payments API.  They automate much of the process and post a callback to you once the funds are received.


How does Bitcoin makes sure that nobody can duplicate a transaction? I understand that when creating a transaction, you send in data, the hash of that data, and a signature that is created using the hash of the data and your private key. However, what is stopping someone, for example the recipient of the original transaction, to simply send in the same exact transaction with the same data and signature. Wouldn't this come up as being valid, and therefore make the system insecure? How does Bitcoin solve this problem?

If the answer is a timestamp, how does Bitcoin deal with different transactions coming in at various times, often out of order?

However, what is stopping someone, for example the recipient of the original transaction, to simply send in the same exact transaction with the same data and signature?

Bitcoin does not have the concept of account balance but works on the concept of unspent transaction outputs (UTXOs). Each output of a transaction (except OP_RETURN ones) lead to the creation of a separate UTXO. When you create transactions in Bitcoin, you consume these UTXOs in entirety and create separate UTXOs. This is done by referencing the outpoint (txid and n) from which you 'earnt' these UTXO. For example, if you control 2 UTXOs (1 BTC and 0.5 BTC), and you want to send your friend 1.25 BTC, you would have to consume both your UTXOs and send the remaining change of 0.25 BTC to yourself (neglecting tx fees). So if the recipient of a transaction output tries to broadcast the same transaction again, the Bitcoin nodes when verifying the transaction would find that these utxos do not exist and hence the transaction is invalid.

When full nodes start syncing from the Genesis block, they start to build the database of all these UTXOs. Every transaction involves removing spent UTXOs and adding new ones. These database is stores in chainstate directory and aggressively cached in memory.


Calculating Z value in a tx with 1 input and 2 outputs After reading this:
ECDSA Signature and the "z" value

I'm still confused about the 'Z' value, for this transaction:
 https://blockchain.info/tx/ea6aa5d49b8e351e307bf9220f2d7cd31d41e640683539e00580e17cb4cf3e36?show_adv=true

  the signature is in the input script, and uses the output script of it's source transaction when calculating the message hash. So the nr of outputs to the transaction does not matter, they are always hashed unmodified into the messagehash for each input. – Willem Hengeveld

I find the above quote confusing, sorry!

This is what I hashed:

01000000
01
e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65000000001976a9147e7fe35e49f0e8a920780c00d40b7171d880811988ac1976a914942920e041353162b0d8bd006d09c2ca25cdc27888acffffffff
02
1004df02000000001976a9147e7fe35e49f0e8a920780c00d40b7171d880811988ac
c05f3b04000000001976a914942920e041353162b0d8bd006d09c2ca25cdc27888ac
00000000
01000000

And got this:

0x76041b6949563e76d77012f9723bec3c7a1a21fd84c74bb58df47087cef056d7

Is it correct? Is there a way to verify it?

Seems to me that it is not correct

Sorry, I do not have a tool rigth now, and creating data manually is a little bit difficult and I may create errors also See update below

There should be something like this

01000000
01
e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65 00000000
1976a914 f65d5c02866b8cea5840b2f9fb739f2e6ee6c8f4 88ac
ffffffff
02
1004df0200000000 1976a914 7e7fe35e49f0e8a920780c00d40b7171d8808119 88ac
c05f3b0400000000 1976a914 942920e041353162b0d8bd006d09c2ca25cdc278 88ac
00000000
01000000

Update: Here is a piece of my checking code.

const QByteArray xx ( QByteArray::fromHex ( "01000000"
"01"
"e3dbc4fada0034ad8581cb429af4953d7d092b137ebd9e193344db376314ab65 00000000"
"1976a914 f65d5c02866b8cea5840b2f9fb739f2e6ee6c8f4 88ac"
"ffffffff"
"02"
"1004df0200000000 1976a914 7e7fe35e49f0e8a920780c00d40b7171d8808119 88ac"
"c05f3b0400000000 1976a914 942920e041353162b0d8bd006d09c2ca25cdc278 88ac"
"00000000"
"01000000" ) );
const MyKey32 digest ( xx.constData ( ), xx.size ( ) ); // construct object of sha256 (sha256 ( xx ) )
_trace ( digest.toStringRev ( ) );                      // print result
const QByteArray pubkey ( QByteArray::fromHex ( "036a6d9c781613b2f07607b240e019fb2344704258e63df4802a436302942e73d3" ) );
const QByteArray signature ( QByteArray::fromHex ( "30450221008f1bcf2624da3b423ca19eb9eb6c8fb84e6614cd603cbf9f2f1d8c7103534138022038190065341fd3cd4a697ee1ca02f5b1f1131a5268ba9df5d976e782a5edc379" ) );
_trace ( QString ( "verify=%1" ).arg ( digest.verify ( pubkey, signature ) ) );

and the result is

"f71aa6b6127ce9229d9607c0ee133d8195f91b14fe7d554ef8a6a40d99338426"
"verify=1"


What are some interesting applications of Taproot "smart contracts"? From a strictly technical perspective, MAST makes a lot of sense. However, understanding it in the context of Taproot/Tapscript does require prior knowledge in Merkle Trees and hash functions.

What are some toy use cases that could be used to highlight Taproot's value proposition? From what I've seen, 2FA-like applications are often used as example, but what are other fun applications this technology could serve?

I think it's important to note first that BIP341-BIP342 are improvements to the Bitcoin script "framework" more than they are improvements to the smart contracting "functionality".
All Bitcoin scripts can do in practice is enforce combinations of conditions on signatures by certain (sub)sets of signers, timelocks, and revealing hashes. At a conceptual level, this does not change with Taproot - everything that can be implemented using it can be implemented without Taproot too.
What it does do is:

Make certain things smaller/cheaper (but sometimes at the cost of higher signer complexity).
Make certain things more private.
Make certain things easier to do.
Add mechanisms through which actual new conditions/features can be added later.

In some cases, these advantages can be very substantial though - making the difference between feasible and infeasible in practice, or between actually incentivizing more private constructions or not.
It's hard to give a comprehensive answer what that entails, as it's akin to a new programming language, and there are presumably many things it enables that haven't been discovered yet. I can give a few examples though:

The "Taproot" function itself means that any output, regardless of how complex its script is, can be spent using a single signature on-chain if all signers agree with spending (which also reduces their costs, but it may complicate the signing procedure). This applies to escrows, cooperative Lightning closes and various other things.
Various kinds of multisig become cheaper even when the "optimistic" taproot single-key spend can't be used, either through key aggregation (one key representing multiple people), or MAST (just revealing a script that embodies the exact condtions that were satisfied, rather than revealing all possible conditions). The advantages of key aggregation are in theory already possible using multiparty ECDSA, but that is significantly more complex than what is possible with the Schnorr signatures introduced by BIP340, and not used by anything in practice (as far as I know).
Atomic swaps, which can be used as a new privacy tool, are also in theory possible using multiparty ECDSA, but become a lot simpler using Schnorr based adaptor signatures.