text:
Bitcoin.conf & JSON-RPC options
What does it mean in the bitcoin.conf file when it states:
  server=1 tells Bitcoin-Qt to accept JSON-RPC commands?

If all one needs to do to solo mine is type setgenerate true in the console, then what is at stake with accepting JSON-RPC commands?  Does this allow other software to interact with Bitcoin-Qt, or something akin to that?  Can someone explain?

@George This post is only designed to confirm solo mining protocol with bitcoin-qt.  I concur with your sentiments, but feel it is important to master basic concepts, however inefficient those methods might be ...  Regards, oemb1905

Update: After solo mining, I decided to mine share, which I did from 2014 - 2018 for 'pennies.'  I forgot about the shares and had a nice $2000 surprise this past Spring 2021.  Glad to see this post about fundamentals of solo mining and the JSON api has had so much viewership!

The JSON-RPC API can be used by other programs to communicate with the Bitcoin client.  That could include external mining programs, "e-commerce" software to automatically make and receive payments, or any other software that wants to interact with the Bitcoin network.
It is true that you do not need this feature simply to solo mine using setgenerate true.  However, you should be aware that setgenerate true enables an inefficient CPU miner which is obsolete technology and should be used for testing only.  It will cost you far more in electricity than you can ever expect to earn in mining revenue, and with very high probability you will never successfully mine a single block.  The current state of the art in mining is dedicated ASIC hardware.  Such hardware would normally be controlled by a separate piece of software, which would then communicate with the Bitcoin client over the RPC API.

Thanks, I am aware that ASIC is the current technology and that CPU mining is obsolete.  Just wanted to confirm this part of the bitcoin.conf file.  You mention that the hardware, an ASIC miner, would be controlled by software, e.g., rpgminer, and would communicate with bitcoin-qt using RPC API.  Does your answer suggest that I would keep Bitcoin-Qt running in th background while mining with rpgminer?

@oemb1905: Yes.  You could also use the headless client, bitcoind, if you didn't want the extra window on your desktop.

Can you direct me to the site to download bitcoind?  Thanks, and I will consider that for my set up.

@oemb1905: You get it from the same place you got bitcoin-qt.  Depending on what you downloaded, you may have already installed it together with bitcoin-qt.

I heard that they are bundled together now, so perhaps I did.  I will revisit the .org site.  Thanks again!

One reason you might use server=1 is when you're using a third-party mining program like cgminer.
Example bitcoin.conf:
server=1
rpcuser=SOMEUSER
rpcpassword=SOMEPASSWORD

Note: Don't set gen=1, because you don't want to use CPU mining. Instead, install cgminer and run:
cgminer -o http://127.0.0.1:8332 -u SOMEUSER -p SOMEPASSWORD

This is actually great - and still relevant for Litecoin mining I would imagine.

Yes. if you set server=1 in your bitcoin.conf file your wallet will run a server that listens for and accepts commands passed to it. These can be used to externally control the wallet. By default only requests from your local machine are accepted.  JSON is the formatting language the commands are issued in. JSON_RPC is a standardized way of issuing these commands using the json format.  When you run the client you can use the Console available from the help menu to run the same set of commands directly.  As people mentioned its been quite a while since its been practical to use the client as a miner.


text:
Does Bitcoin-Qt require that I create a bitcoin.conf file in order to solo mine on my Mac?
Does Bitcoin-Qt require that I create a bitcoin.conf file in order to solo mine on my Mac?  I created one after reading the wiki and placed it in Lib/AppSupp/Bitcoin but I am not sure I needed to.  Was I correct in creating this file?  If not, what application besides Bitcoin-Qt is it used for?

As the name suggests, bitcoin.conf is a configuration file to set various options of the bitcoin client.  Details of the file and available options can be found here.
The most commonly used option is to set the RPC username and password (see your other question).  If you only want to solo mine using setgenerate true (which, as I mentioned in my other answer is not recommended), the defaults should be fine and you don't need to put anything in bitcoin.conf.

Indeed, Mr. Eldredge, the wiki is where I got my template for the .conf file!  Your answer is unclear to me, however.  First you say that the most commonly used option is to "set the RPC username and password" and then you say the "defaults should be fine," however the defaults do not have the user and password activated.  Can you clarify?  (I should also mention that I did not state that I only intend to mine with setgenerate true. I do, however, want to know how to do so regardless of this impractibility.)

@oemb1905: Well, you only need to set the RPC username and password if you intend to use the RPC API with some external software.  Your other posts suggest that you don't plan to do that, in which case you do not need to set them.

Thanks for your help thus far and please answer future questions as well.  My questions are designed to clarify set-up facts and will not necessarily have anything to do with my preferred method of mining.  Again, much obliged.  Regards, oemb1905

So just to clarify, the nodes are who the RPC client connects to, so I use the trusted nodes wiki to establish who I want to enter in that field?  And the peers below that refers to the machine I have running the client, so I enter my local manually assigned IP address there?

source: Stack Exchange

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

sort: votes


text:
Bitcoin.conf connect command
When configuring the bitcoin.conf file, what should you put in connect=?  There are IP addresses listed here, so I removed the # sign and left them as is.  I also entered my WAN address and my local IP address with the forwarded port a separate time.  What should I enter and how will I know it is working correctly?

Where does one verify which nodes are trusted and which not?  Should I remove the # sign and enter my WAN and local IP, or should I leave the defaults?  Sorry, I realize that my intermediate command line and tcp/ip knowledge may make this question look ridiculous, but I just wanted to confirm.  Thanks, oemb1905.

That was helpful.  However, how come the defaults then are not listed on the trusted nodes wiki?  The default lists 69.164.218.197 and 10.0.0.2:8333 ... whose nodes are those?

So then I should replace that entry with one of the nodes listed on the page you referred me to?

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


text:
Bitcoin-Qt & setgenerate true
Will Bitcoin-qt mine bitcoins if all I have done is downloaded and installed Bitcoin-qt, and typed in "setgenerate true" into the console?  Are there other steps or configurations necessary?  If so, what are they?

There are no other steps or configurations necessary. You can type getmininginfo to verify the mining process is running. However, it is extremely unlikely that you will find a block using this method, because CPU mining for Bitcoin is far too slow for the current difficulty.

Thanks, I am aware of the difficulty already, just wanted to confirm the process.

Answered here.

@NateEldredge Would it be correct to assume that it is a duplicate then?

Hey Murch, No.  He happened to answer this question in his answer to a question about JSON.  That's because the questions were related, not because they were the same.


text:
Do mining pools centralize the Bitcoin network and make it less secure?
A mining pool with a significant percentage of the hash rate could allow double spend attacks by the pool manager. There are a number of pools that approach this level. However, most people say that a compromised pool would be easily detected, and the attack would be insignificant.
However, isn't this issue not about a single pool but the combined centralizing effect of pools? A moderate-sized attacker could easily compromise more than a few pool managers with a rubber hose attack, or pose as legit pools for a while until they obtain nearly complete control of the block chain.
The attacker would be able to double spend a lot of bitcoins (that it generated for itself with its pools in the first place), and regardless of any monetary advantage it could destabilize and destroy confidence in bitcoin. Easily within the capabilities and motivations of a government. A well-planned attack could happen far quicker than anyone could notice and pull their miners from the pools.

It's a good topic, I also made multiple posts about the issue on forum, but it has to be Q&A format for StackExchange.

I'm at a loss how this question is not in a question & answer format.  I asked a clear short question and then explained the context of that question.

because someone would have to write a small book to answer that, the question is just too big for Q&A.

Its better to separate the question from the answer.  But feel free to answer your own question.

I'm not attempting to answer my own question. I'm really asking it.  It seems like people don't think this is an issue, and I want to understand why it isn't.

@MrJoshua The question is poorly constructed.  It is a useful topic but the question could be cleaned up to meet SE standards.  You shouldn't attempt to answer your own question in the body of the question.  Instead of saying "pools do x" = answer.  It should be phrased openended like "Do pools x?", "Could an attacker compromise multiple pools?", "How quickly could a 51% attack be executed".  Openended questions lead to increased debate and better answers.  Providing your own answer in guise of question without supporting information is less effective.

As a belated explanation, now that I understand the confusion, it appears that everyone thought I was asking "Do mining pools centralize bitcoin?" But actually that seemed to me to be obviously true at the time so I only mentioned it to set the context of the actual question. Perhaps a better phrasing might have been "Given that pools centralize mining, do they make bitcoin less secure?"

The short answer to your question is "yes".
Efforts are underway to develop schemes that allow pooled mining without the pool manager being able to control what transactions go into the pool's blocks, leaving that decision (as well as which chain to extend, so long as it is reasonable) to the individual miners. All the pool really needs is proof that the miner is mining for the pool.

I voted up this answer, but it would help if you could site references.  I was under the impression that suggestions on doing this have been made, but that no one was actively working on it. (ostisably because no one feels this is a real threat, hence the original question so I could understand why people believe that.)

"Efforts are underway" - what about P2Pool? https://en.bitcoin.it/wiki/P2Pool

P2Pool is an example of one such effort.

Stratum V2 is another (current) example of such effort.

Large pools with a significant fraction of total hashing power do represent an increased risk to the security of the Bitcoin network.
Pools by themselves are not necessarily a risk as a peer to peer network doesn't necessarily need to consist of invidiual users.  A network of pools being the peers is also viable however the pools must be peers and there must be a sufficient number to make collusion between peers infeasible.  When one pool is 50x the size of average pool it has no peer. One could encourage miners to support smaller and medium sized pools thus restoring the "peer" nature of the network however that is likely a futile effort.  The problem is that large pools have an inherent advantage over smaller pools in the form of less reward variance which is a desirable attribute for miners.  Due to this advantage there will always be a tendency for hashing power to aggregate.
Realisticly we should accept that large even massive pools are an inevitability due to the high variance nature of Bitcoin hashing. However the risk of large pools stems from the fact that miners are "dumb". By miners I am referring to the software not the person.  Currently the pool server tells the miner what to hash and the miner blindly hashes it.  If the pool is compromised or malicious it can tell the miner to hash "bad data" such as a forked blockchain, or double spend transaction.  The current implementation of mining pools makes it impossible for a miner to ensure they are doing "good work" until after the fact.  This is an important element because large pools aren't inherently a risk.  What makes them a risk is the control they have over a large amount of hashing power.
Any reasonable mitigation must address that:

Large pools are inevitable.  Miners will seek out pools which minimize variance.
The pool server is the weak link in an otherwise robust network due to denial of service, corruption, or compromise.
The miner must be smart.  It must decide for itself what to include in the block to ensure only "good work" is done.

p2pool (peer-to-peer pool) is one solution to this issue without the unrealistic goal of simply having no pools or only "small" pools. p2pool could someday have >51% of the network hashing power and it wouldn't represent a risk to the network.  This is because each miner in the pool is working independently which makes subversion of the pool ineffective for the purposes of attacking the block chain.
How p2pool creates a network of "smart" miners.
p2pool creates a "share chain" where each miner submits shares to a parallel p2p network that records all the shares completed by the pool. Each miner independently includes transactions, sets up block headers, forwards other miner's transmissions for shares it hashes.  When a block is found the reward is split fairly because in generating each block header the miner looks at last x shares in the "share chain" and setups the coinbase transaction to split reward based on work over the last x shares.  IIRC x is currently set to roughly 1 day of work. So everytime a block is found each miner in the pool is rewarded equal to the % of shares accepted by the pool in the prior 24 hours.
https://github.com/forrestv/p2pool
https://bitcointalk.org/index.php?topic=18313
https://en.bitcoin.it/wiki/P2Pool

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


text:
How to retrieve all transactions from a public address?
I run a Bitcoin node with txindex=1 so I can retrieve any transaction from the txId.
My question: if I have any public address, how can I retrieve all transactions involving this address (inputs and outputs) with the Bitcoin Core commands ?

Something like this:
https://blockchain.info/fr/address/19HuaNprtc8MpG6bmiPoZigjaEu9xccxps

You can't. Bitcoin Core does not index transaction based on address.
If you want to do this, you'll either need an indexing tool/service, or implement the P2P protocol yourself to be notified of all transactions.


text:
I Restored My Phone Wallet and Now All My Coins Vanished
TL;DR:
After creating a backup, I added a pin to my "Langerhans" Dogecoin wallet for android. Now, the pin doesn't get accepted (or I forgot it). Finally, I used the "Restore Backup" function and got:

"You have successfully restored your wallet. Now determining the value of your wallet will take some time."
"Synchronizing with network, 6 weeks behind."

Did I lose my money? Do I have to wait six weeks to find out? I also have the backup on my computer, but it is in an "unrecognized format". How would I use it?

This question regards the "Langerhans" Dogecoin wallet for android phones, which is effectively the same style and configuration of wallet as the "Langerhans" Bitcoin wallet for Bitcoins. Both of these wallets are, of course, available for download through Google Play.
I had amassed a total of over 10-million Dogecoins into the android phone wallet (or about $1,500 USD) over the course of approximately one week. I did this by first purchasing Bitcoin from a Bitcoin ATM and then exchanging the Bitcoin for Dogecoin through the SHAPESHIFT.IO exchange system. These exchanges were conducted in the form of 15 separate transactions of equivalent $100 each per transaction.
I then backed up the wallet a final time through the wallet itself, which created an external backup file that is accessible not only through my Gmail account, but is also apparently accessible through the Bitcoin wallet on the phone itself. Then (unfortunately) following that final transaction, I created a so-called "Spending PIN," which would need to be entered any time I wanted to spend the coins.
Well, it seems I either forgot my Spending PIN, or something else went wrong with the system; because when I attempted to transfer the coins out of the wallet, the application indicated that I had used an "INVALID PIN."
No, I did not write down the PIN, which was numerical and eight (8) digits in length, but it was also a common combination of two separate 4-digit pins that I use all the time anyway; so I didn't think I would forget it. I did attempt several different combinations of any potential PIN numbers that I would have used, but nothing worked. (I also read another testimonial of this same exact thing happening with another user of the Langerhans android wallet, whereby he was certain that he didn't forget his PIN.)
In not being able to access the funds in the wallet, I then used the "RESTORE WALLET" function of the wallet itself, which required me to enter another password; but in that case, I did have the password written down. Apparently the process of restoring the wallet was successful at least in the sense that the system accepted my password entered into it.
HOWEVER, in the first place, the system offered a warning that any coins in the wallet would be lost following the restoration process UNLESS I had otherwise created a backup of those. The statement in this regard was very general, and in that sense it seemed vague. While I didn't fully understand why it would be telling me that I was going to lose coins if they were not backed up, since I was using the most recent backup file that I had created in the first place, I still assumed that because I had the backup file stored on my Gmail account it would allow me to recover the coins from the external file itself.
THEN, in the second place, it was after conducting the "RESTORE WALLET" function where a message appeared on the screen stating to the effect that -- "You have successfully restored your wallet. Now determining the value of your wallet will take some time."
Okay, so it didn't tell me HOW MUCH TIME that would take, but when I went into my phone wallet, it is showing a balance of ZERO coins. The other notation showing on the wallet is where it states the following: "Synchronizing with network, 6 weeks behind."
SIX WEEKS BEHIND? Good grief! What the hell does that mean? Does it mean that I can expect to be waiting for at least SIX (6) weeks before my coins miraculously appear back inside my wallet? Or is it more likely to mean that I have lost my ass on this whole thing?
Well, the only other thing I still have at this point is the actual externally saved so-called "BACKUP" file that was sent to my Gmail address as an apparently "UNKNOWN" file type. I did open the file through the Windows NOTEPAD program, it shows up as an considerably long string of random characters, which are inclusive of both numbers, letters, as well as the plus (+) sign symbol and the forward slash (/) symbol. There are no other special characters.
At least generally, I am strongly presuming (or hoping anyway) that this long string of characters amounts to a valid copy of my suggested backup file that would allow me to recover my coins. If it would allow me to recover my coins, then I don't know how to use it. My only thought for using the file would be the need to turn it into a QR CODE, but the amount of characters in the ledger is too long to be supported by any known online QR CODE generators.
Does anyone know what I can use this backup file of code for in attempting to recover my coins? Naturally, I don't want to wait for SIX WEEKS or more to have the coins back; but I'm also not convinced that I will get them back anyway in that case.
Thanks for any help. (sigh)

I haven't read all of your question, but "six weeks behind" doesn't mean you will have to wait six weeks to use the wallet.  It means that the latest transaction data it has is from six weeks ago, and it is downloading and verifying information about everything that has happened since then.  Depending on the details of hardware and software, this could take a few minutes or a few hours.  Definitely not six weeks.  So assuming everything else works and you are connected to the Internet, just wait patiently.

The moral of the story is -- backup your private key(s).

Thanks for the response back, Nate & David... I just now looked at the phone wallet and there are still zero coins in it; and it is still showing the phrase, "Synchronizing with network, 6 weeks behind." I had already seen this same basic phrase while using the wallet continuously for a period of time, but in past instances where it was showing the statement of "1 HOUR BEHIND." That statement was in reference to the current exchange rates; and I frankly don't know what the "6 weeks" thing is all about. Also, I did back it up per the program, but that backup appears to be useless.

I recently installed the same app onto a secondary phone and the "6 weeks" message is NOT showing on the new phone. If you read the fine print about what those apps are capable of doing to your phone (both the Dogecoin & Bitcoin versions) it states that the apps are capable of -- "Erasing or modifying your SD card." With that being said, I had deposited TODAY equivalent of $3,000 USD into another new Bitcoin wallet, came directly home to unload the funds into a separate account, and the Google browser froze on me. All I could do to complete the process was to copy/paste info from emails.

But I frankly don't know what you mean by suggesting that "the latest transaction data it has is from six weeks ago." Are you referring to transaction data concerning my phone specifically, or are you referring to the worldwide network of operations? My phone has NEVER been off during this period of time; AND I only started doing this thing during the last week in December, not six weeks ago.

If you want to watch how (and if) the app catches up on the blockchain, go to Options > Network monitor > Blocks. You should see the blocks arriving, unless the most recent block is from just a few minutes ago.

The main issue seems to be a misunderstanding of this message:

"Synchronizing with network, 6 weeks behind."

This indicates that your wallet will be processing transaction data of the last six weeks to ascertain whether any of it is relevant to your wallet. As apparently the Langerhans Dogecoin Wallet is a fork from Bitcoin Wallet for Android, this should take no more than a few hours depending on the computing power of your hardware.
Presumably, the wallet has to check the last six weeks because that's the age of the first addresses it created. This would also explain why the message didn't show up on the other phone. As that wallet was new there couldn't be any past transactional data relevant to it.
The backup file on your Google account is likely a binary file encrypted with your password specific to the wallet software you are using. You would use it by copying it to a smartphone with the Langerhans Dogecoin Wallet and restore it there. There may be other software that can import it as well.
To permit yourself more equanimity while familiarizing yourself with new cryptocurrency software, please consider testing with pocket change amounts at first.

Well, thank you for responding here. The wallet did eventually come back, but it took a full week to do so. Then, the forgotten password was apparently still intact into the encryption, so attempts to access the funds were unsuccessful, since I evidently didn't input the correct password. Then I ended up "recovering" the wallet a second time, which again took about a week to ponder through the system. In the process of the secondary recovery, I found that I could delete the app info from the phone, which then allowed the setting of a NEW password, but it WAS NOT the same wallet in that case...

By not being the same wallet configuration, that meant the so-called "recovered" funds were never going to show up on it. I had also used a secondary Bitcoin wallet (i.e., of the exact same design as the Langerhans Dogecoin wallet, but apparently NOT by the same designer) on a totally different phone. Since I had never experienced any problems with the original Bitcoin wallet on the first phone, I didn't anticipate any problems with the SAME type of Bitcoin wallet on the secondary phone. In that case, I deposited about 3.0 Bitcoin onto the wallet...

When I then attempted to transfer the 3.0 Bitcoins to an online wallet, the phone mysteriously froze up on me, thus displaying the ominous message: "Sorry, Google search stopped working." While it had NOTHING to do with "Google Search," per se, what happened is that my "keyboard" function stopped working, which meant that I could not input data into the Bitcoin wallet in the interest of moving out the funds...

In figuring out a "back door" to solving this dilemma, I used the Gmail address installed on that second phone to send the input date from one Gmail address to the Gmail address on the phone -- AND THEN I was able to copy & paste the input data into the Bitcoin wallet enough to be able to facilitate the transaction in the absence of my keyboard function not working anymore. Following that, I deleted both the Bitcoin wallet from the secondary phone in the interest of seeing if that would fix my keyboard problem. It did not fix the problem...

I am convinced that the phone was infected with a virus or Trojan and that this is what caused the keyboard to stop working in the first place. The fact that the keyboard decided to stop working AT THE TIME when I was trying to transfer 3.0 Bitcoin out of the wallet is apparently quite the coincidence; but my thoughts are that the wallet itself is a phishing operation...

CASE IN POINT: Prior to deleting the Bitcoin wallet from the secondary phone, I read the "precautionary" message in the app info page, which clearly states the following information, to the effect: "Program is capable of altering and deleting the phone SD card." In contrast, you WILL NOT see this same message being displayed for the "MYCELIUM" Bitcoin wallet, which is evidently at the top of the list for the most trusted phone wallets out there...

I think the fact that they would produce a wallet that is capable of TAKING OVER your phone is suspect enough. Otherwise, in commenting on your suggesting to first experiment with a wallet by using a small amount of funds, that sounds good, EXPECT that almost no thief out there is likely to be interested in ripping off "small amounts of change." It makes more sense that they would be looking for dumbshits like me who are putting thousands of dollars onto their apps and then THAT MUCH MONEY is definitely worth stealing...

I think that the idea of trying to temper the reliability of any phone application of this sort by using "small change" as a test environment is definitely NOT a good barometer of proving anything in the event that the application itself is capable of taking over your phone. Just because it would work with small change does not prove anything in this case.


text:
Limit order versus Market order
What is the difference between the two definitions that is not the following explanation: "Sell BTC 2.3 at $593.18" is an example of a limit order asking for $593.18 per 1 BTC. "Buy BTC 0.32 at $592.03" would be a limit order bidding for $592.03 per 1 BTC.

Your question doesn't actually ask about a market order...

In a limit order, you specify how much of the asset (in this case BTC) you want to buy or sell, and the price you want.  If there are matching orders on the book (e.g. someone who wants to sell at the same price, or lower, as the price at which you want to buy), your order will be filled immediately.  If not, your order will stay on the book until matching orders arrive (which could be never).
(It is also possible for a limit order to be only partially filled, if the counterparty wants to trade a smaller amount than you did.  In that case the rest of the order remains on the book.)
In a market order, you only specify how much of the asset you want to trade.  Your order is then filled immediately at the best price currently available on the market.  For instance, if you place a market buy order, you will be matched with the current lowest-priced sell order on the book.  If that order is not large enough to completely fill yours, the next-lowest sell order will be used to fill some more of yours, and so on.


text:
Why is Bitcoin fair?
According to the Wikipedia article on Bitcoin:

The initial bitcoin distribution is advantageous towards early-adopters. [...] However, the amount of work that must be done for one bitcoin is currently over 500,000 times more than the amount of work at which the first bitcoins were being distributed. As more people join, and also because of a reward function that halves the number of rewarded bitcoins every so many blocks, it becomes harder to generate bitcoins over time, using the same computing power.

So how is this fair? Why should someone get money just for hearing about Bitcoin before I did?

This is a valid question with a good answer. Why downvote this poor guy just for asking this?

It's worth noting this has it's own entry in the bitcoin.org FAQ: https://en.bitcoin.it/wiki/FAQ#Doesn.27t_Bitcoin_unfairly_benefit_early_adopters.3F

It's a complete irrelevancy. It is still early, and Bitcoins are worth on the order of $3 each. If you want to be an early adopter, buy Bitcoins now.
If Bitcoins never become really valuable, what difference does it make whether it's fair or not? The sums involved will be modest.
If Bitcoins ever do become really valuable, what difference does it make whether it's fair or not? You can buy Bitcoins now for a pittance and get the same benefits as the early adopters.
This is just petty jealousy. It's no different from the folks who missed out on Google stock or Apple stock when it was cheap. It's not just about hearing about Bitcoins first, it's about investing first, and taking the risk of loss. That's how everything works. Maybe it's not fair, but that's how it is.

I have no problems with the investing part of it. I'm specifically referring to the mining component.

Mining is the same as investing if you keep the Bitcoins. There's no real difference between mining 100 Bitcoins and buying 100 Bitcoins. Mining, and keeping the Bitcoins, was just the easiest way to invest in Bitcoins in the early days -- it's no different from buying a penny stock. (And was just as risky.)

Jason: mining is currently less profitable than investing.

David: there is a difference between mining and investing (not for the individual, you are correct on that one). Mining increases bitcoins security against double-spend and other attacks while investing increases the "worth" of bitcoin measured in FIAT currency.

If you imagine the "difficulty" as sort of a second price that you can optionally pay with resources rather than money, the question becomes functionally identical to "how is it fair that the first investors in Apple got rich just because they heard of it before me."

@molecular Buying Bitcoins raises the price, which increases people's incentive to mine, leading to more miners anyway.

@DavidSchwartz, while I agree with your general sentiment, I do NOT agree that early mining was as risky as early investing, as the very early miners were most likely using existing equipment and very little power to actually generate blocks. Early mining was more along the lines of fractions of fractions of pennies, not whole pennies.

It is not that someone gets money for hearing about Bitcoin before you. They get money for TAKING ACTION before you did. What gives Bitcoin value is all the people working on the software and services to make it better. What gives Bitcoin value is people educating others about it, and getting merchants to use it. What gives Bitcoin value is people acquiring it by exchange with other currencies as a show of faith. This pushes the price higher and creates more investment capital for the Bitcoin entrepreneurs and investors to launch more ventures for ...Bitcoin.  The reason they have more Bitcoin is because they are the ones who made Bitcoin what it is today. And YOU can help make Bitcoin what it is tomorrow.

could also say that miners giving their cpu/gpu power to the network increases the security and makes bitcoin more valuable.

Bitcoin was publicly announced before mining began. Those who were interested in cryptography and new digital technology were more likely than others to learn about it sooner, and it's perfectly fair that they were in a position to profit more from any rise in its value since its success would mean the information they were browsing had more value than the information others were consuming. Of those who learned about bitcoin, only a few took the initiative and got involved, something which was necessary for bitcoin to get to the stage it is at at this point in time, so it's fair that those individuals profit from its rise in value.
To generalize, early adopters/investors who profit from emerging technologies are usually those who are interested in and learn about fields of technology that turn out to produce useful innovations, which is economically valuable since acquiring this knowledge increases the rate at which useful innovations are developed and adopted, and are those who show the initiative and invest their time and money in fledgling projects that the majority does not see much potential in, which also provides value to the economy by helping develop new technologies/businesses with high economic potential when few were willing to do so.

That's a very interesting take. Usually I consider the "active ingredient" to be what you do after you hear about such things. But this nicely explains why hearing about things in the first place also deserves to be rewarded.

Hearing about Bitcoin is the easy part. The hard part is having the vision to understand how it's revolutionary, spending the resources to acquire it (whether other currency or electricity/compute power), taking the risk that it might not eventually succeed - and in so doing, taking a part in helping Bitcoin succeed thus making the world a better place. This deserves to be rewarded.
If you had heard about Bitcoin when the rate was $1, or $0.3, or $0.06, or when they weren't traded at all and it was just some software written by some guy consuming power and generating worthless monopoly money - would you have invested? When the rate goes up to $1000 and someone else will come complaining how it's unfair, do you want to be the guy who had the vision to invest when it was $3 and profited from it, or the guy who had the opportunity and missed it?
(I am not suggesting that Bitcoin should be thought of as primarily an investment vehicle or recommending that you do invest. There really is risk in such an investment and you shouldn't make it unless you know what you're getting into. What I'm saying is that it's all your choice and it's fair to be rewarded for making the correct choices).

From the FAQ:

Early adopters are rewarded for taking the higher risk with their time
  and money. In more pragmatic terms, "fairness" is an arbitrary concept
  that is improbable to be agreed upon by a large population.
  Establishing "fairness" is no goal of Bitcoin, as this would be
  impossible.
The vast majority of the 21 million Bitcoins still have not been
  distributed. By starting to mine or acquire bitcoins today, you too
  can become an early adopter.

I agree with you this "early adopter advantage" is not fair per se.  But the currency has to start somewhere.  And what most people mean when they say BitCoins are fair is there is not a big entity (governments) that are controlling how much money is circulated thereby reducing the value of everyone else's money.  Since the amount of Bitcoins in circulation will grow according to a set algorithm the system is "fair"

People who invest now are taking a big risk with their money. They aren't buying now what is guaranteed to be worth $1000 in the future; they are buying now what has a small chance of being worth $1000 in the future and a much larger chance of being worth nothing. If their dreams come true and Bitcoin does take off, that just means they were lucky. Anyone with a sufficiently aggressive portfolio is likely to make a windfall gain at some point, which will probably be all but cancelled out by losses elsewhere; this isn't "unfair" except insofar as chance itself is unfair.
If you're confident that bitcoin value will go up and people will be left behind, and that this is an unfair thing to have happen, you could always buy bitcoins now and resell them to late adopters at ridiculous bargain prices in a few years. If you think this is too risky, consider what that means for the actual expected value of bitcoins.

Also, if you feel that Bitcoin are likely to be worth less than their current value, you can always short them.

If you believe the current implementation of bitcoin is unfair, you are welcome to start your own branch - since afterall the code is open source. You can change the rules. However, without disproportionally rewarding early adopters, I don't see how it would ever take off, but good luck none the less.

It's worth mentioning that this has been done several times already... with i0coin, ixcoin, and solidcoin. I'm still waiting for CosbyCoin though...

In what way is it "unfair"?
When the first people started mining gold in California, were they being unfair to the people who started mining long after them? Nope.
The first miners got a big reward because they took the big risk, others saw there was money to be made and followed them.
Just like with bitcoin: if those first miners/investors hadn't spent their time and energy on bitcoin then it wouldn't be here today for you to wonder why you waited so long to get in on it.


text:
Why do namecoins have any value?
Many Bitcoin mining pools offer merged mining with Namecoin, and there are places where one can buy and sell BTC for NMC and the other way around.
But, why would anyone want to own NMC? As far as I understand, browsing dot-bit domains doesn't require owning NMC.

There's also all the same reasons Bitcoins have value. They're scarce, fungible, easily exchangeable, pseudonymous, and so on.

Namecoins are used to register .bit domains:
https://www.namecoin.org/dot-bit/
They're also bought and sold by speculators, but DNS registration is their original purpose.

Thanks for your answer, but I still don't understand. Buying an .bit domain costs bitcoin. You don't pay for the domain with nmc. And browsing .bit is free. Why then would anyone want to own nmc? If the answer is merely speculation, why would anyone in the future maybe want to own nmc?

If you're using bitcoins (or dollars, etc.) to buy a .bit domain, you're paying someone to use their namecoins to actually register that domain.


text:
How does one submit a transaction to the network using the blockchain.info API?
I am currently working on a project which makes use of the blockchain.info api (php). Could anybody please tell me how to use this api to submit transactions to the network?

What do you mean with "send data over block chain network"? Are you asking how to submit raw transactions?

yes exactly same

To broadcast Bitcoin transaction using blockchain.info you have to send a post request to https://blockchain.info/pushtx with tx=yourRawTransaction.
I would suggest you run your own node because you may face some rate limit.

is there a way to send it to the testnet?

Not on blockchain.info, you may do it on your own server or look for some other blockchains.

that's shitty.  I've found that blockcypher will do it

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

authors: Михаил Боговков


text:
Can I force my company to pay me in Bitcoin
I just got my bank account closed.

Reason: International payment were not supported

I don't like to waste my time in bank formalities. I am a programmer. I wish to stay technical for most of the part.

If you are Indian, read https://bitcointalk.org/index.php?topic=1320939.0

Probably not - I mean you're not in an absolute position to demand them to compensate you via bitcoin.  Can you possibly get an E-checking account with someone like INGDirect then have your BTC automatically dispursed via bitwage or even lawnmower...I think you could even do an auto-rebuy with coinbase if you felt inclined to do so.

No. You can ask nicely, but unless your company operates in a country that has declared Bitcoin legal tender you have no legal grounds to enforce it.

Bitcoin is legal in India. Govt. Supports it

@AbhimanyuAryan: Bitcoin being legal, and Bitcoin being "legal tender" are two vastly different things.

Paolo from BITWAGE here; we at Bitwage can help you get paid in bitcoin without your employer even knowing you are availing of our Bitcoin Payroll Service and earning a "bit wage" from Bitwage.
HOW IT WORKS: 1. We give you a bank account number. 2. You tell your employer to send any percentage of your payroll deposit to that number. 3. We put bitcoin, local currency in your preferred bitcoin wallet address the next day after deposit.
If you have further questions or need help with the sign up, please feel free to reach out to me anytime at: paolo.huelgas@bitwage.com

This has been flagged as spam several times. In this case I disagree: The answer describes a valid way of countering the problem the asker describes. Per our guidelines this answer may adhere to what is described as "Post good, relevant answers, and if some (but not all) happen to be about your product or website, so be it. However, you must disclose your affiliation in your answers.". @Paolo: I hope you will also contribute in other ways on our site. If you are just here to advertise your product, please talk to the Stackexchange team for an advertising contract.

That said, please take a [tour] to understand how Stack Exchange network works. Also, take a moment to understand how to not be a spammer.


text:
Can the mining pool with the most mining power always win?
Suppose we have three mining pools, one with 40% of computing power, and the other two having 30% of computing power each. Will the node with 40% power, be able to solve the puzzle for each node always quicker than the others?

No.  Everything else being equal, the node with 40% of the computational power will 'solve the puzzle' 40% of the time, and each of the nodes with 30% of the computational power will 'solve the puzzle' 30% of the time.
By 'solving puzzle', we mean mining a block by finding a nonce that (when combined with the rest of the information in the block header) produces a SHA256 hash that meets the difficulty requirements of the network at that time.

Thanks for your answer.
My assumption is that all the mining pools begin the process of finding the nonce exactly the same time. If they begin solving the puzzle the same time, then the one with more computational power wins. Isn't that right? I cannot see why one with smaller computational power will find the nonce quicker than one with bigger computational power. I will be grateful if you explain to me how one with small computational power find the nonce quicker than the one with small computational power.

Imagine you and I play a game with a deck of cards. All of the cards are turned face down on a table. We each take turns flipping over a card until one of us uncovers the King of Spades. If we both turn over one card on each of our turns, then you and I each have a 50% chance of winning, right? Now, let's say you get to turn over 2 cards when it's your turn, but I only get to turn over 1 card on my turns. You would win 2/3 of these games, and I would win 1/3, right? Mining is similar to this game of chance. Miners that can hash faster will win more often, but will not win 100% of the time.

And now imagine how to do that card game 1) without any dealer 2) without trusting any of the other players (to shuffle the deck fairly and not peeking) 3) while being on the other side of the world of each other 4) without even any communication until the moment the right card has been picked. Only Proof of Work can do that and it has never been done before Bitcoin.

@GeorgeTsichritzis: Each miner is trying to solve the puzzle with a different set of tiles. Therefore they require different amounts of work at random to solve it.

@murch Do you mean that every mining pool scans different possible inputs to the hash function?

@GeorgeTsichritzis: Exactly. Among other things, they are trying to send the block reward to different addresses which causes them to work on different input data for the block.

authors: Виталий Гаврилов


text:
Tainting with HD wallets
I'm having trouble understanding HD wallet privacy... for one thing, what if I want to send more money than I have in any of my individual derived addresses? Then I would have to use more than one, right? Which would compromise privacy, because it would show that at least two of my addresses are connected, exposing information about me, right? Like if I get money from A and money from B, then when I send C a payment she would know I was involved with both A and B. Can someone explain me exactly how much privacy HD wallets give compared to using the same address for everything?

You might want to check out What's the difference between a wallet and an address?, because it seems to me that you're mixing up those two.

HD wallets help avoid reusing addresses when receiving payments because you can generate a new address each time. HD wallets also make backup of many addresses much easier:
https://en.bitcoin.it/wiki/Deterministic_wallet
You are correct that when you send a payment from an HD wallet that needs to combine Bitcoin from several addresses (because no single address you control has sufficient Bitcoin to fund the payment by itself) previously unconnected addresses can become linked together.
There are multiple ways you can deal with this scenario to greatly improve privacy. Coin control and careful planning of payment sizing can minimize the frequency and privacy impact when this needs to happen. You can send Bitcoin from only one address when you desire the most privacy and combine Bitcoin from multiple addresses when privacy is less important to you.
Another solution would be this idea from Peter Todd:
"For me personally shapeshift adds a lot of value to Bitcoin, as it gives me much stronger privacy by using Monero as an anonymous intermediary point. Specifically, I buy Monero on shapeshift, then sell it to xmr.to, which in turn sends bitcoins to the Bitcoin address of my choice."
"https://www.reddit.com/r/Bitcoin/comments/3s085o/why_the_altcoin_takeover_scenario_has_become_a/cwt2prf"

Is there a way to configure wallet software to send multi-input transactions one by one for each input? Which, of course, would provide plausible deniability for the association of those addresses, esp. if the transactions had reasonable space between them.

@RenéG You could certainly do that manually with coin control. I am not sure if there are any wallets that can do this automatically and send send multi-input transactions one by one at certain intervals as you describe. Even if you could then the recipient would have to agree to it (some merchants generate a new address with each payment and/or expect to be paid in a single transaction) and you would end up paying multiple transaction fees due because of the multiple transactions


text:
What are the limits of ASIC Mining?
My assumption is that ASIC miners optimize for the "hashes per joule" metric, as did GPU miners over CPU miners.
It would seem that after some time, the decision to mine Bitcoins would be based on if you could source energy cheaply enough.
When do we reach that point?
I'm not a hardware guy so I'm curious to understand what the upperbound limits are of ASIC mining from a technical perspective. How much more can we optimize?
Thanks!

That point has already been reached.
For most people, Bitcoin mining is not profitable unless you live in a place like Iceland (i.e. with access to cheap, abundant electricity) or you have an already-installed solar panel/wind-mill installation that's already paid for itself and can divert some of that electricity into feeding your ASIC.
Electricity expenses are the single most important fixed cost for miners and, with the current continuous escalation of both hashing power and difficulty, should you buy a machine now you'd never recover your initial inversion unless Bitcoin had another round of 10x increases in prices versus fiat.
Likewise for scrypt-based coins, buying graphic cards and refrigeration equipment is not worth it anymore unless you have access to darned cheap electricity.
That's what happens in a completely free market: since there are no hard or legally mandated barriers to entry (or to exit) profitability for first comers drops very fast due to the continuous improvements in productivity that newcomers are bringing forth. So unless you can keep innovating (as an ASIC producer) or buying new equipment (as a pro-miner) you'll be left behind and become unprofitable.

I'm not an expert, but as far as I understand it, Moore's Law applies to ASICs just like other chips. So, every two years you get newer ASICs which can hash more, even though the chip design is not all the different from the previous ASICs, the number of transistors that chip has on it is doubled.  So, there is always going to be a cost of keeping up with the latest chips. This is part of what prevents a 51% attack, since there are literally not enough ASICs is the world for one big bank or something, or one scammer, to buy them all up to mine with.  World BitCoin Network on YouTube goes into this in more detail in the 51% attack video.
Moore's Law isn't going to hit a limit in the near term, since when we get so small we are on the scale of just a couple of atoms, we will just start stacking chips on top of each other.  Itel is already researching liquid cooling between chip stacks.  So, for the forseeable future, Bitcoin mining is not just going to be a function of cheap energy, or optimized chips, but the financial treadmill of buying new ASICs every two years.

Even if the physical limit of miniaturization is reached after having transistors of just a couple atoms, another cheap productivity increase could be brought simply by bringing back the Soviet-tested, long abandoned idea of ternary-based computers. Actually I wonder why no ASIC producer has tried to use those ideas again yet...


text:
Bitcoin - differences between address, account and wallet
I've been reading official BTC documentation and now I'm completely lost. Documentations is too tangled and written in unnecessary many words.
They have:
https://en.bitcoin.it/wiki/Address
https://en.bitcoin.it/wiki/Accounts_explained (no, actually not explained)
https://en.bitcoin.it/wiki/Wallet
Please, somebody tell me the difference between them in a simple manner. What's an address, an account, a wallet, and how does the keys fit in.

"Accounts" are a concept limited to bitcoin-qt, and it's probably better to forget about them entirely.
Each address has a corresponding private key, that you use to move bitcoin out of that address. A wallet is simply a collection of (address, address_key) pairs.
Some people also use the term "wallet" to refer to the software that implements the wallet functionality.

Obviously, this is a grossly simplified answer, and not strictly true, but useful if you just want to understand bitcoin superficially.

Can you elaborate why Accounts should be forgotten? It is a useful feature which allows to arrange funds into buckets. Only end-single-user wallets doesn't need that feature.


text:
Mining with multiple older computers
Is it worth using about 20 old dell workstations to mine at once? They have ancient hardware from about 2003-2005. Would it be better to use than one computer from modern time?

I wouldn't use them to mine.
Since GPUs back then couldn't do arbitrary calculations, the only thing you can use are the CPUs. CPUs are relatively better at mining scrypt (e.g. Litecoin) than SHA256 (e.g. Bitcoin), so let's go with that. Based on the oldest CPUs listed (which aren't quite old enough) on Litecoin's wiki, I'm going to guess that each computer can do 5 kH/s, which is probably being too generous. So that's a total of 100 kH/s. Plugging that into a calculator, even with assuming (another probably-too-generous assumption) 500 W total are used (that wouldn't otherwise be used), you're losing money if you have to pay for the electricity and/or cooling. (making maybe $0.14 per day, pre-expenses)
For comparison, a modern GPU can mine around 1400 kH/s for ~500 W ($2.01/day pre-expenses). Or a dedicated Bitcoin miner could actually turn a profit ($4.84/day pre-epenses) in a reasonable amount of time (of course, you're basically betting on/investing in the future of Bitcoin by buying something like that, which involves a good deal of risk/uncertainty).

@bobSmith1432 You're probably right. Since the result is negative even with way too much generosity all around, I doubt it matters much. And really, without more info on the scenario, (e.g. what sort of CPUs, are they on anyway, how much does power and cooling cost) we're both just making wild guesses.

From a power standpoint it would be much more expensive than mining with a normal machine. Bitcoin CPU mining has been phased out by GPUs and GPUs have been phased out by ASICs.
There are some coins which are more effective by CPU or are not yet implemented in GPU. I would say this is your best possible chance at netting a return even on just the power consumption of your rigs. There is a well-maintained list available at http://cpucoinlist.com/ make sure to google the algorithm + GPU (e.g. "X11 GPU") to make sure there is no GPU mining.

"CPU mining has been phased out by GPUs and GPUs have been phased out by ASICs."
GPUs has been phased out by FPGAs, and FPGAs were phased out by ASICs.


text:
How can we trust any crypto currency if the NSA could use 51% attacks?
My understanding of cryptocurrencies is that with the "51% attack" you can fake transactions and stop anybody from making any transactions. If any crypto currency actually threatens Government backed currencies then what would stop a company like the NSA from using their resources from attacking the currency? They have to have enough money and enough computing power if they are collecting all this data and are backed by the United States Government.

Why do you think this is a trust issue?

A correction: even an attacker who controls 100% of the network's hashing ability cannot fake transactions.  That would require breaking ECDSA.  They may, however, be able to prevent new transactions from confirming, and invalidate past transactions.

@David if I cant trust that a crypto-currency wont be bought out by a corporation to control then why would i get any?

The NSA can't force anyone to listen to them. They can say whatever they want, but the Bitcoin community will only listen if it's in their interest to do so. If there ever were a real 51% attack on Bitcoin, the design would be changed in a few days. You just have to trust the community to react sensibly, as they did during the blockchain split.

im saying the NSA would have the computing power to do it themselves to crash the bitcoin network if it becomes a threat or so it wont be a threat

@51attacknsa Right, but so what? Do you think the Bitcoin community would respond by saying, "Oh well, guess that's it for Bitcoin."

@DavidSchwartz Altough I agree with you, you can't marginalize the effect a 51% attack would have on the trustworthiness (and thus the value) of Bitcoin. "the design would be changed in a few days" How exactly?

@51attacknsa Your link leads to a blank page for me.

As mentioned in comments, the 51% attack doesn't let you fake transactions. You just take control of what gets in the blockchain from the moment the attack is realized.
As to realizing the attack, the current Bitcoin hashing power is about 60,000TH/s.
Right now, the more efficient mining rigs cost at least $2,000/TH/s. So just getting all that mining power would cost the NSA, or any similarly powerful actor, about $120M. That's assuming that so many miners can actually be sourced which is highly doubtful at the current production volume.
Then you'd have to factor in all the procurement, the time it takes to setup operations of that scale and the mind-boggling electricity bill. So it's probably a 2-3 years project with a half-billion dollars price attached.
And then what would be the NSA's motive? The dollar is doing just fine right now and the US government can control Bitcoin just as well is they want to do so.

That's also assuming that one of the producers of these rigs would sell one huge lot to the government... keep in mind that these companies greatly benefit from having Bitcoin survive.


text:
SegWit Version - is there a proposal for new versions?
I can see transactions with version 0.
Are there any other versions of SegWit proposed or in existence?

BIP-114 which was published a while ago comes to mind :
https://github.com/bitcoin/bips/blob/master/bip-0114.mediawiki

Taproot is implemented as SegWit version 1.
Another proposed feature that would most likely be implemented as a new SegWit version is cross-input signature aggregation.

The introduction of Schnorr signatures would require a new script version.


text:
Why aren't miners filling up Bitcoin Cash blocks?
I see that there are over 100K transactions in the mempool, but most blocks have only a few hundred of transactions.
Can anyone shed some light on this?
The blocks can be seen here: http://blockdozer.com/insight/blocks
Clarifications:

I'm running Bitcoin ABC.
getmempoolinfo returns "size": 101223
getinfo returns "version": 140400

At the time of the question, Bitcoin Cash mempool had 917 transactions, and the Bitcoin mempool only had 8.1k.

yes from ABC getinfo says "version": 140400

You're running an outdated version of Bitcoin ABC. 140400 translates to Bitcoin ABC 0.14.4, but the current release is Bitcoin ABC 0.14.6. Mandatory two-way replay protection was introduced either with 0.14.5 or 0.14.6. Your older version still considers Bitcoin transactions to be valid, so you're collecting both Bitcoin and Bitcoin Cash transactions in your mempool. Obviously, Bitcoin transactions aren't leaving your mempool though, because they are not being included in blocks. Thus, eventually your node's mempool will consist solely of Bitcoin transactions, assuming that Bitcoin transactions generally have a higher fee level.
Updating to the current version of Bitcoin ABC should resolve the discrepancy.


text:
SegWit and previous hash: txid or wtxid, or either?
With segwit there will be two transaction ids wtxid and txid
Can either one of them be used as previous hash or only txid?

Inside transaction inputs, you have to refer to previous transactions using the txid. Allowing a wtxid there would be (1) a hard fork and (2) defeating the purpose, as it'd make transactions malleable again.
The wtxid is only used to compute the Witness merkle root, which is committed to in the coinbase.


text:
Is there any come back when an exchange goes bust?
I had .95btc in cryptsy.
The exchange is now bust with intermittent updates from 'big Vern'.
The authorities don't seem to care, fellow crypto enthusiasts just say things like, 'oh how stupid, never leave your coin in an exchange'.
Is there any regulation around exchanges at all, so that if they go bust, some protocol must be followed?
edit: Just to add cryptsy concealed the loss and continued to trade, if it were a bank there would be legal ramifications.  Exchanges are similar to banks, they have accounts with client money but none of the rules seem to apply.

There are the usual rules for bankruptcy - you are an unsecured creditor of the exchange, and are legally entitled to a share of whatever assets they may have.  Which might be none.  In general this will depend on the jurisdiction where the exchange is located, but I don't know of any place where Bitcoin exchanges are regulated like banks or stock brokerages.


text:
Is it possible to schedule a transaction in the future?
Wondering if it's technically possible to set up a transaction to be sent in the future, for example 6 months? Is this related to block timestamps parameters? Transaction timestamps?

Who will keep your transaction. For what?

I would like to put some funds in the blockchain so I'm sure I will not spend it. Also I'm curious about this. Sorry newbie here.

@Theodore.us, you may want to look at OP_CHECKLOCKTIMEVERIFY for that usecase. It lets you make a transaction output which can't be spent until a time in the future.

Yes, there is tx.nLockTime. A transaction mined before its nLockTime is invalid, so you can send your funds to yourself on some newly created address, then send it back with a locktime and destroy the private key for the newly created address.  Transactions with nLockTime can be amended, but since you destroyed the private key, you actually can't, thus preventing them from being spent before that time has passed.
See here, here, or here.
Note that nLockTime transactions may not be stored/relayed by the network. So you need to keep the transaction in a safe place and broadcast it at the right time.

Afaik it's not possible.
But you can ask a relative to help and make with him 2-2 multisignature transaction so you will be sure you will not spend money until you have two sigs.


text:
Matching pushpool difficulty with stratum's
I have a new question for you.
I have setup the stratum mining proxy, and all is working fine. (Actually found our first block recently!)
However, I have pushpool running as well, and some of my users still use it based on preference.
How can I be assured that people that use stratum isn't getting more shares than those who's using pushpool? Is there a way to set the difficulty on stratum?
As of now i set the difficulty manually in pushpool's config file, with rpc.target.bits
Help is appriciated!

This is how you change the difficulty in Stratum:
go to mining/subscription.py
change
self.connection_ref().rpc('mining.set_difficulty', [16,], is_notification=True)

to
self.connection_ref().rpc('mining.set_difficulty', [32,], is_notification=True)

That will set the difficulty to 32 - or change to whatever value you want.

Will the 32 in: self.connection_ref().rpc('mining.set_difficulty', [32,], is_notification=True)
actually correspond to the SAME difficulty stated in the config of pushpool? So 20 in pushpool = 20 in that line you posted?

Note that this stratum server does not use the same definition of difficulty as the rest of mining. So if you want difficulty 32 shares, you need to use:
self.connection_ref().rpc('mining.set_difficulty', [31.99951171875,], is_notification=True)


text:
Calculation for transaction input-output balling:
To roughly calculate transaction send size in bytes we do:
((numberOfInputs*148)+(numberOfOutputs*34)+10)

We want to make a transaction using two inputs of 0.01BTC (Amount to send = 0.015BTC, change left over = 0.005BTC). Number of outputs in this case will be two; as we have two inputs, one of which we are 'tearing-in-two' creating change that will be sent back to us (we are the second output so the change is not lost).

So to calculate the fee

We calculate the value of each input in BTC multiplied by the age of the input in blocks
Add up all the answers into a total priority
Divide the priority by the size of the transaction in bytes
If this gives a number less than 0.576 then the transaction requires a fee
Also if the transaction size exceeds 1000 bytes it requires a fee

If both inputs were 1000 conformations old, a fee would be required:
((0.01*1000) + (0.01*1000)) = 20 //priority
((2*148)+(2*34)+10) = 374 //bytes
20 / 374 = 0.053475935828877004

If both inputs were 11000 conformations old, a fee would not be required:
((0.01*11000) + (0.01*11000)) = 220 //priority
((2*148)+(2*34)+10) = 374 //bytes
220 / 374 = 0.5882352941176471

Is this correct?
If one input was old dust and the other new and large (this looks free to me):
((0.00001*11000) + (1*1000)) = 1000.11 //priority
((2*148)+(2*34)+10) = 374 //bytes
1000.11 / 374 = 2.6740909090909093

Does this explain how you can put a dust-input with a large-input to rescue dust?
Will the threshold of 0.576 change in the future and if so how will we find out?

where does you initial formula come from? Is it form you or from some wiki?

http://bitcoinfees.com

The whole section about priority is not relevant anymore; free transaction mining doesn't happen in any significant amount anymore and software support for it has been removed in various places. Every transaction just pays bytes * feerate in fee.

authors: виталина Фёдорова


text:
Why doesn't the Bitcoin blockchain truncate past data?
AFAIK, verification of transactions on the blockchain doesn't require the full chain data and six to ten verification will be enough (which makes uses of a Merkle tree). Thus, why cannot it abridge the data for a future complete node?

I think it's healthy to re-ask questions since that one was asked more than 2 years ago.

@LucaMatteis: The situation hasn't changed from when that question was answered. The protocol of Bitcoin still works the same.

@GregHewgill I found not technique detailed description on this. It seems I have to read source code.

The idea of Bitcoin is that you can obtain the current state of the network without having to trust anyone. You essentially rely on the fact that the state that has most work put into it, is the valid state, and that all transactions are chained together up until the genesys block, after which there are no more transactions.
Now if you were to truncate this state (the block chain) in half, you could hard code this information into the software and it could reach some form of consensus among the nodes of the network. However this opens the door for attacks, because a dishonest node could easily fake and send you a wrong block height information, perhaps making you believe that a different history happened before the truncation of the block chain. And it could do this by simply broadcasting chunks of the history that was truncated, because lots of work has been put in that chunk and your client is programmed to accept longest worked on chains.
You would really have no way of knowing unless you read the entire history yourself.

Thanks, but I should ask in a more concise way that I'd like to dip into tech details. If mining is not involving/safe enough to do without actual history records in blockchain we can clean up the history redundancy. The only question is here that I do not know how the merkle tree is generated. Can anyone explain me an abstract model that takes in (previn) and outputs (stdout), showing in a diagram?

No, nobody could fool you.   If you truncate the chain a year ago, saving the aggregated state, and the old block hash, all you'd need to do is ignore anything that doesn't hash to the longest chain, offset by your truncation.   There's no way a fork can reach back a year, so you're good.   Clients do this all the time.   And since you reached your own conclusion and cache state... you didn't have to trust anyone to do it.


text:
How can I import Electrum addresses into a Core wallet?
I have been running all my BTC transactions through Electrum, but recently installed the 0.14.0 Core client and would like to move to that. I managed to export my ~40 private keys from Electrum, but how do I properly import them into the Core client?


text:
Why was transaction malleability ever allowed?
I understand that the data included in a transaction signature is not exactly the same as the data included in a transaction hash, but why was it designed this way?  I don't see any advantage in just making the data set the same for both purposes and there are apparently a lot of drawbacks.

The many examples I've seen simply have insignificant zeros added to a signature. Why not just remove the extra insignificant zeros and only have significant numbers?

Wtf is loopty loop scripting?

@Gracchus, What do you mean by "loop scripting"?

Bitcoin transactions are intentionally malleable. Some forms of malleability are a feature, and by design. Many of the more advanced uses of Bitcoin transactions (see the Contracts wiki page) rely on the ability to modify transactions in specific - and limited - ways.
However, the current problems are unrelated, and because of unintentional malleabilities. Several are known (and have been known for years). Making them impossible requires changes to the protocol, to validation software and to wallets, so cannot be done very quickly. In fact, the reference client version 0.8 (released almost a year ago) made some types of malleability already non-standard, with the hope of someday being able to add a strict network rule to forbid it.
The reason why the transaction signatures do not sign the full transaction hash, is because that would require knowing the signature before signing. The signature is part of the transaction, so it influences the transaction hash. Because of the design of the scripting language, it however signs less than just not the signatures. This is the source of many (but not all) malleabilities. Some are due to ways in which the signature itself can be modified without invalidating it.

When you say "in fact, the reference client version 0.8 made some types of malleability already non-standard", what types of malleability are you talking about?

The problem is that "transaction" refers to two different things:
1) The actual monetary transaction: address A sends something to address B.
2) The collection of bytes sent to the network expressing the above.
Transaction malleability is possible because there isn't a unique way to express 1. You can express it with two different scripts that do the same thing, and therefore cause the collections of bytes in 2 to have different hashes. Transaction malleability is a consequence of the bitcoin scripting flexibility. To understand this in more detail, read this post:
http://www.righto.com/2014/02/bitcoin-transaction-malleability.html

But there is a unique way to express 1 isn't it? How un-unique is "A send 0.246 BTC to B"?

@Gracchus, I don't get it, his whole answer is based on "Transaction malleability is possible because there isn't a unique way to express 1" which is false, yet it gets 4 upvotes...

It is designed that way because it has to be designed that way. When you sign a transaction, the signature isn't known yet. And the final transaction hash must include the signature otherwise people couldn't agree on whether a transaction was validly signed or not. So the data included in the signature cannot be the same as the data included in the hash because the former cannot include the signature itself and the latter must.

Is there no better workarounds then?


text:
Probablity Distribution of mining
What is the probability distribution of solving a block, given the same difficulty.
So if I try to mine multiple times using the same difficulty, is it normal distribution with mean of 10 minutes? What is the variance? Or is it some other distribution? Or maybe even deterministic chaos?

It is a poisson distribution. Every attempt to form a block has the same probability of success and the number of attempts per second is roughly constant.

@DavidSchwartz: No, it's a Poisson process. Which means that the number of blocks in an interval follows the Poisson distribution - but the time between blocks, which the OP asked about (I think), follows the exponential distribution.

@MeniRosenfeld The question is sufficiently vague that it could be asking either about the expected number of blocks found or about the expected time between blocks found. They follow two different distributions.

The time between consecutive blocks follows the exponential distribution, with mean (roughly) 10 minutes. This means that the variance is 100 minutes^2.

so standard deviation is 10? So its just as likely to take 1 minute vs 19 minutes?

http://bitcoin.stackexchange.com/questions/4690/what-is-the-standard-deviation-of-block-generation-times

@jaybny: Yes, the standard deviation is 10 - however, the distribution is not symmetric, so 1 minute and 19 minutes have different probability densities.

im now asking if the probability that it takes exactly 1 minute or exactly 19 minutes the same? since they are both the same STD from mean?

@jaybny: This is a continuous variable so the probability that it is exactly 1 minute is 0. That's not what you wanted. You meant to ask about the probability densities. And I already answered negatively. The distribution is not symmetric so being 1 sd from the mean does not mean it's the same density. You can see a graph of the density in the linked Wikipedia article.

I am not sure why this should follow exponential distribution. The hashing function that bitcoin follows uniform distribution ie .. all hashes are equally likely to occur. So assuming that hash rate is constant between two blocks, it is equally likely that you get a block in 0 - 20 min. Can you explain why u say its exponential distribution ?

im assuming it has to do with real world factors, like mining rigs online/offline, and human operators of the mining strategy

If you factor increase of hashrate during  difficulty period, the average will be much less than 10 min. Its fair to assume same hashrate  , the next difficulty is also calculated assuming uniform probability distribution https://en.bitcoin.it/wiki/Difficulty

read up on poisson processes. maybe meni has answers

@darkknight: I didn't see your comment when you first wrote it. In case it's still relevant: Unlike jaybny's suggestion this has nothing to do with real-world factors, I'm assuming the most ideal model possible, including that the difficulty and hashrate is constant. The hash of each attempt is uniformly distributed but that's irrelevant - the only thing that matters is if it's below the target or not. That's a Bernoulli trial with (continued...)

(...continuing from previous comment) some probability. These trials are all independent. So the time to find a block can be arbitrarily long (because I can just be unlucky and fail again and again and again). But the probability decreases exponentially: The probability to find a block in the 4th minute is the probability to fail in the 1st and fail in the 2nd and fail in the 3rd and succeed in the 4th. Because of the extra conditions, this has less probability than just succeeding in the 1st minute. This results in the https://en.wikipedia.org/wiki/Exponential_distribution.

@MeniRosenfeld Thanks for explaining. So get the part that its exponential distribution. Minor question is had is that in the 4th minute is it not more probable that we find a block. I am thinking we already covered lots of hashes in the first 3 minutes(versus a coin toss its always 0.5 each time).

@darkknight: The number of hashes you can find is a tiny portion of the space of all hashes (something like 0.0000000000000000000000000000000000000000000000000000000001%), and an even tinier portion of the space of all possible inputs. There's not even a guarantee that there is any solution. Each hash attempt is its own independent coin toss.

The expected time (mean) for a new block is of course 10 minutes, assuming constant hashrate, and no block propagation time.
The tricky part is that there is no such thing as a point in time. You can only ask only for an interval.
Let's illustrate this. First it is important to not fall for the Gambler's fallacy. Luck has no "memory". Thus if no block has been found (or if a block has just been found), what is the chance of a block being found in the next minute? The easy answer would be 1/10 = 10%. Or in the next second? 1/600 = 0.16667%. But this is not quite true.
If you ask how often a block is found before or after 10 minutes, you are asking for the cumulative distribution function (CDF) of the exponential distribution.
We can use Wolfram Alpha to plot this:
cdf exponential distribution λ=1/600
How many blocks are found after the mean (600 seconds)?
exp(-600/600) = exp(-1) ~= 36.788%

How many blocks are found before the mean?
1-exp(-1) ~= 63.212%

How many blocks are separated by more than 1, 2, 5, 10, 20, 30, 60 minutes?
exp( -1/10) ~= 90.484%
exp( -2/10) ~= 81.873%
exp( -5/10) ~= 60.653%
exp(-10/10) ~= 36.788%
exp(-20/10) ~= 13.534%
exp(-30/10) ~=  4.979%
exp(-60/10) ~=  0.248%

So what is the chance of finding a block in the next second/minute?
1-exp(-1/600)  ~= 0.16653%
1−exp(−60/600) ~= 9.516%

Bonus: How many blocks are found between 5 minutes an 20 minutes?
exp(−5/10)−exp(−20/10) ~= 47.120%

For the impatient

What is the probability distribution of solving a block, given the same difficulty.

It is not clear if you mean the probability distribution of the time it takes to mine a block or you mean something else. In any case I am going to describe some random variables and their probability distributions, including time.

So if I try to mine multiple times using the same difficulty, is it normal distribution with mean of 10 minutes?

The time it takes to mine a single block is a random variable distributed according to an exponentially decaying distribution function. The mean value depends on the hashrate of your miner and the current difficulty.
<t> = w1*d/h

where w1=4.2e9 is a constant. For example, if you have a 100PH/s mining facility at the current difficulty d=5.7e13, you're expected to mine a block after 28 days (if difficulty remains constant).
Mining a block in a single trial
The probability of mining a block with a single hash trial is p = T/2^{256}, where T is the target. The target is determined from the current difficulty d as
T = T1/d

where T1 is the target of the genesis block.
The target is encoded in the blocks header under the field "bits".
For instance T1 is encoded as 0x1d00ffffff which means
T1 = 0xffff * 256^{0x1d - 3}

which is approximately equal to 2.7e+67.
This situation can be described with a random variable that takes values either 0 (block not found) or 1 (block found), which formally follows a Bernoulli distribution.
Mining a block in a sequence of trials
We can define a random variable w that represents the number of blocks candidates (or trials) until a valid block is found.
The probability distribution of w is formally known as a Geometric distribution.
P(w|N=1) = p*(1-p)^{w-1}

This is understood as a multiplication of probabilities of w-1 failures (probability 1-p) and one success (with probability p).
This is useful for example in order to compute the expected work needed to mine a block; ie. the expected number of trials before one hits a valid block.
<w> = 1/p

Notice that, by the way we have defined the difficulty (above) we could write
<w> = w1 * d

where w1=2^{256}/T1=0x100010001 is the expected work needed to mine the genesis block.
In order to put time into the equation we consider the fact that a miner is a computer that roughly produces w = t*h block candidates (trials) in a given period of time t, where h is its hashrate.
Therefore the expected time until a block is found is
<t> = <w>/h = w1*d/h

This time increases with the difficulty and it decreases with the hashrate of the miner.
We can construct a probability density function (PDF) for the time variable as well in this case. Just consider that P(w|N=1) = p(t|N=1) dt
where p(t|N=1) is the PDF for t and dt is the smallest unit of time dt = 1/h (one single hash), then if one uses the approximation (1-p) = exp(-p) it turns out that
p(t|N=1) = P(w|N=1)*h = h/(w1*d) * exp(-h*t/(w1*d))

This means the waiting time is distributed according to an Exponential probability density function, just like radioactive decay.
Mining N blocks after a sequence of trials
We can generalize the previous result in a situation in which we will continue making trials until we find N valid blocks. The number of trials w in this case is a random variable distributed according to a Negative Binomial distribution:
P(w|N) = (w-1)!/(N-1)!/(w-N)! p^N (1-p)^{w-N}

It follows that the expected (mean) work required to mine N blocks is
<w> = N/p

We can turn this into a PDF for t, but first let's do the following approximations

p<<1 hence (1-p) = exp(-p),
consider the case in which N is not a very large number, ie. N<<1/p and N<<w.

And just like in the previous case with N=1 we will need to normalize the PDF of t by dividing P(w|N) by dt = 1/h:
p(t|N) = P(w|N)*h = h/(w1*d) 1/(N-1)! (t*h/(w1*d))^{N-1} * exp(-t*h/(w1*d))

Which corresponds to a Gamma probability distribution function;
in the case N=1 we obtain the exponential PDF.
The mean waiting time until we hit N blocks is then
<t> = N*w1*d/h

Counting valid blocks in a sequence of trials
If one tests w different hashes candidates then the probability distribution of the number N of valid blocks is a Binomial distribution. In other words the probability of finding N valid blocks is
P(N | w) = w!/N!/(w-N)! p^{N} (1-p)^{w-N}

From here it follows that after w trials the expected number of mined blocks is:
<N> = w*p = h*t/(w1*d)

In the limit when p<<1 and for N<<w the previous probability of finding N blocks after w trials approximates a Poisson distribution:
P(N|w) = (wp)^N/N! exp(-wp)

and if one introduces time into the equation (substitute w = t*h and p=1/(w1*d)) you can obtain
P(N|t) = (h*t/(w1*d))^N / N! exp(-h*t/(w1*d))

Which is the probability of obtaining N valid blocks after a period of time t. This formula again reminds us of radioactive processes, where the N would be number counts in a instrument like a Geiger.
At least one block in a sequence of trials
If you want to know the probability of mining at least a single block after w trials, let's denote this P(N>0|w) that would be 1 minus the probability of mining none after w trials:
P(N>0|w) = 1 - P(N=0|w) = 1 - (1-p)^{w}

It follows that the probability of mining at least a block in a time frame t = w/h is
P(N>0|t) = 1 - (1-p)^{h*t}

p is a very small number, we have seen above that one can express it in terms of the difficulty d as:
p = 1/(w1 * d)

where W1=0x100010001, for instance for d=1,
pis around 2e-10. This means the previous formula for the probability can be written, using some fundamental limit, as
P(N>0|t) = 1 - exp(-p*h*t)

or in terms of the difficulty
P(N>0|t) = 1 - exp(-h*t/(W1*d))


text:
In what scenarios can the blockchain size decrease for bitcoin?
I am running a private bitcoin network for which I changed the target time between two blocks to 12 seconds and the difficulty adjustment to 25 blocks interval. I ran the network for about 4 hours with 50 nodes. In one of the node's logs I observed that the blockchain height increased up to a maximum of 181 and then started decreasing, all the way to 38. what could be an explanation for such a strange behaviour.
Please refer to the log below:
2015-11-04 01:58:47 receive version message: /Satoshi:0.11.99/: version 70011, blocks=181, us=0.0.0.0:0, peer=2, peeraddr=127.0.0.1:44117
2015-11-04 01:58:47 UpdateTip: new best=0000005265ca4ce01ad0d06f45cf475bf303de3d64e942c5cf1177e00f346c78  height=180  log2_work=37.083283  tx=30941  date=2015-11-04 01:53:17 progress=1.000000  cache=0.0MiB(1tx)
2015-11-04 01:58:47 UpdateTip: new best=00000052a34cedf3c5ddbeb46d36644654523db855c4cce984d2623e840dd219  height=179  log2_work=37.082953  tx=30940  date=2015-11-04 01:53:10 progress=1.000000  cache=0.0MiB(2tx)
2015-11-04 01:58:47 UpdateTip: new best=00000030fd7652affb883f05fe0c98e7fe3fbc3cfd74808e061ed05ec61c22e6  height=178  log2_work=37.082623  tx=30939  date=2015-11-04 01:52:55 progress=1.000000  cache=0.0MiB(3tx)
2015-11-04 01:58:47 AddToWallet c32bcbd8102c602a5e71ee717232e204435f331dce6fbfb9eb5d552698faa95b
2015-11-04 01:58:47 AddToWallet 1c91517aeadd12bcbcfdf4a1423b671d405543ae9abfbd87078969ce1971663f
2015-11-04 01:58:47 AddToWallet b11f9c2e3b1ab3d3983da63783bb95903d89405243d0716ea88272a9261b7a33

That's really strange. Can you pastebin the full log, including where the blocks are added/removed?

Agreed, can you show us where the blockchain height decreased to 38? It's not in the log you've posted.

@NickODell http://codeshare.io/lp1G6

Best chain is selected by the most cumulative difficulty, not height. Your modifications have essentially ensured frequent forks and reorganisations. The difficulty adjustments are long in Bitcoin are a long period partly as attack resistance, but also to avoid noisy chain movements. It's completely legal for the height of the chain to drastically reduce.

@Bitcoin But the log bawejakunal posted shows that the total work goes down when the client changes the blockchain. Before: height=181  log2_work=37.083613 After: height=38  log2_work=36.832912 The 38 block chain is entirely contained within the 181 block chain.

@NickODell I think there's other misguided tinkering going on in that case which we aren't seeing. It's difficult to say without knowing the whole patch set.

@bawejakunal, I don't see anything in the link you provided. Can you try pastebin?

@JimmySong Reuploaded: https://gist.github.com/nickodell/1d8f29faad7a566c08fd

It looks like this part of the code is what was adding all those UpdateTip messages:
https://github.com/bitcoin/bitcoin/blob/8fe30fb4d130532d4a0e4c9d143f03e1b85a749e/src/main.cpp#L2234
Essentially, bitcoind thinks another chain with more cumulative work exists on your 4-node network, though from the logs, it's hard to tell how much lower it goes. You'll have to run it for longer in order to find out.

Oh so you mean this is the case of switching between two competing blockchains ?

Yes. This could happen if, for example, one of your nodes wasn't receiving blocks, only sending them.


text:
How do I access the Bitshares that I received from my Protoshares "snapshot"
I have had some Protoshares for a while.  At some point (according to my fuzzy memory) there was a "snapshot" which gave me the right to Bitshares.
I still have access to my Protoshares wallet but haven't installed a Bitshares wallet.  How do I access the Bitshares that I received from the "snapshot"?

Install the BitShares wallet. Create an account and go to that account page. Select the "Keys" tab and import the wallet.dat file.

You will need the private keys for the addresse(s) you donated from. You can get them from the client you used and need to import them into an account in your client.

Open up you client
Let it sync with the network
Create a new local account (no need to register it)
Got to the settings of your account
Go to the "keys" tab
Import the private keys
Get the wallet.dat file from the bitcoin-core/protoshares client and import as "Bitcoin wallet"
Click Import

You should see your funds instantly. Also note that you certainly also have a vested balance from the merger with DNS and VOTE. You can check the balance with wallet_check_sharedrop and claim your vested balance using wallet_collect_vested_balances accountname. Note, that the vested balance can be collected over a 2 year period, no matter the exact date of collection (except for the transaction fee).


text:
How would an artist be able to sell their own music for Bitcoin?
What options are there for artists to market their Music in exchange for Bitcoin? How would an artist be able to directly sell his work to his fans?

This is a fantastic question. I've got a client who is a well known artist and I've yet to push the Bitcoin integration because Coinbase essentially handles the whole situation. I'd love to know if being the middle man in setting up BTC payments was worthwhile or if Coinbase/Bitpay is the only real option.

It rather depends on if you are a signed artist or not. Signed artists have to go through the various processes of collecting and distribution, unsigned artists are free to set up a simple Bitpay account for example, and generate direct sales online. If not you could print a QR on your merchandise or something like that.

Regarding this question, its probably worthwhile to check out Bittunes. The company was started in May 2013 with the mission to enable the monetization of file sharing with Bitcoin. The significance of this is that it is not about just using Bitcoin as a way to buy music, but actually incentivising buys (fans) to serve as a new kind of distribution channel for music. ~ In other words, its an 'earning platform' for both artists and fans. It is early days for the system, with many aspects still to roll out. see:  www.bittunes.com and www.bittunes.org for more detail.

Liberty Music Store is a place to buy and sell music with Bitcoin. It is geared towards simple user experience. The artist can keep 100%.
(disclaimer: I am the author)

If I was an artist, I would have bitpay integrated to my Website, or direct people to an online store like Cryptothrift where my song would be listed and they can purchase it there with bitcoins.


text:
Creation of P2SH MultiSig Input Script
In the createP2SHMultiSigInputScript() function of BitcoinJ according to this:
public static Script createP2SHMultiSigInputScript(@NullableList signatures,Script multisigProgram)
Create a program that satisfies a pay-to-script hashed OP_CHECKMULTISIG program. If given signature list is null, incomplete scriptSig will be created with OP_0 instead of signatures
https://bitcoinj.github.io/javadoc/0.12/org/bitcoinj/script/ScriptBuilder.html#createP2SHMultiSigInputScript-java.util.List-org.bitcoinj.script.Script-
the Script multisigProgam input refers to the Redeem Script or the ScriptPubKey??
due to the fact that the createP2SHMultiSigInputScript() returns the ScriptSig script.

Downvoted because the question is not very clear and probably no longer useful today. I considered editing it to align it with my interpretation of what is being asked, but I'm not sure it's of much use today. Bitcoinj is not being used a lot anymore, and the asker probably solved the problem many years ago.—Happy to upvote if it's turned into a more useful question.


text:
What are spent transactions?
Satoshi's paper says:

Once the latest transaction in a coin is buried under enough blocks,
  the spent transactions before it can be discarded to save disk space.

What are spent transactions?

Balances in Bitcoin are stored in Unspent Transaction Outputs utxo. UTXO can be used as inputs when a transaction is created. They can only be spent completely, while the resulting transaction creates new ones in the process, redistributing the balance to the recipients of the transaction. Spent transactions refers to Transaction Outputs that have been expended.

@green Note that this way of saving disk space as Satoshi described it is not actually used as such. Bitcoin simply keeps a separate UTXO database and basically only keeps the original blocks (with the actual transactions) to be able to upload them to any per asking for them. Recent Bitcoin Core versions do have the ability to simply completely delete really old blocks. This is called purging.


text:
Does halving ever end?
Every certain number of blocks the reward is cut in half, for example from 50 to 25 BTC.  Will this halving continue indefinitely, so the reward never gets to zero?

It will, one day, reach 0, which mean mining wont be possible anymore (or it wont just be worth it). and by 0, I mean it could be 0.000001.
But if you look at it in a mathematical way, it should never end. Try that with a calculator, the number becomes really small.
The Bitcoin network is made so there will be a limited number of coins available and they have to be generated at a predictable rate, thats also why there is a difficulty on the mining

I know it will get very small, but it will never actually reach 0? So the target number of bitcoins will never actually be reached?

If you look at the link below (which is a similar question to this one) you will read that there should only be 32 halvings. If the precision is not increased it WILL reach 0  http://bitcoin.stackexchange.com/questions/5545/how-many-halving-days-will-there-be

mining will be critical when the reward = 0 because it is required to confirm transactions.  The volume of transactions and the included fees will still make mining valuable to the network.  Mining was not designed to be highly profitable, it was supposed to help secure the network and offer a little reward to the miners.  I doubt Satoshi foresaw the ASIC race that we are seeing today.

It is also a pretty steep argument to assume that mining will not be profitable just because today the transaction fees wouldn't support the mining expenses. When the halving ends in more than one hundred years, either Bitcoin will have failed or there will be sufficient shareholders bound to lose a lot if mining fails - they will be putting some money into the fee pot.


text:
How do mining-pools prevent work duplication?
Do mining pools take any precautions to make sure that their members are not doing the exact same work (i.e. they've been given the exact same block to mine, and thus they're doing the same hash calculations as a fellow member)?

Possible duplicate: How do mining pools distribute work effectively?

No, there's not a need. The "work" generated by the pool includes the time, transactions, transaction order, and a completely unique coinbase. All of this information is hashed once with SHA256 and then sent to the client for them to do the POW calculation on. There is absolutely no chance of two pools creating the same work, and indeed pool software is designed to make work unique to each user. Protocols like GBT and Stratum also generate work items locally so the pool server is even less involved.

How does the pool make the coinbase unique?

The coinbase is largely random, it needs to be otherwise the block could contain a non-unique transaction ID, which would make the block invalid and useless. At the present time the coinbase often contains information like a vote, the name of the pool, or merged mining information. Block #212261's coinbase decodes to "#= BitMinter/P2SH/,ú¾mmÏ�|ì�i§[Ð³\�e?3w�&ý �¶ù (¨ÇÎñÕ eu1º*" for example, which indicates the pool "bitminter" and a lot of random padding. Not all coinbases decode to human readable, a lot are just left totally random.

Perhap you could add to your answer how the pool software makes the work unique to each user?

This does not answer the question.  You are answering the question of "how do 2 different POOLS make sure they're not doing the same work".  My question was "how does an individual POOL make sure no 2 pool MEMBERS are doing the same work"

@RentFree "and a completely unique coinbase".