text:
New to Bitcoin - Need help understanding the mining part
I had a quick read of the basics of Bitcoin and the mining, but i still don't understand why this is done. can someone please explain in simple terms...

The biggest problem with developing a peer-to-peer payment system with no central authorities is preventing a double spend.
Say you're developing a payment system to allow people to pay each other widgets. If Alice has 10 widgets, she has to be able to pay 10 widgets to Bob. And she has to be able to pay 10 widgets to Charlie. But if she can do both with the same 10 widgets, the system is broken. So, somehow, Alice paying 10 widgets to Bob must stop her from paying those same 10 widgets to Charlie.
Bitcoin solves this problem with a mechanism called "proof of work". It's a bit complicated to explain, but the key point is that it requires an enormous amount of computational effort to be placed on either of the two payments. The one that has this computational effort is the one that "wins". The cost to put the computational effort behind both transactions would exceed the value of the transactions and you'd never catch up anyway because the winning transaction would be getting more and more proof of work (called "confirmations").
Because this computational effort costs money, Bitcoin needs some way to reward those who do it. They won't just do it out of the goodness of their hearts. Eventually, transaction fees will probably do this, but in the early days, there were too few transactions and Bitcoins weren't valuable enough for transaction fees to pay for the proof of work needed to secure the system.
The genius of Bitcoins is that the designer(s) solved two problems with mining. They added a "block reward" that goes to the miners to reimburse them for their computational effort. This not only solved the problem of how you pay for the computations effort needed to secure the currency before transaction fees can do it but it also provided an automated and predictable way to create the currency in the first place.


text:
Is it possible to confirm a specific transaction with your own miner?
I sent a Bitcoin transaction a few days ago and it still doesn't have any confirmations.
I actually have a ASIC miner.
Is it possible to confirm a specific transaction, in this case mine, with my miner?
Thanks

You could try to confirm it by mining a block in which you explicitly include said transaction. However, unless you have very powerful mining hardware, it is highly unlikely that you will succeed any time soon to solo-mine a block.
You could either try to double-spend the outputs you used to fund that transaction and for the second one include the correct fee, or just wait until the transaction's priority has risen sufficiently that it will be processed eventually.

It is not possible to confirm a specific transaction, you have to mine a full block that happens to include that transaction.
At current rates you need around 100PH/s to mine a single block within 24 hours. so 2.5EH/s to (roughly!) mine a block in under an hour. That my friend, is a farm that makes USD 250,000 per hour (excluding power mind you).

source: Stack Exchange

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

sort: votes


text:
Does using bitcoins require a "K-1" under some circumstances?
That's it...whenever currencies are traded, the possibility of a K-1 form arises, and since we're dealing with the dollar and the bitcoin here, and some people just trade the two without using them for a "pay-pal" purchase,it seems like a reasonable question.

Regulation in the area of digital currencies is still emerging, the best way to approach the topic is probably to talk to a tax advisor or tax lawyer.

From what I understand, you must report a capital gain (or loss) when you convert the BTC back into dollars.  But I am not an accountant so you should consult your own accountant and not rely on me.

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


text:
What do `minerd`s feedback messages (LONGPOLL, yay, boo) mean?
I have been testing a script that essentially runs (incomplete command shown here!): minerd --algo scrypt -s 45 --retry-pause 5 --threads $threads --url ...
Among the feedback messages, while minerd is running, there are once in a while following messages:

LONGPOLL detected new block
...accepted: 1838/2122 (86.62%), 49.94 khash/s (yay!!!)
...accepted: 1832/2116 (86.58%), 50.00 khash/s (booooo)

What is a LONGPOLL and how is it related to the bigger picture of mining? What is the difference between a (yay!!!) and a (booooo) accepted message?
Finally, what is the percentage in parenthesis in an accepted message (as above) showing exactly? Why does it both increase and decrease during mining? Shouldn't it grow only upwards reaching the 100% level?

If I recall it correctly, the "boo"s mean: your answer's correct but somebody else had solved the problem before, so you wasted your electricity and time - sorry. And the "yay"s are: you did it first, congrats.
As for "LongPoll", it's a protocol that enables a miner to keep in touch with its pool's servers so that it's communicated as soon as possible when someone (within the pool or outside of it) discovers a solution for the current block - the miner can then stop working on that block immediately. All work up to that moment has been wasted, of course, but the waste's minimized this way - otherwise, your machine would just keep going, produce a result and deliver it... only to be informed then that it was way too late. Today, most pools support it - so you should see a lot of "longpoll" messages but relatively few (if any) "boo" :-)
Finally, as to the percentage: it tracks the number of solutions your machine has dispatched to your miner pool's servers, comparing the number of accepted ones versus the ones that got rejected. In an ideal world LongPoll would ensure your machine gets notified immediately upon someone else's discovery of a block's solution, and your machine would stop working on that block right away - so the percentage would always be 100%. In real world, lots of bad stuff can prevent this from happening.
What can you do to improve that percentage? Find out why you're having rejections! You might not be receiving the longpoll notifications, either due to your Internet connection being slow or the pool being under a DDoS attack - so change your Internet provider or go to another, smaller pool. You may have set up your ASIC or graphic cards to a too-aggressive configuration, try changing the settings of your miner. And some other things I can't remember right now - there are questions and answers about that on this site.

Could you please explain also the LONGPOLL?

Done. Please take note I'm also very new to the Bitcoin world myself, so you'd better wait/ask for a second opinion from someone else, hopefully more knowledgeable than me

Thank you. I will upvote as I think you have covered my questions. I will wait for other answers before accepting.

There is this percentage thing which I didn't understand... but I'll search for it.

Oh, sorry! Wish I weren't so lazy and had provided a more thorough answer from the very beginning :|


text:
How long does it take to gives again into circulation after loss Bitcoins
How long does it take to gives again into circulation after loss Bitcoins ?

This question is based on a false assumption: Lost bitcoins are not returned into circulation.
The problem is that one cannot distinguish lost bitcoins from saved/stored bitcoins, as it is impossible to prove that nobody has the private key to a given address.

You cannot distinguish between valid and invalid addresses either. If you're referring to addresses with an invalid checksum, you can't send to those in the first place.

Oh thanks, I wasn't aware that you couldn't circumvent that with raw transactions. I'll correct that in my answer.

Addresses are really shorthands for standard transaction output scripts. With raw transactions you can certainly create invalid outputs (provably lost coins), but those are special scripts, which do not have a corresponding address.

Right, I thought I had read about that. I didn't realize that your interjection was about the distinction between address as valid recipient and invalid output destinations.

Eventually once  all of the bitcoins have been mined the design calls for a permanently-finite system and eventual deflation

Also, Bitcoin users are faced with a danger that doesn't threaten users of any other currency: if a Bitcoin user loses his wallet, his money is gone forever, unless he finds it again. And not just to him; it's gone completely out of circulation, rendered utterly inaccessible to anyone. As people will lose their wallets, the total number of Bitcoins will slowly decrease...
...That being said, there is a mechanism in place to combat the obvious consequences. Extreme deflation would render most currencies highly impractical: if a single Canadian dollar could suddenly buy the holder a car, how would one go about buying bread or candy? Even pennies would fetch more than a person could carry. Bitcoin, however, offers a simple and stylish solution: infinite divisibility. Bitcoins can be divided up and trade into as small of pieces as one wants, so no matter how valuable Bitcoins become, one can trade them in practical quantities.


text:
How do you create a miner?
I just downloaded GUIMiner for my Windows and in the tutorial they said that i should create a miner. I have no idea how to do it. Could someone tell me?

You can create an account on a mining pool like Slush's pool (http://mining.bitcoin.cz/). Everything is written there.

First you need to decide which crypto-coin you wish to mine: Bitcoin, Litecoin, Peercoin, Dogecoin or any other of the hundreds of alternatives. You should've already downloaded the wallet for this coin.
Next you have to decide if you're going to join a pool or go solo-mining. Unless the coin you wish to mine was released yesterday (literally), has too few users or you have enormous amounts of hashpower, forget about going solo.
Next you need to open an account at a miner pool - there are hundreds by now, a minimum of 1 for each crypto-coin (bitcoin, litecoin and doge have dozens each). Miner pools have their webpages where you register, create your username and set your ccount so the coins you mine go to your wallet.
At the end of the registration process (or in the help page) you'll be given the IP address an port you should point your mining program to. Finally you start your miner and watch as you get coins, hopefully at a profit vs. the electricity costs.
There's also the option of using a p2pool, these are decentralized pools where you don't have to open an account at a page, don't need to trust the pool's manager to be honest, etc. But these require you to have more in depth knowledge of how cryptocoins and mining work, so leave that aside for later.


text:
If a block chain is considered invalid, how about transactions in this block chain?
Say if at current time there exist split of block chain, we call them A and B. A is "longer" then B, as the result B will be eventually forgotten, but what happened about the transactions in blocks on B? The block which is different between A will be unpacked, reconfirm the transaction then create new block, add new block on A?

Any transactions in a block that is no longer part of the longest chain will revert to unconfirmed (assuming they're not in the new longest chain) and return to the mempool. In most cases, assuming the transactions remain valid (i.e. the outputs they spend aren't already spent in the new longest chain), said transactions will simply be mined into a new block on the longest chain.

Competing chains do not split transactions between each other to be confirmed. In fact, each chain assumes that it is the only valid chain as the other chains are incompatible to itself, therefore each chain will try to include any and all transactions.
Some transactions might be in a different order or at a different block height, but unless the chains have confirmed conflicting transactions such as a double spend, all transactions will be present in both chains.

Exactly. That's the whole idea of POW. Transactions in a side chain by it's very definition are invalid


text:
Why was the time between these two blocks not approximately 10 minutes?
A new block will be created in approximately 10 minutes, but I saw on blockchain.info that these two blocks were found only two minutes apart!

How come that the time between the first two listed blocks is just two minutes?

See also this related question: What is the expected time until the next block is found?

There are a few things to know about the frequency of blocks:

Every hash has the same chance of finding a block. So, times between blocks are randomly distributed.
The difficulty (i.e. the expected number of hashes required to find the next block) is only adjusted every 2016 blocks. With ten minutes between blocks that would be every 14 days. However, since a lot of hashing power is being added to the network every day, the hashing power quickly starts to exceed the difficulty that it was estimated to accomodate, and the average time between blocks starts to get lower until the difficulty is adjusted again. So right now, we are probably closer to a block every 7 minutes in average than every 10 minutes.

10 minutes is the average time between blocks that the network tries to attain (by adjusting the target/difficulty).  It is not a fixed thing.
Due to the way mining works, there is a great deal of random variation in the time between blocks.  A block may be found seconds after the last one or hours may go by between blocks.


text:
Are hacked bitcoins spendable?
700,000 BTC were stolen from MTGox. So are they actually spendable by the hacker or are they now just lost to the world? I can understand wallets being encrypted, but why aren't individual BTC encrypted with the owners private key so that a stolen BTC is worthless unless the owner unencrypts it first?

This cannot be answered accurately as we do not know what exactly and truthfully has happened to MtGox coins. If it was a hack why would you want to make the coins un-spendable anyways? Just keep em!

Your question indicates certain misconceptions about what Bitcoin is. I would advice you to take an afternoon to read the Bitcoin whitepaper, learn from other sources and understand as much as possible. It is possible to know what Bitcoins truly are without great technical knowledge. (Bitcoin transactions can only be made with the owner's private key. A "theft" usually means performing a transaction towards a thief's address, by manipulation of software or persons or obtaining other people's private keys.)
They can be spent just like any other Bitcoin. The only thing is that you can trace every Bitcoin, and therefore know it has been partially stolen Bitcoin. This is called "Taint".
A tainted Bitcoin could be considered less valuable as it would not be accepted everywhere and spending them at "legal" institutions would give a lead towards the thief. Buying stolen goods is illegal in most countries, stolen Bitcoin would count too.
If the Bitcoin community agrees on no longer accepting stolen coins they could even become practically worthless, the risk of arrest for theft and the low value or spendability of coins would be complicating.
The problem is that "theft" is a political issue, just like ownership. Some nations might not consider a hack a theft, and certain Bitcoiners definitely think so too ;). Who would be the judge in discriminating a stolen from an unstolen Bitcoin?
Then there's the fact that someone might have accepted Bitcoins not knowing they were stolen, or even whom they're really from. Or accepting them before it was decided they were stolen. Similarly to counterfeit money. This means that Bitcoins once stolen, are not per definition "stolen" or "illegally accepted" now. Certain Bitcoin laundry services are available to attempt to disturb the usual tracebility.
Overall I would say that a thief would have to be very careful not to expose him/her self. An effective laundry service could help him/her with that. But the coin is still the coin, and can still be spent.
Please let me know if this answered your question. Comment if you are unsure of something.

Related: http://bitcoin.stackexchange.com/q/7966/13866

You can't encrypt individual BTC. Only the wallet containing BTC (to say it in a popular way, the real technology behind it is different) can be encrypted.

The stealing of the coins means they got sent to another address and are therefor spendable. Individual bitcoins can't be encrypted since they only exist as numbers in the public ledger of transactions called the blockchain. What you encrypt is the private key that 'gives you the right' to spend output from a previous transaction.

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


text:
Antminer S1, how to mine on multiple pools
I have an ant s1 and I want to mine on 3 pools. We can set them in the miner configuration but  the antminer use only the first one. I guess it will use the second then the third one in case of failover.
Is there a way to make the antS1 mining simultaneous on the different pools?
Thanks.

Not quite, however you can pool hop.
Check out Bit Hopper
this way you can maximize your mining profits, obviously you put other people at a disadvantage, but the pool operator should really take care of these exploits...

Lol ok thanks, I will check this but it was not really my intention to use any kind of exploits :)

Do you know how to use it on an Antminer s1 ?


text:
How to decrypt asm?
Here's what I get from Mintcoin client for some transaction. I have decoded output, but
how can I decrypt asm in transaction input? I know it's a public key. Here it is:
304502207fc09b1c29548feceb349aa1450874f97e7e9b9c0084e5917380151258236633022100808b8ca131480afcdef328c961131be389489fdc07e5201a807c47a6b94b18f201

I merged your previous question with the almost exact same text into this one. Please edit questions if you want to improve them instead of just asking them again.

This is ASN.1 DER encoding. This is NOT the public key, but the ECDSA signature.
30 45 means set of data with 0x45 bytes following
02 20 means big integer with 0x20 bytes (this is big endian value "r")
Skip 0x20 bytes...
02 21 means big integer with 0x21 bytes ("s")
In other words:
r = 0x7fc09b1c29548feceb349aa1450874f97e7e9b9c0084e5917380151258236633,
s = 0x808b8ca131480afcdef328c961131be389489fdc07e5201a807c47a6b94b18f2

The final byte 0x01 means SIGHASH_ALL (default)

This is technically correct.  ASM is not "encryption" like the OP writes, as such it can't be decrypted.  It is the binary (ones an zeros) of a file that is converted to letters and numbers for humans to read.  The main purpose of this ASM is to be read by a computer.

Note: reason "s" takes 0x21 bytes is that leading byte 0x80 has bit 7 set to 1, so an extra leading 0x00 byte is added to indicate positive sign, for interoperability with OpenSSL.

Is the encoding of s really 21 bytes for the DER encoded signature, or is it variable based on the value of the second-to-last bit?  If s is variable, I'd say it fluctuates between 21 and 20 bytes.  R should be the same way at least 1 in every 1,000,000 random signatures (in my experience)

Yes it is variable based on the most significant bit. Both r and s can be 0x20 or 0x21 bytes.

You may be interested in these test cases for the recoverable signature format that may be less than 32 bytes http://bitcoin.stackexchange.com/a/22881/1878

I suppose you are talking about the scripts. The scriptPubKey script in the output is indeed more readable because it contains OpCodes like OP_HASH160 and OP_CHECKSIG. However, the input scripts are in their original form as well.
As you can see in the specification of the pay-to-pubkey-hash transactions scripts (the regular scripts to pay to Bitcoin address), the input input script only consists of two data elements, the signature and the public key. So what you see in the input fields "hex" and "asm" are the signature and the public key of the address the input spends funds from. The reason that these two values vary slightly is because they are encoded differently, but that doesn't matter all that much.
Basically, they are not encrypted or so, they just contain little to no relevant information.


text:
I am new with peercoin and confused is it mining or not [screenshot]

I am new in peercoin and trying first time mining of any currency just to see how it works.
I installed cgminer but there's an error

Probing for an alive pool Network diff set to 91.5

like that but I am confused that is that are errors or not because its also saying

stratum from pool 0 detect new block

can anyone explain me what's its going I mean working or not if not then why this error is coming if its working then meaning of these messages.
Thanks

What hardware do you want to use to mine? Cgminer hasn't GPU support from the 3.7.2 version

Not using any hardware just using my computer I just want to see how it works

i think cgminer decide not use your cpu because it's not efficent for sha (the algorithm behind peercoin). For seeing how it works i think you can try cpuminer

I think its for litecoin and bitcoin only

no, it isn't. bitcoin and peercoin share the same mining algorithm which is sha

If you have a graphics card you can use previous versoins of cgminer and have it mine with your GPU


text:
Previously functional Bock Erupter Cubes suddenly throwing errors and will not mine
For the past two months I have been mining, without incident, using the stratrum proxie on my block cubes. I run the proxie, alternating, from two different systems so I don't believe anything has changed on the PC side, or I would expect one of them to still work. The only thing that I have done, that is different, is try to change pools to a PPC pool to diversify my earning. Since I attempted to change pools I am no longer able to mine on any pool (including BTCGuild, which I have never had a problem with before. I am receiving error messages, that I cannot decipher and I'm not sure what to do about this. Has anyone else dealt with this problem before, and if so did you find a solution.

If anyone has any suggestion, I will be forever in your debt. I am at a complete loss, as to how to solve this problem. Thank you for taking the time to look.

Is there a chance the IP address of the proxy changed? Added an Android WiFi device?
You might also post to "Dogie's Comprehensive ASICMiner Cube Setup" on bitcointalk, that is ASICMiner Block Erupter Cube specific with over 1300 posts.


text:
How to build a bitcoinj checkpoint file
How can I build a bitcoinj checkpoint file
like the Bitcoin-wallet checkpoints?

From this discussion: How to create a checkpoint file
Run mvn exec:java -Dexec.mainClass=com.google.bitcoin.tools.BuildCheckpoints in the tools/ directory from the bitcoinj repository.
BuildCheckpoints expects you to have a fully synced local Bitcoin-Qt/bitcoind instance running.

Providing an updated answer:
Bitcoinj provides a tool for that. I'll assume you have downloaded bitcoinj repository:
Inside the 'tools' folder you will find a file called build-checkpoints.cmd (for Windows, or just build-checkpoints for Linux).
Try build-checkpoints -help to learn about the tool's options.
If you don't have a local bitcoin node, you should provide a node's ip using the -peer parameter.


text:
Workers aren't showing up in ghash.io
Im using cgminer 3.7.2 and I'm mining at ~77Mh/s in the ghash.io pool. I go to the worker list at the ghash website but nothing shows up. At the ghash main page it shows that I'm mining the blocks but it says 0 Gh/s

You'll probably have more luck sending them a support request

You will need to have some accepted shares before any stats etc. will show.


text:
Is it chain of headers rather than a chain of blocks?
We know widely used explanation of the blockchain:
"Every block contains a hash of the previous block". The sentence above implies that since every block contains a hash of the previous block, therefore every block should have a knowledge about transactions included into the previous block because every block has a following structure:
Block:

Magic No
Block Size
Block Header
Transaction counter
Transactions

Block Header:

Version
hashPrevBlock
hashMerkleRoot
Time
Bits
Nonce

However, every block does not have knowledge about transactions incuded into previous block correct???
As fas as I understand there are two chains in the Bitcoin:

a chain of blocks headers (a block chain)
a chain of transactions (Prev Tx Hash)

Hence just to clarify, rather than saying: "every block contains a hash of the previous block", would not it be correct to say: "header of every block contains a hash of header of the previous block"?
Please correct my assumptions if I am wrong. Thanks.

Blocks contain a header, and headers are chained, so blocks are chained also.  Note the merkle root from your question: this attaches the transactions in the block to the header, making them a logical combined unit:

That is, you can't attach an arbitrary block to an arbitrary header---each header only attaches to one set of transactions.
You are correct that this expression is wrong: "every [valid] block contains a hash of the previous block".  That phrasing may be useful for non-techies, but if you find it in any editable technical documentation, you should probably change it.

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


text:
Blockchain for internet-of-things or is there any mining algorithm that can be utilized in low-computational power devices preserving security?
Recently IBM and Microsoft showed their interest (IBM post, Microsoft post) in utilization of blockchain for internet of things development.
Let's assume that in close future the blockchain technique to be implemented in smart cars overlaying road conditions or traffic data to each other.
Since the majority of honest nodes will be low-computational power devices (maybe like raspberry pi) it will be easy for adversary to perform a double-spending attack if implemented mining algorithm will not be able to bottleneck mining capabilities of devices.

Is there any mining algorithm that can resist nodes with high-computational power to a certain extent, so the blockchain can be utilized in a network of low-computational power devices?
From security perspective is it possible to allow only certain devices connect the network (let's say if they will somehow proove that they are limited in computational power within acceptable range defined by network)?

No, not in a fully decentralized way.  Hash-based methods (like what Bitcoin uses) will always be more efficient on more efficient hardware.  Proof-of-stake methods can't be fully decentralized.
No, hardware can't prove its capabilities in a fully decentralized way.  It is possible for a device to prove its maximum distance from you using the speed of light---if you send it a ping and it replies in n seconds, you know it's within n times 300,000 kilometers of you.  You can use similar hacks to prove other things---but you can't trustlessly export that proof to other users on the network you don't directly observe the phenomena, making it useless for block chains.

I read the two articles you linked to, and I suspect they're using "block chain" as a buzz word.  There's no way to do fully decentralized mining without giving control of the block chain to the people with the most efficient hashing hardware.
Their plan is probably to install a key pair on each device, sign each device's public key with the IBM master key, and then tell each device to accept messages from other devices as long as those messages have been signed with a key that was also signed by the IBM master key.
For example, my IBM car GPS will send traffic updates to other nearby IBM car GPSes.  Those GPSes will count my update as one authenticated vote.  If other nearby IBM car GPSes send the same message, eventually the message will have enough votes to cause all nearby IBM GPSes to choose alternative routes.  This is nominally "decentralized" and it may work until some IBM sysadmin signs 10,000 public keys for himself in order to get everyone off the highway so he can get somewhere quicker.

Regarding 2: i think you did not understand me. I meant when connecting peers send each other versions and if versions are the same, nodes proceed with exchanging verack messages. Hence maybe these devices along with a version of installed client should send their computational abilities. Therefore if a requesting peer possesses too much of computational power no other nodes will connecto to him. It is easy to get memory information both from Windows and Linux machines. So when I send such data along with version, based on it a node can either accept me or decline. Can it be a solution?

That's not a trustless solution because any node can lie about its capabilities.  I have a laptop and a Raspberry Pi in the room with me right now: I can't make the RPi act like the more powerful laptop, but I can easily make the laptop act like the less powerful RPi.

If you require a network key then you can achieve the objective of keeping a network secure and therefore your IoT application safe and sound.


text:
How to calculate signature generation, signature verification, transaction verification speed?
I read this post on Bitcoin Scalability.
As far as I understand sequence of steps in Bitcoin, simplified version of performing transaction should be following:
On Sender's side:

Create transaction
Generate signature and sign
Broadcast the transaction to peers

On Peer's side:

Get the transaction
Verify signature
Verify transaction
Pass to the next peer. - ???

//if a peer is a miner

Collect transactions into block
Calculate PoW for the block
If found include it to his version of the blockchain
Broadcast the block (with nonce and targe)

Other peers:

Get the block
Verify that PoW for block is Valid
Include the block into their version of the blockchain

I would like to understand Bitcoin's performance speed at every step in general or given my specifications of the laptop if possible.
How I can calculate signature generation, signature verification, transaction verification, block PoW verification, **etc speed?**

Typically, it's easy to benchmark times ($end - $start) and send them somewhere. Is there particular software you wish to test?

Thanks for you reply.  No I didn't have anything particular on my mind, but I am have more experience with Python and C++, so I thought of those implementations.
Yes as you said I thought of find the start and stop timestamps between parts of code in charge of signature generation/verification, transaction verification, and then just subtract them from each other.

All of these things you want to calculate are highly dependent not just on the hardware you use, but the software you use. For example you can generate signatures many different ways and every bitcoin wallet generates them a little differently. The signature generation performance of Java in bitcoinJ is going to different than that of Go in btcwallet is going to be different than that of C++ in bitcoin core and so on. In addition, deterministic signatures are going to have a different performance profile than non-deterministic signatures and so on.
That said, if you really wanted to, you can run some performance testing on any one of these, though not all of them exist. For verifying signatures in btcd, there is a benchmark test that you can use.
Note that block verification (or creation) necessarily means verification of all transactions in the block as well as checking the proof-of-work. Checking the proof-of-work, by the way, is really as simple as a calculation of a double-sha256, or a single "hash" that mining gear can do billions or trillions of per second.

Thanks for you reply. To be honest I have never used Go, I basically have academic experience with Python and C++. I installed Go though, but even following the guide from github, still can't properly figure out how to run this benchmark test.

It should be pretty straightforward. Try go test -bench BenchmarkSigVerify in the btcd/btcec directory.

Sorry for bothering, so as you said I ran go test -bench BenchmarkSigVerify and received an error:  go tool: no such tool "6g"
As I've read it can be problem with .bashrc, so I checked it for export GOROOT=/usr/lib/go and it was there, but to be sure I did source .bashrc, still the same error

Totally depends on your setup. Wherever the btcd repository is, make sure the GOPATH is pointed there. Typically this is /home//go. export GOPATH=/home/myusername/go should set it up.


text:
Is it legal to start a Litecoin mining pool in the US?
My question is this: Given all the regulations in the USA, is it legal for me to start my own litecoin mining pool here in the US?

I really wish I had the answer to this.  I also don't think the question has been answered in general yet.

US Treasury confirms Bitcoin miners and investors won't be regulated But don't use this comment as actual legal advice.

This is a q&a site populated by random      people from the internet, and you expect trustworthy legal advice? No, what you need is a lawyer.

This question appears to be off-topic because it is asking for legal advice.

The question might be mostly on legal matters, but definitely is something that pertains to all crypto-currencies, not just to Litecoin (nothing in Litecoin would merit treating it differently than Bitcoin). A way to answer would be to search - are there any mining pools operating physically from servers in the States? In which case, their managers could answer it. I believe slush's and Luke-Jr's are, but not sure.

There is nothing illegal in the process of mining litecoins or bitcoins.
As far as cryptocurrnecies concern, you should be worried about "money transmition" and "money laundering". If you do not hold other people's coins you are not breaking any laws.


text:
What hash rate should I expect using a BiFury with USB2.0 rather than USB3.0?
I'm considering the BiFury which is generates ~5GH/s on a USB3 port. They say,

Miner is designed to be used with USB 3.0 port or USB 3.0 hub (must meet min. 0.9A per port to achieve full hashrate)
  USB 2.0 support is also available but hashrate will be lower.

However they don't quote an expected hash rate for USB2.0. Will it be significantly lower?

Why the down vote, this is a sensible question?

I found that some USB2 hubs with enough amps (3-4) can take 3 BiFury each easily reaching 5.2-5.6 GH/s. I have 5 running off two 5V 3A hubs daisy chained off of a RaspberryPi with minepeon, works well. You 100% need a couple of fans to keep these cool, I am using arctic breeze, works fine. Errors are at about 4% and temps range from 38 to 50°.
So, the conclusion is… USB2 will work well with BiFury just make sure you have a good amount of amps to supply the thirsty 0.9A they need each! I think they are a good miner for people to get started without spending to much.


text:
Mining bitcoin using cudaminer?
I have started mining using an nvidia gtx 670m GPU. I have compiled cudaminer and started mining on the slush pool. However, during mining I always get results similar to:
accepted: 0/X (0.00%), xx.xx khash/s (booo)
accepted: 0/X (0.00%), xx.xx khash/s (booo)
accepted: 0/X (0.00%), xx.xx khash/s (booo)

where X is an increasing counter and xx.xx is the hash rate(usually between 75.00 and 100.00 khash/s). Is this related to networking, more specifically port forwarding? I am asking because the bitcoin-qt client managed to synchronize with the network.

You probably want to mine an scrypt based coin, such as litecoin or dogecoin. Bitcoin is practically impossible to mine without ASICs these days

That means your results are being rejected. Most probably becouse someone else's found them before. Mining bitcoins at 100KH/s is useless, at 280GH/s 0.06BTC are mined daily so....

I am mining for educational purposes. I have found a thread that mentioned that the launch configuration of the miner was wrong. I've changed the credentials and pointed to another resource and now I am no longer getting the accept 0/X message, only the hash rate.

It is because you're trying to mine bitcoins with Litecoin (scrypt) algorithm.


text:
Bitcoin Mining Through VPN
I'm fairly new to bitcoin and mining and am currently using a very restrictive ISP(port forwarding is not permitted). Therefore, it is not possible to connect to the bitcoin network(port 8333 is blocked). I also have a work station, in a different network, which doesn't share the above limitation.
I am using ubuntu 12.04 and went for the OpenVPN package. I can connect to the remote machine but don't know how to route mining traffic through it. Also, I don't want to delegate mining tasks to the remote box as it is a low end machine.
Is mining through a VPN tunnel possible in this context?

Are you sure that a port forwarding is needed for mining? As far as I know, you just need to be able to send traffic out on that port. (if your ISP blocks everything but port 80 for traffic or some such, that would be a problem)

You need that port when peers broadcast transaction information; and sadly yes the ISP blocks all inbound connections

There is no way, at least not with a pool. I have a restrictive firewall (no UPnP or ports forwarded) and I have no problems connecting to the bitcoin network. Do you mean the ISP blocks all outbound connections on non-standard ports or some such?

Yes, nobody can connect to my machine. I am currently trying to set up OpenVPN on the remote machine.

I'm also having what appears to be an issue with running bitcoind behind OpenVPN. bitcoind appears to crash after a few minutes with nothing in ~/.bitcoin/debug.log. Couple questions:
1. How can I tell the cause for the daemon terminating if there's nothing in the log file?
2. Do I need to make a change to my IP tables, or some other aspect of my VPN configuration? Not exactly sure conceptually what is required to get bitcoin network traffic in/out through the VPN. Thanks guys!

I've managed to route all traffic that runs through eth0 to tun0. The tun0 interface is created by default once the VPN service starts(given that the bridging option(tan) was commented out on both the client and the server config files).
Running "netstat -nr" gives the routing table. Then, all duplicate routes need to be deleted. For example if there are more than one Destination(s) pointing to the same Gateway one needs to be dropped in order for the other to work properly. Otherwise packets are sent through both gateways. In my case I had to delete the route which was pointing to my NAT and leave the one which pointed to my VPN server's address(usually 10.8.0.1 is assigned by default). In order to drop a certain route run the command:
sudo route del default gw <NAT internal IP, i.e. 192.168.2.1>.

Yup.  Most of the common VPN services would work with it, it's a normal TCP/UDP sort of system.  I use torguard VPN, but I think most would work.


text:
0 Payout at litecoin pool with a processing power of 1.6 Mh/s. Why?
Recently I managed to get my hands on 10 servers with 32 cores each and 128GB ram each. I realised that in 10 hours of working at 100% I had mined exactly 0 litecoins using a p2pool. I think it's called mint.
I was delivering an average of 1,6 MH/s to the pool. I was in the TOP 3 active miners of the pool.
My mining layout is: One CPUminer (minerd) per server with one thread per core all pointing to the same pool with the same username (litecoin wallet address).
Does anyone have any clue why this is happening? Is it a technical problem or was I just purely and simply tricked?

Welcome to the world of PPLNS pools. You're much better off trying a PPS pool, as they tend to be much more balanced compared to the hash rate.

According to the crypto-coins' profitability calculator coinwarz, with that much hash power you could have a gross daily earning of about US $14 should you mine Dogecoins and not Litecoins. Mining Litecoins instead, theoretically you could earn about US $11 per day.
Most of the times it's much more profitable to mine an alt-coin than the grand-daddies of them all (i.e. Bitecoin and Litecoin). The problem is, of course, you need to have wallets for those alt-coins and open an account at an exchange that accepts them to get bitcoins or dollars for them.
How many blocks per day is your pool finding? You won't be paid at all until/unless your pool finds a block.  That statistic will give you an idea of how often you'd be paid.
In "normal" pools the whole blocks' reward goes to the pool administrator who then pays miners their share -according to the hash power they've provided- minus his fee, so there's a bag of coins (coming from fees) whence to pay you should the pool find no blocks in some time.
Since p2pools lack (by design) a central administrator, you're forced to wait until it finds a block. The pro is you don't have to trust an admin. to be fair and honest, only source code you can audit/inspect should you know how to.


text:
Why doesn't the number of shares in my miner match the number of shares reported by my pool?
It was my understanding that I have found a share, when the miner reports accepted:...(yay).
However, the number of shares I'm being credited with in my pool is much lower than the number in the miner.
I'm talking about total shares as I have always used the same pool, and I haven't reset the miner so far. So, both should refer to the same frame of time.
Why doesn't the number of shares in my miner match the number of shares reported by my pool?

If you're using P2Pool, the following Q/A might be helpful: "Q: Why does my miner say it has found a lot of shares but p2pool say I have only found a few?!
A: The real P2Pool difficulty is hundreds of times higher than on normal pools, but p2pool essentially lies to your miner and tells it to work on relatively easy shares so that it submits shares every few seconds instead of every few hours. P2Pool then ignores any submitted shares that don't match the real share difficulty. By doing this, P2Pool can more accurately report your local hash rate and you can see if..."

Or another pool might do something similar. What pool and software are you using?

I'm using DEDICATEDPOOL mining 42Coin. Yeah your answer corresponds with my problems though, thanks a lot, I was just worried that I'm loosing coins because I'm a newbie.

@TimS. You really should post this as an answer.

@Murch I was unsure, but yeah, I've posted it as an answer. Might not be perfectly right, but probably helps...

Well, it seems to be a likely explanation and the asker stated that it fits his problem – that's why I suggested you post it as an answer. :)

It's possible that your pool is doing something similar to P2Pool:

Q: Why does my miner say it has found a lot of shares but p2pool say I
  have only found a few?!
A: The real P2Pool difficulty is hundreds of
  times higher than on normal pools, but p2pool essentially lies to your
  miner and tells it to work on relatively easy shares so that it
  submits shares every few seconds instead of every few hours. P2Pool
  then ignores any submitted shares that don't match the real share
  difficulty. By doing this, P2Pool can more accurately report your
  local hash rate and you can see if you are having problems with too
  many stale shares quickly


text:
CGMiner settings so that Photoshop usage isn't slow
Currently I have two settings for CGMiner, using a Radeon 6850 for home usage.
One for casual work, and one for night-time (light and heavy).
However, even at the casual settings Photoshop is very slow to use, so I have to switch it off completely.
Are there are any settings that will give priority to Photoshop (and other applications), when CGMiner is running? That way I can leave it running all day, but the hash rate simply drops when other programs require the GPU.

Maybe you can add what settings your currently using? General rule of thumb is to lower the intensity and your system will overall perform better while mining.

My "easy" settings are: setx GPU_MAX_ALLOC_PERCENT 100 setx GPU_USE_SYNC_OBJECTS 1 .\cgminer-3.7.2-windows\cgminer.exe --scrypt -o stratum+tcp://dogeu.nut2pools.com:5585 -u xxx.yyy -p zzz -w 128 -g 2 --auto-fan --thread-concurrency 3840 --intensity 9 --shaders 960

If I set GPU_MAX_ALLOC_PERCENT to say 50 or so, would this only utilise half of the GPU?  What I'm ideally looking for is some kind of dynamic allocation, rather than a fixed setting upon startup.

my 6970 struggles massively when altering from its stock settings. Try removing the thread concurrency and shaders along with putting intensity down to 7. Having said this my performance on scrypt with cgminer has always been poor even when pushed hard.


text:
Armory takes 8 Hours to sync. Is it going to get worse as Bitcoin becomes more popular?
I have been experimenting with Bitcoin and I installed Armory wallet. It told me that it would take approximately 8 hours to sync the worldwide ledger.
My question is, as Bitcoin gets more popular, will it take longer to download the ledger?
If so, doesn't this pose a problem - could it get to big to be feasible?

Please see further detail on my question.  It is distinctively different, as I would like to know if the growth will cause a problem.  Thanks :)

Regarding that edit: Possible duplicate of Are there any studies into the size of the blockchain scaling over time?, How big will the block chain become?, Can blockchain size become a blocker for bitcoin adoption? ;)

It's a good question, but it has been asked a few times already. :)

Although this question is in principle a duplicate, it's so that Armory does not really downloads the blockchain, but parses it from Bitcoin-Qt. But they are working on changing that so that it does not take 8 hours every time you open the client. Not sure how far they are with that.

The short answer would be yes, if the chain
becomes bigger it takes more time to download
it.
The more detailed answer would be: there is
plenty of options to make it quicker: for
example you can download already constructed
chain from some trusted source.

No, blockchain grows with time, not with popularity bigger blocks can be a factor but are not the main issue.

The question was if it is going to take more time, the answer is yes it will because it become larger.

Both in title and description the question is linked with Bitcoin becoming more popular and even if Bitcoin become less popular and even abandoned except for a minority the blockchain will continue growing. So no blockchain size problem has nothing to do with popularity.

what about much more transactions data in each block ?
common take the -1 off :)


text:
Why would you rather mine Bitcoins than Litecoin? What am I missing?
I must be missing something here.
This calculator site says that a 2000 kh/s rig can generate .6 litecoins a day or ~10 USD.
http://www.litecoinminingcalculator.com/index.php?khs=2000&diff=3130.08003568&cdiff=3130.08003568&fee=2
Are these numbers wrong or has mining bitcoins with non asic rigs completely pointless now a days? Why isn't everyone mining litecoin at this rate?

Hashing speed of the same hardware for BTC and LTC is different said so, yes mining BTC without ASIC is almost sure a loss of money, unless you want it to get the BTCs and avoid the need of buying them.

Mining Litecoins and mining Bitcoins use completely different algorithms. There do not exist any rigs that hash both at the same rate.

Mining Bitcoins with anything other than a purpose-designed ASIC is inefficient with the current hash rate, and is unprofitable in terms of power expended and daily profit. But mining coins using the Scrypt algorithm with graphics cards is profitable in a small or large operation.
Why is Scrypt Mining Profitable?
To simply put it, Scrypt requires more memory than SHA hashing and memory is expensive. GPU mining is popular and profitable, because it has large banks of memory standard and cheaply ($300-$400 a card). SHA hashing is easy to do with an ASIC chip because it can be done with very low memory and very inexpensively in terms of resources. So, building an ASIC to do the job of Scrypt mining is a lot more complex and expensive – keep in mind the designing a Bitcoin ASIC was a multi-million dollar process. Having large banks of memory on your ASIC chip introduces a lot more design issues. ASICs for Scrypt is very doable, but a lot less doable than Bitcoin ASICs. We probably will see the rise of Scrypt ASICs within 5 years or less.
What is Scrypt?
It is the hashing algorithm a majority of the cryptocurrencies use. Litecoin, Dogecoin, etc are all Scrypt-based coins. People use Scrypt for good reason, it makes ASIC mining tough, and that's about it. Bitcoin using SHA-256 is not bad in any way, but it's a lot more sensible to use Scrypt with any new altcoin to avoid getting ravaged by extreme hash rates ASICs can impose. And Bitcoin cannot simply change over from SHA-256 to Scrypt either.
When is ASIC Mining Profitable?
Don't get fooled into thinking Bitcoin mining is not profitable, the profit comes with large operations. Say you could get your hands on a few racks of ASICs mining Bitcoin, you'd have reasonable returns. You also have to move fast with Bitcoin, certain ASICs obsolete fast. You start turning a profit with ASICs when you've spent tens of thousands dollars. The BFL units that cost around $250 became inefficient within a few months of release, and you could find units going for thousands of dollars because those were one of the first few shipped early. See http://motherboard.vice.com/blog/a-guide-to-bitcoin-mining-why-someone-bought-a-1500-bitcoin-miner-on-ebay-for-20600


text:
Installation troubles... Compiling from source code on a mac book pro
So, I've tried to follow the instructions in /doc/build-osx.md
I installed the dependencies using Homebrew
brew install autoconf automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt5

Just to verify if I run this command again, I get the following:
Warning: autoconf-2.69 already installed
Warning: automake-1.15 already installed
Warning: berkeley-db4-4.8.30 already installed
Warning: libtool-2.4.6 already installed
Warning: boost-1.60.0_1 already installed
Warning: miniupnpc-1.9.20151008 already installed
Warning: openssl-1.0.2e_1 already installed
Warning: pkg-config-0.29 already installed
Warning: protobuf-2.6.1 already installed
Warning: qt5-5.5.1_2 already installed

I then run :
 ./autogen.sh

which is fine,
Then I run:
./configure --with-gui=qt5

And after a lot of lines of checking... I get, the following
...
checking miniupnpc/upnperrors.h presence... yes
checking for miniupnpc/upnperrors.h... yes
checking for main in -lminiupnpc... (cached) yes
**configure: error: Qt dependencies not found**

Any ideas what I could to fix this?
Thanks in advance.

I ran the ./configure without the -with-gui=qt5 option and the installation went through fine.
btw, this was on MAC OS X Yosemite (Version 10.10.5).


text:
How long to earn fractions of bitcoin
I started mining today, and I'm using the bitcoin GUI miner, along with rpc2013-cuda. I'm running algorithms on the CPU(completely maxed out - It's a core i7 quad-core/Hyperthreaded at 2.3GHz) and the GPU(98% Load - GT 650M at 1GHz Core/ 2GHz Memory don't Know the shader speed. I think it is the same as core) and got no share of bitcoins so far.
How much do you guys think that i'll be able to get a fraction of a bitcoin. I say fraction because I'm mining in a pool. That is Eligius. Should I start to mine in another pool? Maybe forget about CPU/GPU mining and try to buys a FPGA or dedicated miner?
edit 1: On total I'm having a hashRate of 40MHash/s

At the current difficulty, it would take you about 100 years to earn Eligius' minimum payout of .04 BTC. Of course, in that time period the difficulty would increase and the block reward would drop. So you would almost certainly never earn the minimum payout at that hash rate.
Of course, your electricity cost would be many times the value of the Bitcoins you would mine. By my rough math, you're wasting about $10/month, if the computer would otherwise be off.
It hasn't made any sense to mine Bitcoins with a CPU in more than a year now.

It depends by the machine, of course, but keep in mind that difficulty changes as time goes on. You should look at that specific index in order to aknowledge it correctly. By now, it takes about 1 year to get 1 BTC with your hardware, supposing no difficulty increases. I do advise you to mine other currencies (BTB or others) and then convert them into BTC... that's easier this way!

Do you have any tutorials on how to mine say, litecoin or BTB? Thanks by the way :)

I don't have any video tutorial (am not a youtuber ;) )... you may start from here: http://btb.pnwminer.com/index.php?page=gettingstarted  and follow the instructions... One tip: BitBars do not comply with SHA256 algorithm (for BTC), but use another algo, called Scrypt; so, you'll need a proper miner, like "minerd" (CPU) or "cgminer" (GPU), the latter started with "--scrypt" on the command line. Do not hesitate messaging me for further help! :)


text:
Why is Bitcoin-qt using my CPU at 100%?
I am running Windows 7, and every time I open Bitcoin-Qt (v0.8.6-beta) during synchronization my CPU runs at around 95% according to the Windows Task Manager. As soon as synchronization is finished, the processor goes back to a normal 4-15% usage. What is Bitcoin-Qt doing that it needs so much processing power? Why is Bitcoin-Qt different from my other wallets, like elacoin, that do not use CPU when synchronizing?

When Bitcoin-qt synchronizes with the network, it is not only downloading blocks (lists of transactions) but also verifying them: checking cryptographic signatures, etc.  This gives you independent verification that the blocks you've received are true and correct, and that you're not being sent fake data by some malicious peer on the network.  However, it is computationally intensive, especially given the large volume of Bitcoin transactions, and I am not sure that Bitcoin-qt has highly optimized code.  Other clients may do a reduced amount of verification, saving time and CPU, but at the expense of some security.

Synchronization with the bitcoin networks need the full capability of the processor to complete the sync of your wallet with the btc network as soon as possible. That is why it is around 95%


text:
How do you install cgminer on ubuntu
I have downloaded cgminer for linux and uncompressed it and tried to run it but clicking on the executable file does nothing it is marked as executable and still does not run. Is there something else I should do?
I tried to open this file:

Edit:
Here is a screenshot from the directory cgminer is in from the "ls" command

Thank you for the screenshot. I'm installing Ubuntu on a Virtual Machine to look into the issue.

I could download, compile and run cgminer with the steps described in my answer without any problem. Did you download the binaries or did you compile it from the source code?

I downloaded the binarys

Can you link me the package?

http://ck.kolivas.org/apps/cgminer/ I have " cgminer-3.8.5-x86_64-built.tar.bz2"

It works for me, I ran out of ideas...

cgminer is a command-line software.
Open a Terminal and change the working directory to where you have your cgminer executable with the cd command. For example, if you have it on the Desktop you have to use the following command: cd ~/Desktop (where ~ indicates your home directory).
Then, if necessary, mark it as an executable file with the chmod +x cgminer command and finally run it with the ./cgminer command. Note that you will probably need to run it as the root user, so you probably want to run this command instead: sudo cgminer.
You can also specify command line options. For example, if your pool URL is http://foobarpool.net:3333, your username is qwertie.1 and your password is 1234 you can run cgminer with the following command so it is preconfigured and will start working right away: sudo cgminer -o http://foobarpool.net:3333 -u qwertie.1 -p 1234.
You can also specify lots of options for the GPU, fallback mining pools and other things. For a complete list, use this command: cgminer --help.

This gives me sudo: cgminer: command not found

Are you in the right directory? Where is your cgminer executable placed? Did you use cd correctly?

cgminer is under home/Apps/cgminer. Here is the line from the terminal "/Apps/cgminer$ "

Try to run the ls command in that directory. Does cgminer show up in the list?

yes. I even copied/pasted cgminer from ls to make sure I spelt it right, still go the same result

Does it work if you run just cgminer alone without sudo?

I still get command not found

Then you are not in the right directory. Can you please provide me with a screenshot of the result of the ls command?

Go to the directory of cgminer.
Type
sudo -s

Type your password
Type
chmod +x cgminer

Type
./cgminer --help


text:
Miner quit working this morning
CPU mining for Quark coins for the last few days, (just doing it for fun, I know they're practically worthless) been working with no issues. This morning I wake up and look at my wallet and the last transaction shows as completed at 7:26 AM 22 DEC 13 and nothing follows that transaction. I've tried stopping and restarting everything, viewed my logs, reviewed my settings, checked with the pool to make sure they're still up.... everything seems to be in order. I'm still relatively new to all of this so if anyone could help me think of some troubleshooting tasks I haven't taken, it'd be appreciated.

A bit more of info would have been helpful...
Let's see, if you mention your wallet, I understand that you're mining by having your wallet mining for you (solo-mining) and not via a pool. In case this were to be true, you'd have to make sure that your wallet is up to date and that you have at least one or two nodes listed in your conf file.
In case you were mining via a pool, I'd make sure the pool is still up. The fact you don't see any new transactions could be for two reasons:
1) The power you put to solo-mine is not enough anymore, difficulty has risen too much and your computer can't mine efficiently anymore.
2) Check that you're still really synchronised with the blockchain.
Hope it helps.


text:
How do we know which co-signer signature is in raw hex in multisig?
I have a raw 2of3 multisig transaction. In this transaction, one co-signer already signed. The signature is for only one input.
0100000001f479528049ee4b235548a7116f5ca31c607728af3d4ac8f102c5be13e93dcca900000000b40047304402201b83bd2209bc101736f60eeec3bcc1f79d45019d1829af97f5bd3210e8d8d786022020954c15372268d299b5463e1335595221e16222aee0291509a2098a0eb7fe80414c69522103556117b3f9a92f2997529af415c2c07185b872ddf1439995eca7f3acb65c58822103917f2527fc394ae2da48ce0148d29e5b756c4d9d180a6762bbe7abe215b29a562103f03364c624889c99059902524bcd8e2b24fb09cceb2e0f895d6475ef4913676553aeffffffff02a08601000000000017a914fd80725877f902f4491a6dc733fe788c376aeff8875033f4050000000017a9149aba36d2c19b08781230a4301f364610a163fc2d8700000000
after decoding the transaction, I have the following public keys:
03556117b3f9a92f2997529af415c2c07185b872ddf1439995eca7f3acb65c5882
03917f2527fc394ae2da48ce0148d29e5b756c4d9d180a6762bbe7abe215b29a56
03f03364c624889c99059902524bcd8e2b24fb09cceb2e0f895d6475ef49136765

and this signature:
['OP_0', '304402201b83bd2209bc101736f60eeec3bcc1f79d45019d1829af97f5bd3210e8d8d786022020954c15372268d299b5463e1335595221e16222aee0291509a2098a0eb7fe8041', 'OP_PUSHDATA1', 'OP_VERIFY', 'OP_2', '03556117b3f9a92f2997529af415c2c07185b872ddf1439995eca7f3acb65c5882', '03917f2527fc394ae2da48ce0148d29e5b756c4d9d180a6762bbe7abe215b29a56', '03f03364c624889c99059902524bcd8e2b24fb09cceb2e0f895d6475ef49136765', 'OP_3', 'OP_CHECKMULTISIG']

I have xPubs of all co-signers. How do I know which co-signer signed the transaction?

I've rolled your post back to the original question. Please don't add more topics to a question after it was answered. New questions should be asked in a new post instead. In this specific case, Bitcoin Gold is not on-topic on this site. You could try the Bitcoin Gold forum instead.

The only way to know which signers signed is to verify the signatures against the public keys. Each signature will only verify with one of the pubkeys.

Hi Andrew please see the edited question. I am not sure how to calculate sighash.

here is my new question https://bitcoin.stackexchange.com/questions/99368/veirfy-signature-against-public-key


text:
Why aren't block hashes used directly as scores for difficulty purposes?
Why does Bitcoin apply a difficulty function to block hashes and then use the output of this function to add up and determine the "longest" chain?
Why not just e.g. add together all block hashes (as bigints) and consider the longest chain to be the one with the biggest or smallest sum?
Is there some mathematical reason for this or is it just a performance optimization or a way of avoiding excessive dependence on big integer arithmetic?

Background info:
The block hash must be less than a certain value (as defined by the difficulty function) in order for the block to be valid.
Generally, as time has progressed, network difficulty has increased. So as the blockheight has increased, the cutoff value for a valid blockhash has decreased.
—————

Why not just e.g. add together all block hashes (as bigints) and consider the longest chain to be the one with the biggest or smallest sum?

I think it may be easiest to explain why this sort of implementation is broken by giving an example. Let’s consider a system following the ‘smallest sum for a given blockheight’ rule:
—————
For simplicity, let’s imagine a pow function that has an output value range of 1-100. Let’s say the network difficulty is currently set so that any output of 10 or less is valid.
Now, miner A finds a block at height X, with blockhash 10. This is valid, and so it is added to the chain.
Miner B sees this, but continues to mine blockheight X, because if they can find a block with hash 9 or less, then their new chain will replace the previously accepted one. By forcing a reorganization this way, they may be able to successfully commit a double spend attack, etc.
—————
This example shows how a miner could game the algorithm to rewrite the blockchain. The same is true for a ‘largest sum for a given blockheight’ rule: if a miner finds a small blockhash (eg. Blockhash = 5 in the example above), another miner could profit by continuing to mine on the older block, forcing a reorganization if they find a block with a larger, but still valid, blockhash.
For the bitcoin network to function properly, the game theory needs to incentivize miners to always mine at the chain tip. Using a difficulty function instead of the explicit blockhash value helps ‘level the playing field’, so to speak. This is because any valid blockhash is no better or worse than any other valid blockhash.

This makes sense but I'm still unclear about something. Let's say the network splits briefly and both sides mine two new blocks with hashes that meet the difficulty target. When the network re-merges who wins?

They will not ‘remerge’ until one chain is extended further than the other. The winner will be the chain that is extended further. The ‘losing’ side of the network will reorganize those two blocks to join the longest chain. Look up ‘orphan blocks’ to learn more. In practice it is quite rare for an orphan block chain to be deeper than one block.

The "apparent" work is 2x higher than actual work due to luck, but the reason it's good bitcoin doesn't use the apparent work is because it has bad stability properties due to variance, and bad game theory interactions.
Imagine Bitcoin were worked the way you suggested-- Say, for example, you mine a block and by chance it has 10x the 'work' expected.  It would be best for you to not announce that block but instead continue to try to extend it in private. If the publicly disclosed work starts getting close to your lucky block, then you announce it. This is a pretty bad incentive.
The extreme of this is that you start trying to mine at block 1, and hope by luck to end up with enough "apparent work" to wipe out the whole chain.
So under this model the probability of successfully reorging off a static chunk through pure luck doesn't go down with more blocks.


text:
Obtaining historical stale blocks (chaintips) without old node
I'm attempting to do some research surrounding stale blocks within the Bitcoin network. From my understanding the best and really only way to obtain data for blocks that no longer exist in the main chain/branch (including stale blocks) is to execute the getchaintips RPC command. This command appears to be dependent on how long the specific node has been running (as blocks that are not in the main chain have no reason to be downloaded to newer nodes).
Unfortunately, I no longer have access to the node or data I had setup in 2013 and therefore I have a limited set of stale blocks to deal with (my current node is only several months old).
Alternatively, I've ran this command on an online RPC query here but the earliest recorded block height is 283,421. Luckily, this also allows me to query getblock and actually view the information from the discarded blocks, but does not list any blocks before 283,421 (Mined in January of 2014).
The online block explorer Blockchain.info keeps track of stale blocks but sadly they only go back to block #291,122.
While doing a bit of googling, I was able to find more of an "extensive" list on PasteBin which dates back to block height 179,641. However, I cannot use getblock on any of these hashes from my node as it was not in existence when these blocks were originally mined.

My question: Are there any ways to query for stale blocks that have been discarded without requiring a node old enough to witness them?

Keep in mind that there may have been orphaned blocks that propagated so poorly that they were never even seen by any node that did such archiving. So the records will always be slightly incomplete. Another thing is that it's trivial to create backdated fake "orphaned" blocks. I don't think there's an incentive other than to screw with your studies, but it's cheap to do the POW for sufficiently old blocks.

I don't see how you'd get data about old reorganized blocks except by having access to an old node that saw them happen.
Simply put, a node that was only synchronized after the reorganization occurred will never even see the reorganized block.


text:
No transactions are showing on my Blockchain page
I'm new to this but I know how to use the request button on BlockChain to receive money? The Bitcoin was sent  to the address I provided and I didn't get it. I've received money before and sent money and none of this is showing. Transactions aren't even showing on my blockchain home page. I've always used the same email address. There is always change in my Blockchain account and that not there is either. I done this over may 7times probably and never had an issue. Was I hacked? The day I requested the money I thought it was odd that no change was in there because there is always 95 cent to 50 cents in the blockchain. Because the money was sent 10 days ago. The company sent me all the information and I've never had any issue before with blockchain. Can somebody help? NO TRANSACTIONS are showing up in my whole time using blockchain and I find that odd.

If you had money in the wallet, and it was sent out of the wallet (not by you), then it sounds like the wallet is compromised. Do not use it anymore. You can easily create a new one, but be mindful of security.
Receiving a payment is as simple as sharing one of your wallet's addresses with the person paying you. Once they send a transaction it will automatically show in your wallet, you don't need to do anything else for it to work.

so my 400 bucks is gone. Why am I not seeing any transactions though. Thank you

Are you using blockchain.info? What are the payment addresses your wallet is displaying? If you can post the address you expected to receive payment to someone can check it for you. DO NOT ever share your password, private keys, or seed phrase. Sharing a bitcoin receive address is safe, it only affects your privacy (someone can see how much bitcoin you've received at that address).


text:
c-lightning & Lightweight nodes (no local bitcoind)
I am trying to take advantage of the new release of c-lightning 0.6 that provide the ability to setup a lightweight node (i.e. No Local bitcoind instance running). But did not found any documentation how to do that yet.
What should I do in order to have a lightning node running a lightweight node? Is there a specific flag to use? or it is just a call from bitcoin-cli with a remote connexion flag setup on it?
Current setup:

Ubuntu 18.04 server
c-lightning 0.6

One lightweight alternative that I use quite often when setting up a Lightning node is spruned. The following will get you up and running:
Install some dependencies:
apt-get install -y git python3 \
                       libleveldb-dev \
                       python3-dev \
                       git \
                       gcc \
                       g++ \
                       python3-pip

Get spruned and its dependencies:
git clone https://github.com/gdassori/spruned.git spruned
cd spruned
git checkout 43e197693278fd551b165c6cfa5de78f853ef554
pip install -r requirements.txt

The third line is currently needed since the master commit is currently broken.
Next you can start the lightweight node with the following:
python3 spruned.py --network bitcoin.mainnet --datadir data --debug --rpcuser=rpcuser --rpcpassword=rpcpassword

Once the node is running you can start c-lightning like this:
lightningd --log-level=debug --network=bitcoin \
           --bitcoin-rpcuser=rpcuser \
           --bitcoin-rpcpassword=rpcpassword

I'm the developer of the spruned Bitcoin client, thank you for posting that.
I always told that spruned is highly experimental. At the moment, however, I'm confident to advice the latest 0.0.5 release as stable enough to keep a c-lightning mainnet instance in sync.
The latest release on pypi includes an electrum based fee estimation quorum and a robust P2P connection pool with a 100% blocks hitrate.
Today, the bandwidth usage is still high and cannot be used on metered connections.
https://pypi.org/project/spruned/


text:
Can you make profit from a miner?
Someone named mr_richard665 on instagram told me he was a bitcoin broker that worked with bitcoingroup and that he could help me make 30% profit everyday from my investment if i let him manage my account by me sending my bitcoin investment to his miners wallet address,is this a scam?

Yes, this is a scam.
The scammer has probably asked for your login info, so that he can 'set you up for mining'. In reality, mining does not work like this at all, the scammer simply wants access to your account so that they can copy down your seed phrase. With that done, even if you change your password, the scammer will be able to re-create your wallet on a different device, no password needed! The scammer could then steal your coins at a later date, after convincing you to 'fund the wallet for mining', etc.
DO NOT give the scammer any login or otherwise identifying information. There is never any need to do so.

If it was possible to get a 30% daily return, in one year you could turn a penny into more than three thousand billion, billion, billion, billion dollars. So no, a 30% daily return is not possible. But if you think it is, sure, go ahead and invest a penny. Next year, you'll own more wealth than exists on the planet. If you're conservative, invest just a penny and after two months, take out $30,000 to be safe. Anyone who had access to such wealth generation wouldn't want anyone else's money.


text:
If a bitcoin wallet service provider terminates a users account, what happens to the funds?
A friend of mine has/had a bitcoin wallet service provided by an online marketplace. Sounds like he had some kind of disagreement with the site administrators and they terminated his account. At that time, he still had some BTC in the wallet. Not a lot (about $50.00 USD or so), but still.
Is there any way to recover the funds, or are we all at the mercy of our wallet service providers in that respect?
Seeing as all transactions are recorded in the ledger, I figured perhaps there's some way to claim/prove/declare ownership. It seems pretty thin, but surely there's some kind of safeguard in place, otherwise wallet service providers could exploit that trust and just terminate all their customers accounts and take all their funds with impunity at any moment. Right?

This is why people say "Not your keys, not your bitcoin. Your keys, your bitcoin". The online marketplace owner owns the private key of the address that your friend used to fund his account. The owner of the marketplace can always say he lost the private key of your friends' account, but if he wants, he can prove ownership by signing a message with the private key (he has nothing to gain though).
Your friend should provide a new address to the owner of this marketplace and ask him to send the bitcoin that he had to that address, otherwise, yes, he is probably stealing.

No, if her account was terminated, contact them for full bitcoin funds transfer since that bitcoin are theirs now (It actually always has been) unless you still have hold of the private key. Though they may unlikely to return the bitcoin but try it.


text:
Bitcoin core full node won't start on mac reboot!
I had been running bitcoin core qt for a few months fine and then on rebooting my mac and opening the application the following prompt popped up

Error: Cannot parse configuration file: specified data directory ""/Users/username/Library/Application Support/Bitcoin/"" does not exist..

I'm a long way from being technically competent but I'm 99% sure the data directory does exist.
Any advice on what else this could be? or what I'm doing wrong?

this error pops up if the mentioned directory is not found... so please dbl check if it exists... otherwise startup bitcoin-qt with --resetguisettings (/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt --resetguisettings).

Place bitcoin core in the application folder
Start terminal
Paste

/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt --resetguisettings

Hit enter


text:
Create multisignature wallet from xpub keys in Bitcoin Core
I can create multisignature wallet in Electrum from two xpub keys.
How can I use Bitcoin Core to do that?
Standard use:
Add a multisig address from 2 addresses

bitcoin-cli addmultisigaddress 2 "["16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5","171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV"]"

Is there way to do like:

bitcoin-cli addmultisigaddress 2 "["tpubDAenfwNu5GyCJWv8oqRAckdKMSUoZjgVF5p8WvQwHQeXjDhAHmGrPa4a4y2Fn7HF2nfCLefJanHV3ny1UY25MRVogizB2zRUdAo7Tr9XAjm","tprv8erNzbjXdtYpKbKF4HeZpBCQj2W64MS2SAJCcWxgqLueSZ9KLTPZGoDTu8NugecLLqeS2RYan2f6qcexUTjp3m2HGxmpAiP48BaUz7XHxzQ"]"

This will be mostly possible in the upcoming Bitcoin Core 0.18 release.
First you need to understand that the sequence of such paired multisig addresses (with public keys generated from 2 xpubs in lockstep) can be described in the new descriptor language.
The syntax is sh(multi(2,XPUB/*,XPUB/*)). The sh indicates P2SH embedding, multi refers to multisig, the 2 means 2 signatures are required, and the two XPUB arguments are what the public keys are drawn from.
As descriptors are intended to be safe for human communication, they need a checksum in some cases. This checksum can be computed using the getdescriptorinfo RPC command, which will append a #CHECKSUM suffix.
Once you have the descriptor, you can do multiple things with it. One is determining the corresponding addresses using deriveaddresses.
bitcoin-cli deriveaddresses "DESC" [0,1000]

Will give you the first 1001 addresses (using keys with indexed 0 through 1000) for your descriptor.
You can also import them into a wallet, all at once using the flexible importmulti RPC, which in 0.18 is extended to support descriptors.
bitcoin-cli importmulti [{"desc" : "DESC", "range" : [0, 1000], "watchonly" : true, "timestamp" : "now"}]

Will import the first 1000 addresses, together will all information necessary to recognize payments to them, and sign for spending them (excluding the private keys, of course).

The watchonly indicates you're aware private keys are missing, but want to import as watched anyway.
The timestamp indicates the first time these keys may have been used. "now" means you know the keys haven't been used yet (or you don't care about their history); alternatively you can give a timestamp as the number of seconds since UNIX epoch to specify a birth time.

Note that this will not automatically watch for more than the first 1000 addresses as they get consumed - you'll need a new import command for that (for now).

Ive finally put this to test and it is really handy. Any idea when importing an xprv in this manner will allow private key importing? It would be really nice to have an offline node that I can import xprv into to be the final signer of my HD musig transactions.


text:
Can I continue to use an old Bitcoin address?
I have a wallet on Blockchain.info and
they generated a Bitcoin address for me.
Now, I have another Bitcoin address. Can I still use my old Bitcoin address?


text:
What does channel num_updates mean?
Some LND wallets provide a channel's "Number of Updates". Here's an example from Zap Desktop:

The LND gRPC API Channel Reference cites a property called num_updates. The description of this field is not very informative:

The total number of updates conducted within this channel.

What specifically is a channel update?

For some reason stackoverflow has a 50 reputation limit on comments, so I must use the answer box to point out that Karlo's answer is not correct - or at least does not tell the whole story. I understand that this is not the correct use for the answer box, blame stackoverflow's poorly thought out reputation limits.
I have a node with a few (outgoing) channels, have not spent a single satoshi with it yet. So the "remote balance" of the channels has always been 0, in other words there have been no balance updates. Yet the number of updates in the channels is non-zero.

Updates can include changes to (on-chain) transaction fees. By default num_updates will also always be >0 if the channel is fully established, because there is a required update between the channel's initial funding and the funds being locked.

The num_updates metrics are also not 1, closer to 10.

A channel update can be a new payment routed via the channel (balances need to get update so a new commitment is generate), new fees negotiation (fee uncooperative  channel closure), a request of CSV change by the other party (value in which your node will be able to sweep funds if you close the channel in a uncooperative way) among others...

Is this documented anywhere?

https://github.com/lightningnetwork/lightning-rfc/blob/090af1a22d00eb7ad57419eb45d7e206610aeade/02-peer-protocol.md#committing-updates-so-far-commitment_signed

When a payment is done, the channel states update.
Your channel might start with a balance of 100 000. This is all on your side.
Then a payment is done of 10 000. The channel gets updated: your side has 90 000, the remote side has 10 000.
Any update, or: "payment" beyond this point is an update.

As mentioned above, num_updates is incremented for fee changes, CSV limit changes, and other non-payment updates.


text:
What is the proper way to handle reorgs when fetching headers
I work on bitcoin-s, and we've found a problem where if a node is stopped with it's chain tip being a one that is later reorged out it will not be able to continue syncing headers.
This happens because we request headers using a get headers message with hashes= <current chain tip> and stopHash=<00000..0000>. Since, our chain tip is reorged out we will receive the first 2000 block headers of the network.
My current solution is to walk back our chain tip, and each iteration check if don't get the first 2k blocks. However, I recognize this is a poor solution, is there a GetHeadersMessage that I should be using here, or a better alternative?
Thanks

The getheaders message allows you to list multiple block hashes. So instead of just putting the current chain tip, you can insert multiple block hashes. Responding nodes will see if any of those hashes are in its main chain and start sending headers from there. Since reorgs tend to be small, you could put the most recent 10 block hashes and it should be enough to handle the reorg.
Note that the maximum number of hashes you can put in a getheaders message is 101.

Awesome, this seems to fix the issue!


text:
Is it okay to send witness transactions in response to `MSG_TX` get data messages?
I have a neutrino client that currently signals NODE_NONE. When it announces transactions it sends inventory messages and gets getdata MSG_TX requests back. Currently it replies with the witness serialization of the transaction and it seems to work fine. Is this correct or should we be signaling NODE_WITNESS so we can receive MSG_WITNESS_TX and properly send the witness version of the transaction?

Given that the vast majority of nodes are Bitcoin Core and segwit capable, this is probably okay, but technically does not follow the protocol.
Bitcoin Core itself does not check whether a transaction it receives is in response to a particular getdata, and so it does not check whether it asked using MSG_WITNESS_TX or MSG_TX. So responding to a getdata containing MSG_TX with a transaction with witnesses will be fine as long as the node is segwit capable.
However, if the node you are connected to is not segwit capable, you would probably end up being disconnected by that node (and possibly banned by it) as segwit transactions are not understandable by non-segwit nodes. It is for this reason that there is a distinction of segwit capability in network messages. Non-segwit nodes need the non-segwit version of the transaction.

So should I signal NODE_WITNESS, so segwit nodes ask with MSG_WITNESS_TX

Yes, the correct thing to do would be to signal NODE_WITNESS.


text:
Is there a minimum number of transactions in a block?
What encourages Bitcoin miners to include lots of transactions in blocks in the Bitcoin blockchain?
It seems like you could quickly add a block with just a single transaction and get the block reward from it.
Is there some incentive for miners to include lots of transactions in blocks?

It is no quicker to mine a block with one transaction, compared to a block with many transactions.

A block may contain only one transaction: the coinbase transaction. However, the time it takes to mine a block is not affected by the number of transactions in that block, so mining blocks with fewer transactions does not benefit the miner. On the other hand, miners collect fees from the transactions they include in a block, so by including more transactions in a block, they may collect more fees.

The answer is one, the coinbase transaction.


text:
Could BTC be changed so that it limited the amount of computation power a given miner used?
I am assuming this would be hard or impossible to prevent miners from circumventing but would there be a way to change the algorithm to limit how many transactions a given mining installation could process per day, etc.? This is to address the energy use concerns we are recently hearing about.

would there be a way to change the algorithm to limit how many transactions a given mining installation could process per day,

No. Miners can submit blocks anonymously, there is no mechanism by which miners can or do 'register with the network' in order to perform their mining work.
Further, energy use has nothing to do with how many transactions are processed, it only concerns the amount of security the network gains per unit of time. There is unfortunately a lot of misinformation being passed around concerning bitcoin mining recently, which makes poor and inaccurate comparisons and conclusions.
Valuable things require security, and security cannot be gained for free. The openness of the bitcoin network allows a rather objective quantification of the energy (ie the opportunity cost) used to secure it, especially compared to other systems which have a more obfuscated or social form of security, which comes at a higher relative opportunity cost!

Furthermore, there's basically nothing that can stop a given miner splitting their installation in two and calling each half a separate 'mining installation' from a different user/company. Repeat ad infinitum.

No, it does not seem possible to impose limitations as proposed on miners without severely impacting key properties of Bitcoin. The proposed change would at least require registering miners and instituting some sort of oversight mechanism to evaluate their participation. The likely outcome would be some mix of reduced utility and evasion of the oversight at the cost of increased complexity and centralization. Either way, the Bitcoin network can only be upgraded by convincing the vast majority of participants to run software enforcing the updated rules—and a proposal with such mixed trade-offs sounds like a tough sell.
While it is possible to form a ratio from Bitcoin's energy consumption and on-chain transaction count, that number is not as meaningful as one might think at first glance. The payment mechanism is a necessary function of the Bitcoin system, but Bitcoin's predominant use has been emerging to be as a long term store of value. Bitcoin's mining expenditures now secure savings worth about $1T.
I'd like to explain a bit further why comparisons with other payment systems are often inapt.
Bitcoin is not book money like PayPal or banking balances. An on-chain Bitcoin transaction is an irreversible transfer of a bearer instrument directly from sender to receiver that finalizes in minutes. Consider being able to directly hand someone cash or a bar of gold on another continent without any intermediaries. A system like that is useful, e.g. to gain access to banking-like services, to facilitate international payments, or to hedge against the rampant inflation of their national currency.
Leveraging Bitcoin's digital nature, the Bitcoin network is used as a base layer to build additional systems on top, much like the internet is built on top of TCP/IP. Even today, most Bitcoin payments are not recorded on-chain but happen on second layer systems like the Lightning Network or in the form of book money between users of custodial services—akin to transactions on Fedwire vs payments on PayPal or the VISA network.
I suppose our argument is that the uses and benefits of the Bitcoin network justify its energy consumption even when taking into account its environmental impact.

This doesn't even attempt to answer the question, and is nothing but an ad (not not say propaganda).

Do you have any reference/source for that 50TWh energy wasted figure?

@vsz: Point taken, I have completely rewritten my answer.

@marstato: https://en.wikipedia.org/wiki/World_energy_consumption#Energy_supply,_consumption_and_electricity, https://www.nasdaq.com/articles/a-comparison-of-bitcoins-environmental-impact-with-that-of-gold-and-banking-2021-05-04


text:
If miners are paid when they solve a block, how can a miner who is not in a pool make less than the block reward?
I have heard of miners making much less than the block reward and I had assumed they were being paid also for processing transactions which would be potentially many small amounts.
However, if these transactions are associated with the block to be solved, then it seems they would make the block reward PLUS the transaction fees -- a miner could never make only transaction fees.
Or are the miners who make a few dollars a day doing so via a mining pool?
Note that I do understand a miner is likely to make zero because mining is very competitive so what I might have expected a miner to have occasional big wins of 6.25 BTC (plus transaction fees) or exactly nothing.
But I think of the example of the guy in Guatemala who burns used cooking oil in a generator and supposedly makes 200 month -- does this apparently steady return of 200/month imply he is part of a mining pool?

A solo miner (a miner who is not in a pool), can only either win or lose a block. When they win, they get the block subsidy (6.25 BTC currently) plus the transaction fees. When they lose, they get nothing. There is no in between. In particular, there is no such thing as processing individual transactions in the network; miners' only job is producing blocks. Without block, no income.
Almost all miners work in pools however, where the rewards (of both subsidy and fees) are split between all workers in the pool.


text:
What is the O(n^2) signature hashing problem and how does SegWit solves it?
One of the many benefits of SegWit is that it solves the O(n^2) signature hashing problem. What exactly is the O(n^2) hashing problem and how segregating signatures to separate witness field solve it?

Moving signatures to a separate field does not actually solve it. However one of the things that segwit did was to redefine the message that is hashed and signed. This is specified in BIP 143.
Signature verification requires three things: the public key, the signature, and the message that was signed. In Bitcoin, the public key and the signature are provided by the person spending an output (or in some cases the public key is provided in the output itself). What is missing is the message. Instead of having a user provided message, the message is actually the spending transaction itself or some variation of it. How this message is constructed is known as the signature hashing algorithm.
For non-segwit signatures, the message is typically the entire spending transaction with all scriptSigs empty except for the input that the signature will belong to. That input will contain the scriptPubKey of the output being spent. The important thing to note here is that the message contains all of the prevouts that are specified. And every single signature signs a similar message, but still has all of the inputs in each one.
If you were to add another input, this not only adds another signature that must be done, but also it increases the size of the data that must be hashed for every single signature in the transaction. This means that if a transaction has n inputs each requiring 1 signature (thus n signatures required), for every signature, n inputs must be hashed. This is done n times so every input is hashed n*n = n^2 times. Thus it is quadratic.
However segwit defines a new signature hashing algorithm for segwit inputs. The message that is signed is not the spending transaction with modifications, rather it is a completely different structure which contains data pulled from the transaction.
From BIP 143, the data that is serialized and then hashed is:
     1. nVersion of the transaction (4-byte little endian)
     2. hashPrevouts (32-byte hash)
     3. hashSequence (32-byte hash)
     4. outpoint (32-byte hash + 4-byte little endian)
     5. scriptCode of the input (serialized as scripts inside CTxOuts)
     6. value of the output spent by this input (8-byte little endian)
     7. nSequence of the input (4-byte little endian)
     8. hashOutputs (32-byte hash)
     9. nLocktime of the transaction (4-byte little endian)
    10. sighash type of the signature (4-byte little endian)

The important thing to see here is that this by itself does not increase in size when more inputs are added. Almost everything has a fixed size, with the only thing having variable size being the scriptCode.
Now you may notice that this does contain hashPrevouts and hashSequence which are the hash of the prevouts and the hash of all of the sequence numbers, respectively. The amount of data that is hashed for these hashes will grow as more inputs are added. If implemented naively, signing and verifying segwit inputs would still be quadratic.
But by specifying the hash of the prevouts and the hash of the sequence numbers separately instead of interspersed throughout the message as non-segwit does, these hashes can be precomputed once and then reused for every signing and verifying operation in a transaction. Thus this allows for an optimization which makes this linear.
At signing or verifying time, the signer or verifier can first compute hashPrevouts, hashSequence, and hashOutputs once. These values remain the same for all inputs. Then for every signature, they compute the sighash which does not end up re-hashing the majority of the data and does not typically change in size from input to input. Thus since the amount of data being hashed really only changes when the transaction gains an input, and it only changes by a relatively fixed amount, segwit sighashing is linear.


text:
Does broadcasting the network flood it?
There are a lot of messages that are sent around the Bitcoin network - e.g. updating new blocks, spreading new transactions. Do these not flood the network? Is it a pure broadcast to all the connected nodes?

You have a lot of (some unrelated) questions in there. Stack Exchange usually follows a 1 question per post format. Moreover, a lot of the questions have already been answered on this site previously. I suggest you search for each of your questions first, and ask any that are still not answered after that

Transaction and block broadcast use a gossip mechanism which floods the network. A node will send a transaction or block to its peers. Once those peers validate the transaction or block, those peers will send the transaction or block to their peers and so on and so forth. This results in all nodes receiving a transaction or block.


text:
Looking for a Bitcoin Cash (bch, bcc) testnet faucet
As the title states I am looking for a Bitcoin Cash faucet. I know about the very nice one:
https://testnet.manu.backend.hamburg/bitcoin-cash-faucet
but it seems to be down at the moment. A google search does not yield any other faucets so I am not very optimistic.
Thank you!

Does this answer your question? BCH ABC testnet Faucet?

There's a new faucet, it can be accessed here: https://testnet.wormhole.cash/faucet/
Edit: Broken! Coinfaucet still works.

Death atm. not working any more!

https://testnet.manu.backend.hamburg/bitcoin-cash-faucet
worked for me. Please try again and report back.

No, its not working atm

True. Now it is 4 month later, and the site actually offline due to spam issues on the testnet.

Just found this one that seems to work:
https://coinfaucet.eu/en/bch-testnet/

There is an active faucet for Bitcoin Cash (BCH) testnet coins at:
https://tbch.googol.cash

Unfortunately, https://tbch.googol.cash does not appear to be working (after entering address and number gives 500 error back)

@user134281 can you test again? seems working now.