text:
Beginning 2017 what estimate of individuals own bitcoin?
How many different individuals in the world own bitcoin?
I.e. John owns .5btc, Michelle 300btc, Al 4000btc : the answer would be 3.
I am interested in the percent of the global population that owns bitcoin as it would be a good indicator of the potential (and value) further for bitcoin as it is educated to more and more people and eventually reaches mainstream (hopefully).

There's a hard limit on the amount of people that own one bitcoin: There currently are only 16.1 million bitcoins in circulation, so there can't be more more than 16.1 million people with one bitcoin. However, there are a number of individuals that control much more bitcoin than that, so it is safe to say that the actual number of users that own one bitcoin is much smaller, I'd guess less than one million people.
On the other hand, the number of users that own any bitcoin at all is very hard to estimate as well. There are currently 46 million unspent transaction outputs, so if we'd assume that every user maintains their own balance that would be a strict upper limit. However, many users leave their coins to be managed by online wallets or exchanges, so it's not a reliable limit. On the other hand, the number of people is probably even much smaller than that, because few people own many of those UTXOs. If I were to hazard a guess, I'd say that there are fewer than five million people in the world that own any bitcoins.

"However, there are a number of individuals that control much more bitcoin than that"  It would be nice to have a list of known high profile individuals and their approx holdings, such as Winklevoss, Ver, Draper, etc so those coins can be subtracted from the 16.1 million count.

Yes or early adopters (even earlier than now) who played with bitcoin in the thousands and basically forgot about them until their surge in value like this guy https://www.theguardian.com/technology/2015/dec/09/bitcoin-forgotten-currency-norway-oslo-home

This website shows statistics about the number of addresses containing amounts in specific ranges:
https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html
The sum of all addresses containing 0.01 or more bitcoins is only 3.884.657. Even assuming that all the addresses containing 0.001-0.01 bitcoins would cointaing 0.01 bitcoins only increase that number by at most 23.819 individuals controlling at least 1 bitcoins. So I think it is save to assume that no more than 4 million (probably much less) control 1 or more bitcoins.
But I am not sure how accurate the website is.

Of ~16 million coins out there, as much as 2.2 million have never been moved or have fallen out of circulation. We're looking at maybe 14 million coins.
Then there are people who for one reason or another have much much more than others.
If there are 11.4 million wallets I'd be surprised if even 1% contain any value. Let's say 10 percent of wallets are a coiners main wallet.
11.4 million wallets
10 wallets/person
14 million bitcoins (unevenly distributed.)
So out of ~1.14 million coiners, they each could have at maximum 12.3 bitcoin, but they don't. I'm sure there are much less than one million souls with at least one bitcoin.

Note that the 11.4 million number is only user accounts on blockchain.info.

One thing we all probably know for sure, is that Bitcoin and Alt Cryptocurrencies are getting more coverage in the news, and that coverage is increasing at an increasing rate.  My gut tells me that the numbers of individuals getting into Bitcoin is probably also moving along the same graph lines as the news coverage.  The price increases only encourages involvement, as small fractional investments will increase at the same rate as large investments, so the little investors may also reap great returns.  When that fact is understood by the neophytes, millions of fractional Bitcoins buys will be the norm.  This points to the need for faster transactions, and you get where that leads.  Lastly, as the base of ownership broadens, the more stable the movement, as far as ups and downs, and the more these small buyers are buying, the price will continue a more sustainable rise.  But, all this is opinion based on many years of experience, and it could be flawed.  However, I’m an aggressive buyer based on my opinion and gut feelings.  When the upside is so massive compared to the downside on new innovations, those are risks indicators worth taking.

Based on what others have said, we could make a low-end estimate of the number of crypto users to be well under a million active users.  If that indeed is the case, it could be a bad sign as it would indicate that the increase in price hasn't been driven by meaningfully increased adoption but rather by speculation.  I also bring this up because I noticed the amount of views and subscribers on YouTube crypto channels is quite low.  If the cost of coins is already prohibitively high enough to prevent newcomers from adopting/investing and current price trends are driven by whale holders and speculation, we could be setting up for a major downwards correction or even a market collapse.

Welcome to Bitcoin SE!  I'm not sure this really answers the question.  You give an estimate of a million users, but provide no basis for that estimate.  The rest of this answer is speculation about what that could mean.  A more useful answer would be to explain where how you arrived at your estimate, rather than talk about the consequences of an assumed estimate.

The current price is undoubtedly speculation and way above the normal rate of adoption! But with the news comes awareness pushing adoption further.

I came across the following in an article
"Nobody knows how many bitcoin users there are but there were 11.48 million bitcoin wallets in existence in January 2017 according to Blockchain.info. Each bitcoin wallet is a potential customer for an online merchant."
So I would say a safe guess is anything less than ~11.5 million. The obvious next question is the average amount of addresses per person and how many people are using cold storage. So essentially 11.5 million / 7.5 billion global population would give us ~0.15% of the population actually owns a bitcoin (my estimate is less)? An interesting indicator of bitcoins potential in the future.

Those 11.5 million is only user accounts on blockchain.info, not a global user number. It doesn't mean that all those user accounts actually have a balance, I think, much less one of at least one bitcoin.


text:
The cost of Exchanging $50k
Walk me through buying 50k in BC using cash in Dallas and exchanging BC for cash in the SF bay area 3 days later. Specifically with attention  to costs and fees, and maintaining anonymity via in person transactions or whatever method is most relevant to maintaining anonymity.

Just don't... the chance you lose it is way too big. As not all amounts can be easily converted to cash and even if so, you still need to withdraw it somehow... so you would just get it back on the bank account it came from. Probably a LOT less then you have put in though due to fees and stuff.

If for cash means you want paper then it is possible only theoretically - you sell it in the same way as cucumbers or gas to the people that want to buy it. You just need to find them and it will be hard because if you don't want to do it online means you are afraid of something: fake banknotes, money laundering, etc.

Finding an Exchange
I'm not sure if there are walk-in exchanges in Dallas, but the Bitcoin site is a good place to start a search. Most exchanges take a couple of days to set up and verify your account, so just walking in and purchasing $50k of Bitcoin is unlikely.
Cost
Your specific fees will depend on the exchange that you choose. Generally you should plan on the purchase costing around $1k. You shouldn't have any fees associated with selling, apart from the transaction fee, which should be less than $30.
Anonymity
When Bitcoin began it offered a great deal of anonymity, as there was very little regulation. It's use as the primary currency for illegitimate transactions on sites such as Silk Road has brough regulation which errodes anonymity. Now exchanges will require photo identification (not uncommon for them to ask for more than one form as well) prior to doing business with you.
Hypothetically speaking, I believe its still possible to use Bitcoin with some anonymity. Its unrealistic to think that you'll be able to achieve this with a quick $50k cash transaction. If anonymity is important, you may have a look into Monero.
Volitility
If you're planning to use Bitcoin specifically to transfer funds, then you'll need to be aware of volatility. There are many speculative traders betting for or against the Bitcoin, which means that the price can (and does) move rapidly. 10% movement in a day isn't uncommon. The longer it takes you to sell your coins, the less likely it is that they'll be worth the same amount you paid. For the amount that you're asking about, you could easily lose or make a few thousand dollars in 3 days.

source: Stack Exchange

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

authors: Темирлан Мырзахметов

sort: votes


text:
Do I need to mix my coins to stay anonymous?
I think my Bitcoins are anonymous if:
I receive bitcoins from "Person A" on address 1. then I transfer them to address 2. and then to address 3.
Because:
Nobody knows that I own address 2.
Is this correct? An analyst can suspect that I own address 2 but he can't proof this.

It depends what you mean by "knows" and "proof".
You're right that an analyst will not be able to be prove with absolute certainty that you sent the coins to address 3, because it is possible, consistent with the blockchain evidence, that address 2 belongs to some third party.
But in the real world, people and organizations don't need absolute certainty to take action.  They have lower standards, like "proof beyond a reasonable doubt", "probable cause", "reasonable suspicion", etc.  It's entirely possible that a detective / jury / president / mob boss would consider this sequence of transactions to be sufficient evidence for an arrest / conviction / drone strike / vicious beating.  That's particularly true if there is other evidence linking you to the owner of address 3.
So in evaluating whether a system or protocol has enough anonymity for your purposes, you have to ask yourself who you are trying to stay anonymous from, what consequences you are trying to avoid, and what level of evidence you think your adversary would need in order to proceed against you.   Maybe a single extra transfer is enough anonymity for you.  Maybe a mixer would be needed.  Maybe even that isn't good enough.  It all depends.  These questions don't have straightforward yes-or-no technical answers.
It's like asking whether a system is "secure".  It depends who your adversary is and what their capabilities are.  It might be secure enough for some people, and not for others.

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


text:
inputs getting smaller
noob here,
am I right in thinking that as bitcoin matures, the average size of transactions, will go up, i.e. higher kb per n BTC, as all the coin gets increasingly spent so that any sizable payment will ultimately end up being made up of increasingly large numbers of smaller inputs, and that this will contribute to the rate at which the blockchain size increases, on top of general total transaction increases over time.. ? With the current large mempool size and delays in getting transactions accepted for mining, except with big fees per kb, will this lead to increasingly large fees to send payments in a timely way or longer delays ??
Thanks

You seem to think that the number of transaction outputs must be higher than the number of transaction inputs. That's wrong.
Just have a look at transaction 19e68405b2ac2f96d5127748ff07bbd629cde93a230582317c9ff50d9644b562 (click me) which has been included in the most recent block. It took 28 inputs from 28 different addresses and produced 2 outputs in 2 address.
The transaction you describe (transactions with a lot of inputs) actually mean that there are fewer UTXO because of them. The transaction I linked to above is very big (8.6 kB) but it destroyed 28 UTXO and created only 2 new ones.
When you're fearing to have to pay higher fees as an individual, you should think about how you actually get many UTXO. If we're talking about a transaction which takes only 2 inputs and has 28 outputs, those 28 outputs will most likely to belong to 28 different people (28 people who retrieved money from an exchange at that time bundled together in 1 transaction or 28 employees payed by a single employer). But in those cases, creating many UTXO is totally justified because they belong to different people. When they spend their money, they unify the money, again, into fewer UTXO.


text:
Who pays for the computational cost when validating a transaction
Suppose Alice wants to validate a transaction (check this transaction does exist, not make a new transaction),
and suppose her has not downloaded all transaction history.
My understanding is,
1) Alice will send a request to all her peer computer nodes and ask for the root the Merkel tree and hashes required to validate the transaction.
2) Some miners among her peer nodes will locate the block that includes the transaction
3) As block only stores Merkle tree root, not internal nodes, these miners will have to construct a Merkle tree from all transactions
4) The miners send block header and hashes (Merkle tree root and hashes on the authentication path) back to Alice.
Since the step 3 requires computational resources, my questions is why some nodes want to perform these computations for Alice?
It seems that these nodes will not get paid for validating an old transaction.

You have a few things wrong.

1) Alice will send a request to all her peer computer nodes and ask for the root the Merkel tree and hashes required to validate the transaction.

Alice probably already has the Merkle root, since it is part of the block header.  The first step in validating a transaction is making sure that block that contains it is real.  Even SPV clients store all the block headers of the entire chain, so they already have every Merkle root.

2) Some miners among her peer nodes will locate the block that includes the transaction

This is more or less correct, except that the nodes do not have to be miners.  There are plenty of full nodes with full copies of the blockchain on the network that can be queried for these hashes.

3) As block only stores Merkle tree root, not internal nodes, these miners will have to construct a Merkle tree from all transactions

Full nodes store all transactions, and returning the hashes of the Merkle tree is not too computationally intensive.  You can read more about this in the Transaction Data section of the Developer Guide.

4) The miners send block header and hashes (Merkle tree root and hashes on the authentication path) back to Alice.

Again, it is not necessarily (or even usually) miners who will send the hashes of the Merkle path that are needed.  It will usually be non-mining full nodes.  And as mentioned before, the block header and Merkle root do not need to be requested.
In the end, Alice is the one validating her transaction, but doing so by using additional information provided by full nodes on the network.  The work that the full nodes do to supply this data is important, yet not too computationally intensive.  For example, my Raspberry Pi 2 works just fine as a full node.  As for who pays the full nodes for their service...well...nobody.  This has been a topic of much debate.
In the end, however, people operate full nodes for several reasons.  Off the top of my head:

so they can operate trustlessly
as a service to the overall health of the network (which, in turn, protects their own investments)
for research or business purposes

So even though supplying the required data for thin clients to do transaction verification can be viewed as charity, in reality there are incentives for participating...even if not directly financial.

I read the "Transaction Data section of the Developer Guide" and then go to the SPV section (https://bitcoin.org/en/developer-guide#simplified-payment-verification-spv). Now I understand this. Thanks for explaining the motivations that why people want to run full nodes.

Suppose Alice wants to validate a transaction
suppose her has not downloaded all transaction history.

That's not possible. In order to validate a transaction you must have the entire state of the ledger before that point. Either you validated the entire history yourself, or you copied the result of that history (the chainstate, who owns which coins and how much are they worth) from someone you ultimately trust.

1) Alice will send a request to all her peer computer nodes and ask for the root the Merkel tree and hashes required to validate the transaction.

That's not what happens when validating a transaction, but what lightweight (non-validating) clients do in order to check the transaction exists. It relies on the fact that miners will not produce a block with invalid transaction, and thus implicitly trust that when it appears in a block, it is valid.
Also, the request is not really "give me all the data necessary to prove transaction X exists". The request is "give me all transactions that match criteria A, and include the proofs that they're real. See BIP37 for more information, but know that now it is known that this method has very bad privacy implications.

2) Some miners among her peer nodes will locate the block that includes the transaction

Miners only have a function in creating blocks, not looking things up in it. After a block is created, and propagated across the network, any node can look things up in it.

3) As block only stores Merkle tree root, not internal nodes, these miners will have to construct a Merkle tree from all transactions

Miners do that at the time they create a block, but every fully-validating node does that to when they receive a block. It's not done separately for each transaction.

4) The miners send block header and hashes (Merkle tree root and hashes on the authentication path) back to Alice.

Again, not miners. Any full node that Alice is connected to and supports BIP37 will do that.

Since the step 3 requires computational resources, my questions is why some nodes want to perform these computations for Alice? It seems that these nodes will not get paid for validating an old transaction.

Step 3 requires some resources, but they vanish compared to the work of actually validating transactions (validating signatures, checking that no coins are double spent). However, all of these steps are only done by nodes that fully validate.
Most of your question does not seem to be about validation, but about BIP37 as a means for a lightweight clients to obtain assurance that what their peers tell them about new transactions it is correct. That does have a cost, but the cost is mostly in scanning through the blockchain to find transactions Alice is interested in. This costs CPU and disk accesses, but only very little memory. In recent versions of Bitcoin Core, BIP37 support was made optional for that reason.

Thanks. It is very help for me to understand BIP37 (https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki).


text:
Where is my bitcoin balance stored in the blockchain?
This is possibly a duplicate but, since I am a Bitcoin dummy I cannot find it.
Anyhow; as I understand (and I will make some assumptions here), a block in the blockchain contains one or more transactions.
Transactions are typically bits of information which contains delta's, I mean e.g.: Alice transfers 2 bitcoins to Bert.
So, to determine or verify my bitcoin balance (in order to make a valid transaction), does the whole chain needs to be analysed? If so, is this optimized in any way?
Or am I completely off track here?

related: Can someone explain how the Bitcoin Blockchain works?

You are on the right track, actually. Each transactions tracks changes in the ownership of bitcoin, so in order to get the total current balance for a particular address, you do need to look at every record of change for said address. Unfortunately, the only way to do that is to analyze every transaction involving that address ever.

The blockchain defines your balance, but it doesn't have a specific field in which your balance is stored.
Yes, it needs to be analyzed to find your balance. However, it doesn't have to be analyzed all over again, just to check for the balance of a new address. Instead, checking the UTXO set (which only has to be created once and then to be updated every time new blocks are received) is sufficient. Furthermore, not the entire UTXO set has to be traversed. There are things like hash maps which make this a lot easier.

Your balance is the sum of UTXO (unspent transaction output) values in the blockchain since genesis block (block#0).
UTXO is the coins that the addresses' you control (by having their private keys) received and you haven't spend.
Your wallet keep reference to your UTXOs. So, no need to scan blockchain every time you spend.


text:
With the upcoming hard fork will there be a fixed exchange rate between Bitcoin Unlimited and Bitcoin?
As you know, there might be an upcoming hard fork of BTC to enlarge the block size.
Will the new currency Bitcoin Unlimited be a different currency or will it be compatible with Bitcoin with a fixed exchange rate between the new and the old currency?

If the two projects both persist, they would be freely traded one for the other. A fixed price could only be established if someone with unlimited funds guaranteed an exchange rate, which naturally can't happen because there is a limited number of tokens.
If the hardfork occurs you will have whatever Bitcoin you had on both these chain-tips.
Note, that to Bitcoin Unlimited nodes as it's currently implemented the Bitcoin chain would still appear valid, and if the latter ever grows longer after the chain split, BU nodes would reorganize back to the Bitcoin chain. This could of course be prohibited by setting BU nodes to require one of the blocks created after the chain split to be part of their longest chain.

So, as long as it's a hard fork, people can use their BTC in the BU environment, so there is no need to sell BTC and to buy BU, thus BTC won't have a huge value drop in my assumption. Do I think right?

Some large Bitcoin holders have announced that in the event of a fork, they'd sell either one side or the other. I'd be expecting a surge in trade volume and volatility for both BTC and BU. Some exchanges might even be overburdened by the traffic. As block intervals would increase for both chains, fees would spike at the same time at least for BTC (since the split would be initiated by larger blocks establishing a BU chain). I find it hard to predict what would happen, but would expect chaos.

Thanks, I missed the point the fork will include the whole history, so copying my BTC to BTU, too. BTC will stay the main imo (one to rule them all). But how dare they call the fork Bitcoin Unlimited, hurting a well hard established strong brand by splitting it? It's a rhetoric question, I just realized there will be a long dry time for BTC.

Yes, the brand is Bitcoin's most valuable asset. The network could be moved and the technology is already open source. Another major issue with the common history for both forks is the possibility of replay attacks


text:
bitcoin.conf priority on merging and conflicting keys?
My main bitcoin.conf is located in the AppData. Setting the datadir in it or via argument allows me to let the daemon/qt load another bitcoin.conf that is located in the DataDir. I can also change the main bitcoin.conf by setting the conf via argument and I can also specify includeconf in the config to load another config file.
I'd like to know how the priority will be when using all of the above features on conflicting keys as well as if merging is done and if so, how.
For instance: Which of the values will be used if I define its key in the main config as well as in the config at the datadir and even in a config that was included using includeconf? Is it also possible to use includeconf twice or more times to load more than one additional configuration?
What if I use includeconf in the config of the datadir and in the main conf and both files also contain conflicting keys? Will there be any merging at all?

Firstly, command line arguments always override the config files.
Secondly, if you specify a config file using -conf, the default config file in the datadir will not be used - only the config file you specified will be used.
Thirdly, if you don't specify a -datadir as a command line argument, the bitcoin.conf in the default datadir location will be loaded. If that config file specifies a different datadir be used, that chosen datadir will be used for blocks, wallets, etc. but no config file will be loaded from it. The config file in the chosen datadir will only be used if you load Bitcoin with the -datadir arg set on the command line so that it looks in that datadir first.
Generally, if there is a conflict between two options, the first one will win. That means an option set in the main conf file will take precedence over one set in an includeconf file. You can use multiple includeconf augments in the main config file but they can't be recursive - you can't use includeconf inside a file that was included using includeconf.
The exception to this is that options declared network-specific (e.g. [main]) will take precedence over non-network-specific options, even if declared later.
Source

Thank you. Regarding the conflict of keys: If a key is behind the datadir key as well as in the config file of the datadir directory, the key in the main config file will still be the first, right? So the order of priority is main config, datadir config (if -conf wasn't used), includeconf config, ..., right? Also can I use includeconf in the config file at datadir as well?

I've updated my answer to answer your followups.

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


text:
I sent out a payment over a day ago and it's still not confirmed
https://blockchain.info/tx/3b047ef34fcd283ce57868dedb80eb239970ded1aeb10c0fe3a39360dc822056
https://blockchain.info/tx/2a774b4a29a498f95aeb8fd256c36404118fce1157aea976a3fcfe0f29a6918c
Electrum won't let me overwrite the payment with a higher fee either. Any Ideas?
EDIT: I'm using electrum and it wont let me send out another transaction without the "funds" in the wallet which are still unconfirmed. Is there a way to resend the transaction with a higher fee from a website or another wallet? Or is there a way to cancel the entire unconfirmed transaction so I can resend the payment?
Sidenote: There's not enough bitcoin in my wallet to send out a CPFP.

Related: http://bitcoin.stackexchange.com/questions/51511/broadcast-a-signed-transaction

The fees you included are quite low indeed.
According to Bitcoinfees, and Bitcoinexchangerate the current recommended fee/byte is around 160-168 Satoshis, implying a median transaction fee (around 226-byte transaction) of about 40K Satoshi. In your case, you are paying around 50 Satoshi/byte, 116K Satoshi per transaction. The sources differ in how many blocks will take for a transaction with this fee ratio to be published, from 6 blocks to way more than a day.
What can you do? You can either wait until both transactions get confirmed. Wait until them get pruned from the nodes mempool and resubmit them with a higher fee, or create a new transaction spending from the last one using a CPFP approach.
Child pays for parent (CPFP)
Basically what you do is to create a new transaction spending from one that is already unconfirmed, and add a high fee to that new transaction. By doing so, you incentivize a miner to include that last transaction in the blockchain, having to include the previous one also.

Thanks! But I'm using electrum and it wont let me send out another transaction without the "funds" in the wallet which are still unconfirmed. Is there a way to resend the transaction with a higher fee from a website or another wallet?

Not really. You will need to modify the transaction in order to add a higher fee, and by doing so the signature will not match. Moreover, the ID will change and it will be treated as double spend, as long as your old transaction is still in the mempool of the network nodes. If you have access to the keys of your address (if you can export them from Electrum), you can use them with bitcoind or bitcoin-qt for example to build a CPFP that will do the trick.

authors: alexa дизайн


text:
Blockchain.info websocket not working
I have been trying to get this code to work and I get a blank page no response at all from the server what is wrong with the code? or has blockchain.info changed something in their code? Can some help???
Here is the code i'm using : http://btcthreads.com/websocket.html

I am hosting a webvisualization that depends on the websocket API from blockchain.info. The API stopped working at exactly 16:40:45 GMT yesterday (march 1st) for me.
This API has gone down in the past, let's hope it goes up fast.
EDIT: for me it is working again (since 13:50:14 GMT).

Its an awesome site you got there mike! which of the non permission based api's is the best to use?

All blockchain explorers (and a bunch of other bitcoin companies) have APIs nowadays, however most are aimed towards people wanting to know specific transactions, while for my globe I wanted all transactions (+relay IP address). For this reason I choose blockchain.info at the time. Disadvantage is that it does go down a lot..

I need to verify if transactions have been confirmed by at least 3 nodes. I have the addresses in a database and I was going to run a cron job every 15 min hitting https://blockchain.info/q/addressbalance/14hYpVjonymPS1jwSuFsfE188f3FJtL7NE?confirmations=3 to see if there is a balance or not on that address. How reliable is that API does it go down often?

"been confirmed by at least 3 nodes" I think you mean 3 confirmations, there is a big difference. ---- in my experience it goes down ~once a month, but most of the time just for an hour or two.


text:
Minority Attack on Bitcoins
I read the first paper which described the bitcoins. Most of it is clear except for one thing. I tried to find solutions online but couldn't find it.
I am completely aware of the implications of a regular majority attack and how it is carried out, the other resources required for it and the consequences. The question below is completely different from it.
The paper by Satoshi Nakamoto claims that bitcoin is secure when >50% of precessing power is controlled by good people(non-attacker). This means that the chain mined by good people will grow the fastest and the probability that the attacker will be able to catch it will be exponentially low. But consider a case when 51% of processing power is with good people and 49% of cpus have joined hands to attack the network. Now each good node might get transactions in different order. Further the first transaction in each block is special which pays to the creater of the block. So basically each good node is trying to hash a different block while all the attackers are trying to hash a single block. Isn't it that the attackers can hash the block much faster than good people. Thus their chain has one extra block at this step than good people.
I have already asked few people but couldn't get any satisfactory answer to it. Neither could I find anything which addresses the difference of block for good people online.

Hi Akash Garg, you should try looking into the tag [tag:majority-attack], it collects all questions related to your topic. I think this question may be a  duplicate of What can an attacker with 51% of hash power do?.

Hi Murch, thanks for the tag. I appreciate your help. And about the duplication. I clearly understand what will happen when attacker holds 51% or more power. It is the most basic case. I read the answer as well and I am well aware of the derivation. My question is about security when attacker has 49% or less power. Can we guarantee security if attacker has <= 49% power. The case I have described above, the attacker holds exactly 49% of cpus and good people 51% but still security is not guaranteed.

You're right, due to the efficiency of scale, the attacker doesn't actually require a majority of the hashrate. At least for selfish mining there have been dozens of papers showing that it might even be sufficient to have 25% to gain more than your fair share in mining. I'm not sure if there has been a paper for majority attacks along those lines.— Perhaps you could edit your question a bit to make this point stand out more and be reflected in the title. Please also mention that you're aware of the implications of a regular majority attack.

Thanks for the suggestions. Also this thing can be linked to mining groups. A mining group can actually use this way to gain more than fair share. A group where all people are trying to mine the same block controlling x% of processing power is more likely to hash faster than other x% of processing power which is divided into individual units each mining different block.

Yes, in this context also see [tag:selfish-mining]


text:
Is there any tool to extract the bitcoin transaction network from the blockchain?
I'm looking for a way to extract some data from the latest downloaded bitcoin blockchain. In particular I'm interested in extracting the whole transaction network, so input and output public keys used in each transaction, the transaction date, hash, block hash and BTC amount.  I tried several solutions so far with no luck:
Bitcoin-Transaction-Network-Extraction
rusty-blockparser
bitcointools
BitcoinDatabaseGenerator
BCGraph
I've had some luck with bitcoindatabasegenerator and rusty-blockparser, but while these tools succesfully extract the output PKs, input PKs are nowhere to be found in the resulting files.
Summarizing, I'm looking for something like this to produce a network visualization of bitcoin transactions:
|Source PK(s) (BTC)| ------> Transaction ------> |Target PK(s) (BTC)|
Im not really an expert in coding so this makes everything more complicated for me. Can you suggest me a way to extract this data from downloaded Blk files?
Any help would be greatly appreciated!

BlockChain::BlockChain ( QObject* parent ) : QFile ( parent ), blkFile ( START_BLOCK )
{
  connect ( this, SIGNAL ( block ( const QByteArray& ) ), parent, SLOT ( block ( const QByteArray& ) ) );
  connect ( this, SIGNAL ( doneFile ( ) ), parent, SLOT ( doneFile ( ) ) );
  QTimer::singleShot ( 0, this, SLOT ( start ( ) ) );
}

void BlockChain::start ( )
{
  setFileName ( blkFileName ( blkFile++ ) );
  if ( !open ( QIODevice::ReadOnly ) )
  {
    _trace ( QString ( "cant open [%1]" ).arg ( fileName ( ) ) );
    emit block ( QByteArray ( ) );
    deleteLater ( );
  }
  else
  {
    _trace ( QString ( "processing [%1]" ).arg ( fileName ( ) ) );
    QTimer::singleShot ( 0, this, SLOT ( next ( ) ) );
  }
}

void BlockChain::next ( )
{
  if ( pos ( ) < size ( ) )
  {
    quint32 magic;
    quint32 sz ( read ( (char*)&magic, 4 ) );
    while ( !magic && pos ( ) < size ( ) - 4 )
      read ( (char*)&magic, 4 );
    xassert ( ( ( magic == MAGIC_ID ) || !magic ) && ( sz == 4 ) );
    if ( magic )
    {
      read ( (char*)&sz, 4 );
      emit block ( read ( sz ) );
      QTimer::singleShot ( 0, this, SLOT ( next ( ) ) );
      return;
    }
  }
  close ( );
  emit doneFile ( );
  QTimer::singleShot ( 0, this, SLOT ( start ( ) ) );
}

const QString BlockChain::blkFileName ( const int i ) const
{
  return
    ( i < 10 ) ? QString ( DATA_ROOT "\\blk0000%1.dat" ).arg ( i ) :
    ( i < 100 ) ? QString ( DATA_ROOT "\\blk000%1.dat" ).arg ( i ) :
    QString ( DATA_ROOT "\\blk00%1.dat" ).arg ( i );
}

This seems to be missing a class definition at least.

this piece of code is only a demonstration that blockchain parsing is very simple task

Ok, but it's not an answer. You don't explain what it does, why it works, what it needs.

this is an answer for a question "Is there any tool to extract the bitcoin transaction [network] from the blockchain?". the short answer is: "yes, there is. here is a proof that such tool exists"

I'm downvoting this because it gives no context. Just a piece of code that doesn't even compile is not informative.


text:
The complement of s (when s < curve order / 2)
Bitcoinlib refers to the requirement that if s > ORDER / 2, then the complement of s should be used instead since it's one byte shorter
This sounds like it's referring to the inverse or negative s value, but I also know complement can be a computer science term.
The relevant code can be found here (perhaps someone adept with the Bitcoin Core code can chime in on what the code is doing), so, what is the complement of s referring to?

In ECDSA s can be on either side of the curve and the signature will still be valid. The term "low s" is referring to the value literally being being below the curve order (0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0). The requirement of low-s is arbitrary (high s would have worked just fine as well), and is one of the new BIP62 validity rules that are intended to combat transaction malleability.
Absent this rule, any person is able to take a Bitcoin transaction, flip s in any of its signatures, and push the transaction out again with a different TXID. Being able to do this only changes the hash of the transaction, and does not alter its validity in any way. Being able to mutate transactions breaks a number of potentially interesting transaction types in Bitcoin like payment channels, where chains of transactions will suddenly be invalidated by a parent being mutated and an alternate form included in a block.
By forcing valid transactions to always have low s this ability is removed, though a person with the private key for a transaction is still able to mutate their own transactions by resigning them with a new nonce.

Fantastic! Can you write some pseudocode (or Python) which shows how to flip the s value? It's not just the negative value is it?

The pseudocode is very simple:   s2 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1;

@amaclin oh wow, so I was absolutely overthinking this. Of course, i see the logic to it now. Tangentially, why is this code so un-Pythonic? Is it basically a Python "port" of the C++ code?

python-bitcoinlib is unpythonic because it is emulating all of the structures that you find in Bitcoin Cores CPP codebase. You could make it more pythonic but it wouldn't be as useful that way.

What is the complement of s referring to?

I haven't heard that term used like that before, but reading the code, it appears to compare s to see if it's more than n/2 rounded down (where n is the order of the curve, FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141.)
If it is, it calculates n - s and uses that as s.

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


text:
Do we put all the transactions in the memory pool?
I wonder if orphan transactions are also stored in the memory pool? If yes, how do the Bitcoin client distinguish between the orphan and non-orphan transactions?

Bitcoin Core maintains a separate orphan pool, with transactions whose parents are missing. Its main purposes is dealing with peers that send us groups of independent transactions in the wrong order, so this pool does not need to be large.
Since Bitcoin Core v0.13.0, all transactions sent to peers are sent in batches, and within those batches in dependency order. This massively reduced the average size of orphan pools on the network (from hundreds to typically just a few).

Thanks, I've fixed the half-knowledge expended in my post.

Orphan transaction
"Orphan transactions" are transactions for whom a parent is missing and therefore at least one input unknown to the node. This can happen when a node receives transactions in the wrong order or when the parent was doublespent and therefore one of the inputs of this new transaction will never manifest. Until the prerequisites for the transaction are met, such a transaction would essentially appear invalid, as the node will recognize that the transaction is spending money that the node is unaware of. The mempool does not store orphaned transactions, but it collects them in a separate orphan pool in case the parent still gets relayed.
Orphan block
An orphan block is one whose parent is unknown to the node. This could happen in earlier versions of Bitcoin, when a later block got relayed to your node before you received the parent, e.g. during synchronization. I believe that nodes would keep orphan blocks at least until they could tell for sure that it isn't part of the longest chain (i.e. they synchronized up to the height of the orphan block).
Stale block
Every now and then, there's a chainfork when two miners discover blocks at the same height. Once one of the two competing blocks gets a successor, the other block will become part of a "stale chaintip". Generally, nodes only consider one block at the same height as valid, and thus ignore confirmations in parallel blocks at the same height. Transactions that were only confirmed in one of the two blocks at the same height will be considered unconfirmed in the other block. Nodes will consider the second block they receive at the same height not to be part of the longest chain and just keep it to be able to follow a potential reorganization.
So, I'm afraid that I have no clue what issue you think there may be to distinguish between orphan and non-orphan blocks. ;) And for the most part what you probably consider "orphan transactions" are either invalid transactions or unconfirmed transactions.
In case I'm missing the point of your question, please update your post and tell me in a comment.

By orphan transaction I meant the transactions whose parents are missing or have not arrived yet. İn such a case, the node has to wait for the parent to be able to validate the transaction at hand. This is what I understood.


text:
Why is the transaction priority removed?
As far as I know, in the earlier version of Bitcoin, there was a mechanism about transaction priorities. However, it has been removed (or not being taken into account anymore) and now the only criterion to be selected for confirmation is the fee.
Can anyone explain, what the reason was behind this design decision? Shortly, why?

I was about to ask just now why it was not removed. I don't know why a miner would ever use this value. They can optimize their profits by selecting transactions by fee. It is not necessary for Bitcoin to function that miners act altruistically by prioritizing certain transactions and it's probably unrealistic to expect that to happen.

Why do you think it is unrealistic to expect that a very old transaction is confirmed? OK, it paid lower fees to the system, but it received a slower confirmation also. It is fair, no?

Bitcoin does not enforce any notion of fairness. The whole ecosystem works just fine assuming complete selfishness. That's the innovation.; Old transactions can be confirmed just fine when the fee level decreases to the fee rate that that old transaction offers. Miners can include whatever transactions they want so they milk that stream for maximum fees.

Personally, I think this is how it should have been from the beginning. No 0 fee transactions at all, strict fee maximization. That's what we will end up with anyway and forever. Billions of revenue are at stake for miners. The priority thing as well as child pays for parent and RBF are all unnecessary mechanisms. Had miners been selfish from the beginning CPFP and RBF would have been enabled for everyone without a single line of code.

It seems to me that when everybody is selfish the fee rate is increasing. Also it should be noted that I did not say that zero fees, I said lower fees. By the way, what is RBF, I do not know about it.

The fee rate will go up as long as people are willing to pay it. It's a free market. That's inevitable, and the alternative is just an unreliable system with arbitrary selection when more transactions are produced than fit in blocks.

Please limit the discussion in the comments, rather consider [chat], creating an answer, or if the topic shifts, to create another question. Thank you :)

Firstly, the priority mechanism was not a consensus rule. Originally it was just a few hundred kilobytes of space reserved in a block (100 kb IIRC) for transactions that had a high priority. But this was not a consensus rule; it does not have to exist. After blocks started getting full, many miners, out of the interest of getting as much income as possible, chose to stop reserving this space for priority. There is more money to be made by choosing a few hundred transactions that paid more fees than it was to choose a few hundred transactions that didn't but had priority. Since no one miner was actually using priority, Bitcoin Core removed priority from its fee and confirmation estimations so that the given values would be more realistic and the code would be simpler.
The following pull requests and the issues linked within them contain some of the discussions that the Core devs had when removing priority: https://github.com/bitcoin/bitcoin/pull/9602, https://github.com/bitcoin/bitcoin/pull/7022, https://github.com/bitcoin/bitcoin/pull/7008.

Selection by "age x value" creates an arbitrary nobility for early adopters/large hodlers. Early adopters having old coins would be able to cut in line any time, large hodlers could cut in line by transferring a large amount from themselves to their change output. Neither of the two characteristics is in any relation to the actual resources on the network being used. In fact, the latter may actually increase resource usage by encouraging potentially avoidable change outputs.
On the other hand, transaction selection by fee rate is a mechanism that creates a relationship between the demanded resources and the cost. It allows miners to maximize their revenue and users to efficiently signal priority.


text:
How is a Transaction ID generated & when does it change? (with a new sequence ID?)
I'm creating a non-mainstream client that processes and validates Bitcoin transactions and need to track transactions in my database.

How is the TxID generated and when does it change?

Specifically, since sequence is intended to update a transaction, and if the transactions hash were to change I would assume the txid hash would change s well.
When I look at this image of a Tx, it appears that the txid is marked as TxIn (VI)

Is it possible or useful for a script to verify the TxID and signature hash?

TxID is just a SHA256 hash of binary transation data, so it changes upon any modification of transaction.
Therefore, one cannot include verification of TxID in the script in same transaction (if I correctly understood what you want to achieve).

Maybe I'm confused... Where is the TxID?

The transaction id is used to refer to a transaction; it is not part of it.

@PieterWuille Is the TxID a simple Sha256 hash of the tx data in it's entirety?  Does that mean the TxID changes if the sequence # changes?  How should I track revisions (new sequences) of the same tx?

@makerofthings7 Yes, it is just hash of all data. If tx data changes then it is NOT the same tx.

It is a double-SHA256 of the serialized transaction. So indeed, the sequence number is part of. Changing the sequence number means you get a new transaction, but there is some (currently disabled) code in the reference client which can detect one transaction as a 'new version' of another, and replace it.

@PieterWuille does generating txid mean you hash the scriptSif & scriptPubKey as well ?

Yes, any change at all, including any non-sensical or irrelevant change, will change the transaction id.


text:
Why does my client not show funds that were sent to me?
Quick question regarding a transaction that I am having an issue with, about a week ago I bought some BTC with MtGox, however when I withdrew the BTC I opted not to pay the fee. One week later I am still waiting for the BTC, can I pay a fee myself to process the transaction quicker, post original transaction?

Nope. Maybe it's a problem with your client. What does blockexplorer say about your bitcoin address?

Are the funds gone from your MtGox account?

Peter - yes they are

Nick - http://blockchain.info/address/1J9pWgJFnw8RCpUC888gbFUREdH6KCGMdd - 14.12806148 BTC

If something is wrong with my client, how can I manually 'receive' the funds? I have keys etc.

Your client will immediately show a payment that was sent to you however it will only show as "0/unconfirmed" until the transaction has confirmations and also your client must be synchronized (has downloaded the needed remaining blocks).
If the transaction was broadcast to the network (e.g., shows up in Blockchain.info) but your client doesn't show any payment whatsoever then the problem is likely to be either that your client isn't connecting to the network or somehow the address you think is in your wallet really isn't.
If you manually imported private keys into the client's wallet, then possibly the client needs to have the client launched from the command line with the "-rescan" option to get the imported private key and its bitcoin address to be properly recognized.  That option can be run at any time (i.e., isn't harmful to run, even if not needed) so if you are expecting results that aren't occurring, this is one step you can take to eliminate any question.
Of course, make sure you have a backup (multiples, actually) of your wallet.dat at all times, including before doing a -rescan or at any time there appears to be trouble.


text:
Why does Armory enforce a minimum transaction fee?
When I send coins using the standard bitcoin.org client I can set the transaction fee to 0.  However in Armory client there is a transaction fee of .0005 and you cannot override it to less.
I was under the impression that transaction fees were set by the user, and that the transaction fee determined the priority of your transaction on the network...so why does Armory force this?
In fact when I sent coins with fee of 0 via bitcoin client it went through faster than when sending the coins back with a fee of 0.0005 with armory...?

If the Bitcoin.org client sees that a fee is necessary, you must pay a fee.  There's no way for you to force it to send without a fee if it thinks you should include a fee.  Armory works the same way, no?

Also, the network doesn't know what client you used when sending.   So your experience probably had less to do with whether a fee was paid or not and more to do with the age of the coins that were being used as inputs.

I sent .01 coins from bitcoin.org client, to an address in Armory wallet, set fee to zero.  .01BTC arrived.  I then tried to send the .01 back from Armory to my bitcoin.org wallet, it would not allow me to set a fee of zero, forced me to pay a fee of .005 so I was only able to send .095 back.  Why did i pay no fees when sending from bitcoin.org client, but paid fee of .005 when sending from Armory client?

Probably because when you sent from the Bitcoin.org client, the coins were old.  When you sent from Armory, the coins were new.  The fee algorithm is set to make new coins more expensive to send than older ones (more than a day old, for example, might be the threshold).

If the coins it is using have a lot of confirmations, the less likely a fee is going to be needed.
In the instance reported here, when the payment was sent using the Bitcoin.org client the funds had many confirmations and no fee was required.
When a payment for that same amount was then created using Armory, the funds did not have many confirmations and thus the client insisted on there being a fee.
This is not a difference between Armory and the Bitcoin-Qt client.  This is a difference between sending coins which had lots of confirmations versus sending coins which had fewer confirmations.   The same thing would have happened regardless of which of the two clients was being used.

I will try the experiment again but this time leave the coins a few days before sending them back, so that they have a similar number of confirmations as the original transaction.

I tried again, and still the same result.  I have received .01 costs to my armory wallet (sent from bitcoin.org client with no fee).  The coins now have 350 confirmations.  I select to send .01 coins and set the fee to 0.  When I click "send" armory pops up a message saying "You have specified a valid amount to send, but the required transaction fee causes this transaction to exceed your balance.  In order to send this transaction, you will be required to pay a fee of 0.0005 BTC."

This answer doesn't seem to be correct. The coins I'm using have over 200 confirmations - and yet I still can't send them without a fee. That should be plenty, correct me if I'm wrong.


text:
Why Do Compact Signatures Need To Start With a Byte 27-35?
There's a hard-coded 27 value in Bitcoin's encoding of Compact Signatures that I don't understand:
https://github.com/bitcoin/bitcoin/blob/v0.7.1/src/key.cpp#L333
I get that the need to encode the nRecId to disambiguate the correct recovered key, but I don't understand the 27 (or for that matter why fCompressedPubKey is encoded as a 4).
The decoder requires the first byte be between 27 and 35, but then just subtracts the hard-coded 27 sans explanation.
It this poor man's bitmasking? It there something in the protocol that Compact Signature's can't begin with a 0x00 and this is a weird work-around? Perhaps it's acting as a sort of magic cookie?

To clarify, the decoder requires the first byte to be 27, 28, 29, or 30 for uncompressed public keys, and 31, 32, 33, or 34 for compressed public keys.

Frankly, I just picked a range of numbers whose binary representation wouldn't easily collide with those of addresses (0, 111), secret keys (128, 239), public keys (2-7) or signatures (48). At the time, I didn't really expect it to end up in the message signing feature eventually.

Thanks Pieter! Is there a writeup somewhere for this compact signature format?


text:
Bitcoin Transaction never confirmed even with a significant fee?
I just had some questions in regards to relating fee/byte to confirmation. From an exchange the withdrawal fee for bitcoin is fixed to 0.0005 btc but the bytes vary very much, and thus you get very different fees/byte.
Transaction id eb956503c6459d564cb097064f6093a14d85a607f7dca76d265a21d90eeecb7f
and for some strange reason this transaction can only be viewed on https://blockchain.info and not the other block chain explorer's I tried to use. It has a 61.2 sat/B fee/Byte, over 5 days later it has not reached a single confirmation.
According to https://bitcoinfees.earn.com/ the max time I should of waited for 61.2 sat/B is 1200 minutes or 20 hours, which I'm well way above.
I tried sending a larger amount of bitcoin to the same address manually with a massive fee/byte in the hopes that the 61.2 sat/Byte fee transaction would get a confirmation, but it didn't, only that one did (I read somewhere that by doing this it could confirm the slower one).
I didn't want to have to waste someones time with this, but the question is if it's possible that an error or glitch may have happened between the blockchain or miners that could of caused this? Considering the future time valuation of a risky asset like bitcoin, then it can be thought that the longer I wait for this, the more intrinsic value I lose.

https://bitcoinfees.earn.com/ is highly inaccurate, have a look at https://core.jochen-hoenicke.de/queue/#24h. Currently around 350 S/B TX are getting confirmed

Thanks, sorry for the possible duplicate, it was not my intention


text:
my coin transferred on 17 Dec and confirmed on 31 Dec still showing unspent on 5 Jan
I have done a couple of transaction in Blockchain but have never experienced such problem. I transfered coins from my wallet to another account by choosing custom fee option on 17 Dec which got confirmed on 31 Dec and showing unspent there till 5 Jan now.
https://blockchain.info/tx/592d3405f60e87c55afa72b989354c7f773def2bca848bb0f15d3039c4d6b91e
I hope my coins are safe and will get it soon?
please help
Manoj

Whatt do you mean as unspent? TX seems fine

That transaction is valid and confirmed.
"Unspent" in the right-hand column means that the outputs have not been spent.  The funds are still sitting in the 1965... and 144f... addresses and have not been moved out of those addresses.
If one or both of those addresses belong to you (i.e. you generated them with your own wallet and have the private key(s)), then you can spend those funds any time you like.
If they belong to someone else (e.g. a merchant from whom you are trying to buy something, an exchange where you are trying to make a deposit to your account, etc.) then that person has the funds.  If they haven't acknowledged the funds (delivered your order, credited your account, etc) then that is something you have to take up with them directly.  But the Bitcoin protocol has done its job at this point.

hi, I have transfer to my account with other exchange so if they have not acknowledge the fund, Can I get that unspent coins back to my blockchain wallet? or else how can I ask them to acknowledge if they have not done yet?

@ManojMishra: No, you can't get the coins back.  The exchange has complete control over them now.  You can keep contacting them, or try to escalate to higher management, or call a lawyer and look into your legal options.  But from a technical point of view, there is nothing you can do, and nothing further we here can help you with.


text:
Fastest way to transfer funds from Ethereum address to Bitcoin address
I have an Ethereum address with some Ether in it, and I would like to transfer some of those funds to a Bitcoin address.
I am wondering what's the quickest and most painless way to perform the token exchange and the transaction - possibly without having to install a wallet client.

Although you may not realize it, what you are asking is for is effectively a service review.  Unfortunately, this is off-topic in this forum.  I'm sure you can find plenty of reviews for crypto-exchanges elsewhere, but this site is for questions with less opinion-based answers, and questions whose answers will remain relevant as various exchanges/services come in and out of existence.

Use an exchange that trades both BTC & ETH.
Bittrex, ShapeShift, Coinbase, Poloniex, etc.


text:
Can't connect to Bitcoind remotely
I am running a Bitcoin Cash node on my server, and starting it like this:
start bitcoind.exe --server=1 --rpcuser=user --rpcpassword=password --rest=1 --rpcport=8332 --datadir=F:\Bitcoin --bind=10.1.0.4 --testnet=1 --rpcallowip=0.0.0.0/0

The node runs, and I can connect to it locally.
However, I can't connect to it remotely, from my C# application, using the BitcoinLib library:
ICoinService coinService = new BitcoinService(ConfigurationManager.AppSettings["Bitcoin_DaemonUrl"], ConfigurationManager.AppSettings["Bitcoin_RpcUsername"],
ConfigurationManager.AppSettings["Bitcoin_RpcPassword"], ConfigurationManager.AppSettings["WalletPassword"]);

I am getting this error:

BitcoinLib: There was a problem sending the request to the wallet.
  System: Unable to connect to the remote server.

I have created inbound/outbound rules in the server's firewall settings, allowing access to the 8332 port, and I think that --rpcallowip=0.0.0.0/0 should allow all IPs to connect to my node... So I really don't know what the problem is.
Edit: I can't access the node from https://bitnodes.earn.com/ either.
Update: the node has finished reindexing blocks, and I still can't connect to it remotely.

You're running in testnet mode (which Bitcoin Cash doesn't have), and trying to bind to the normal RPC port, and bitnodes don't support tesstnet.

@eponymous I have started it in main net mode now, and bitnodes still says it's unreachable. It says in the logs that it's "reindexing blocks" - will my server be unreachable untill the reindexing is done?

It turns out that the solution didn't really have anything to do with bitcoind itself - I was running it on a virtual machine hosted on Azure, and I needed to create firewall rules for the port not only on the actual Windows machine, but also in the Azure portal!


text:
Alternative to Python pip bitcoin
This Python pip package https://pypi.org/project/bitcoin/ was originally developed by Vitalik Buterin (that Ethereum guy) but is no longer maintained. Is there any alternative equivalent pip package which can also work with segwit addresses? Thanks.
Found this https://github.com/1200wd/bitcoinlib . And it is crap. Won't even install with pip or pipenv.

Try this library by Peter Todd https://github.com/petertodd/python-bitcoinlib
Or pycoin https://github.com/richardkiss/pycoin

pycoin easier to use


text:
retail hardware SHA256d hash rates
Obviously it hasn't been profitable to mine bitcoin on retail hardware for years at this point.
Nevertheless, I'm curious.
Does anybody have any benchmarks on what the hash rates for retail hardware would be today? Preferably on an x86 chip?

Mine for what coin? It depends..

@Willtech good question! Just updated the question to make it clear it was about bitcoin :)

@pebwindkraft thanks for that, that's helpful. The hashing rates referenced there are for scrypt though and here I'm looking SHA256d rates here. Updated the question to reflect this.

@HighlyIrregular Ah yea, I saw that but that question simply points users in the direction of tools that can be used to determine the hash rate of your hardware, it doesn't supply any actual numbers.


text:
Relation between bitcoin price and other cryptocurrencies prices
If bitcoin price goes up, Will that increase the value of the other cryptocurrencies?
Edit: If yes, then WHY? Seems a mystery for me since I guess every coin has its independent price.
Thank you

It depends, obviously. Short answer, yes.
Bitcoin used to make up a huge percentage of the value of all Cryptocurrencies, so obviously since Bitcoin was the largest and most used, if it were to crash or change in price drastically, obviously most of, if not all other cryptocurrencies would be affected.
Bitcoin still makes up a large percentage of the Cryptocurrency Market Cap, over 34% on January 25, 2018, followed by Ethereum with 18%.
This is important not to be mistaken though. Perception is what controls the price of Cryptocurrencies.
since bitcoin is the leader of all cryptos, if news were to come out that someone figured out how to exploit it's "proof of work" algorithm, or something giving Bitcoin a negative perception, it would loose value.
Because Bitcoin is so prominent in the crypto world, all other coins would be impacted too, because its literally the "leader".
of course if news comes out that a very small and unknown cryptocurrency would grant you super powers if you owned enough, just that cryptocurrency would go up, not really impacting others because it doesn't have a large market cap.
So in short, the larger market cap, the larger the impact on other currencies

“So in short, the larger the marketcap the larger the impact on other currencies” ... still I do not get WHY that happened since every currency has its own value. It sounds to me like if Iphone mobiles decrease in their value that would impact Sumsong or Nokia which is unrealistic I think.

The price of these cryptocurrencies (and stocks) are partly dictated by public appeal, consumer confidence, and the media. If the media says the Nasdaq was just scamming everyone (or something negative I dont know), then because Nasdaq is the umbrella so to speak, lots of stocks would crash as well as Nasdaq because there wouldn't be any consumer confidence or appeal. The same works with cryptos, Bitcoin is still the main one, even if there's tons of altcoins, but unlike Nasdaq you could say It indirectly influences because it doesn't "house" stock or etc.

Your comparison is not valid @GamalThomas. You don't need to buy a fraction of an iPhone with your FIAT to trade it for a samsung. You just go and buy the samsung with FIAT.


text:
Fees for transfering money by bitcoins and banks
When I send money to someone using the bitcoin network, I have to pay fees for converting my dollers to bitcoins in an exchange market, then I have to pay the miner fees then the Wallet fees to receiving my bitcoins and the Wallet fees to sending the bitcoins to the other person.
Why do people say that using the bitcoin network in transfering money is less fees than banks?

I for sure cannot answer, why other people say, that transferring money with bitcoin has less fees. Your picture is correct, everywhere are fees.
For specific cases, fees might be lower than bank transfers. I usually send money to Africa. I was doing it with banks, with WE and Moneygram, and with bitcoins. With bitcoins the advantage is, that the fees are independant of the amount. So I can send the equivalent of 1 mio Euros in bitcoin to Africa, and pay just the transaction fee. Try this with the 7 or 8% fees of the best banks or money transfer agencies. You will never ever end up at 5 Euros tx fee. So in these cases, bitcoin is far cheaper than traditional, old-style money transfers.


text:
How to be assured a wallet is on a blockchain?
How could I check that a wallet or any app I download from Google play or Apple store or a website is truely runs by a blockchain and be certain that producing company can not manipulate the private key?

That's impossible. The only way you can be sure is that you compile the wallet from the source code by yourself. In practice, you should only use wallets that are famous (some of those are Blockchain.info wallet, Bitcoin.com, CoPay, Coinbase, Electrum, BRD,... I can count at least 20 of them). You can search online with the name of the wallet software you want to download and refrain from downloading it if there isn't enough of convincing reviews.

Thank you, maybe a paper wallet is another safer option, not full sure.

You'd still need to install a wallet software to spend it.


text:
Why do we need bitcoins in the bitcoin network?
I am new to the bitcoin world and I am just wondering why don't we simply use the US currency (or any fiat currency) to transfer money using the bitcoin network? Why do we need crypto currencies as a must to deal with that network?
Edit: why do we need (in the bitcoin network) to change our US dollers to bitcoins so as to be able to transfer our dollers to someone else? Or can we use the technology of the bitcoin network to transfer dollers without the need to convert the dollers to bitcoins, like what banks do?

I've got a $100 bill. If I send you some bits that say you have it now, who is going to believe you? I still have the $100 bill.

Thanks for the answer but sorry I can not get you, I am not sure if you mean that the bitcoin currency is a kind of proof to transactions or not could you explain your idea further if you please?

Who would you trust to hold the dollars? Why would I trust them too? You need an asset that can be custodied without requiring a counterparty. That's what the tech behind bitcoin does.

You cannot transact physical goods digitally. If I have a physical dollar bill, I cannot magically turn that into something digital that I can send to you. I have to go to someone who will accept my physical dollar bill and give me digital dollar bills in return. Likewise, with my bank account, I need to convert my bank dollar bills into digital dollar bills that work on this other network.
Well now we really have three things that represent the same value: physical dollar bills, bank dollar bills, and digital dollar bills. At this point, the only thing holding them together is the fact that they all have the same value. But they can only have the same value if some central authority is dictating that all of these have the same value.
Suppose the digital dollar bills were created by some independent entity which is not influenced by the same entity that enforces that a physical dollar bill and a bank dollar bill are equal in value. Well now we have digital dollar bills which have a different value; it is now its own currency. It has its own digital tokens which have their own value. And thus we have Bitcoin, a digital token which has its own value independent of any other currency.

authors: Николай Бойко


text:
Do I have to save my private keys?
Is it a good idea to take my private key from my wallet and save them? Because I read it is not save to make your wallet shows your private keys. (It guess I do not understand that well).
Edit: Are they different than seeds? the words-phrase that wallet gives?
And how can I use the private keys to restore my coins in case for example, my wallet company stopped working?

Yes indeed you should back up your wallet, printing out a paper copy of your private keys is a good way to do this because paper can only be accessed physically rather than being hacked via the internet. Obviously it's not safe to store them unencrypted on the cloud or something. The security warnings are there just to make sure you don't do anything stupid with them, to make you double check before potentially giving others access to them.
Bitcoin Core for example allows you to import private keys to restore a backup. If you print them out as QR codes, many wallets allow you to sweep them

Thank you for good answer, so by sweeping you mean I can use another wallet to restore my coins by using the private keys .. is that right?

Yeah, phones for example can easily scan QR codes to restore the private keys encoded in them


text:
Transferred bitcoin to an address - they are gone - what can I find out?
I was transferring some bitcoin between online wallets to sell some.
I must have been distracted or something, I was transferring to a coinbase account. It has all been confirmed but the address it says it went to doesn't correspond to any coinbase addresses (not bitcoin, litecoin or ether).
I may have done something stupid here - but I'd like to find out what happened. I thought I might have entered an Ether address by accident - but as I say it doesn't correspond to my ether address listed on coinbase - + I read that the network would reject it anyway because it know's it's not a bitcoin address.
I have the to address - how can I research this further? I've found nothing on Google of help. thx.
The to address:
1ACLteUzuXTYHV5v9nsoEk648hK8DShb4B

Go on blockchain.info

Yes I've seen that - but what does it tell me? If I can't get them back I'd at least like to know - say - which wrong crypto network I mistakenly tried to transfer the to (if that's possible) etc?

I've added the to address to the question

Well the money was received at that address, if you do not have the private keys for that address and Coinbase does not, there's no way of getting your money back. It is a valid BTC address and it received today 0.053BTC with 35 confirmations.

It can't be an ETH address, ETH and ETC starts with 0x . Maybe you sent to a Bitcoin Cash address? or to an old deposit BTC address. Have you checked Tools->addresses?

the transfer was from blockchain

yeah im sure i copied and pasted that address from something that's mine - but its not showing up anywhere. So those confirmations mean its gone to a valid bitcoin address right?

it might be a bitcoin cash address - would that work?!

First thing will be to check if 1ACLteUzuXTYHV5v9nsoEk648hK8DShb4B is your BCH address in Coinbase. Remember to also check in Tools->Addresses

YES its listed under my BCH addresses

If that is the case, then you have to ask Coinbase support nicely if they can recover those funds for you. There is a chance that you might need to sign the address you sent from to prove ownership of it.

awesome thanks - i guess the private keys are the same for both accounts - this gives me hope :D


text:
How can I create an exchange in a foreign country?
New to stack exchange this is my first post so sorry if its rough.
I'm part of a project interested in bringing BTC and crypto trading to Angola. We aren't sure where to start or what the best route to take is ie: create an exchange or wallet that allows P2P mobile transactions. We have a great team in place and some serious interest + investors but lack the technical expertise.
I'm looking to speak to individuals interested and knowledgeable about trading Bitcoin for AOA in Angola. Also if you have any general / technical knowledge on Africa / BTC we would love to chat or bring you on board.
Thanks so much.

here is some prvious discussion: https://bitcoin.stackexchange.com/questions/52974/bitcoin-exchanges-website?noredirect=1#comment61607_52974

Thanks so much. Only problem is since I am new I do not have enough reputation to comment on someone else's post / question to create a dialogue I can only read. :(

Here's some other previous discussion: https://bitcoin.stackexchange.com/q/3054/5406, https://bitcoin.stackexchange.com/q/18540/5406, http://bitcoin.stackexchange.com/q/17007/5406, however I must admit that your question is not a great fit for this platform. It sounds more like you want a discussion thread which we can't really provide here: We're actually in the business of focused questions and corresponding answers. ;) When you have a little more reputation, you could join our [chat], or perhaps you can break down your topic into more specific parts.

I'm voting to close this question as off-topic because it does not ask a question so much as it is soliciting for employees/partners in a business venture.


text:
Been reading the bitcoin source code but unsure what this segment of Serialize.h does
I decided to learn about crypto (and C++) by first reading the entire C++ implementation of bitcoin. I'm having issue with this segment of serialize.h
template<typename Stream, typename I>
void WriteVarInt(Stream& os, I n)
{
    unsigned char tmp[(sizeof(n)*8+6)/7];
    int len=0;
    while(true) {
        tmp[len] = (n & 0x7F) | (len ? 0x80 : 0x00);
        if (n <= 0x7F)
            break;
        n = (n >> 7) - 1;
        len++;
    }
    do {
        ser_writedata8(os, tmp[len]);
    } while(len--);
}

I get that it is writing some variable to a stream, however I don't understand the significance of
(sizeof(n)*8+6)/7

for the array size. Then it enters some loop where it performs a bitwise or of the bitwise and of the loop counter and the hex representation of 127, and either the hex of 128 or 0 depending on whether or not the loop counter is 0.
Then if the number is less than 127 it is going to exit and write the reverse of the array to the stream.
What I don't understand is:

What is the significance of that size of the array?
Why the bitwise operations?
Why write the array to the stream in reverse order?

I am not familiar with this, so I won't post a full answer, but it makes sense to think about this from a binary perspective. Decimal won't help you much.

The size of the array makes a jump after each (8*i) bits.
(n & 0x7F) grabs the last 7 bits of N. The (len ? 0x80 : 0x00) makes it add an extra 1 unless it's the first run. This explains the above - extra bits.
If (n <= 0x7F) tells you there are no bits beyond the ones seen, so no need to continue.
The array is written to in reverse order - it is then written to the stream backwards so that it is in the correct order again.

I should clarify. The array isn't written to in reverse order, per se. But you're taking the least significant bits out of n and putting them into tmp in a forwards order. Writing it backwards to the stream means the most significant bits hit the stream first.

@JArkinstall, this makes a ton of sense grabbing the last 7 bits, especially considering David Schwartz's answer. This is how they generate the variable length data. Thanks!

The encoding used fits 7 bits of data in each byte of output. So, to figure out the number of bytes of output you will produce, you need to take the number of bits of input and divide by 7 (since 7 bits of input fit in each byte of output), rounding up.
So, sizeof(n) is the number of bytes of output. Multiplying by 8 gives the number of bits of input. We divide by 7 to get the number of bytes of output needed to fit that many bits of input.
But integer division rounds down. To divide by 7 but round up, we add 6 to the number before dividing. That makes it round up.

Thanks for this, really puts it into perspective. I didn't know you could do x +
(n-1) before dividing x by n to round up the number, at least I never thought about it.
I didn't get how they were generating the MSB variable length data. Guess I still need to do a lot more practice using hex and binary in my code.

On another note I've decided to go along the route of blockchain development. Do you have any suggestions on resources to read or any general tips or advice?

One piece of advice: If you can find something that needs doing, no matter how small, do that thing. Having a specific, useful goal in mind tends to make you more efficient than just trying to read code line by line with no specific problem or focus. If you're looking at the bitcoin source code, take a look at problem reports or feature requests and try to find something small but interesting. (The bitcoins I got as a bounty for fixing the problem I fixed when I was learning my way around that code paid the downpayment on my house!)

Will do but I originally started reading the source code so I could heavily document it for beginners once I'm familiar with it. For people who want to get into it there's not enough documentation for them to understand without a wealth of experience.

If it were commented for beginners, would you know as much about the method as you do now? Terrible justification, I know, but worth considering.

@JArkinstall I see your point but not everyone learns the same way. I know that the general consensus is that you should try more on your own first but I still see the value in keeping it as reference.


text:
What is a likely solution to Bitcoin's energy consumption problem?
If the price of Bitcoin continues to climb, the total energy consumption of the system will increase proportionally at least until 2020 when block reward halves. It is not unlikely that at this point the price of Bitcoin will have increased so much that energy consumption will be unsustainable in a way that Bitcoin will be opposed by a large proportion of global society (we are still below 1% of total electricity consumption but a 10-fold price increase could change that quickly).
I see the same options that are laid out in this article:

Bitcoin will be abandoned and people just use something else
the protocol is changed to reduce the block reward earlier than 2020
the protocol is changed to exchange Proof-of-Work for something else (maybe Delegated Proof-of-Stake?)

since 2 and 3 will almost certainly result in a fork, they are related to 1. I feel that a solution will have to be found, I'm just wondering if I missed another option and which of the options is most likely.

I just found this statement by A. Antonopoulos: https://www.youtube.com/watch?v=2T0OUIW89II However, he does not really convince me. He does not address the problem that the block reward decreases very slowly.

First why would an increase in price cause energy consumption to go up? That's not immediately clear and probably worth more justification than some of the other nonsense your on. As far as Bitcoin is concerned it does not need a specific energy consumption level. That is not in the standard. That energy is spent on mining Bitcoin simply because it is available. And if at some point it isn't, the Bitcoin will adjust.

Also the price of bitcoin, to dollars is probably more related to the ratio of liquid Bitcoins to u.s. m2 or m3. So actually one could argue given fixed u.s. supply (which isn't fixed) more mining would reduce the u.s. dollar price of a Bitcoin. Assuming all btc are nice and liquid. Either way completely irrelevant to Bitcoin protocol.

And as for society's view on it, when was last time society complained at Facebook for storing huge amounts of user data? Are making sure they areent "waisting energy"? Did you drive a car today instead of a bicycle or take a bus? If society cares then the first and only place they need to look is at themselves.

Also if you actually look at the mining dynamics itself, distributed mining software that says barrows computation time on a web browser, if a relatively small number of people support it, can out pace any single mining group. Nothing you said has to happen and is simply fud.

Also I wonder how many of these mining pools ultimately end in failure in the long run. Bitcoin simply makes use of the computational power available to miners. It doesn't by any means require it and that seems to be biggest point everyone is missing. Unless I'm missing something? But nobody has voiced that point so.

Theoretically (not familiar or too lazy to loo) , iff all the computers disappeared but somebody managed to print out block chain, you could still follow the protocol and perform the hash on paper. You could then break it up and hire people to improve hash performance. It would still be hard to alter the chain and again if say a computer did come back it would be better off mining. This Bitcoin would still work completely. Hope this helps to explain why there is no tera flop requirement or min wattage requirement for Bitcoin.

"some of the other nonsense your on" is not the appropriate tone for stackexchange, especially when you are totally missing the point.

@marshalcraft I don't claim Bitcoin needs a certain amount of energy. You are right that the protocol could -- in theory -- work on paper. But you also point out that you have an advantage when you use a machine. The increased energy usage in case of a rising price is simple economics.

You have an advantage over other miners if you buy more hardware and use more electricity. At some point this becomes unsustaible because you spend more on mining than you earn in Bitcoins. However, when the price doubles, you can (and many people will) spend twice as much on mining resources as before, because it would still be profitable (given it has been profitable before) and you fall behind if others do it and you don't.

Another similar explanation can be found here:
https://www.quora.com/Is-there-a-correlation-between-bitcoins-hashrate-and-price

Would it be bill gates most productive strategy to hold so much wealth? What about Rockefeller? A lot of times these situations 90% of the wealth is left in used. This could be similar to using 1% of world energy to sustain accentually a Fiat currency. I don't these economic choices are simple or fully understood either.

My opinion is that these aren't clear set of possible outcomes. And if you really think they are that is fine, maybe you are right. But I would need some justification before specifically picking one of them.

Let us continue this discussion in chat.

One thing is Bitcoin earns about 7mil from btc a day. How much does so much energy cost per day to mine that? Probably a lot more than 7mil. So I'm betting on its just a lot of failing get rich quick ventures.

I feel that a solution will have to be found

I'm not sure I agree there is a 'problem' that needs to be explicitly fixed. The article you linked explains the relationship between price and electricity usage, now remember that price is a measure of the demand (since the supply is fixed and known).
So the market acts as a naturally regulating force: as people pay more and more to buy and use bitcoin, the network's power consumption will increase (and vice versa). So to say "bitcoin uses too much energy!" is to say "bitcoin is worth less than the current market value!". The article linked supports this point, but you kind of have to 'read between the lines' to realize it is true.
Consider gold mining: if the price of gold were to rise, then it would become profitable to start mining gold in places where a more expensive  processes will be needed to extract the gold from the earth. Is it a problem that companies will spend a lot of energy to get this extra supply that is now worth while?
Interestingly, consider what happens if the demand for bitcoin continues to increase, to the point that the network is in direct competition with all other use cases for power. In that case, for the btc price to increase, electricity prices would have to be increased, effectively spreading the cost of mining across all of the world's energy usage (because if the demand for bitcoin did not exist, everyone would be paying less to power their home appliances, etc).
I think it is easy to say "this is a problem!!", but the less obvious realization is "bitcoin is using this much energy because the market considers it useful enough to be worth the cost"

I'm just wondering if I missed another option and which of the options is most likely.

I don't think any of the three options you listed are likely to happen.
Another 'option' to consider is this: once mining chips become commodity (more easily and readily available from multiple suppliers), I think the nature of the mining competition will change. If everyone has access to good ASIC chips, then there will be immense competition to develop and utilize the cheapest sources of power available. What if bitcoin miners must help fund the development of ultra-efficient solar panels in order to maintain a competitive advantage? This is how ASIC miners were developed, why can't the same happen for another variable in the mining industry?
If this occurs, rather than the energy consumption of the network being a problem, it becomes an incentive for finding a solution to the larger issue of 'needing to develop green sources of power'.

Thank you for this answer. I'll have to think about it a bit. Just one quick note. You write: "So the market acts as a naturally regulating force". Markets are good at allocating resources with regard to certain incentives and costs. However, they can be self-destructing too, if not regulated (e.g. tragedy of the commons).

This is true, so perhaps a good question to ask is "will the advent of bitcoin lead to a net positive for humanity?". This is tough to answer definitively, but I think that environmental damage caused by the creation of a politically neutral system of value is better than (say) environmental damage cause by the proliferation of fossil fuels. I'm not sure "hey, at least its better than X" is a great argument in itself, but ultimately any system we create will have some impact on the environment, so it becomes a matter of "how much, how bad, and for what benefit?".

Resource consumption is ok, to secure the network. I just worry it could get really get out of hand. The electricity consumption seems to be sufficient to secure the network already. The market is not demanding more mining but the market wants Bitcoins. That both is coupled is an arbitrary decision by the protocol designer. Block reward could be much lower and the system would still work well. With 4% inflation, miners could spend electricity worth 4% of Bitcoin market cap per year (mining fees on top). I just have the feeling that this is not sustainable. However, I don't see how to avoid it.

The market will never get more Bitcoins, since mining is adaptive. Insofar it is a bit different from gold or oil where more (per year) is extracted when price increases. So it's a bit weird. The demand for Bitcoin increases but what people get is more wasted energy. Looks like the market cannot easily regulate that. But I'll think about it a bit more.

FWIW, the network is currently at ~4% inflation alreaddy. I'm not sure inflation matters anyways, bitcoin holders are essentially subsidizing the block reward already, by letting their bitcoins to lose value to inflation in order to pay miners to secure the network. As the inflation level drops, the miner's reward will come more and more from tx fees. I think that where the miner's reward comes from does not really matter though, what matters is how much of an incentive they have to mine. That is determined by what people will pay, which is not capped by the explicit supply/inflation of btc.

In the long term you're right. But currently inflation equals roughly what miners get (12.5 BTC block reward vs. ~1.5 BTC fees). It doesn't matter if it is inflation or something else. What matters is the 4% of total market cap. If Bitcoin price increases by 500% per year, market cap could be as high as 30 trillion in 2020 already. 4% of this is more than 1 trillion dollars. This would have a huge effect on electricity prices.

Right, but if the supply of new coins were reduced, then the price of the bitcoins already in existence would increase to account for this reduction. The variable that matters is "how much money is trying to enter the market". More people buying = more money entering the market = higher prices = more energy spent on mining. The number of coins in supply / inflation dictates the price per coin, but as you pointed out, it is the total market cap that that more directly influences the energy usage of the system.

Let us continue this discussion in chat.

"I'm not sure I agree there is a 'problem' that needs to be explicitly fixed. ...The article you linked explains the relationship between price and electricity usage, now remember that price is a measure of the demand (since the supply is fixed and known)."
Demand for electricity != demand for transactional processing. There's no good reason to couple these resources, and PoW may be seen are purely waste given future models.

@user48956 PoW is related to security, not tx processing. Any ‘future model’ will need to allow similar security guarantees. Would it be nice to have a way to create security without expending any energy? Yes, but I don’t think that is thermodynamically possible.

@chytrik Are you arguing that proof of stake models, which do not have requirements for vast amounts of work, are necessarily insecure? Can you say more / point me to a reference?

@user48956 more pointedly I’d say that security is a measure of the opportunity cost of using said energy to do whatever work. Proof of stake has many issues imo, but in relation to this conversation I wouldn’t say it is necessarily insecure (security is a relative measure, after all), just that it has a higher opportunity cost to achieve equivalent(?) security. There are many good references discussing PoS online, eg: https://download.wpsoftware.net/bitcoin/pos.pdf , www.truthcoin.info/blog/PoW-cheapest , https://www.youtube.com/embed/jE_elgnIw3M?start=4774&end=5170&rel=0&autoplay=1

Bitcoin uses Proof of work to validate,secure and record transactions. This is done through mining and as long as mining continues, electricity will be used. Following are ways to avert it:
1). For micro transaction, use offchain technology like Lightning network.
2). Pack more transactions in a block, either by increasing block size or by removing signature from block(segwit) or a combination of both.
3).Use alternate algorithm  (other than POW). This is not possible for  BTC.

surprised to see folks abusing their power and downvoting without any reason.

Mining will not stop when 21M coins are mined. Miners still receive the fees.

@user2203937 your answer contains inaccuracies, for example, putting more txs in a block will not necessarily reduce the power spent on mining, in fact if the utility of the network increases (more tx/s) one may expect the price (and thus mining energy consumption) to increase as well. Also, mining will not stop once all of the coins are minted. The end of the supply inflation era may not have much of an effect on the mining electricity consumption, as miners will have become dependant on tx fees instead by that time, so it won't be a shock to their income.

@chytrik It seems that you did not understand mining and blockchain. It is block which is validated during mining so if we include more transactions in block, overall less numbers of block will be mined for any given number of transactions. It's simple arithmetic. Also, do not twist my words when I say ,mining will stop it means no new coins will be generated. Tx fee will skyrocket then. If it is you who is downvoting my answer without even understanding the context, read more and stop abusing your little power here. Just because you have been here a little more doesn't make you smart.

@user2203937 I'm sorry, but your understanding of mining is off a little. The number txs that fit into a block has nothing to do with how many blocks will be mined in a given time period. I don't think I twisted any words, you literally wrote that mining would stop, not that coin minting would end. In any case, please don't take a downvote to be an insult, the majority of users on here seem to be quite pleasant and willing to help.

@chytrik, If you downvote for some valid reason, I will take it in right stride but if you do it just that you didn't understand one's argument then there is problem within you. You need to open up. Tell me,let's say 1000 transaction are generated, 1 block can keep 10 transaction - so total 100 blocks will be mined, what if one block keeps 200 transaction  how many will be mined. The answer is 5. So won't that take less power overall.

@Chytrik, use power with responsibility. I have heard many instances on stack overflow where people abuse it. Please don't do that.

@user2203937, I would also downvote your answer if I could (need 125 reputation), just because it is wrong. Bitcoin miners generate one block every 10minutes regardless of the number of transactions. For this block they receive currently 12.5 BTC block reward. It's that simple.

@lex82, block generation time is 10 mins....I know that. What has it got to do with over all electricity consumption. If you pack more transactions in block, overall fewer blocks will  go through validation and pow, hence will need less electricity. I also would love to downvote both your ill researched comments

The number of Tx and the block time has nothing to do with the electricity consumption. That's the point. Currently there is a mining reward of around 80 BTC per hour and people will spend a lot of resources on mining to get them. If the BTC are worth 10x as much as they are today, around 10x the resources will be spent.

@lex82, I have given you the reasoning. You said it has nothing to do with transactions in block without  proper reasoning and then attributed it to cost. I would have really considered your logic if you talked in terms of watts or kilowatts but seems you do not know difference between cost and watts So I drop my argument here.

@user2203937 Your math about fitting 1000 txs in either 100 blocks or 5 blocks is right, but that example tells us about the miners ‘electricity cost per confirmed transaction’, whereas OP’s Q is about ‘electricity cost per time’. A block is generated every ten minutes, whether it is full of txs, or empty. Miners are always mining (spending $/sec), no matter how many txs are waiting to be confirmed. So having the ability to add more txs to a block will not decrease the $ spent per 10 minutes, only the $ spent per confirmed transaction.

Re: "3).Use alternate algorithm (other than POW). This is not possible for BTC."
I note Ethereum switching from proof of work to proof of stake.  Is this "not possible" for BTC also.

@user48956 relevant: https://bitcoin.stackexchange.com/questions/95356/why-doesnt-bitcoin-migrate-to-proof-of-stake/

Another solution would be to work on the bitcoin scalability problem.
Technological solutions like the lightning network or Schnorr signatures will hopefully make it cheaper to transact in bitcoin (and thus, reduce the reward and by extension also reduce the amount of computational power competing for the block), in some cases making it even somewhat secondary (as with the Lightning Network).

Currently the basic block reward is 12.5 BTC + about 1.5 in fees, so fees play only a minor role. With lightning network enabled the value of BTC will very likely rise a lot, so the problem will actually worsen since miners are competing for the much more valuable block reward.

I strongly disagree with your views, as you said miners will have to compete, which discourages miners from getting in the network. I have the feeling you are thinking about miners and not trying to answer the question.

I asked the question, so I am interested in an answer. However, technological advances will not change to value of the resources spent to mine the Bitcoins. A reward of one billion will lead more people to compete for it than a reward of one million. Thus, more resources will be spent to get it. If everybody has better and cheaper hardware, then more of it will be bought.

Lightning network could be answer but if is not we can always do fork on bitcoin to upgrade to different system, so we can keep Bitcoin name, users and amount of each address. I also see no reason why in the future they could not make one joint fork on the top 5 cryptocurrencies with migration to one "multicurrency" coin and keep it old max supply of each coin (This is just a suggestion that could be developed). Only consensus is needed.

None of these things are in any way related to energy consumption of PoW.