text:
miner_proxy and minerd Settings
I've started a mining account of Wemineltc.com, and have decided to go down the track of CPU mining.  I looked up the relative tutorials on how to do so, and I got some different results.  I set the proxy batch file to
mining_proxy.exe -o freedom.wemineltc.com -p3339

and the minerd batch file to
minerd -a scrypt -o stratum+tcp://freedom.wemineltc.com:3339 -O USER.1:12345

One of the tutorials says instead to use the minerd command line of
minderd -a scrypt http://127.0.0.1:8332 -O USER.1:12345

I tried the latter minerd command line and it didn't mine, so I tried my own version.  Is there any explanation to this? Am I doing something wrong?

Am I doing something wrong?

Yes. mining_proxy is used to translate from stratum to the old getwork protocol. This is useful if you want to use a mining program that does not support stratum, but you still want to get the benefits of stratum.
However, minerd supports stratum out of the box. You don't need mining_proxy.
You should remove the first and third commands.


text:
How do I calculate the txid of this raw transaction?
I'm trying to parse a bitcoin block using Python.
I called getrawtransaction over JSON-RPC. I got this:
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d014dffffffff0100f2052a01000000434104e70a02f5af48a1989bf630d92523c9d14c45c75f7d1b998e962bff6ff9995fc5bdb44f1793b37495d80324acba7c8f537caaf8432b8d47987313060cc82d8a93ac00000000
How do I calculate the txid of this raw transaction?

TXIDs have two forms; the form used internally for outpoints and merkle leaves (internal byte order), and the form used in RPC calls and block explorers (RPC byte order).  These are often called, respectivey, little-endian byte order and big-endian byte order (although those descriptions aren't quite accurate).
Here's python code from the Bitcoin.org Developer Documentation generating both forms for the TXID for the transaction in your question:
#!/usr/bin/env python

from sys import byteorder
from hashlib import sha256

## You can put in $data an 80-byte block header to get its header hash,
## or a raw transaction to get its txid
data = "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d014dffffffff0100f2052a01000000434104e70a02f5af48a1989bf630d92523c9d14c45c75f7d1b998e962bff6ff9995fc5bdb44f1793b37495d80324acba7c8f537caaf8432b8d47987313060cc82d8a93ac00000000".decode("hex")
hash = sha256(sha256(data).digest()).digest()

print "Warning: this code only tested on a little-endian x86_64 arch"
print
print "System byte order:", byteorder
print "Internal-Byte-Order Hash: ", hash.encode('hex_codec')
print "RPC-Byte-Order Hash:      ", hash[::-1].encode('hex_codec')

And here's the output:
Warning: this code only tested on a little-endian x86_64 arch

System byte order: little
Internal-Byte-Order Hash:  660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d
RPC-Byte-Order Hash:       2d05f0c9c3e1c226e63b5fac240137687544cf631cd616fd34fd188fc9020866

The internal byte order used by the Bitcoin is in fact Little-Endian, while the RPC byte order is Big-Endian. For details explaining how this works refer this link.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

authors: Александр Кирьянов

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Noob question about mining
I'm not interesting in mining myself, just interested in the topic.
I understand that you can still get bitcoin by contributing computation power to a pool (a company)

Does only one person/company receive the bitcoin reward every 10 minutes? So in 1 hour, only 6 individual/company gets the reward? It's a zero-sum game?
If #1 is true, doesn't that mean only the fastest/best machines has any chance of getting the reward?
If #1 and #2 are true, does that mean that mining without joining a pool is a futile effort for any average individual with average income because he cannot compete with pools and companies have more powerful computers?
if #1,2,3 are true, does that mean that the companies that sell mining computers/devices are marketed towards those who join pools rather than mine the network themselves?

In order: yes, no, no, yes.

On a related note: you'll get more focused answers if you stick to one question at a time.

Additionally, please summarize your question in the title, instead of describing/categorizing it.

As pointed out by Nick, this should be split into several posts, yet all of the points have been answered in some form or another anyway. See e.g. Why doesn't the same miner always win?, How does the network adjust the rate at which the coins are created?, Wouldn't the expected return of a mining pool be no more than solo mining?.

Hence, as this question is a composite of multiple duplicates, the title being unsubstantial, and it therefore being of little long-term value for the site, I have downvoted it, and propose to delete it. Please create a new post for each question that remains unanswered and interesting to you.

I apologize and understand the mistake I made in this posts and the need to delete it. Still new at Stackexchange. Will post better questions next time. Thanks to those who answered my query. Much appreciated. Please let me know if I should delete the post myself, and will do so as soon as I get back on, or do I just let the admin do it. Thanks

It's more like a lottery than like a race. Let's say one miner has 90% of the hashrate and another has 10%. It is not true that every 10 minutes the big miner will always win because he's faster. Rather, the big miner has 90% chance of winning and the small miner has 10% - in exact proportion to their hashrate (unless they carry out some sophisticated attacks).
As such, to compete you don't need a more powerful computer, but a more efficient one. If the computer is efficient enough, then you'll be profitable and what you'll get is exactly proportional to its power.

Hey Meni,
Thanks for your continued effort here. It pains me point out, that this question and therefore also your answer will probably not survive, as the question doesn't work well with our format. I suggest that you re-post your answer to Why doesn't the same miner always win?, where it would also fit well. Please consider not answering low-quality posts, as your effort might just be wasted.

@Murch: I understand what you're saying, but while it might not be the SE way, I feel uncomfortable leaving questions unanswered. I adjust the amount of effort put into the answer - for a low-quality question I spend only a minute or so, in full knowledge it might go to waste. Specifically, I don't think much of this answer can be reused, as I didn't actually talk about why the fastest miner doesn't always win.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Bitcoin QT computer time
Bitcoin qt says my computer time needs to be correct for it to work properly. My time is right to the minute, but not the second.
Will this cause a problem?

The Bitcoin client can fix the time if it's only an hour off by asking other clients what time it is. http://bitcoin.stackexchange.com/questions/7404/how-does-bitcoin-figure-out-what-time-it-is

Bitcoin-Qt/bitcoind will reject new blocks whose timestamp is more than a couple hours  ahead of the previous block.  This means you could be nearly two hours behind and your node would still accept most new blocks.


text:
What was the most recent change to the official client that broke block validity?
There have been suggestions that various bitcoin protocol rules (max block size, mining reward policy, etc) could be changed in the future by everybody "agreeing to update their client".  The logistics of this are somewhat questionable.
Another question asked about the mechanics of such a change in the situation where people object to it.
I would like to know if there is any recent precedent for this that we could examine.  Specifically: have there ever been any changes to the official client version Y that would cause client version X to reject its blocks, where X < Y?  If so, what is the most recent such case?
I suspect there were probably a bunch of changes like this back in the early days when only a few dozen people were using bitcoin.  It would be interesting to know if it's happened more recently.

Good question--there are many such changes, and much more recently than you might think.  Hopefully we can get one of the active devs to enumerate some of them?

The last changes I'm aware of that would cause a blockchain split were in August 2010, after the overflow bug; see, for example, https://github.com/bitcoin/bitcoin/commit/4bd188c4383d6e614e18f79dc337fbabe8464c82
I don't think there have been any changes to the block or transaction validity rules since, although it is very possible I'm forgetting something.

One can argue whether it 'broke' block validity or fixed it. The client didn't do what the protocol said it should do and the change was to make it do so. It did result in clients disagreeing over whether blocks are valid, which is how I would interpret the question.

In 0.3.12 blocks with more than a certain number of sigOps were made invalid.

@David, sorry, I should have picked a word with more neutral connotations than "broke".  I wasn't asking for a value judgment, just wondering about any sort of compatibility failure.  Also, AFAIK there is no official protocol spec other than the source code for the official client.

I guess I misread the question there--Gavin is right that the overflow bug of August 2010 is the only time the block chain has been affected.
But in regards to the question of precedent for everybody agreeing to update their client, we do have some pretty good examples that are worth mentioning.
Take the situation with transaction fees, for example.  Up until a few months ago, the Bitcoin client contained a .01 btc minimum transaction fee.  In the early days this was nearly negligible, but as the exchange rate rose it started to be a pretty hefty chunk of change, especially since it was required on any transaction of less than .01 btc.  Miners were allowed to include any transactions they wanted in their own blocks (and some did) but since the majority of the network would not forward transactions with insufficient fees (and the default client wouldn't even allow you to send the transaction) it was impractical for normal users to do this.
But you couldn't simply release a new client with lower minimum fees, because the transactions it produced wouldn't be forwarded by the rest of the network.  This was a very similar chicken-and-egg problem to what you mention in your first paragraph.  So instead of just abruptly changing the rules, an intermediate release was first made that would forward the lower-fee transactions, but not create them.  Once that release obtained sufficiently wide adoption that these transactions could be used normally, a second release added the ability to actually send the transactions, and everything worked like clockwork.  The same one-two model of compatibility-breaking releases could be used for virtually any needed change to the client:  first release a version that supports the change passively, and wait to see if it achieves sufficient adoption.  If it does, release the version that makes the change live.
For emergency situations, however, the overflow bug of August 2010 is an excellent model.  An exploit was found that allowed someone to insert a fraudulent transaction into the block chain itself, so obviously any future versions had to disregard that version of events.  The previous versions, meanwhile, would (accurately) view this disregarding as an attempt to fork the block chain. You can view a more detailed overview of that incident here.  The exploit was noticed almost immediately, publicised, and a fix was written within hours.  The vast majority of users updated their clients very quickly(especially the miners, vital to making the new fork succeed), and the new block chain fork quickly surpassed the old--bringing all the valid transactions from before with it.  And disaster was averted in clockwork fashion (there were a lot more than just a few dozen people using Bitcoin by this point).
So we end up with some pretty clear precedents for both malicious action that requires an immediate response; and adjustments to the quality and usability of the network that require consensus.  I'd say the idea that people can simply agree to update their client if a change is needed has a pretty firm footing.

Can you elaborate more on what happens if before the exploit was noticed and fixed, someone has already "did the exploit"?


text:
Do miners have both the incentive and ability to keep the reward at 50BTC?
There has been some concern about the fact that transaction fees (in their current form) are not an adequate replacement for the current 50BTC block reward.  Gavin has said as much, as have others.  The issues of incentive misalignment are described in other threads.
I'm curious: as the 50BTC->25BTC block reward reduction approaches, there is a strong incentive for the miners to modify their clients to simply ignore this rule, continue producing 50BTC-reward-blocks, and ignore any blocks which try to reduce the reward.  It requires changing only a single line of code!
It is in the best interest of every miner to do this, and the miners decide what winds up in the block chain.  Therefore, I suspect that it might actually happen.  Is there reason to believe otherwise?
Obviously if more than half the miners agree, they can change any aspect of the bitcoin protocol.  But this is a bit different: it's easier to get a bunch of people to agree to not make a scheduled change in the protocol than to make a new change.  It's also easier to do this if omitting the scheduled change is in all the miners' best interest.  So I think that eliminating the reward reduction is a lot more likely than any other protocol modification.  "Oops, I forgot to reduce the reward I pay myself!"  It's also less likely to produce panicked "OMG they changed the rules of the game" and a crash in the BTC exchange rate, since what's really happening here is less change, not more.
Additional note: although pooled mining makes it easier for this to happen, no "agreement between pools" or collusion is actually needed.  Think of it this way: the block that is supposed to reduce the reward to 25BTC is very likely to be a forking point in the blockchain.  Every miner will decide for him/herself which side of the fork to work on.  The fact that there is more reward on the non-reduced side of the fork means that a rational miner will choose that side.  The fact that more miners work on that fork means it will ultimately become the "real" blockchain.

They can create as big a fork as they want--it won't become the "real" blockchain unless it's valued higher in the markets.  Greater numerical bitcoins doesn't mean much if they're worth pennies on the dollar.  They'd need to convince users to switch en masse as well.

This question needs to be reworked.  As it stands, it's just an invitation for discussion, which doesn't belong on Stack Exchange.  Generally questions of the form "BIG PROBLEM amirite?" aren't very useful.

Agreed.  Voting to close.  If the question is improved we can simply re-open.

It's not just about the miners, it is also about people using bitcoin. If miners decide to fork the chain and keep block bounty at 50btc, they cannot use those bitcoins in any place where people have not also modified their non-mining bitcoin client. Protocol changes are not just about >50% of miners, but about >50% of user clients.
In this case, since users do not have any incentive to modify their clients to treat the new fork as legitimate, rather than the original rules fork, any miner that decides to spend his resources mining the new "50 btc forever" fork is just going to be wasting time, since he will not be able to spend his coins anywhere; they'll be rejected as illegitimate by users, merchants, exchanges, etc.

I beleive not just their 50 btc will be rejected, but their entire fork of the blockchain those miners are using would be rejected...exposing those miners to potential losses of usable blocks they could have been mining at 25 btc.

Good answer nanotube.  There's still the problem of users jumping ship when the hashrate plunges -- if enough miners switched the difficulty on the unmodified side of the fork would take a long time to come down to a reasonable level, and the network would become unusable in the meantime (days to get even 1 confirmation and months until the first difficulty drop).  This actually happened to NameCoin so it's not just a theoretical problem.

A similar question was asked over here, and it seems a completely different answer was arrived at, http://bitcoin.stackexchange.com/questions/1207/what-happens-if-the-developers-make-a-controversial-change-to-the-standard-cli

I don't think it would happen. If the market didn't go along with the miners, the Bitcoins they mine would be worthless. Meanwhile, the difficulty on the original chain would drop, increasing its profitability.
This might be a more realistic fear when the reward starts to drop more catastrophically in the future. But it's hard to predict what would happen then because we really don't know what the usage of Bitcoin will be like then.

How is a 50% drop in the reward less catastrophic now than a 50% drop later?

Two reasons: First, the reward will eventually drop to zero. Second, the reward will become a lower and lower fraction compared to the total number of existing Bitcoins.

@David, it's worth noting that even if the block reward were never reduced, the reward would still "be a lower fraction compared to the total number of existing bitcoins" with each block compared to the previous one.

Of course. You could make an argument that even if the block reward was constant, there would be a gradually increasing incentive for miners to push to raise it. (Assuming the value of the currency wasn't increasing.)

Who's going to continue to value Bitcoin if the supply inflates forever? Any miner that does this is shooting himself in the foot. Feel free though.


text:
Transaction ordering when one transaction redeems another within a block
Say we have txA and txB, and txB contains an input that redeems an output from txA.
In order for a block containing both txA and txB to be valid, is it necessary that txB be after txA in the list of transactions for that block?

Related: http://bitcoin.stackexchange.com/questions/35719/is-there-a-fixed-order-for-all-transactions-in-the-block-chain/35726#35726

While I agree that the question is the same, the answer to the other question is simply a long-winded "yes", without any references or sources. How can I mark an answer as correct if I can't judge whether it's correct or not?


text:
Electrum exchange rates. Where do they come from and why are they incorrect?
On the simple view on the Electrum client, the value of the bitcoins is displayed in USD, GBP and EUR (changeable by clicking on it).
Currently by clicking through, I am seeing exchange rates:

10.29GBP/BTC
10.40EUR/BTC
11.90USD/BTC

This is completely out of line with mtgox, and also completely out of line with international currency markets (currently 1.6usd/gbp and 1.24eur/gbp)
So could someone explain where these rates come from and why they are so incorrect?

As of this writing, Electrum retrieves its exchange rate from Intersango. The last sale there must have been abnormally low for the current exchange rate.

In this forum post: https://bitcointalk.org/index.php?topic=100502.msg1308531#msg1308531 BkkCoins says he has an Electrum fork (https://github.com/bkkcoins) that allows it to support multiple exchanges. But be careful as reading later posts from Bkkcoins indicate that his fork may not be compatible with latest mainline Electrum build.

MultiBit uses the Java XChange library which is able to work with multiple exchanges. It might be possible to leverage the code in that library in your own projects.


text:
How to anonymously and privately purchase Bitcoin through Tor?
How can Bitcoin be anonymously purchased through Tor in a secure and private fashion?
My question is related to:

How can I setup Bitcoin to be anonymous with Tor?
Personal information and bitcoin purchasing

but more focused on anonymous and private purchasing transactions.

This question has been voted as off-topic citing the market value close reason. I've voted to leave open, as this is not asking about a service provider, but about ways to address a specific need.

what is the market value close option?  And, yes, not asking about a specific service provider.

I was referring to the off-topic close reason "Questions on current or future market values, energy costs or service provider availability are off-topic as the answers are changing too frequently to be useful to others.". In my opinion, it doesn't apply here. :)

First of all, anonimity and privacy are two different things. Bitcoin is designed to be pseudonimous - which is close to anonimity, but instead of being completely anonimous, you're linked to your bitcoin address, or pseudonym.
You cannot make a private transaction on the Bitcoin network, but you can try to be as anonymous as possible.
It is possible to run Bitcoin Core as a Tor hidden service, and connect to such services.
The first step is running Bitcoin Core behind a Tor proxy. This will already anonymize all outgoing connections, but more is possible.
More instructions at github:
https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md

For purchasing BTC in a private way, you should buy OTC (not from centralized exchanges). One possible way is Bitcoin ATMs, another option is using HodlHodl.com (works with Tor Browser) or Bisq (software you install on your computer), both of which just connect buyers and sellers and then you can do the trade using various payment methods, including meeting in person and paying with cash.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How did anyone buy bitcoins before exchanges?
How did the first bitcoins get bought by anyone?
I understand how miners got them, but what did they do with them?

On messageboards like bitcointalk and chatrooms. People would use Paypal or other digital payment systems to send dollars. You could also trade in person through meetups and localbitcoins.com which still happens today.

Localbitcoins.com would allow people to meet up locally, and use cash or in person bank transfer. Also PayPal!

in the first days of bitcoin there were no exchanges to buy bitcoin. if you didn't know someone who sells bitcoin you had to mine bitcoin (mining was less expensive in the first days of bitcoin).


text:
Why criminals still use bitcoin mixers when there is other blockchains?
I came across the following article

Allen Goldmann, A person is trying to hide $5 million in stolen Bitcoins from a Darknet marketplace, Forbes, November 28, 2022

where some criminal tried to launder stolen 300 bitcoins with mixer "desperately creating new wallet addresses".
There is a lot of forensic techniques which let tracing crypto within same blockchain easily enough, so my question is very simple: why not just convert stolen bitcoin to other crypto based on different blockchain (chain hopping)?
P.S I assume that tracing will be stopped in the point of transfering between blockchains (you transfer from wallet A1 to wallet A2 of blockchain A and get the funds on wallet B1 from wallet B2 belonging blockchain B)

As you say a lot of forensic techniques which let tracing crypto within same blockchain, so why not such of techniques not exists in a diffrent blockchain as you say ?

@Pegasus, I suppose because tracing will be stopped in the point of transfering between blockchains (you transfer on wallet A of blockchain B1 and get the funds on wallet B from wallet С belonging blockchain B2)

@AseN but if you use a normal exchange to convert currencies, the money can be traced by the exchange. Most of them apply Know Your Customer (KYC) regulations intended to counteract money laundering.

@RedGrittyBrick, KYС is good point, but it hard to imagine that all of exchangers do it, especially in darknet. And even if there is KYC, can`t it be bypassed with simple scheme: BTC->Monero_wallet1->Monero_wallet2->BTC?

I believe it's a matter of liquidity, and BTC is the most liquid digital asset right now. In the case of fiat, if you stole US dollars you wouldn't change them to Turkish liras just to be untraceable, you rather find a way to keep the USD.
It's a Forbes article anyway, it could be mainly FUD for people to stay away from "crypto".

Thanks for reply! What about liquidity, is not is enough of it in closest to Bitcoin blockchain - Etherium?


text:
Is mining still profitable at this point?
Given that Elon Musk is partnering with Ethereum founder Vitalik Buterin to mine Bitcoin sustainably, it surely is still profitable, right?

If mining wasn't profitable, some people would stop mining. The remaining miners would find that mining becomes profitable. It is a self-regulating system.
What it means to mine bitcoin sustainably is probably controversial.


text:
What benefits does Bitcoin have that other cryptocurrencies do not?
I have heard several times Bitcoin being called "the king of crypto." It makes sense when you look at how the coin surpasses all the altcoins in terms of market capitalization and trading volume. No doubt that BTC is dominant in the crypto market.
Why? Why do people prefer to buy Bitcoin over other cryptocurrencies? If you disregard the sheer popularity of the coin, I don't see what other value it has and why there is such a high demand.
The most notable argument is that people buy BTC for international money transfer and buying/selling. However, it seems that BTC would not come close as a perfect candidate for that. Stable coins (ex. Tether) having less volatility would be much better for such transactions. It seems pretty obvious that people and stores buying and selling in stablecoin would be so much better. Using such alternative can provide trust for customers and sellers that what they thought they paid or accepted will actually be what they thought of the upcoming day.
There are a lot of perks for using cryptocurrency. Transaction fees are minimal and transfer is speedy. There is potential for international money transfer, and it is not really tied down to massive regulation and manipulation. However, I'm just not finding the perks of why BTC is the best coin to do all these things.
If Libra is introduced as a stablecoin with a company like Facebook supporting it, why would there be a demand for BTC? Why is there still demand today when Tether can serve as a stable medium of transaction?
Ultimately, is BTC mostly only bought for investment/speculation or is there a real use for using this currency today where there are so many other altcoins to choose from?

Why do people prefer to buy Bitcoin over other cryptocurrencies?

There are many reasons:
Liquidity
Bitcoin is the most capitalized market amongst cryptocurrencies, and that is an important measure for any form of money. If it is difficult to trade a form of money without crashing the price of it, then it is not a very useful money in the first place! As liquidity grows, more economic activity can occur using BTC (liquidity begets liquidity), it is a positive feedback mechanism.
User-base
Systems of money benefit from network effects. It is beneficial to own a form of money that a large number of people accept, compared to a specialized money that only a few people will accept. Bitcoin is still 'specialized money' in the big picture, but it is certainly the most widely accepted cryptocurrency at this time, with the largest userbase.
A decentralized network
When compared to a centralized financial network, the operation of the Bitcoin network is quite inefficient: every network node independently computes and validates the entire history of the network. This inefficiency is seen as acceptable because it results in a network with no hierarchy amongst nodes: nobody is in control of the network. There is no central admin. There is nobody that can exert undue influence on the network (for example, to change the rules, or inflate the supply). This point is very important! Many other cryptocurrencies are tied to some central authority, and this represents a single point of failure, that a user of that currency must trust to not be abused or attacked.
Historically, the Bitcoin network has proven to be extremely difficult to change (as evidenced by events such as the 'Segwit2X' debacle), which gives investors confidence that the value they store in the network will remain secure (1 BTC continues to = 1 BTC). To contrast, the Ethereum network regularly enacts hard-forks that change the rules of the network (see: the DAO attack, ice-age setbacks, changes in issuance of new ETH, etc).
Network security
The history of the Bitcoin network is probabilistically secured through the economic incentives of Bitcoin mining. To put it more clearly: each new block on the network provides a reward which incentivizes miners to spend resources mining and progressing the network's state. To alter the history, an attacker would have to spend more resources than the entire rest of the network combined (this is called a majority attack).
As a user, it is thus in your best interest to use the network which has the highest amount of security, so that there is the lowest chance of someone successfully attacking the network you've invested in. To date, Bitcoin has always had the largest amount of security, no altcoin has come close to it in this regard.
Hard money
As mentioned above, the rules of the network are extremely hard to change. Making a change requires that a super-majority of users will all agree to the change, and then update the code of their nodes to reflect the desired change. Because of this, the issuance and supply of BTC is very well understood, extremely predictable, and likely almost impossible to alter. This means that investors can have confidence that they understand their stake in the network, and this stake will not be changed without notice (by, for example, a central authority deciding to alter the supply).
Financial Sovereignty
With all of the above in mind, the result is a network that grants the user financial sovereignty: un-censorable money that is completely under the control of the user. Other cryptocurrencies do not have the level of decentralization required to strongly guarantee such a thing, many of them are in fact entirely centralized, depending on some central authority to guarantee the value, services, security, or function of the network.
Infrastructure
The Bitcoin network has been around for the longest time, and as a result of this, it has a large developer base working on a huge variety of projects that will benefit the network and it's users. Since the code is open source, you can view the development progress in real time by checking out the Bitcoin-core project's github repository, the bitcoin-dev mailing list, #bitcoin-dev IRC channel, etc. Beyond this, you can also check out development of the Lightning network (LND, c-lightning, etc), the lightning-dev mailing list, the many wallet projects in the ecosystem, and the many systems and services being built to utilize Bitcoin.
Following the work can be dizzying, but the results are clear: as time has passed it has become increasingly easier to use and interact with the Bitcoin network. It seems logical to conclude that this trend will continue.

You may have noticed that everything written above is largely a social phenomenon: the code itself is entirely open-source: you can copy/paste all of it, tweak a few parameters, and start up your own altcoin network without much work at all. What you can't copy/paste is the network of humans that partake, and that is where the real value comes from.

If Libra is introduced as a stablecoin with a company like Facebook supporting it, why would there be a demand for BTC?

Libra is no different than any other altcoin that has a centralized point of failure, posing a huge risk to its users. Further, facebook's abhorrent privacy policies and past abuses of user data make it inconceivable that a currency they control would gain widespread trust.

Why is there still demand today when Tether can serve as a stable medium of transaction?

Similar to Libra, Tether is backed/guaranteed by a central authority, it does not promise the same things that Bitcoin does (which isn't to say these things can't have use-cases in their own right, but the key point is that they are not equivalent to Bitcoin).

Thank you for the detailed answer! I was looking to understand why there is a demand for BTC in particular in comparison to other coins. If there is a good reason, then there's no doubt that its demand will exist and grow in the upcoming years. These are all great reasons! Thanks for that.

People get religious about "their" choices... it comes down to the longest chain with the least likelihood of being coopted by something like a 51% attack.
Almost anything the other coins have can (and often is) being developed on top of BTC (side chains).
I think long term BTC becomes the TCP/IP of crypto and great ideas can flourish in other cryptos as long as they also use the longest, strongest chain (BTC) to verify transactions occasionally. "Delayed proof of work".

What about the Ethereum network? Isn't it also as strong as the BTC chain and thus used for many new coins? Isn't there a possibility that one day ETH or some new crypto that does not use the BTC chain top the list (perhaps Libra)?

Its chain is five years behind.  It's got problems.  Google them.   re: Libra, you really need to research it.  It's nothing like Bitcoin.


text:
Does the main Bitcoin client blacklist addresses?
Does the main Bitcoin client blacklist any addresses that send too many erroneous messages? If so, how can one whitelist a particular address? I am developing an app that will be communicating with the main client and I don't want the program to ban it during testing.

I don't know the answer, but there is a testnet intended for app development isn't there? It should presumably be more forgiving.

Why not title this as "Does the main Bitcoin client blacklist addresses?"

There is a ban mechanism which is handled in net.cpp.
Any node which misbehave by more than -banscore (defaults to 100) is banned for -bantime (defaults to 60×60×24 seconds = 1 day).
However, nodes with a local ip address are exempted, and for those a warning is shown in the logs after each misbehavior.
Also bans are not persistent, they are lifted when the client is restarted.
So, during development, just make sure that your app connects with a local address to the bitcoin client, and you will not be bothered by bans.

Here is the relevant piece of code:
bool CNode::Misbehaving(int howmuch)
{
    if (addr.IsLocal())
    {
        printf("Warning: local node %s misbehaving\n", addr.ToString().c_str());
        return false;
    }

    nMisbehavior += howmuch;
    if (nMisbehavior >= GetArg("-banscore", 100))
    {
        int64 banTime = GetTime()+GetArg("-bantime", 60*60*24);  // Default 24-hour ban
        CRITICAL_BLOCK(cs_setBanned)
            if (setBanned[addr.ip] < banTime)
                setBanned[addr.ip] = banTime;
        CloseSocketDisconnect();
        printf("Disconnected %s for misbehavior (score=%d)\n", addr.ToString().c_str(), nMisbehavior);
        return true;
    }
    return false;
}

Setting -banscore=999999 (or some other very-large number) would be another way of getting bitcoin to be very forgiving when developing an app.

What determines misbehavior?


text:
In Proof-of-Stake, can the same miner mine a block multiple times in a row?
In Proof-of-Work, there are no rules on who will mine the next block - the selection is random and proportional to miners' computing power.
How is the next miner selected in various Proof-of-Stake block creation algorithms? Can the same miner / address / person be chosen to create multiple blocks in a row, or are there some mechanisms preventing this from happening?

Can the same miner / address / person be chosen to create multiple blocks in a row

Yes, a single entity can mine multiple blocks in a row with no ill effect.

are there some mechanisms preventing [multiple blocks in a row from one entity] from happening?

The sybil problem makes this fundamentally impossible; if there was a way to stop a person from pretending to be multiple entities at once, proof of stake and proof of work would not need to exist in the first place. In a naive attempt at this if you prevent a specific key from signing two blocks in a row, then the user would simple split their money into multiple keys.

How is the next miner selected in various Proof-of-Stake block creation algorithms?

In some implementations of proof of stake the selection is simply based on the previous block hash as a random oracle. ECDSA signatures can have a practically indefinite amount of permutations which allows a user in the network to simply sign repeatedly until the next "random" selection is also them, amplifying their income or ability to warp the network. This is commonly known as stake grinding.
In an attempt to fix this other implementations use either a block hash from a long time ago, or the hash of some period of blocks in the past. The intention of this is that an attacker would supposedly need to control all of the blocks in that period (or be extraordinarily lucky) in order to be able to re-sign and jump ahead with their new control.
There's other selection methods in existence but the enormous number of implementations make it extremely hard to research for this question, however they are likely variations on the same concept in some way. There's some more discussion of the general problems of proof of stake available for digestion in pos.pdf.


text:
In Proof-of-Stake, can a block creator fudge the block hash?
In Proof-of-Work, a block hash is costly to manipulate (say, wanting the hash to be even, or have the hash of the hash smaller than some number) since there is a lot of computing power put into selecting the right header to produce a valid hash.
I'm wondering - are the block hashes in the various Proof-of-Stake implementations easier to manipulate since the hashes aren't bound by PoW mining? Could a PoS miner spend some computational time to generate many valid blocks and pick one to use, or are there some other constrains preventing block hash fudging?

Absolutely. ECDSA signatures at not unique, they can always be permuted by the signer at will by re-signing with a new nonce. The creator of the block can also choose to reorder or omit transactions to alter the block and then re-sign this to get a new block hash.

Does that affect security of blocks/blockchain in PoS systems? Changing a particular block hash, would require recalculating the hashes of blocks on top of it - no?

This is called "stake grinding" and demolishes the security of PoS systems.


text:
Getting a Zerocoin for d bitcoins
I've read the Zerocoin paper by Miers et al. and understood most of the concepts.

How do I get a zerocoin for some denomination in bitcoin? e.g. If I spend (d bitcoins + txn fee) in a bitcoin txn and get a (c, skc) pair, then is this mint txn accepted into the blockchain just like a normal bitcoin txn?
What does it mean when they say the currency is placed in escrow?

Thank you.


text:
Bitcoin exchange platforms and foreign exchange regulations
I'm wondering how cryptocurrency exchange platform adapt to country regulations where foreign exchange is forbidden (especially where sending money outside is forbidden).
How they could buy Bitcoin from outside without violating regulations (foreign exchange regulations), in the case if they don't have much liquidity to match international market price of Bitcoin ?

There's basically no way to answer this in a way that's general to countries that forbid foreign exchange, because these regulations have different goals in different countries.
For example, in Venezuela, all foreign exchanges must go through a state bank. The purpose of this is so that they can pretend that their currency is worth more than it actually is. If the central bank in Venezuela doesn't deal in the currency of your choice, I don't think you have any sort of recourse.
I don't have any advice for you, besides, "Hire the nephew of the guy who runs the central bank in your country."

Illegal exchange flourishes wherever exchange is forbidden.
Legal exchange operates to the degree and magnitude of effective enforcement of the ban.
Tracking goods & services trade paid in a cryptocurrency would be difficult, so trade would be the only way in an area that effectively restricts a cryptocurrency's trade with other currencies.


text:
What large and well known companies directly sell BTC?
At one point TangibleCryptography offered direct sales of Bitcoins in exchange to USD wire transfer, at competitive rates.
Is there a list of active trusted companies that offer this service?

We have a long history in bitcoin...
bitinstant.com
We offer many options and transaction types.  :)

In The Netherlands: https://bitonic.nl
They charge quite a fee, but are easy and quick. iDeal (direct bank transfer) supported. I used them once and got my bitcoins in a few minutes.

If you have an US bank account maybe Coinbase is something for you.

$100 transfer per user doesn't seem practical


text:
Are there Miners (or Mining Pools) that accept below standard fee transactions?
Let's say I create a transaction of 0.0005 BTC with a fee of 0.000005 BTC. From looking at the bitcoin source I find that this transaction would be considered non-standard and therefore not accepted and relayed by any node running the satoshi bitcoind.
Are there any Miners or Mining Pools where I could directly relay this transaction, which would accept it and place it into a block? Would the resulting block be considered standard and accepted in the block chain by other nodes?

Turns out there is a Bitcoin.it wiki site dedicated to this topic: Free transaction relay policy
Currently the only mining pool is eligius that accepts below standard fee transactions. Hopefully there is more to come :)


text:
In BitcoinJ, do I need to run downloadBlockChain() again after adding a new key?
I added a Wallet instance to PeerGroup instance and executed downloadBlockChain() method. Now if I add a key(s) to that wallet, do I have to execute downloadBlockChain() again to get a current balance including a new key or will it show a right balance automatically, assuming the new key has some balance?

Yes. You must call clearTransactions(0) on the Wallet, followed by downloadBlockChain() on the PeerGroup.
BitcoinJ is a thin client, meaning it doesn't download transactions for addresses that aren't in its wallet.
https://bitcoinj.github.io/working-with-the-wallet#replaying-the-chain


text:
Someone scammed me, and I want my money back. What can I do?
I was cheated by ebankbtc.com, which gave me this address: 1QiCsWaZxvNy4hXZMvQJEBcnVm5KH3fK5
You can see the transaction here:
https://blockchain.info/tx/e22206dcf27249afa6576443b3953b11ae43c04050c9e663a64f61ea320a7a4f
So, I lost my own Bitcoin.
What can I do about it?

Welcome to the bitcoin stack exchange! I think we'll need a little bit more info to help you figure out what happened. You might also try contacting them directly (http://ebankbtc.com/contact.php) to see if they can help you figure out where your BTC is.

The transaction you reference doesn't seem to involve the address you gave. Can you provide more details?

@ChuckBatson Err, whoops. Sorry, that was my bad.

If the receiving party is not co-operating you cannot enforce them to return the payment.
In this case it is recommended to take the case to your local police and make a  crime report of fraud. Most civilized countries have courts which can enforce the fraudster to repay the stolen property.
However getting anything back is unlikely if you were scammed in Internet. as most likely the culprint is in another country.
Welcome to non-regulated cryptoanarchy.


text:
How to use the bitcoin client without downloading the blockchain?
I would like to be able to use the bitcoin python client to be able to do things like sign transactions offline, create transactions, create multisig transactions, etc.
Is there a way to do this without having to download the whole bitcoin blockchain 20 GB?
I don't mind looking up the bitcoin addresses, outputs and such using an external website (e.g., blockchain.org) using some sort of API.
Is the a client that does this?

Electrum is an SPV wallet which has most of the functionality you mentioned.
Multisig is an issue though, the primary solution I'm aware of at this time is hybrid wallets such as Copay.

One option to do this programmatically would be to use Bitcore. It interfaces with a "blockchain explorer" to obtain stuff like outputs and addresses, and they can either be installed locally or you can use one from the ones already online: https://insight.is/ - and they're all open-source coming from the BitPay people.


text:
Intercept and edit transaction output
When a P2PKH transaction is created there are two main parts: the transaction input and the transaction output. I understand that the transaction input requires a signature that unlocks a previous UTXO for that specific address.
So in simple terms we have
transaction = transaction input(UTXO+sig) + transaction output(destination address and amount)

What prevents someone from intercepting the transaction and replacing the 'transaction output' with their own address?

Your assumption in the following equation
transaction = transaction input(UTXO+sig) + transaction output is wrong.
Correct would be
transaction = UTXO + sig[tx data + hash(UTXO)] + output

UTXO + sig[tx data + hash(UTXO) is added for each input
output is added for each output

This is JSON format of transaction that I have recently created and not yet broadcasted. You may notice that it has 1 input and 1 output.
{
    "hash": "7decf07997e58980b666e3cda17d4a930a21c8e99cad84c587a0e59d06b2dc86",
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 1,
    "lock_time": 0,
    "size": 191,
    "in": [
        {
            "prev_out": {
                "hash": "5cbbbb09f4323badb86d32ef4b8929ce757c078bc399c2ec499daaf8f51c455e",
                "n": 1
            },
            "scriptSig": "304402203a0a2a31e906997d8beed8ca5a81bd303f9fff2475cb0400983eef0fb718a573022069103db03857fb8c7b204e3ed3706ea6fa729708bc85492a7783ca11760a672101 02856209e1b0dfd542898c8a8c58da4a91f9f6a82cddb4157117fe18157fc28c94",
            "sequence": 4294967295
        }
    ],
    "out": [
        {
            "value": "0.00010000",
            "scriptPubKey": "OP_DUP OP_HASH160 c74eb0fc16d79cbf4399c80e7ec07162a41f30c6 OP_EQUALVERIFY OP_CHECKSIG"
        }
    ]
}

As you may know, to prove that you are allowed to spend input of tx you need to provide Digital signature - that is the scriptSig element inside in array.
scriptSig are digitally signed following data:

ID (hash) of particular input (prev_out)
double SHA of new transaction data

Signing transaction data prevents anyone from executing so called Man-in-the-middle attack and intercept and direct out to their wallet, since they cannot provide correct digital signature for the malformed transaction.
Why not try yourself? Here is the hex of above tx:
01000000015e451cf5f8aa9d49ecc299c38b077c75ce29894bef326db8ad3b32f409bbbb5c010000006a47304402203a0a2a31e906997d8beed8ca5a81bd303f9fff2475cb0400983eef0fb718a573022069103db03857fb8c7b204e3ed3706ea6fa729708bc85492a7783ca11760a6721012102856209e1b0dfd542898c8a8c58da4a91f9f6a82cddb4157117fe18157fc28c94ffffffff0110270000000000001976a914c74eb0fc16d79cbf4399c80e7ec07162a41f30c688ac00000000

You can replace output address c74eb0fc16d79cbf4399c80e7ec07162a41f30c6 with double hash (RIPEDM160(SHA256(K)) of your public key.
Then try to broadcast the malformed tx with http://btc.blockr.io/tx/push to see it is impossible. Or if you are skilled you may use sendrawtransaction <tx hex here> command in bitcoind.

I see, so using:
UTXO + sig[tx data + hash(UTXO) is added for each input
output is added for each output
Say that I have two UTXO in an address. one has 3btc which we'll call UTXO_a, the other has 1btc (UTXO_b). so the total in the address is 4btc.
Now I want to send 4 btc to a friend's address (ignoring fees).
Would that come out as:
UTXO_a + sig[tx data + hash(UTXO_a)]
UTXO_b + sig[tx data + hash(UTXO_b)]

output(4btc to friend's address)

Where the tx data would be the same for both UTXO_a and UTXO_b? and only 1 output is required?
Thanks for clearing up the previous misconception :)

@Luke - Yes, you are correct. Tx data for signing are the same for each scriptSig. Moreover, fee is calculated as a difference between sum(in) and sum(out) thus additional parameters are not required.

Do I understand right, each input has a signature of the whole transaction, including outputs? Why not to use single signature as a separate fields for transaction instead of making a signature of whole transaction on each input?

The sig part signs the entire transaction, not just the input part. So if someone intercepting the transaction replaced the transaction output part, the sig would no longer be valid. In fact, changing other inputs or outputs or amounts would also render the sig and thus the transaction invalid.
When you sign away an input, you are essentially saying "only this very specific transaction may spend this input".

Unless you sign with SIGHASH_NONE, but nobody does that, because of the attack Luke mentions.


text:
BItcoind/P2Pool What am I doing wrong?
I am running latest bitcoind and p2pool releases (default port settings) on Fedora 21 with ports open for 3332-3333, 8332-8333, and 9332-9333.  Everything appears to be well when connecting to the BC net, but when one of my miners (Antminer S5) connects to http://myhostname/IP port 3333 p2pool will not respond.  When I try to connect with port http://myhostname/IP port 9333, I get a twisted error complaining about authentication, but when I try to connect to port myhostname/IP (stratum+tcp??) port 9333 it looks like the miner is trying to connect and get work, but after several seconds p2pool reports a "handshake timeout" for the miner IP address.
This is the error I get:
2015-02-25 18:05:35.107254 Got peer connection from: IPv4Address(TCP, '192.168.0.21', 45024)
2015-02-25 18:05:45.108525 Handshake timed out, disconnecting from 192.168.0.21:45024
2015-02-25 18:05:45.109817 Peer connection lost: ('192.168.0.21', 45024) [Failure instance: Traceback (failure with no frames): <class  twisted.internet.error.ConnectionAborted'>: Connection was aborted locally, using.
2015-02-25 18:05:45.110143

What am I doing wrong?

Can you post any errors exactly how it looks on your computer? Also, stratum+tcp is generally going to be more reliable.

Hey thanks for the response.  I chewed through things a little bit further and discovered that I needed to set the miner to port 9993.  But now it looks like my connection to the miner is getting dropped.

2015-02-25 18:05:35.107254 Got peer connection from: IPv4Address(TCP, '192.168.0.21', 45024)                            2015-02-25 18:05:45.108525 Handshake timed out, disconnecting from 192.168.0.21:45024
2015-02-25 18:05:45.109817 Peer connection lost: ('192.168.0.21', 45024) [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.Connecti
onAborted'>: Connection was aborted locally, using.
2015-02-25 18:05:45.110143 ]

Thanks for the help everyone! Got the p2pool server running last night.  Ended up recompiling a clean cloned Git of p2pool from foresttv (instead of the one on Bitmain), connected all miners to port 9332, and Voila!  One happy p2pool node!!

The p2pool node communicates on more than one port. By default, miners connect to the node on port 9332 and other p2pool nodes ("peers") connect on port 9333.
So just switch your miner to port 9332, that should fix your issue.


text:
Why I haven't received my transfer from BTCGuild?

Possible Duplicate:
How long does it take to receive bitcoins?

At BTCGuild site it shows on Payout History:
2012-01-26 19:01:06 1BiNp9GmFJv1VuoudsJy8Ke79qvh6BPDzp  0.20000000
2012-01-22 07:29:27 1BiNp9GmFJv1VuoudsJy8Ke79qvh6BPDzp  0.11390889
2012-01-20 01:36:25 1BiNp9GmFJv1VuoudsJy8Ke79qvh6BPDzp  0.23492573
But in Bitcoin software, I haven't received the first (0.20000000) payout.
Only the second and the third were received.
Why have I got this problem?

According to the Blockexplorer, you should see all of those transactions when you reach block 163971. Your client probably needs to finish synchronising with the network, as the first transaction is the newest one. If you see the second transaction, then you still have about 7 days at most to synchronise. Just leave your client on for a couple hours and you should see your last 0.2 Bitcoins arrive.


text:
Bitcoin transaction anonymity

Possible Duplicate:
How do I see the IP address of a bitcoin transaction?

When making a bitcoin transaction from or into a wallet that is on my computer, can my Ip address (and thus identity) be found out by the other part of the transaction or a 3rd party?

http://bitcoin.stackexchange.com/a/231/196

Making a transaction
When you make a new transaction sending Bitcoins, you broadcast the transaction to the peers you're connected to, then they send it on to their peers, etc.  There's no way for anyone to know for sure whether you created a transaction they get from you, or whether you're just relaying a transaction you received from someone else.
If I was able to connect to all the peers in the network then it's likely that the first one to send me a transaction is the one who created the transaction, but that's not certain, and it's also not possible to connect to all the peers.
Receiving a transaction
When someone sends Bitcoins to your address, your client isn't involved at all.  You don't even need to have your computer turned on to receive Bitcoins at your address.  So there's no way anyone can find your IP address when you receive Bitcoins.


text:
Is mining something specific of Bitcoin?
I am very new to the world of cryptocurrencies (I first read deeply about them today) and I've just discovered the concept of mining. Everything that I've read so far applies to Bitcoin but I know that there are a lot of different cryptocurrencies. So I was wondering if mining also exists for other currencies.
Is mining something specific of bitcoin or is it possible to mine different cryptocurrencies? If so, is the process different than the one used to mine bitcoins?

A lot of the competing cryptocurrencies are based on the bitcoin design and also use the mining concept. I do not know if any of them have succeeded in eliminating the mining concept.

@kasperd Ones that use distributed agreement protocols rather than proof of work have no mining.

@DavidSchwartz I don't know any cryptocurrency based on an agreement protocol. Could you mention the name of one?

@kasperd XRP, Stellars.

@DavidSchwartz I understand that you are affiliated with those. Based on my initial reading of those links it sound like that is a very relevant cryptocurrency to mention in an answer to the question. Unlike all of the copycats, that one does appear to offer something new which isn't offered by bitcoin. Given how relevant it appears to be to this question, I think you could write an answer covering that cryptocurrency without being in violation with http://bitcoin.stackexchange.com/help/promotion

Cryptocurrencies fall into three broad categories:
1) Centralized/counterparty cryptocurrencies are classic cryptocurrencies that are run by some kind of central authority. These can use the same methods that traditional banking ledgers use and aren't particularly interesting technically.
2) Public ledger cryptocurrencies that use proof of work to solve the double spend problem without a central authority. These cryptocurrencies have to incentivize people to provide the proof of work they need to remain secure and typically use mining to do it. Bitcoin was the first currency of this type.
3) Distributed agreement cryptocurrencies that use consensus protocols to solve the double spend problem without a central authority. These cryptocurrencies don't require large amounts of computation to secure their transactions and generally don't use mining. XRP was the first currency of this type.

Earlier cryptocurrency systems (which predated Botcoin) relied on a central clearinghouse to prevent fraudulent transactions, such as double-spending.  One of the objectives of Bitcoin was decentralization.  To prevent double-spending without a central clearninghouse, blocks of transactions need to be mined.  The process of mining requires a significant amount of computational effort to be expended by the miner.  Other nodes on the network will not recognize a mined block of transactions without this proof of work.


text:
Should I be running Bitcoin Core or Bitcoin-XT?
I just read about Bitcoin Core and Bitcoin-XT, and I want to know what is the difference between Bitcoin Core and Bitcoin-XT?
And which is better Bitcoin Core or Bitcoin-XT?

The two pieces of software, Bitcoin Core and Bitcoin-XT, are very similar. Bitcoin-XT is actually just a fork of Bitcoin Core with some features added that Bitcoin Core developers didn't deem appropriate, such as a larger block size (BIP 101) and relaying of double spends.
Bitcoin Core is more up-to-date with all of the work that the community doing. Additionally, Bitcoin-XT now has a different consensus protocol regarding the maximum size of blocks. There has been much debate within the bitcoin community about if/how/when to increase the artificially imposed block size limit (of 1 MB), and one attempt to resolve this debate is being done through Bitcoin-XT.
The Bitcoin-XT README.md has these notes on how it is different than Bitcoin Core:

Support for larger blocks. XT has support for BIP 101 by Gavin Andresen, which schedules an increase from the one megabyte limit Bitcoin is now hitting.

Relaying of double spends. Bitcoin Core will simply drop unconfirmed transactions that double spend other unconfirmed transactions, forcing merchants who want to know about them to connect to thousands of nodes in the hope of spotting them. This is unreliable, wastes resources and isn't feasible on mobile devices. Bitcoin XT incorporates work by Tom Harding and Gavin Andresen that relays the first observed double spend of a transaction. Additionally, it will highlight it in red in the user interface. Other wallets also have the opportunity to use the new information to alert the user that there is a fraud attempt against them.

Support for querying the UTXO set given an outpoint. This is useful for apps that use partial transactions, such as the Lighthouse crowdfunding app. The feature allows a client to check that a partial SIGHASH_ANYONECANPAY transaction is correctly signed and by querying multiple nodes, build up some confidence that the output is not already spent.

DNS seed changes: bitseed.xf2.org is removed as it no longer works, and seeds from Addy Yeow and Mike Hearn are (re)added to increase seed diversity and redundancy.

So, if you support these changes and/or the possible future changes on the consensus-block-size-limit, run Bitcoin-XT. The releases are available here: https://github.com/bitcoinxt/bitcoinxt/releases

Seems that Satoshi Nakamoto - or someone claiming to be Satoshi - is in deeply disagreement with the XT fork http://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-August/010238.html

I highly doubt that email is from the real Satoshi Nakamoto. No PGP signature, and it honestly doesn't sound much like his other writings. Sounds more like a dump of the arguments others have already made. I think if Satoshi did give a response, it would include something more original.

yes that sad attempt at a fake rebuttal only validates the fork and explains the reason behind it - to get whole community participating in the decisions on bitcoin future, not 3 devs.

Down-voters of a perfectly unbiased answer like this are users who would rather information like this be censored away from the public. To that down-voter, you are not fully grasping the most fundamental principle that Bitcoin is built upon: decentralization.

in my opinion Bitcoin is a protocol. if you create a protocol with different rules (such that it accepts different block sizes) then you're using a slightly different version of the protocol and therefore are not really using Bitcoin. it's like saying, "if you want to see my website correctly you have to download this slightly different web-browser that renders JSON instead of HTML". sure you can do that, but you're not really using the web then. you're using another web that renders JSON instead of HTML.

@LucaMatteis, it's fine to take that point of view, but it's all besides the point, with respect to my previous comment. Just because you personally don't support a 'Bitcoin' that has larger block sizes doesn't mean this information shouldn't be available to those that do.

@LucaMatteis web-browser does not render JSON ane even HTML. They just can parse them ;)

Core. Bram Cohen has a good writeup on medium

The upcoming ‘crisis’ which is being used as a justification for a
  hard fork is something which it’s easy to convince people who aren’t
  very familiar with the technology will be a disaster. There’s a hard
  limit on the rate which transactions can happen, about five per
  second, and the transaction rate in bitcoin has been approaching that
  over time. We’re going to hit a wall! The sky is falling!
So what happens when that limit is reached?
Transaction fees go up.
Literally, that’s all that happens. That’s the big ‘crisis’. What’s
  being claimed is: Transaction fees might go above two cents! The sky
  is falling! I am not exaggerating.

and

Raising the block size limit is the idea of Gavin Andresen, former
  Bitcoin lead developer, who initially went around to core developers
  and players in the Bitcoin ecosystem trying to convince them that it
  should be done. The core developers had reactions ranging from neutral
  to vitriolically against it. Rather than accept this strongly negative
  reaction as a sign that his idea is a bad one, or attempting to work
  on some kind of compromise proposal, Gavin’s now blaming the arguing
  on a lack of benevolent dictator or clear voting process. There are
  several obvious problems with this. In projects which have a real
  Benevolent Dictator For Life, that person was the one who created the
  project. Gavin didn’t invent Bitcoin. He isn’t even a Bitcoin
  developer any more. He resigned his position as lead developer a year
  ago, and has been largely inactive since. Using a voting process, or
  even a system of rough consensus among core developers would cause his
  proposal to be quickly rejected. It’s only the exertion of outside
  political force which has forced it to be taken seriously.

This is a political statement which doesn't answer the question.

But I'll bite. What's more central to the value proposition of bitcoin? An artificial consensus limit of 1 MB that pretty much everyone agrees will need to be removed eventually, or bitcoin as a low-cost payment rails? Fees will go up, sure, but the fact that that happens means that other transactions with lower fees are being pushed out. This means that if we leave the 1 MB limit in place, then for many users, bitcoin simply won't work, or will be too expensive. Such a scenario is not good for bitcoin adoption.

@StephenM347 I disagree - this is kind of a "vi or emacs" question where neither is objectively better. I agree with the other points.

Gavin is not a problem, miner's greed is a real problem. If XT will erase miners ability to ask more comissions and keep block size limit enough then I will support XT

We are talking about the difference between USD $0.02 and USD $0.08. That is all.  In the end of May and again this past Monday, stress tests were performed.  Even at the peak, if you paid a whole dime in transaction fees, you were getting your transaction in the next block.  The backlog of transactions cleared reasonably quickly.  Bitcoin offers extremely inexpensive transactions.  It doesn't promise free and fast.

first look for fees at the end of 2016 if block size limit don't change then you might be interested in how many transactions per day were at the last bubble. question you should ask yourself is - how many transactions per second Bitcoin should offer at the end of 2016?

"Transaction fees go up." but that is all the problem I am trying to avoid when supporting Bitcoin TX. If miners want transaction fees to rise, its simple: don't include cheap transactions. It should not have to have anything to do with the block size limit.

are we really talking about $0.02 to $0.08 increase?

@user568021 Not necessarily. If everyone sends transactions at the same rate as before, even if the cost goes up a little bit, the cost will have to go way up. The fee will have to go up enough that enough people quit sending transactions to keep the block size at 1MB.

@Jonathan: No, we are not only talking about the fees rising, ultimately we are talking about making transactions prohibitively expensive to push the less important off the network due to limited throughput.


text:
Problem while trying to set up bitcoinj
I'm fairly new to programming and have only built some basic java applications, so bear with me. I'm trying to run the basic wallet application from the bitcoinj repository (using intellij and maven). I cloned the git repository, imported the filles as a Intellij project and added the dependecy to the pom file, but I still get these errors: https://i.sstatic.net/EWHWh.png.
I tried everything I could imagine and can't fix it. If someone could help me I would appreciate it.
Thanks.

Hi Jodyra, welcome to the Bitcoin Stack Exchange. If you haven't already, check out the Tour and the Help Center. While your question relates to a Bitcoin project, it seems to be more of an IntelliJ/maven question. Hopefully someone will be able to help you (I am not), but you may want to start with IntelliJ tutorials.


text:
Antminer U3 not detecting in cgminer nor bfgminer?
I am using windows 7. I have installed the driver successfully by zadig.
In cgminer when I open the .bat file, it just doesn't open and gets closed immediately.
When I open in bfgminer it says no device connected.
Command:
cgminer.exe -o xxx -u abc.worker -p x

From BFGMiner's README.ASIC file:

The U3 does not support autodetection, so you will want to use
  --scan-serial to manually probe it. For example, to scan all devices, you can use:
-S antminer:all --set antminer:chip=BM1382
Additionally, for optimal performance you will need to set voltage,
  clock, and timing. Voltage format for the U3 is not documented by the
  manufacturer, thus must be provided as hexadecimal configuration
  codes. Timing is provided in the number of nanoseconds each hash takes
  at the given configuration. A known-working configuration is:
--set antminer:voltage=x800 --set antminer:clock=237.5
  --set antminer:timing=0.022421


text:
Buying big amounts of Bitcoin for cash in person
Presumably, I want to buy Bitcoin in person somewhere in Europe. I need very big amounts, say, 1K BTC, and I am willing to pay in cash (EUR).
When I find potential sellers online or through friends, I ask them to prove they have access to these amounts of BTC by sending me 1 satoshi from their accounts or by giving me some other proof. However, they all say that they don't just want to show their BTC accounts as it's unsafe and ask for a video of my cash, which I don't want to provide first to anyone.
How should I approach it? How are these trades usually done?

sounds dangerous. You could ask them to sign a message with their private key so that you can proove wheather they have the control of an address, so that they don't need to send you satoshis ( https://bitcoin.stackexchange.com/questions/3898/how-does-sign-message-work ) If they want to offer you 1k bitcoins, then they should send those 1k to a few addresses and proove that they are the owner. Everything else is dangerous for you. Don't let them scam you.

You may want to read Joseph Wang's Back to paper and gold.

For large purchases, you should look at OTC (Over The Counter) Bitcoin markets. Also known as "dark pools".

If a bitcoin address is the recipient of 1000 BTC (it is a utxo), and you send 0.00000001 BTC to someone, the transaction reveals the amount of bitcoin on that address, that address, the public key, and the remainder is sent back to the sender on a new address as change (minus transaction fees), a new address which has not revealed even its public keys yet, so no risk.
Many wallets will pick the smallest utxo to send from so if the wallet has received two transactions one for 1000 BTC, and one for 1 BTC and the wallet owner sends you 0.00000001 BTC then probably you will not be able to verify that they, in fact, have the 1000 BTC that they claim as the smaller utxo would be used.
https://localbitcoins.com/ is the website I was thinking of on which may people directly trade Bitcoin.
As others have said, you need to make sure that the BTC transaction is well confirmed before considering it final.
You might also consider using an escrow service.

Try using www.LocalBitcoins.com. They have designed the website to facilitate cash transactions via an escrow service. You can also see people buying and selling Bitcoin using cash, based on their location, in which you can filter those nearby. I would recommend doing a couple of bank transfers exchanges on the site first so you get a feel for the escrow service and you can also build up a little reputaion to build trust.

This is not only dangerous for you, but also for the people creating a transaction  with you. There is money laundering rules everywhere, and people would have to explain, where the huge amounts came from. Governments are chasing tax issues, and investigation services look for frauds of all kinds.
And then there were too many stories of African princes...
So, if the money is legal (clean source), you can easily go via exchanges. We as a community certainly won’t help in illegal activities. If it is not, then there is a major risk, that is not worthwhile to be taken.  Scams are all around the corner, and prosecutors as well. Bitcoin is maybe secure what concerns transactions, but anonymity an der privacy is not given per se.
Oh, for a little amount of 3-5% I might get interested helping to achieve your goals :-)
Did I just say that?

Buying that amount in person by cash is totally dangerous, you should buy that amount as parts.
if you are buying that amount online, if the seller is really a "bitconer" and he should know how to deal with multi-signature transactions.

Multisignature (multisig) refers to requiring more than one key to
  authorize a Bitcoin transaction. It is generally used to divide up
  responsibility for possession of bitcoins.
Standard transactions on the Bitcoin network could be called
  “single-signature transactions,” because transfers require only one
  signature — from the owner of the private key associated with the
  Bitcoin address. However, the Bitcoin network supports much more
  complicated transactions that require the signatures of multiple
  people before the funds can be transferred. These are often referred
  to as M-of-N transactions. The idea is that Bitcoins become
  “encumbered” by providing addresses of multiple parties, thus
  requiring cooperation of those parties in order to do anything with
  them. These parties can be people, institutions or programmed scripts.

Anyway, the skimmers around are much more than the real sellers, so you can't trust anyone. if you found someone, start by buying low amount and then you both high up the amount.
One more thing, You should wait the transaction to get at least 3 confirmations. Read more about Irreversible Transactions


text:
How do websites get prices for a coin?
There are websites with historical data of coins. How do they get it?
Do they get the price from 10 exchanges at the same time, then divide by 10?

Every website may have a different way of aggregating this data. The method you mentioned would work as long as none of the exchanges report bad data.

@chytrik do you know where I can find the different ways that websites do it?
I imagine some check the set of prices for outliers before averaging, and some may even give weight to some exchanges more, right?
Thanks for answering

if I were you I would start by checking out some websites that provide a service like this, and see if they publish any info on their specific algorithms. There is no "right or wrong way" to do something like that, your method will likely need to be determined by your specific needs/application.

@chytrik alright, if you write up what we discussed, I will mark it as the accepted answer

Every website may have a different way of aggregating this sort of data. I would expect that the exact method used by each website will be determined by their specific needs/applications. There is no absolute "right or wrong way" to get this job done. For example:

A simple implementation someone makes for fun might just display the average of two different API calls
A firm like the CME will pull data from only the most legitimate sources, with external considerations to ensure the price data cannot be manipulated to game futures trades on their exchange

To find more info on some actual implementations, I would suggest looking up some websites that display data in the way you're looking for, and see if they provide any info on the algorithms/methods used. I would guess at least a few sites make that info public.


text:
Is the BTC-e shutdown legal?
The FinCen, dependent of the Deparment of Treasury shut down the BTC-e exchange and prosecuted for:

Violation of anti-money laundering (AML) laws;
Acts of money laundering such as the MtGox scandal related with BTC-e
Requirements to register the exchange with the FinCen

As we know, BTC-e is based in Russia and has no legal obligation with the United States, as far I know and researched about the topic. In the statement previously cited, said:

Regardless of its ownership or location, the company was required to comply with U.S. AML laws and regulations as a foreign-located MSB including AML program, MSB registration, suspicious activity reporting, and recordkeeping requirements.

So, in short: Is it legal that the US law enforcement close a Russian exchange?

Does not matter if it's legal. Important is that it's possible. Interesting is who will collect 110M$ fine


text:
Does this FinCEN Document mean the Bitcoin Network is a bank?
Read this document and see if you think they are talking about Bitcoin.
Here's an excerpt..

Any individual or group of people engaged in conducting, controlling, directing or owning an informal value transfer system in the United States is operating as a financial institution. Therefore, IVTS operators must comply with all Bank Secrecy Act (BSA) requirements, which include establishment of an anti-money laundering (AML) program, registration with the Financial Crimes Enforcement Network (FinCEN) as a money services business, and compliance with the record keeping and reporting requirements, which include filing suspicious activity reports (SARs).

I found it here: http://www.fincen.gov/news_room/rp/advisory/pdf/advis33.pdf

This is a question for a lawyer, not an Internet q&a site.

The date on that document (2003) would indicate that they did not specifically have Bitcoin in mind when that was written. However, there have been other electronic currencies in the past such as E-gold. Naturally the goal of policy writers is to cover the general case so the same document can apply to later adaptations of similar ideas.

@NateEldredge I think it is only necessary to refer people to lawyers when they are trying to figure out legalities directly concerning their own endeavors. On the other hand, this one sounds as if the person is just curious.

As the document predates Bitcoin, it does not specifically address the Bitcoin network. While the document may apply according to the phrasing, I am not sure whether the Bitcoin network as such is a legal entity as it does not have any formal structure. I would assume that only participants in the Bitcoin network could be addressed by law, i.e. "a company", "an organization" or "a user", much like laws could be passed concerning "anyone spending more than $100 in cash in one transaction", but not "the group of people that get out of bed with their left foot first".
Concerning participants in the Bitcoin network though, according to CoinDesk Bitcoin miners and investors are not money transmitters. Specifically, CoinDesk quotes there

“The first ruling states that, to the extent a user creates or “mines” a convertible virtual currency solely for a user’s own purposes, the user is not a money transmitter under the BSA. The second states that a company purchasing and selling convertible virtual currency as an investment exclusively for the company’s benefit is not a money transmitter,” the release states.

So, as far as I understand, regular users, miners, and investing companies neither have to register, nor implement the measures listed in the question, while I'd assume that online wallet services and Bitcoin exchanges have to do so.
IANAL, this is not legal advise.


text:
Why do most trading platforms require ID Verification?
The vast majority of the Bitcoin trading platforms both in the US and the UK require some sort of ID verification in order to make Deposits/Withdrawals.
Is this because of these two countries current legislation? does this obey to some sort of policy?
Thanks.

In the US, these are called "Know your Customer", and "Anti Money Laundering" (KYC/AML) laws and is enforced by FINCEN (financial crimes enforcement network) in the US for any businesses that qualifies as a "Money Service Business" or "Money Transmitter".
This guidance published on March 2013, http://fincen.gov/statutes_regs/guidance/html/FIN-2013-G001.html , makes it clear that Bitcoin exchanges must comply with existing regulation for KYC/AML.

It also protects the exchange against all kinds of scams. It directly protects against a single entity controlling a large number of accounts and using them to perform wash trades or create false volume. And it indirectly protects against fraud because customers know that they exchange can come after them legally if they're not anonymous.

https://www.irs.gov/businesses/international-businesses/list-of-approved-kyc-rules
These are the KYC rules for each country. Do not let places take advantage of you. I had one trader ask for a phone call verification from a country where that wasn't even the required law according to their KYC. So, work out your limits and what you feel comfortable with doing as a buyer and stick to it. You will find many traders that operate properly with you according to your personal privacy requirements.

KYC and AML are required if the entity is moving money from A to B. Those entities are referred to as MSB (Money Services Business). However crypto exchanges are are not truly MSB's but they still do KYC and AML. See this insightful article: https://hackernoon.com/bitcoin-is-not-money-if-you-seek-compliance-you-are-asking-for-trouble-cbe9107e5298?source=linkShare-ea6a485c6847-1499320847


text:
Which blk*.dat file contains a particular block?
Is there a way to find out which blk*.dat file contains a particular block?
For example, it would be useful to know which *.dat file contains block 478558, which is the point where BCH forked from BTC. As both share all the prior blocks, when running the forked node, it would save a lot of bandwith to just copy the block files from BTC to the BCH data directory and reindex them (with the -reindex option), rather than having to re-download them all over again.

Is there a way to find out which blk*.dat file contains a particular block?

We can't tell you which of your *.dat files contains block 478558 because there is no requirement that different nodes store their data in the same way.
Two installations of the same software (e.g. Bitcoin core) could have different blocks in a blk*.dat file of the same name. In fact this is probable.
See Is every copy of the Blockchain the same?
So the only way for you to find out is to parse the indexes or search every file until you find the block. I imagine you could probably make an estimate of which file is most likely based on current blockchain height + sought block and start your search in files near your best guess.


text:
Receiving `error: {"code":-25,"message":""}` on sendrawtransaction with v0.9.3
I'm running a bitcoind regtest node. When trying to relay a transaction (created using bitcoin-ruby) I receive
error: {"code":-25,"message":""}
When I restart the node and relay the exact same transaction it relays fine. This behavior is consistent and reproduces every time.
My output for decoderawtransaction is:
{
    "txid" : "df91267ed650795245882bc91b8dc104e6c41d2f29ed3221f29151aa60554842",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "fab40dbf6b95ef2fe5f4aca0668a84edebdf70cfb80565626be80c7af20a525e",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "0 3046022100fb2a69546ea44db3a06cfcf120d1fda135bfde0946f2186a52d8cfee83835705022100c680cc5135174425ce5137a2996fbdcd55463c4acb88bb9fdbdb03f70f0a213b01 30460221008294d1779bfb21240859feccc96104dea574541d41163d2c849846d8e44496fe022100faf00dabba65f22469a1116ea10d5ce34f90bea779ba770ae1ac3af5c432379e01 52210261318d096a7addf67d935076c28dfa4a1c0e8f2ed04a7cb47ac53bd7fe2ebe6d210397866513a1796e75aae6a53d54d0ccc904c56fa12e14ab0ee989a6eed6e29c0352ae",
                "hex" : "00493046022100fb2a69546ea44db3a06cfcf120d1fda135bfde0946f2186a52d8cfee83835705022100c680cc5135174425ce5137a2996fbdcd55463c4acb88bb9fdbdb03f70f0a213b014930460221008294d1779bfb21240859feccc96104dea574541d41163d2c849846d8e44496fe022100faf00dabba65f22469a1116ea10d5ce34f90bea779ba770ae1ac3af5c432379e014c4752210261318d096a7addf67d935076c28dfa4a1c0e8f2ed04a7cb47ac53bd7fe2ebe6d210397866513a1796e75aae6a53d54d0ccc904c56fa12e14ab0ee989a6eed6e29c0352ae"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 1.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 ee7455fa97980531b90b15f5f18386122a7f6919 OP_EQUAL",
                "hex" : "a914ee7455fa97980531b90b15f5f18386122a7f691987",
                "reqSigs" : 1,
                "type" : "scripthash",
                "addresses" : [
                    "2NEz4B6YtgTCpv6Qv56f7HarXUeHeLmdmih"
                ]
            }
        },
        {
            "value" : 0.99990000,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 0b607311f3db7d2a28b4c6fd259913356a86c302 OP_EQUAL",
                "hex" : "a9140b607311f3db7d2a28b4c6fd259913356a86c30287",
                "reqSigs" : 1,
                "type" : "scripthash",
                "addresses" : [
                    "2MtHNxpeYfFmLTMDnW7DFf9y9ZnM49u4tXW"
                ]
            }
        }
    ]
}

The referenced txout has 2 BTC. I also tried sendrawtransaction <hex>, true to try and rule out some fee problems. Same symptom.
I didn't see any special debug message in debug.log
My output for getinfo is:
{
    "version" : 90300,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 530.90534322,
    "blocks" : 460,
    "timeoffset" : 0,
    "connections" : 1,
    "proxy" : "",
    "difficulty" : 0.00000000,
    "testnet" : false,
    "keypoololdest" : 1421187525,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}

I'm still trying to plug v0.10 into my environment for debugging, I understand bitcoin-core has better messages for code -25, but I still need this to play nice with a v0.9 node.

relevant: http://bitcoin.stackexchange.com/questions/34203/error-25-when-bitcoind-sendrawtransaction

Thanks, I already took a look at this. I tried mining before the relay, to flush the mempool but the same thing happens, error unless I restart the node after which it works (this rules out double spend)

Mining the memory pool doesn't rule out double spend: if there was a conflicting tx in the memory pool, mining it puts that conflicting tx on the block chain---so your transaction is still a conflict. Can you use getrawmempool to verify there isn't a conflicting tx in the mempool and getblock to verify there isn't a conflicting tx in the blocks you mined?  Also, gettxout to ensure the input you're trying to spend exists.

Thanks @David, I checked getrawmempool and getblock for conflicting tx and found none. I agree mining doesn't rule out double spend, but being able to relay the tx and mine it after mining a block and a node restart does.
When I do gettxout I get strange behavior. I constructed the tx to use input 1 of a tx. I see a txout for gettxout <hash> 0 true but not for gettxout <hash> 1 true. When I restart bitcoind I see both outpoints 0 and 1.

Also, this only happens with bitcoind, if I relay through a non-bitcoind node connected to my bitcoind node, it relays just fine and gets included in block.

Besides testing with 0.10.0 and maybe also regular testnet, I can't think of anything else for you to try.  If you can reproduce the problem on 0.10.0, it may be time to report the issue.

After connecting to bitcoin-core (0.10.0rc3) I received:
ERROR: CScriptCheck() : 620186f101b7db97393af8747923db4cf3f30c3c3c48f4c7cfc23567b6d9ca07:0 VerifySignature failed: Data push larger than necessary
ERROR: AcceptToMemoryPool: : ConnectInputs failed 620186f101b7db97393af8747923db4cf3f30c3c3c48f4c7cfc23567b6d9ca07

(Thanks bitcoin devs for adding sane error messages!)
From here I noticed I was building the transaction with an outdated fork of bitcoin-ruby, updating to the latest bitcoin-ruby fixed this issue (On both 0.9.03 and 0.10.0). Still not sure why it would only relay after a bitcoind restart, will edit this answer if I figure this out.


text:
Bitcoin is not connected in regtest mode
I am having trouble using regtest mode on Linux.  Using pre-compiled version 0.9.2.1 for linux and starting regtest mode as instructed on bitcoin.org:
<bitcoin-ver>-linux/bin/64>> ./bitcoind -regtest -daemon

The server starts but doing a getinfo returns 'connections' : 0.  Tried experimenting with various rpc* settings in the .conf file.  What exactly do I need to set in order to use regtest mode?  Do I need to add real nodes via addnode for regtest?  It doesn't seem like I should need to.  I was able to get a few connections by adding several real nodes one time but after a few minutes 'connections' dropped back to 0.  Let me know if any additional info would help.

You need to run more than one node on your machine (you can do that if you give each node a different -port and -rpcport). And you need to tell them how to find each other (using -connect=127.0.0.1:portnumber).
There are examples written in bash and python in the Bitcoin Core source tree:
  https://github.com/bitcoin/bitcoin/tree/master/test/functional

Thanks I will look at the examples.  Is regtest appropriate for developing mining systems or should I use testnet for that?

Although I believe Fred Tingey's answer is complete, it has the following attributes:

it depends on a config file.
it provides examples for bitcoin-qt on the windows platform, and the OP was asking about bitcoind on the linux platform.

Thus, I wanted to share the following concise bash script which does what the OP wants. As others have partially noted the key to getting this to work is:

specify a unique port (if listening) and rpcport (if using rpc) for each node
specify a unique data directory for each node
if using -connect to restrict to own nodes, remember to use -listen to accept connections from own nodes.

That said, here's my start-regtest-network.sh script:
#!/bin/bash
bitcoind -server -listen -port=17591 -rpcuser=bitcoinrpc -rpcpassword=P$SECONDS -rpcport=16591 -datadir=$HOME/regtest/A/ -connect=localhost:17592 -regtest -pid=$HOME/regtest/A/.pid -daemon -debug
bitcoind -server -listen -port=17592 -rpcuser=bitcoinrpc -rpcpassword=P$SECONDS -rpcport=16592 -datadir=$HOME/regtest/B/ -connect=localhost:17593 -regtest -pid=$HOME/regtest/B/.pid -daemon -debug
bitcoind -server -listen -port=17593 -rpcuser=bitcoinrpc -rpcpassword=P$SECONDS -rpcport=16593 -datadir=$HOME/regtest/C/ -connect=localhost:17594 -regtest -pid=$HOME/regtest/C/.pid -daemon -debug
bitcoind -server -listen -port=17594 -rpcuser=bitcoinrpc -rpcpassword=P$SECONDS -rpcport=16594 -datadir=$HOME/regtest/D/ -connect=localhost:17595 -regtest -pid=$HOME/regtest/D/.pid -daemon -debug
bitcoind -server -listen -port=17595 -rpcuser=bitcoinrpc -rpcpassword=P$SECONDS -rpcport=16595 -datadir=$HOME/regtest/E/ -connect=localhost:17591 -regtest -pid=$HOME/regtest/E/.pid -daemon -debug

Additionally, here's my stop-regtest-network.sh:
#!/bin/bash
sudo killall --regex bitcoin.*

I realize my stop script is sloppy, and will kill all bitcoin processes.. if you're so inclined you could modify this to pull the individual pids out of each data directory.
Lastly, You will probably need to precreate some data directors for bitcoind if you don't edit the script at all.
mkdir $HOME/regtest/A/
mkdir $HOME/regtest/B/
mkdir $HOME/regtest/C/
mkdir $HOME/regtest/D/
mkdir $HOME/regtest/E/

You should have regtest bitcoind nodes connecting round-robin on ports 17591, 17592, 17593, 17594 and 17595. Likewise, you should be able to connect to rpc ports 16591, 16592, 16593, 16594 and 16595. If you need to know the RPC password you can check ps aux, or set an explicit rpcpassword in the script.
HTH

Nice. I'm getting an error  ../.pid directory or file does not exist. is pid mandatory ?

In order to run multiple nodes in regtest mode on a single machine you will need to sandbox each node.
In this example I have three nodes, they are named Alice, Bob and Cory. Since Bitcoin is a Peer/Mesh network, my goal is to connect each nodes so that changes made to Cory are ultimately visible to Bob (without necessarily requiring a direct connection between the two.)
Step 1: Create folders for each node.
These folders will contain our data and configs for each node. The names are not important, they can be renamed later, so you can name them "Alice", "Bob" and "Cory" for now. Remember where you create them, you will need their paths for Step 3 below.
Step 2: In each folder, create a bitcoin.conf file
In the config files Alice will be configured to connect to Cory, and Bob will be configured to connect to Alice. In addition to configuring outbound connections, this is also where we specify regtest=1 and server=1 settings.
bitcoin.conf for Alice
regtest=1
server=1
 # Alice connects to Cory
connect=localhost:18333

bitcoin.conf for Bob
regtest=1
server=1
 # Bob connects to Alice
connect=localhost:18444

bitcoin.conf for Cory
regtest=1
server=1
 # Cory connects to nobody

Step 3: Start each node.
Note each node must have a different port number since only one node can bind to a port number at any time.

Alice on port 18444
Bob on port 18555
Cory on port 18333

You can choose your own port numbers of course, just be careful not to use a port number that is already in use by something else.
The command-line options will tell bitcoin what port number to use, where to store data, and where to find its config file:
Alice:
 "C:\Program Files\Bitcoin\bitcoin-qt.exe" -conf="C:\Alice\bitcoin.conf" -datadir="C:\Alice" -rpcport=18444
Bob:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -conf="C:\Bob\bitcoin.conf" -datadir="C:\Bob" -rpcport=18555
Cory:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -conf="C:\Cory\bitcoin.conf" -datadir="C:\Cory" -rpcport=18333
This will launch three instances of the Bitcoin Client, and the folders for each node will begin to initialize with regtest data.
Step 4: Testing
You can use the Help->Debug Window->Console option to interactively execute commands on any of the nodes. For example, you can mine 101 blocks with the following bitcoin console command:
setgenerate true 101
You should (after a few seconds) then have been awarded coins.
These mining activities result in coinbase transactions - and only the last one of 50 BTC is available to spend. Now you can send some BTC to one of the other nodes.  After a bit more mining such a transaction will be confirmed.
You can also use the console commands getpeerinfo and getinfo to check the network is set up correctly.  One of them (Cory with port=18333) should have 'sync=true' in its peerinfo output, and all nodes should have the same "block height" regardless of which node is used for mining.

I would like to make an addition to above answers.
Instead of -connect=ip the correct option to use is -addnode=ip. -connect lets a node connect only to one node and whereas '-addnode' attempts at connecting to the specified list of nodes(ip) among other nodes.

i vaguely recall reading that --addnode will also allow discovery and use of nodes from peers? (whereas --connect will restrict to only the specified node.) if this is true it might be worth updating your answer, it would be good for readers to know

authors: محمد سالم لمباركي