What happens to SHA256 based cryptocurrencies when encription break takes no time? There is 49 qbit quantum processor already, there are predicted trends of time to facror.

So what happens to SHA256 based cryptocurrencies when encription break takes no time and all transactions on all blocks are decripted in a day\month?

SHA256 is used primarily for "proof of work"
The concept originated as a way to prevent email spam, oddly enough.
https://en.wikipedia.org/wiki/Hashcash

Hashcash is a proof-of-work system used to limit email spam and denial-of-service attacks, and more recently has become known for its use in bitcoin (and other cryptocurrencies) as part of the mining algorithm

The amount of work, the # of leading 0's in the hash that has to be mined is completely artificial, and can be adjusted at will.
So it's not a matter of what will happen when/if SHA256 is broken as much as a misunderstanding of how and what it is used for in the context of crypto-currancies.
Generally speaking they would just come up with another way to do "proof of work"

In contrast to hashcash in mail applications that relies on recipients to set manually an amount of work intended to deter malicious senders, the Bitcoin cryptocurrency network employs a different hashing-based proof-of-work challenge to enable competitive bitcoin mining. A bitcoin miner runs a computer program that collects unconfirmed transactions from coin dealers in the network. With other data these can form a block and earn a payment to the miner, but a block is accepted by the network only when the miner discovers by trial and error a "nonce" number that when included in the block yields a hash with a sufficient number of leading zero bits to meet the network's difficulty target. Blocks accepted from miners form the bitcoin blockchain that is a growing ledger of every bitcoin transaction since the coin's first creation.
While hashcash uses the SHA-1 hash and requires the first 20 of 160 hash bits to be zero, bitcoin's proof of work uses two successive SHA-256 hashes and originally required at least the first 32 of 256 hash bits to be zero. However the bitcoin network periodically resets the difficulty level to keep the average rate of block creation at 6 per hour. As of August 2017 (block #478608) the bitcoin network has responded to deployments of ever faster hashing hardware by miners by hardening the requirement to first 72 of 256 hash bits must be zero.

Now when it comes to SSL/TLS/RSA (asymmetric encryption) that's a whole other issue that while it does affect Bitcoin, would certainly break the internet in some profound ways. So I am sure the powers that be would quickly come up with a replacement. As far as Bitcoin in particular, as I understand it, it would affect mostly the wallets.  Although in truth, I am not that familiar with the "guts" of the blockchain itself so there may be some issues buried in there as well.  But as I said this type of encryption is widely used on the internet (my particular area of expertise) and I am sure it would be fixed as soon as it was discovered.
Just to put a bit of English on it
Hashes are used as a means to verify data integrity not for cryptography.  But this is not the only means that verifies the integrity of the data in a blockchain, there is also a distribution component of this. All the copies have to match.
For example a common use of hashing is when you download a file, you can get a file hash to verify that the file has not been tampered with.  Essentially if you hash your copy of the file and it doesn't match what it was supposed to then some one tampered with it (such as adding malware).  Sort of like those tamper proof seals on juice containers, I call them the pop-o-matic button.
Also as I understand it each block in the chain has the hash from the previous block (which has the hash of the previous block and so on) this is what puts the "chain" in the block chain.  See if you went back, say 9 blocks, and made a small change.  Well you not only have to re-mine the hash for that block, but you have to re-mine all the blocks that follow to the current block, and all these changes of course are not gonna fly when compared to another copy of the block chain.  So in someways being able to hash at lightning speeds could help you re-mine them, but it does nothing to address the second part.


Do P2Pool nodes always accept real blocks over share blocks? The standard rule in bitcoin is that if you see two blocks on a chain that has the same work, you accept the one that you saw first as the correct one.

If this extended to P2Pool chains, some nodes could see share blocks before a real block. Would the P2Pool members not then accept their own pool members real solved block? I would hope not!

The p2pool sharechain and the bitcoin blockchain operate similarly, but independently. I do not believe there is any requirement that a "real" block be accepted into the p2pool sharechain.

What I think you are really concerned about is that the p2pool nodes may see a "real" block and not do their part to get it into the blockchain so that everyone gets paid. On that account you can rest assured.

In the source code, have a look at p2pool/node.py ("GOT BLOCK FROM PEER! Passing to bitcoind!") and p2pool/work.py ("GOT BLOCK FROM MINER! Passing to bitcoind!") Regardless of whether the new bitcoin block ends up in the p2pool sharechain, all nodes who become aware of the block relay it to bitcoind to help get it in the blockchain.


Private key generation doubt I read that the private key pk has to be any number between 1 and n, where n is almost 10^77.
Since pk' s function is practically to be used as a scalar for multiplying the generator point G, why does it have to be strictly less than n?

I've thought that is because the math behind secp256k:
inside a order-n group, if I multiply times x a number A (with x > n), it's equivalent to multiply the same number A times y, with y =  x % n. So y will be extremely less than x, making A easier to be discovered.
Is this argument correct?

You're right, there is no strict requirement that the private key is strictly less than the group order.

However, it is required that the resulting public key is uniform, which implies that (x % n) must be uniformly distributed between 1 and n-1 inclusive (or at least indistinguishably close to uniform). The easiest way to accomplish this is by saying that the private key must be picked directly uniformly between its bounds. However, you could just as well say you pick a private key uniformly between 1 and 1337*n-1 (except no multiple of n).

To elaborate on "indistinguishably close to uniform": specifically for the secp256k1 curve (which is used in Bitcoin's signatures), the curve order is very close to 2^256, and in general you won't ever generate a 256-bit number that is >= n. This is not the case for all elliptic curves however, and biasing private keys can actually threaten security.


Can bitcoin address be longer than 35? Can bitcoin address be longer than 35?

Does longer address indicate much lower chance of collision and/or higher security?

According to the Bitcoin Wiki:

  A Bitcoin address, or simply address, is an identifier of 26-35 alphanumeric characters

And:

  Some Bitcoin addresses can be shorter than 34 characters (as few as 26)
  and still be valid. A significant percentage of Bitcoin addresses are
  only 33 characters, and some addresses may be even shorter. Every
  Bitcoin address stands for a number. These shorter addresses are valid
  simply because they stand for numbers that happen to start with
  zeroes, and when the zeroes are omitted, the encoded address gets
  shorter.

So no, the length does not imply higher/lower security.


Is there any way to find out latest bitcoin transaction of a particular address in bit-cli, without knowing the txid? I would like to find out the immediate last transaction of addressA.

But so far, I can only do this, bit-li gettransaction <txid> then bit-cli decoderawtransaction <hex>

But I want to do something like this:

bit-cli lasttransactionto <addressA>

How can I do that, without knowing the tx id??

Bitcoind doesn't index by address, but you can scan the uxto set for outpoints which are spent to the address of interest:

See scanutxoset in the documentation:
https://bitcoincore.org/en/doc/0.17.0/rpc/blockchain/scantxoutset/
However, it is not clear to how it will be supported in the future: https://bitcoincore.org/en/meetings/2018/05/24/
Also note, that the utxo set may not return any result for your address, if the last transaction output associated with that address has been spent (not member of the uxto set anymore).

Alternatively, Libbitcoin-server indexes all transactions by address per default:

See the CLI command bx fetch-history <address>: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-history
Which makes fetch_history server request: https://github.com/libbitcoin/libbitcoin-server/wiki/Query-Service#blockchainfetch_history3
Above commands/requests will return ALL transactions in order of confirmation height related to any standard address and indicate whether the outpoint was spent or not.


How To Get Copy of Bitcoin Source Code Does anyone have an idea of where can I find a copy of the bitcoin source code. I mean doesn't it supposed to be open source, where is the open source project for bitcoin so I can read the code.

bitcoind is what is most widely used. And here is the source: https://github.com/bitcoin/bitcoin/
But there's various other implementations for clients such as BitcoinJ for Java https://code.google.com/p/bitcoinj/ or http://libbitcoin.dyne.org/ for C++.
However, for miners the story is a bit different. If you're a miner you kind of need to use bitcoind. Otherwise bad things might happen such as the blockchain fork from last March: http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by-blockchain-fork/


How to initiate a transaction with address and privateKey using nodejs I have a list of bitcoin addresses and private keys, I need to write an automation script which checks for the balance in each address and transfer the balance funds to another bitcoin address. My question is how I perform the fund transfer with address and privateKey using nodejs

Thanks in Advance

Given a list of bitcoin private keys, first you need to check the balance of the corresponding address, probably best done using a block explorer, e.g. blockchain.info:

Single Address

https://blockchain.info/rawaddr/$bitcoin_address
Address can be base58 or hash160

Optional limit parameter to show n transactions e.g. &limit=50 (Default: 50, Max: 50)
Optional offset parameter to skip the first n transactions e.g. &offset=100 (Page 2 for limit 50)

{
    "hash160":"660d4ef3a743e3e696ad990364e555c271ad504b",
    "address":"1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F",
    "n_tx":17,
    "n_unredeemed":2,
    "total_received":1031350000,
    "total_sent":931250000,
    "final_balance":100100000,
    "txs":[--Array of Transactions--]
}

Then, you can use bitcoinjs-lib, for example, to create a raw transaction for each private key:

const alice = bitcoin.ECPair.fromWIF('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy')
const txb = new bitcoin.TransactionBuilder()

txb.setVersion(1)
txb.addInput('61d520ccb74288c96bc1a2b20ea1c0d5a704776dd0164a396efec3ea7040349d', 0) // Alice's previous transaction output, has 15000 satoshis
txb.addOutput('1cMh228HTCiwS8ZsaakH8A8wze1JR5ZsP', 12000)
// (in)15000 - (out)12000 = (fee)3000, this is the miner fee

txb.sign(0, alice)

For which, you will need unspent outputs to each private key's address.

You will also need to broadcast the raw transaction:

// build and broadcast our RegTest network
regtestUtils.broadcast(txb.build().toHex(), done)


So I mined a block, but why would other nodes accept my mined block? When a miner finds a hash and is thus able to confirm a block of transactions, that miner will then broadcast the confirmation (block?) to the other Bitcoin nodes so that it can be added to the blockchain. My question is, what is the incentive for other nodes to accept this mined block, even if it is correct and checks out against older blocks? I ask because if the reward for mining blocks decreases over time, other nodes may selfishly not want to accept this miner's effort and prefer to figure it out on their own for a greater reward now than later.

The incentive to mine on the currently longest chain is that there is a risk to the dishonest miner that honest, non-mining nodes may have already propagated the first block and hence reject and not propagate the second block found at an equal block height.

As Proof of Work is not reusable this leads the dishonest miner to waste resources.


How do I implement a Merkle Tree? I`m slowly implementing some Bitcoin protocols, and I'm not sure how to properly understand the Merkle Tree from the Bitcoin wiki:
https://en.bitcoin.it/wiki/Protocol_specification#Merkle_Trees
I have strings a, b, c, I double-hash them and I get the three leaf nodes. But I'm not sure what to do with the higher nodes. Do I double hash the sum of the resulting bytes (treating them like big numbers), or do I concatenate (treating them like strings), or perhaps do I should something else?

In each iteration, you concatenate two subsequent hashes of the previous level, and double-sha256 them. If there is an odd number of hashes, concatenate the last element with itself.
This gives you a new list of hashes. Repeat, and stop when one hash remains. This is the merkle root.

Assume you have tx hashes Ha1,Ha2,Ha3,Ha4,Ha5,Ha6,Ha7

First iteration: Hb1=Hash(Ha1|Ha2), Hb2=Hash(Ha3|Ha4), Hb3=Hash(Ha5|Ha6), Hb4=Hash(Ha7|Ha7)
Second iteration: Hc1=Hash(Hb1|Hb2), Hc2=Hash(Hb3|Hb4)
Third iteration: Hd1=Hash(Hc1|Hc2) => Merkle root


What is the ecological impact of the crypto endgame I'm interested in the long-term ecological implications of using cryptocurrencies. kraken states in The Truth About Bitcoin:

For example, according to a report from 2017, Bitcoin consumes around 8.27 terawatt-hours per year, compared to the 132 terawatt-hours per year consumed by the gold mining industry.
Further, the Bitcoin network can use renewable energy, meaning it can be as good for the environment as its source of electricity.

I don't see any reason to doubt that right now, but the comparison is a bit odd given that the legacy financial system is responsible for (let's say) most of financial transactions, and given that only Bitcoin is considered, instead of all cryptocurrencies.
But what if the crypto enthusiast's dream comes true and cryptocurrency will be used for a significant amount financial transactions, say 50%? What is the ecological impact of the crypto endgame? Will it be an ecological improvement over the legacy financial system?
Notes

I find the second point made in the kraken article (mining can be done with renewable energy) a bit sketchy, as this does not take into account (among other things) the hardware arms race that the miners seem to be involved in: As of the writing of this question, GPU prices are rising rapidly due to shortages, and it is virtually impossible to find a good buy on a mid-tier graphics card. So the answer must take into account not only energy consumption, but also the side-effects of mining. (I should add that at this point roughly 40% of mining is done using renewable energy. So a thorough answer should also consider the possibility that for the near future, a significant portion of crypto mining will probably still be done using non-renewable energy.) Edit: This article outlines some other possible side-effects which an answer should consider.

An answer should probably be based on a guess what the proof-of-work/proof-of-stake/proof-of-solvency/etc. ratio will likely be in the future. How much would a change of this ratio affect the ecological impact of cryptocurrency?

There are questions similar to this one, but so old that I would consider them outdated

References to scientific research that makes projections that take the points above into account are also welcome.

Proof of work allows the history of transactions on the network to be considered secure (ie, immutable).
When measuring the security of any thing, what we are ultimately asking is how much energy will it take to defeat the security system? The more value being stored, the more security we will desire.
The bitcoin network consumes energy in a very quantifiable way, at least compared to the traditional financial networks. As a miner, a large portion of your overall costs would be electricity, and this electricity is converted into security with increasing efficiency (each generation of ASIC chip has been more energy-efficient than the last, in terms of hashes/kilowatt hour). So it is easy to at least roughly quantify how much energy the bitcoin network is consuming.
On the other hand, it isn't really easy to quantify how much energy is used to uphold the traditional financial system. What do we even include in that calculation? How much digital infrastructure is required to support that system, and what does that infrastructure cost to run and maintain? How many humans are diverting their skills and attention to building and maintaining that system? Should we include the energy expenditure of things like the US military, when considering the ongoing security of the US dollar system? There is no clear answer here.
But this helps to reframe the question: given that a large portion of the security cost to maintain the bitcoin network is very directly and efficiently used to create security (ie, it is used to compute SHA256 hashes), we might start to wonder which system is actually more efficient than the other. The relative ease of quantifying bitcoin's security costs make it look terrifyingly inefficient at first glance.. but is it really? How can we make such a proclamation, without having a good idea of what we're comparing it to?
Consider: If we have some finite amount of energy to use, would it be more efficient to use it to hash some data for security, or use it to nurture a human being, who can then spend their life working to maintain the traditional financial system? How much of that input energy is actually going to create security in each case? With proof-of-work, it is a very quantifiable, large portion of the net energy, but with a human, there is going to be a lot of inefficiency and loss! It seems to me that using that energy directly for computation is going to be more efficient - despite the obvious issues that we'll encounter when trying to exactly quantify this relationship.
At this point it is probably also worth mentioning that the cost of this security is ultimately measured in the opportunity cost of that energy. Given the above question of 'energy spent on computation vs nurturing a human', we need to consider the opportunity cost of not having this human work on other projects that could benefit society (and likewise, the opportunity cost of using the energy for something other than proof-of-work mining).
If this idea of 'quantifying the energy cost of a human' seems strange or contentious to you, realize that only furthers the point about the how hard it is to quantify the energy costs of the traditional financial system. Where do we draw the line on what costs are included? The answer to that is certainly not clear, and the validity of the entire question really does depend on it.

A few other related remarks:

Bitcoin allows for permission-less financial innovation, so we should expect to see more and more novel financial constructions created upon it in the future. Being a digital asset, friction for economic activity using it is supremely low (it is as simple as communicating data to your counterparty over the lightning network, for example), and so we can likely expect to see entirely new economies arise, as users are capable of transacting value in ways they never were before. This would allow users to better capitalize the things which they already value-- which is to say it will 'unlock' value, growing what we might call the 'GDP' of humankind. With the potential to unlock value in this way, it is interesting to revisit OPs question, as that value would not otherwise be realized. To put it differently: what is the opportunity cost of not seeing bitcoin enable this expansion of economy?

Over time, humanity as a whole has consumed more and more energy, and there is no reason to believe this trend will reverse. There are of course better and worse ways to consume this energy, but it seems strange to just regard all increases in energy use as 'bad'. It seems very unlikely that humanity will stop this trend of increasing energy-consumption.

A lot of content you'll find from the 'pro-bitcoin' side of this question likes to highlight how much renewable energy bitcoin is using. I think this kind of misses the point, its great to not use energy that incurs negative externalities (ie global warming, etc), but more importantly we should consider the opportunity cost of using said energy in whatever way.

This thread by @nothingmuch on the topic of mining effeciency is really interesting! To quote from it:

the payoff from consuming finality is positive sum in this regime (higher velocity of money => more subjective value created) and the cost of a 51% attack increases even if the energy consumed decreases. since mining is zero sum and is in competition with all other uses of energy, that implies that as demand increases because of a need for higher efficiency, the relative fraction of energy expended on PoW can decrease without necessarily compromising finality.

tl;dr because money has positive utility even though it has no intrinsic value, if finality of transactions with that money needs PoW then the more useful that money is, the smaller the relative share of energy must be expended on PoW for a fixed level of finality assurance.

As reply to a few of your points:

An answer should probably be based on a guess what the proof-of-work/proof-of-stake/proof-of-solvency/etc. ratio will likely be in the future. How much would a change of this ratio affect the ecological impact of cryptocurrency?

I don't believe that proof-of-stake/etc offers the same security guarantees that proof-of-work does, and thus it cannot be used to secure systems in an equivalent manner. Without these security guarantees, we cannot realize the same benefits that we can with bitcoin (proof of work), and so in my opinion it becomes an uninteresting question to compare the two. There is a lot written about the deficiencies of proof-of-stake, this article is perhaps a good starting point.

This answer has become quite long, so I'll include a TL;DR:
Bitcoin mining consumes energy to create security in a very quantifiable manner, but the legacy system is hard to quantify in the same way. Considering the efficiency of computation, we may actually conclude that the bitcoin network is a more efficient system of attaining transaction finality, but I have not provided a rigorous proof of this by any means.
So what is the 'ecological endgame'? I think it is that the bitcoin network continues to use a large amount of energy to secure the history of the network, and it enables a huge amount of new economy in doing so, thus justifying the opportunity costs of the energy expenditure.


Getting the wrong txid for coinbase transactions I'm trying to hash transactions to get the txid. I get the hex values from blockchain.info. I get the correct hash for all transactions except for the coinbase when I hash it twice. Is there something different about how the coinbase transaction is supposed to be hashed?

The block I have tried is: https://blockchain.info/no/block/0000000000000000000870497004514bd3807cdc98b9f3a57038faf5df04144f.

The txid of the coinbase is supposed to be:
44763fed906f1a0e8b82e7497ac83856baa4b1c5621affdce04108a212018c4e

But I get:
6e129e567970540b2812ec58388d131c3b8fdbf4e4c992d140e255895df2992e

The txid is the hash of transaction without segwit data. The full coinbase transaction contains the segwit data which will result in the hash that you got. However that is not the txid.


Setup cgminer on Ubuntu 12.04 (im getting libudev.so.1 not found error) I have read and read and read over the internet but noone seems to have problem like this.

Im trying to setup cgminer on my Ubuntu 12.04 (64 bit) desktop but i failed. Downloaded cgminer from url http://ck.kolivas.org/apps/cgminer/ read all the instructions but not working.

The error im getting when i try to start it is

./cgminer: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

Any help? btw im on Nvidia graphic if that makes a difference.

Yes, NVidia Graphics card utilization versus naked CPU does help, quite a bit.

Breath. Take a step back.  Make sure you're running as an administrator. Try bashing

  sudo apt-get install libudev1

Use this wiki http://www.distrogeeks.com/install-cgminer-latest-ubuntu/

Don't get discouraged! It's tough but we've all gotta learn sometime, no better way to do it but to Do It.


How can bitcoin transactions for the same coin belong in different blocks? Isn't each transaction dependent on a hash of the previous transaction?  Wouldn't that mean all of the transactions for a particular coin would have to be grouped in the same block?  As far I can tell this is not true, so by what mechanism are transactions for different coins grouped in the same block.

Everything I've seen on StackExchange about this refers to hashing in blocks, which makes sense to me on the level of blocks, but then I don't understand the level of hashing of transactions since it seems transactions are not organized into blocks by coin.

So I guess a different way to phrase this is how can transactions from unrelated coins be organized into a block?  Because as I previously mentioned, I thought that each transaction was dependent on a hash of a previous transaction.

Isn't each transaction dependent on a hash of the previous transaction?

Yes and no.

Yes, in that each transaction must be created using valid inputs (ie, referencing a valid UTXO to be consumed as an input). No, in that transactions are not 'dependant' on the previous transaction's hash in the same way that blocks are 'dependant' on the previous block's hash.

For blocks, the hash has an extra level of importance, in that the hash of the block must be a valid proof-of-work on the network. Each block must have a valid hash, and also reference a valid previous block. For transactions, this extra layer of 'valid proof of work' is not required.

(Note that as Ugam mentioned, coinbase transactions are special, in that they do not consumer inputs)

  Wouldn't that mean all of the transactions for a particular coin would have to be grouped in the same block?

When a UTXO is consumed as an input, those coins must be spent entirely, by the creation of new UTXOs as outputs. The sum of the outputs will be slightly less than the sum of the inputs (this difference will become part of the miner's fee for the block), so any excess of coins not specified in a new UTXO will simply be claimed as fees (added to the output of the coinbase transaction).

  Everything I've seen on StackExchange about this refers to hashing in blocks, which makes sense to me on the level of blocks, but then I don't understand the level of hashing of transactions since it seems transactions are not organized into blocks by coin.

Right. A transaction is hashed to obtain the transaction ID (txID / wtxID), but this hash is not subject to the stipulations of being a valid proof-of-work.

There is one situation in which ordering within a block matters: suppose you create a transaction-1 that makes UTXO-1, and then create a transaction-2 that spends UTXO-1 and creates UTXO-2. If you wanted to include both of those transactions in the same block, then transaction-1 would need to be included before transaction-2, otherwise transaction-2 would be seen as invalid (and thus the whole block would become invalid). In this way, 'child transactions' must always come after their parents, if included in the same block.

Otherwise, the transactions included in a block do not have to be related to each other at all, there is no requirement like this. The only stipulation is that a transaction must reference a valid UTXO (and hence the rule about ordering transactions that I mentioned above).


getting address from public of ScriptPubKey vs ScriptSig Recently I read some articles about BITCOIN protocol and it's transaction.
I understand(maybe it is incorrect) these rules:

An input is what we call an output when you're spending it in a
transaction.
A public key is the early form of an address.
It seem's that an "input" has two jobs: Select an Output and Unlock it.
Every transaction has a unique TXID, so by using that with a specific
output number(VOUT), we can refer to any output in the blockchain.
Each output is set with a locking script. So if we want to spend
one, we need to supply an unlocking script(ScriptSig).
ScriptSig in an input is a script that unlocks the input and
ScriptPubKey is a A script that locks the output.

if all rules that I wrote is correct, why we can generate an address which is obtained from public key in ScriptPubKey but we can't generate previous output address from the public key inside the ScriptSig?

You can't find the address from the scriptSig or input in general, because you don't know what the output was. Your question makes the assumption that every output contains a (common, but not only) P2PKH script.

If you would know the output being spent was a pay-to-pubkey-hash scriptPubKey, which is spent by revealing the full public key and a signature with it, you can indeed compute the address as the P2PKH address of that public key. But you don't know that without access to the output.

If you would know the output being spent was a P2SH scriptPubKey, which is spent by revealing the full script and its inputs, you can compute the address as the P2SH address of that script. But you don't know that without access to the output.

If you would know the output being spent was a segwit P2WPKH or P2WSH scriptPubKey, which are spent with an input that contains the public key resp. script as the last witness stack element, you can compute the address as the Bech32 address corresponding to that key or script. But you don't know that without access to the output.

If the scriptPubKey of the output being spent is not one of these specific templates (P2PKH, P2SH, segwit), the answer is simply that no address for that output exists. Addresses are a convenient human-readable form for specific types of transaction outputs that are common im payments. But they are by no means the only things supported by the Bitcoin protocol.


How difficulty increases to get the lucky hash in blockchain? Currently first 19 zeros are required in bitcoin block hash which has become very hard. How this zeros are being controlled to increase? If it is dynamic what are the factors which has influence to make hash matching difficult?

The Bitcoin algorithm is written to aim for 2,016 blocks being mined roughly every 2 weeks (which works out to ~1 block every 10 minutes on average). After every 2,016 blocks, the network will adjust the difficulty based on how long those previous 2,016 blocks took to mine: if it took longer than 2 weeks, the difficulty is decreased; if it took less than 2 weeks, the difficulty is increased.
For the exact calculations and more information: https://en.bitcoin.it/wiki/Difficulty


Do electrum fully support Hierarchical Deterministic Wallets? I'm curious if electrum fully support Hierarchical Deterministic Wallets (BIP32). I have seen in source code that some part of implementation is done. But there are also as I think some electrum specific algorithms.

So when I create new wallet in electrum will it be BIP32 compatible?

BIP32 support is planned for Electrum version 2.0. The code is already there, but disabled.

You can find some features that were first planned for 2.0, but were included in a 1.9.8 release as the servers were being updated to a new important version so it was needed to apply some changes already to the client to put all in place for 2.0 https://bitcointalk.org/index.php?topic=518133.0


How to unlock private key of bitcoin I need help on how to get the private key....i  have that much on my account and i want to cash out very soon

People with 86 million dollars generally don't need to ask this.
People who have been tricked by con-artists are the sort of people that usually ask this.
That looks like a "blockchain" wallet.

How to unlock private key of bitcoin

If you have forgotten a password needed to "unlock" your wallet, you have lost all your bitcoins and will either never get them back or will spend many months and tens of thousands of dollars in the attempt.
If you are having problems with your account at blockchain.com you need to contact blockchain.com. They are a Luxembourg company. See https://support.blockchain.com/hc/en-us - If you have been tricked, they won't be able to help you.

I  need help on how to get the private key

You can follow the guidance on blockchain.com's support web-pages
Exporting the private key. The example given is for Ethereum but you should choose "Bitcoin" instead.
If your wallet doesn't have a private key for the bitcoin-address holding those 86 million dollars worth of Bitcoin, it means you have a watch-only address imported into your wallet.
If someone tells you that you need to pay them to release the private-key, it means they are a con-artist tricking you into giving them more money.

Backups
If you were not tricked but didn't make a backup of your wallet and a written backup of your password, private key or a written backup of your recovery phrase, and have lost or forgotten them -- you have been very negligent.
Recovery may be very very difficult, time-consuming, expensive, or quite likely, impossible.
Scams by con-artists
If an online friend/miner/consultant set this up for you, it means you are the victim of a scam.
If so, it is quite possible that the money you are looking at is money in the wallet of some innocent third-party whose bitcoin-address has been imported by a scammer into your wallet as a "watch-only" address. In which case it was never your money and any money you sent to the scammer was pocketed by them completely separately.

Useful Links
Some other questions whose answers might be helpful in understanding your situation.

Watch-only addresses

Watch only wallet
Reg: Watch only Address
I have watched addresses in my wallet..how do i use them?
Unlocking a Private Key from watch status

Private keys

i lost access to my bitcoin
Why were private keys made unrecoverable?
Where do I obtain private keys?
How to retrieve unclaimed BTC for wallets whose private key is lost

"Unlock private key"

Are there Bitcoin password crackers I can use to recover forgotten passwords?
I forgot my bitcoin core passphrase. Is there anyway I can recover?


How do I get merkle branches using the Stratum protocol? I need to get the merkle branch quickly for a known TX.

I have connected to various stratum servers, but whenever I send the method below I get "HTTP code 405 - Method not allowed".

{ \"id\": 1, \"method\": \"blockchain.transaction.get_merkle\", \"params\": [ \"967d009ee103340d6762819ebf452107561423fe97b04fbf501594f231e212c4\", \"369863\" ] }

I'm using the HTTP post version of the Stratum protocol and content type "application/stratum".

The question is how do I make this work?

I'm using the HTTP post version of the Stratum protocol and content type "application/stratum".

The HTTP version of stratum isn't supported in the later server versions, it's unlikely you'll be able to use them in any sort of capacity in the future. When connecting to the TCP+SSL version of electrum-server your command works perfectly, though the block height field in your example should be an integer and not a string.

telnet electrum.be 50001
Trying 88.198.241.196...
Connected to electrum.be.
Escape character is '^]'.
{ "id": 1, "method": "blockchain.transaction.get_merkle", "params": [ "967d009ee103340d6762819ebf452107561423fe97b04fbf501594f231e212c4", 369863 ] }
{"id": 1, "result": {"merkle": ["d844420b0f01398953b809b844bc9a5987f41d1373dab3180b6b4fe4de8633c4", "3c1f63dae13e84aaba94d6ee12c7b48fa7b470eacfbe6e183ba008b7cbc3725c", "0c5141f62f1ad58a6ebcee98868451ff392bc49bfb6daa5e4f492b6d175812cf", "e414fd7ee39a83b7bd524f98ed09efa279a97fecbeeca68087de384eda71fc31", "47fbf181989f2549d0d7a9fee2337ea60295059df0c0267cca173fd43b8e8596", "bc441c955a6d9bc629e3a8e428aa7670d2bf631a9d11887bb4ad6b534fcf4817", "1985800e12a150e6196ac07119278ea84ad296f1d8b2c88b2c85f61035f6a7cd", "fc02dfab3083ca9185bce4e8b9357b5aacacce2172c969ac543da04eaa1c0c1d", "6a36f10f34da6d66fdf75d4d97e0796106e7594409d354b8419a248231ab6935", "cbc02af67b294fe7bad08a69f9435b520f8f89fa221583e0a84c8d9c9dc469a0", "1043c7a6b9b4c42243e84a49a1f40476692b5d36d2f64dfb14409490ca3dfad2", "fbbaec1ca9d29ba9ee6a89214428556827b4e5a254de59de5adabbabb2621f54"], "pos": 2917, "block_height": 369863}}


Step by Step instructions on installing Bitcoin Core 0.14 on Raspberry Pi Zero and 1/2/3? I couldn't find a concise tutorial on how to setup Bitcoin Core v0.14 on Raspberry Pi Zero or 1/2/3. Let's say I have a brand new raspberry pi without any image flashed. What are the step by step instructions to get this thing running as a Bitcoin Core node? Assume I only have a 4GB SD card as I noticed that the new .14 version of Core has the ability to prune the blockchain all the way down to 500mb.

This is a guide I used to install a full node on a Raspberry Pi 3B with 1GB of RAM.
You have to compile the code and therefore need a RAM swap on an external HDD. Make sure it is mounted correctly, or it will wear out the sd card!
https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1


Is Ripple's trade history recorded? Currently there isn't a graph of the ripple trade values.

I'd like to know if each trade is recorded in the Ripple's equivalent of the blockchain, so that if in future someone wants to build such graph, it will be able to include old data instead of just newer one.

The ledger chain stores all transactions. So yes, you can rebuild the transaction history.
But the validators don't need to store or serve the whole chain to operate. A new validator only needs the last closed ledger to validate new transactions.
This is different from bitcoin, where nodes need the last output of the relevant public key to validate a new transaction (and that last output won't necessarily be on the last block).

In theory the ledger chain could be forgotten, as validators don't need the history, but probably some "history storage" services ala blockexplorer.com will appear. Some validators can find it useful to store the whole history too.

Since it's not really necessary for the network to work, I'm not sure what happens if a server doesn't serve the ledger history, but I would say the RPC call useful to query the history is this one: https://ripple.com/wiki/RPC_API#ledger_entry


Nonce in Merged Mining When mining Bitcoin, the nonce is included in the header, which is then hashed and checked to see if it is below the target threshold.
Everybody can verify that the header does indeed hash below the threshold. However, in merged mining, according to the wiki, the hash of the auxiliary chain's header is included in the parent's coinbase txin script without the opportunity to change the nonce in the auxiliary chain. The parent's nonce is incremented as usual but the aux hash remains the same.

How can we then verify the auxiliary chain?

is it because the parent nonce makes its way into the auxiliary chain through the parent header's hash? even so it seems that this would not help for verification because the aux chain's hash no longer need meet any threshold criteria.

To verify the auxiliary chain, you need to prove that a certain amount of work has been done upon the latest block in that auxiliary chain. As with any form of mining, this involves computing a hash to be below a threshold.

However, it doesn't matter that the pre-image of the hash has a lot of other irrelevant data in it too, so long as it contains the relevant auxiliary-block header in there somewhere. I.e. from a proof-of-work perspective it makes no difference if you calculate this:

while(h > aux-threshold) {
    h = hash(aux-header + nonce)
    nonce++
}
result = nonce

versus this:

container = hash(hash(aux-header) + other-data)
while(h > aux-threshold) {
    h = hash(container + nonce)
    nonce++
}
result = nonce

Both will take the same amount of work and both will prove that the work has been done on aux-header. This is so because container can be proven to contain the aux-header, and since aux-header and other-data are stored in the aux-chain block and the hash can be re-computed at any time.

So, for merged mining, container is actually the hashed header of the parent-chain block and aux-header just needs to be included in the parent block somewhere. It really could be included anywhere so long as the parent block passes the verification process. For example, you could include the aux-chain-header-hash as an address in a multisig transaction, or as a piece of data that gets placed on the stack but never popped off in one of the transactions. Yet, the easiest place to put it is in the txin script of the coinbase transaction. This always contains arbitrary data anyway, and its location at the top of the chain means that other-data can contain the smallest number of merkle branches.


How many different formats can a public address take? I'm creating an offline index to report off of the block chain.  I plan on indexing each transaction based on the address displayed in the TX.

Are all addresses Base58?   I believe I also read about a compact address and an address type that was used in the beginning of the blockchain before Satoshi knew of/implemented address compression using Base58.

I believe that the earlier format that you are referring to is the Hash160 which is formed by taking the sha256 of the public key followed by taking the ripemd160 of the result:

Hash160 = ripemd160(sha256(pubkey))

Further, what we usually refer to as a Bitcoin address is formed by first concatenating the Hash160 with four checksum bytes (to make it extremely unlikely that you can type the wrong address into a bitcoin client by accident). Then, a network identifier (0x00 for main network) is prepended and the string is base58 encoded:

address = base58(0x00 + Hash160 + checksum)

As you can see these two formats can easily be converted from one to the other. In addition the public key can be encoded either compressed or uncompressed. This results in two different addresses. However, since you can obtain the public key from neither the Hash160 nor the base58 address it is not possible to convert an address of an uncompressed public key to the address corresponding to the compressed public key, and vice versa.


How to verify if it's Segwit Transaction or not? Segwit Usage chart example : https://p2sh.info/dashboard/db/segwit-usage?orgId=1

I Would like to verify by checking tx if it's Segwit Transaction or not.

Is there any simple method to do this?

legacy -> P2SH tx (Is this Segwit Transaction?)
P2SH -> legacy tx (Is this Segwit Transaction?)
bech32 -> legacy tx (Is this Segwit Transaction?)

What about when many types of addresses are set as inputs and outputs?

A transaction is a segwit tx if at least one of the inputs contain a witness. Or if you are inspecting the raw tx then you check the 5th byte (the input count) and if it is 0x00 then it is a segwit tx.

Example:
tx1

  02000000055f4e5315ffe854e75db92f8dda952a8db2f63b37838fca4c32bd4bb692fe7ea2000000006a47304402200ab62a9d1858dceeaa2101cda3f31b7bae60471c0355c54a6eae48f723555806022010d2aad6362a8c56ed66b0670ff84175f534f4f0995f8724a9b2a5fc89a2a4b4012102c424c2670a7aade9cf867576064013d02cc7669c418968993e73e6b25fc122bcfeffffff80cb1bfcde0f309490c717eca07f1353f121fb13e105...

is not a segwit tx because the input count is 0x05 = 5

tx2

  0100000000010106325bac2f2e7ca67fa46c8304fb3b747e5578df1eef0394349ce2cdd744f7f10100000000ffffffff02db355202000000001976a91489ea1263056ac068adba4844efb376a3a19635ad88ac43b72f07000000002...

is a segwit tx because the input count is 0x00 = 0

Also:

Transactions spending P2PKH inputs (address starting with 1) cannot
be segwit.
Transactions spending P2SH inputs will be segwit if they are nested
P2SH, otherwise not.
Transactions spending P2WPKH or P2WSH (starting with bc1) will be
segwit.

In your example:

  legacy -> P2SH

This cannot be a segwit tx because it spends inputs from a legacy address

  P2SH -> legacy

This can be a segwit tx if the address is P2SH-P2WPKH or P2SH-P2WSH (nested segwit into P2SH). You wouldn't know if it is nested if it's not your's unless someone has already spent from it (in which case you inspect the spending tx).

  bech32 -> legacy

This is always a segwit tx


Reward seems to be wrong? I understand the current BTC "reward" for mining is 12.5 BTC.

I found these two blocks (one , two) where the newly generated coins seems to be 13.5 and 14.5.

I don't see a 12.5 BTC reward, and these transactions look like rewards, but have the wrong amount.

What am I mis-understanding?

I think you forgot to read this:

and this:

Remember that fees from the transactions get added to the coinbase transaction and sent to the coinbase address.  It's a bit confusing, since Blockchain.info is labelling the whole coinbase transaction as (Newly Generated Coins), even though some of that value comes from fees, and therefore pre-existing bitcoin.


What was the number of the block in which SegWit got activated? And first transaction? It was definitely on August 24th 2017, but not sure about the block number. Many sources reference block 481,822; but others state 481,824.

Also, even if this was the first block to allow segwit transactions, what was the first very block that contained one of them?

This is a very old question but probably someone else needs to know the same:

SegWit was activated in block 481824 and that block has two p2wpkh txs:

dfcec48bb8491856c353306ab5febeb7e99e4d783eedf3de98f3ee0812b92bad in block 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893
f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd in block 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893

I have to run my script against testnet in order to find the best p2wpk tx.


Is Tendermint proof-of-stake? I couldn't understand if this tendermint protocol is proof-of-stake or something like proof-of-lock?

https://tendermint.com/static/docs/tendermint.pdf

Yes, it looks like Proof-of-Stake or at least something very similar, and suffers from similar issues, for example:

  Note that this does not preclude a 2/3 majority of validators from publishing a blockchain fork after they had unbonded and sold their coins to an unsuspecting party. This is called a long-range double-spend attack. A user can
  avoid long-range attacks by syncing their blockchain periodically within the bounds of the unbonding period.


Does IBB make money? Where does its earning come from? Slightly off topic, but perhaps it is still marginally on topic because it's about a Bitcoin-oriented business:

IBB is an "Islamic bank, acting according to the Sharia (Islamic law), charging 0% interest on BTC loans".

Is it a profit-oriented business? A charity? Does it make money? Where do its budget come from? (I saw they're advertising on the Bitcoin forum today)

I know they issued some GLBSE stocks, that might explain the source of the money - are Muslims effectively "donating" to this bank by purchasing stocks?

As stated by what appears to be the founder (or a key person) in this thread in the bitcointalk forums, calling himself senbonzakura: "profit from the bank must be halal (permissible). So if the bank lends at interest, the interest then is profit for the bank, and that would mean muslims(or jews/christians) cannot buy shares in the company as the bank deals with interest, which makes it non-permissible/haram."

The motivation for running the IBB seems to be somewhat charitable, with this (edited) comment from the same person: "The problem that those 3 religions is trying to solve is human greed. Under that philosophy it does rightly condemn interest, for the reason that interest places the 'haves' infront of the 'have nots'.... From a humanitarian-philosophical perspective [the IBB] makes perfect sense, from a capitalist perspective it doesn't".

However, it is being run as a business. The IBB website says it's listed on the GLBSE, and it has asset, revenue, and dividend figures. The website doesn't go into much detail about what the bank does, but if you were to read the above linked forum thread you'd probably learn a lot more about it. Since the bank is paying out dividends, I doubt that those purchasing stock in IBB are doing it purely as a donation.

So, to summarise:

The IBB is profit based, but doesn't earn money from interest.
If you assume their revenue chart is accurate, it earns money
Their revenue stream includes (complete list so far): Shares/Dividends, Arbitrage, Gratuity
Even though IBB doesn't charge interest, they accept donations from borrowers. Depending on the culture of the customers, this could be considered to be like making optional interest payments.


I have Bitcoins in a local wallet, how do I get my Bitcoin Cash without using an exchange? I have a few Bitcoins in a local wallet and I own my private key.

I know that on 1st August 2017, Bitcoin is splitting into BTC and BCC.

How do I get Bitcoin Cash without transferring my Bitcoins to a 3rd party exchange?

If your wallet has a Bitcoin Cash version of it (e.g. Bitcoin ABC for Bitcoin Core, Electron Cash for Electrum), then you can install that version in a second location and have it use a different data directory (the data for wallets is stored separately from the install location). Then just copy your wallet file into the second data directory and use the Bitcoin Cash version of your wallet as you normally would use your wallet. Since Bitcoin Cash has implemented two way replay protection, there isn't anything special that you need to do in order to properly create transactions for either chain.

If you do not have a wallet that has a Bitcoin Cash counterpart, you can export your private key(s) and import it into a Bitcoin Cash wallet. After the fork, you should first send your Bitcoin to another address that you control. Then you can export your private keys (excluding the private key for the address you just sent Bitcoin to) and import then into a Bitcoin Cash wallet. From there you can send your Bitcoin Cash coins to an address in the Bitcoin Cash wallet and spend normally.

NOTICE: Make sure to always backup your wallet.dat. I've heard of horror stories about people downloading bitcoinabc client and it overwrites their current bitcoin files. It's best to use a extra computer to download bitcoinabc and then use email or a USB to transfer wallet.dat to it.


Redeem script. script hash, witness script and witness program I have a little confusion about naming in Bitcoin.

Redeem script is the conditions that will be satisfy.
For example P2PKH inside P2SH

OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG == redeem script

In P2SH-P2WPKH the redeem script is:

  The P2SH redeemScript is always 22 bytes. It starts with a OP_0,
  followed by a canonical push of the keyhash (i.e. 0x0014{20-byte
  keyhash}).

Sometime It call script hash, and during the transaction I need to insert the redeem script in witnessScript. "witnessScript": "hex",    (string) (required for P2WSH or P2SH-P2WSH) witness script

Then the redeem script in segwit environment is called redeem script, script hash or witness script?

Witness program

  A scriptPubKey (or redeemScript as defined in BIP16/P2SH) that consists of a 1-byte push opcode (for 0 to 16) followed by a data push between 2 and 40 bytes gets a new special meaning.

Witness program depends on script could be scriptPubkey or redeem script?

The scriptPubKey is the script as it is placed in the transaction output.
The redeemScript (P2SH only) is the script pushed as the last scriptSig item. In P2SH scripts, the scriptPubKey is equal to OP_HASH160 <Hash160(redeemScript)> OP_EQUAL.
The witness script (P2WSH only) is the script in the last witness stack position.
The witness program is Hash160(pubkey) for P2WPKH, and Hash256(witness_script) for P2WPKH. For native segwit outputs the scriptPubKey is OP_0 <witness_program>; for P2SH-wrapped segwit outputs the redeemScript is OP_0 <witness_program> (and thus the scriptPubKey is OP_HASH160 <Hash160(OP_0 <witness_script>)> OP_EQUAL.


Is it possible to reference an input outpoint more than once in a transaction? For example, could you have the following transaction:

A --> B
A --> C

Where A is an input txid and index, and B and C are outputs? The reason I'm asking is because I believe with SIGHASH_SINGLE you can only sign one input and one output, so this would be a way to use the same input to spend to two outputs. It would be the equivalent of sighash 'double', if it existed.

For example, to have a transaction like this:

A --> B
A --> C
D --> E

Where the D --> E input and output could be added after the first two inputs had been signed. Is there any other way to achieve this?

No, this is not possible - once an outpoint is consumed by a transaction, it is considered spent, including within the same transaction.

Your only option here would be to have an intermediary transaction splitting A (or using another input), and then using the two outputs from that as inputs along with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY for your flags.

A -> A1
 \-> A2

A1 -> B
A2 -> C
D  -> E

Note that SIGHASH_SINGLE signs a single output and all of the inputs. If you want someone else to be able to add inputs, you need the ANYONECANPAY flag as well


How do I create a wallet with a 24-word phrase? How do I create a wallet with a 24-word phrase instead of a 12-word phrase? I have used a couple software wallets such as Coinbase wallet and Exodus wallet which associate the wallet with a 12-word phrase. Basically, what software wallet can I use that is associated with a 24-word phrase?

Use the command make_seed(264) in console for Electrum wallet

A typical seed has 12 words, which results in 132 bits of entropy in the choice of the seed.

https://electrum.readthedocs.io/en/latest/seedphrase.html


What are good ideas to help promote Bitcoin? Even though I'm a person that is usually informed about anything related to new technologies in any area, I can't believe how I didn't know about Bitcoin until a few months ago.

Then I thought, people that don't even care about this kind of stuff will never know about Bitcoin.

Even worse, I live in a developing country and when I comment about this they think it is like a game. It is really hard to explain to somebody without enough knowledge that the system really works and could be daily used in a near future.

So my question is, how can I evangelize the Bitcoin usage between the majority of people?

So far, my ideas are:

Try to sell BTC at market price (not making profit).
Encourage stores (mostly online) to use it.
Have a local store with discounts for paying in BTC.

I carry around with me a Casascius physical bitcoin (and another one that has been peeled).  This gives a great visual aid in explaining it in terms another person is already familiar with.

You can encourage people to visit the faucet, and then do a trial run spending it, as described here:

http://www.bitcoinmoney.com/post/25967017874

You could print up some Bitcoin notes with a trivial amount of bitcoins (e.g., twenty cents worth) and hand them out to people.  Put an expiration on it and if the funds aren't redeemed within that time (e.g. a month) then you reclaim the funds and give them out again.  But at least every one that does get redeemed, you know that person (or whomever they gave the note to) now knows what a bitcoin is and how it can be transferred.

But the point to get across is that this is not just neat technology or some type of marketing of a new product.  This is how we defang the financial system that repeatedly harms us (or at least lessens our reliance on it).

Every time a bitcoin transaction replaces a PayPal transaction it is like placing a pea on "our" side of scale versus the bricks holding their side down.  The scale has a big plate though, and eventually all of our peas together will cause it to tip.

But that's how decentralizioin works -- one pea at a time.


If a BCH is mined do those coins go against the total 21 million supply I wanted to find out when a fork happens does that mean there are double the amount of total coins added to the max original total of 21 million

The Bitcoin blockchain and the Bitcoin Cash blockchain are now two separate chains.  Even though they both originated from the same genesis block (and several years of common blocks), they have now forked and can never be reunited.  This means you should look at them as two separate currencies, each with their own similar but different rules.

As such, the Bitcoin blockchain can only ever support 21M BTC, and the Bitcoin Cash blockchain can only ever support 21M BCH.  So that does not mean anything has doubled; that would mean there can be 42M BTC...which isn't true.  It means there can be 21M BTC, and also 21M BCH.  Just like there may be X number of euros and X number of dollars, but that doesn't mean there are 2X euros or 2X dollars.  They are separate.


Can I receive detailed tx data via command line using only a lightclient? I recently tried to sync the Bitcoin blockchain, but my laptop does not have enough space on it. I want to be able to analyze UTXOs and raw transaction data.

Will a lightclient allow me to do this?

No. Lightweight wallets are designed specifically only for the wallet user. It only stores transactions and UTXOs relevant to the wallet. It will not store any historical data or data that does not pertain to the wallet, so it is useless for trying to retrieve any arbitrary transaction.


Can an onlooker even learn anything interesting by de-anonymizing a transaction? If people cannot see what exactly the items purchased are but they only see the transaction of funds in the blockchain, does anonymity therefore even matter?

Unless you get associated with criminals later if their address is seized and your transaction to them is viewable on the block chain?

Knowing what you bought isn't the only information that you can get from a transaction. For example, you could possibly discern:

The transaction creator's salary. (If the inputs in a transaction came from your salary payment.) At the very least, you put a minimum on how much money they have.
The transaction creator's location. Many websites track where payments come from, geographically.
Where you buy things. If an onlooker has access to address information from one party, say Overstock for example, then they can see if you transact with them. And sometimes where you buy things is a strong indication of what you're buying.

So, knowing exactly what item you bought is not the only information that a user may be trying to keep private.


Is it true that bitcoin could be extremely slow? I am trying to understand the algorithm of bitcoin.

Let A be a node, and let (...,T_0,T_1,T_2) represents a block chain that A has at some time.

Here, T_i designates a block which was created at the time T_i, meaning that the block T_n was created before the block T_{n+1} was created.

Now, say miners C and D created two different blocks T_3 and T_3’ within 10 minutes. Then, A appends these two blocks to the current block chain and store them separately. Following the above notation, these two chains are (...,T_0,T_1,T_2,T_3) and (...,T_0,T_1,T_2,T_3’).

Now, say E sent F some bitcoins and made a transaction which is included in the block T_3.

After some time, if the blockchain (...,T_0,T_1,T_2,T_3’) is chosen to be the correct one, the chain (...,T_0,T_1,T_2,T_3) is removed from server. (Actually, at this point, these two separate blockchains do not appear in this way. That is, they would appear like (...,T_0,T_1,T_2,T_3’,T_4’,...,T_n’) and (...,T_0,T_1,T_2,T_3,T_4,...,T_n) because as time passes new blocks are added.

Assume that the transaction that E sent F some bitcoins was not included in any other blocks except the block T_3. (This is possible if E sent F very small amount of money, so if this transaction costs really tiny small fee, miners would not choose this transaction to be included in their block).

In this case, if E wants to send some bitcoins to F, does he have to make a transaction all over again?

In this case, if E wants to send some bitcoins to F, does he have to make a transaction all over again?

Not necessarily. A blockchain reorganization will cause transactions that were not confirmed in the "winning" blockchain to remain unconfirmed and placed back into the mempools of nodes which switched blockchains. So the transaction will still be in nodes' mempools and could still be picked up by a miner. If the fee was very low, the situation would be the same as having a "stuck" transaction.


Bitcoind doesn't add miner fee How do I make sure bitcoind's RPC call sendtoaddress adds miner fees to transactions?

Tried adding to our bitcoin.conf file:
mintxfee=0.0001

But some of the transactions still won't get any miner fee attached, causing payments to take hours or days to get confirmed.

The correct configuration parameter is: paytxfee=<amount>, where <amount>is the amount (fee) per kB to add to your outgoing txs


Bitcoins gone missing in Blockchain Wallet My wallet password was not compromised but my bitcoins have gone missing from my wallet with a transaction that says - replace by fee.

I have send two messages to support at Blockchain to find out what has happened but keep getting the message back saying they have updated my ticket number but I have not received any emails from them with an update.

I tried to call them but the person on the end of the phone barely speaks English. I am at a loss of what to do. Can anyone help me?

Do you know what replace by fee means?
Can I find out where my bitcoins went with the wallet number?
Can I speak to a person atBlockchain to discuss my problem?
How can I recover my bitcoins?

My wallet password was not compromised but my bitcoins have gone missing from my wallet

It is very difficult to know this with absolute certainty. And even if it is true, there are other ways to have your wallet compromised. Blockchain.com offers some rather insecure backup options: by email, cloud storage, etc. If a backup is compromised, it doesn't matter how strong your password is, the attacker won't need it.

  Do you know what replace by fee means?

Replace-by-fee (RBF) is an optional flag that can be added to a transaction, to signal that until confirmed, it can be replaced by a new transaction that spends the same inputs, with a larger fee. See this question for more info.

  Can I find out where my bitcoins went with the wallet number?

You can view the transaction that used your bitcoins as input, to see what addresses they were paid to. This is all public information stored in the blockchain, but addresses are pseudonymous by design, there will be no info about who took your bitcoin, or where they reside.

A wallet is software that controls a collection of addresses, but as with addresses, there is no public info available that will tell you with certainty which addresses belong to which wallets, or which wallets belong to which users.

  Can I speak to a person atBlockchain to discuss my problem?

If they have a customer service department, then perhaps you can. But keep in mind they are just a business that works with Bitcoin, so they have no special position of control or power over what happens on the blockchain.

  How can I recover my bitcoins?

You likely cannot. I would suggest contacting blockchain's customer service, but there is likely not much they can do. If you lost a substantial amount of money, you could contact your local law enforcement to report the crime, but again, there is likely little they can do to recover the funds.

How you secure your funds is a big question for Bitcoin users. Some methods are more secure, while others are less secure but easier to use. I would advise not using blockchain.com's wallet if you are looking for a secure storage method.


Why BIP32 extended public key differs from BIP32 derived private key? I put the same input into iancoleman site and BIP32 site, but both derive different result. Why?
I expected derived address will be the same. Do you see what I set wrong?

1FyAoRf82ZRYsjvCD5CFkcJTbvjmuypkJo

1GNsZGjnqj9rt5K2NLfgZRCztJKR1UVQrG

Your first screenshot has a BIP44 derivation path 44'/0'/0'/0'. Your second screenshot has a derivation path of 40'/0'/0'/0'.


Zcoin insight setup in ubuntu system I have tried to installed zcoin insight ui & api in my local machine (ubuntu OS) and it is completed all the steps but I m facing issue while start services in frontground.

Let me share with you command, config file.

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get install libboost-all-dev
sudo apt install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqrencode-dev
git clone https://github.com/zcoinofficial/zcoin.git
cd zcoin
./autogen.sh
./configure
make
cd src
./zcoind

But getting below error in my terminal:

   [2018-02-07T14:05:58.941Z] info: Starting bitcoin process
zcoind: zmq/zmqpublishnotifier.cpp:99: virtual void CZMQAbstractPublishNotifier::Shutdown(): Assertion `psocket' failed.
[2018-02-07T14:05:59.837Z] warn: Bitcoin process unexpectedly exited with code: null
[2018-02-07T14:05:59.837Z] warn: Restarting bitcoin child process in 5000ms
[2018-02-07T14:06:04.837Z] info: Using bitcoin config file: /home/zcoincore/bitcore-node-zcoin/zcoinnode/data/zcoin.conf
[2018-02-07T14:06:04.838Z] info: Starting bitcoin process
[2018-02-07T14:06:04.847Z] error: Failed to start services

MY Config File  (zcash-bitcore-node.json)

    {
  "network": "testnet",
  "port": 3004,
  "services": [
    "bitcoind",
    "insight-api-zcoin",
    "insight-ui-zcoin",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "spawn": {
        "datadir": "./data",
        "exec": "/home/zcoincore/zcoin/src/zcoind"
      }
    }
  }
}

Zcash Config  (zcash.conf)

server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcallowip=127.0.0.1
rpcuser=YANNISCOOLUSER
rpcpassword=YANNPASSISCOOL
uacomment=bitcore

Can you please help me with it? What is wrong in which step?

I solved this issue,

Actually it was issue related confliction because I have setup more than one currency in single server Like (Bitcoin, litecoin & zcash)

For that, I have taken care rpcport & change port for "zmq" in config file and then it is working fine.

Config:

server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28334
zmqpubhashblock=tcp://127.0.0.1:28334
rpcport=8334
rpcallowip=127.0.0.1
rpcuser=YANNISCOOLUSER
rpcpassword=YANNPASSISCOOL
uacomment=bitcore
listen=0


What would happen if I publish a modified version of an earlier block? Would it be rejected immediately by peer nodes? I am reading the book "Mastering Bitcoin" and have finished reading Chapter 2 and 10, but I still don't find the answer.

Suppose the current main chain has 5 blocks:

B0 <- B1 <- B2 <- B3 <- B4

As new transactions flowing in, the honest miners are mining B5, the 6th block.

If I publish a modified B2, say B2', to the Bitcoin network, what happens to this modified block when it is received by the other peers? Suppose B2' contains all the transactions that B2 has except that the amount of transferred bitcoin of one transaction is slightly modified but still a valid amount.

Would B2' be rejected immediately? It doesn't look like so because the modified transaction seems to be still valid. As far as I have learned, the recipient node uses the earlier blocks, B0 and B1, to validate B2', and I think the validation would succeed. Am I right?
If B2' is not rejected immediately, would the peer nodes link it to B1 as a secondary chain? I actually think B2' should be rejected but after reading Chapter 10 of Mastering Bitcoin I don't seem to find a reason to justify why it should be rejected.
Furthermore, if B2' is linked to B1 anyway, what would happen when the 6th block, B5, is now mined and published? According to the Chapter 10, "the transactions ... are re-inserted in the mempool for inclusion in the next block, because the block they were in is no longer in the main chain." so I think now B2' would be removed and its transactions would be re-inserted into the mempool. Then all the unmodified transactions in B2' will be removed again because they have been included in B2 in the main chain, and the modified transaction in B2' would be rejected because it conflicts with the counterpart in B2.

Thanks for any help!

Nodes would reject it immediately.

If you simply alter the data of B2 and send it, the block will be invalid by definition as the proof of work and merkle tree will not be valid anymore.

If you modify the data and rebuild the merkle tree and redo the proof of work to produce an alternative, valid B2' (note that everything else in this new block must also be valid, including transactions), nodes will still reject it as the chain going up to B4 has a greater amount of work.

Nodes will consider the chain with the greatest amount of total work as the valid chain. If you want to rewrite history, you will need to mine a new chain going back to the block you want to start rewriting from, and mine it to a point where its total work exceeds the current best chain. If you then broadcast this new chain of blocks, it will cause nodes to perform a reorganization, and drop the previous chain.

As for transactions returning to the mempool, that does happen in the event of a reorganization. All transactions from the dropped blocks are returned to the mempool. Usually, since miners generally pick similar transactions, the new blocks replacing the old ones will confirm mostly similar transactions, so the mempool will usually only be slightly different at the end of it.


Is it possible to convert Bitcoin Miner to Litecoin Miner? I have 90Gh/s Bitcoin Miner and its almost useless for Bitcoin Mining with current difficulty. By changing the Linux software installed in it can I convert this Bitcoin Miner to Litecoin Miner? I am capable on uninstalling/flashing the current operating system and re-install a new one but I am wondering is it just software that decides to mine only Bitcoin or hardware too supports only Bitcoin Mining?

If not possible with Litecoin Miner can I use this miner for mining any other crypto-currency?

No, you can't. And this has nothing to do with the operating system. Your hardware has a bitcoin ASIC chip made only for doing Sha-256 calculations. Litecoin uses the Scrypt algorithm. Sha-256 and Scrypt are not the same, so what you are suggesting is impossible.

You can mine other Sha-256 coins instead of Bitcoin.


What does getinfo output mean? I am trying to get my foot in the door wrt to bitcoind. I pulled the github version here. As suggested here, I am starting the daemon like so

bitcoind -daemon

and I am monitoring it like so

bitcoind getinfo

And I get the following output

{
    "version" : 89900,
    "protocolversion" : 70002,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 269516,
    "timeoffset" : -2,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 510929738.01615179,
    "testnet" : false,
    "keypoololdest" : 1386220819,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}

Obviously some are self explanatory, but could someone go through and explain what all of this output means?

An explanation of the meaning of the fields given by 'getinfo' :

version - The version number of this bitcoin-qt or bitcoind program itself. Both of are equivalent. -qt is simply the graphical user interface version

protocolversion: The version of the bitcoin network protocol supported by this client (user agent software).

walletversion: The version of the wallet.dat file. Wallet.dat contains bitcoin addresses and public & private key pairs for these addresses. There is additional data on the wallet. Care must be taken to not restore from an old wallet backup. New addresses generated in the wallet since the old backup was made will not exist in the old backup! Source: https://en.bitcoin.it/wiki/Wallet

balance: The total number of bitcoins held in the wallet.dat file.

blocks: The total number of blocks which constitute the shared block chain.

timeoffset: Seconds of difference between this node's "wall clock time" and the median reported by our network peers.

connections: the number of peers on the bitcoin P2P network that this node is connected to.

proxy: If using a proxy to connect to the network, listed here, otherwise blank.

difficulty: the current mining difficulty factor. Difficulty is increased as more miners and more hash compute power compete to be the next one to have a block of transactions added to the blockchain.

testnet: Boolean value (true OR false). There is a parallel bitcoin network, the testnet, where trials and experiments may be carried out without impacting the official, live bitcoin P2P network

keypoololdest: timestamp (UNIX epoch) of the oldest key in the keypool

keypoolsize: A number of addresses are kept in reserve by the client. This is the size of that reserve.

paytxfee: Specifies what fee the client is willing to pay to expedite transactions. Miners may choose to ignore transactions that do not pay a fee, and these fee-less transactions will have low priority on queue of pending transaction and may linger there for hours.

errors: This field may inform of different status conditions. Full list of error codes in source file bitcoinrpc.h (https://dev.visucore.com/bitcoin/doxygen/bitcoinrpc_8h_source.html) (Examples: "Bitcoin not connected", "database error", "Keypool ran out"...)


Do OP_RETURN messages persist on the blockchain? I've been doing a lot of reading on OP_RETURN, and I want to understand something that still seems unclear. When we create a transaction with OP_RETURN (which I understand will not eternally pollute node's RAM as the transaction is not put into the UTXO database), is the OP_RETURN data replicated across the blockchain?

This answer from a related question here (Blockchain transaction message length limit) states that the OP_RETURN is not part of the Bitcoin protocol, and the OP_RETURN data can only be accessed using blockchain.info, which doesn't make sense from what I've read, as the code to standardize the number of bytes for OP_RETURN messages is directly within the Bitcoin source-code, and therefore is part of the protocol, right?

TL;DR: I'm trying to make an application which utilizes OP_RETURN, and I would like to know if the OP_RETURN data exists on the blockchain forever, and can be retrieved using APIs other than blockchain.info.

Yes, the OP_RETURN output is part of the blockchain forever.

This is easy to show: the OP_RETURN and the message that follows is part of the transaction's output set, therefore changing the message changes the transaction ID, which in turn will change the hash of the block. If the message were to be deleted after a certain time, then new nodes on the network would fail to sync as they would not be able to validate that block. Therefore all full nodes will retain your message forever (as you mentioned, not in RAM, but buried deep in a file on your hard drive).

As for actually accessing the data, apart from the Blockchain.info API, I guess you could run a Toshi node locally (on your own hardware). Since it uses PostgreSQL, you can just query the blockchain as you would any database. This way, you don't depend on any external API that could turn evil or shut down. The hard drive requirements, however, are enormous (even worse than a Bitcoin Core full node).


How to move coins into the website of poloniex, for example convert my bitcoins in bitshares I am just interested in know how to transfer into the website of poloniex from bitcoins to bitshares

Firstly, you should have Bitcoin to do this!(sorry)

Now, you would need a deposit address at poloniex. Copy that, and send bitcoin (from wherever you have it - in some other exchange, I suppose) to this address.

This takes time, anywhere between 2-20 mins(may vary depending upon congestion in blockchain). Once you receive bitcoin at poloniex, you should be able to buy bitshares using those bitcoins.


Conflicting transaction info on Blockchain.info and Jaxx compared to other sources I sent a batched transaction with 3 inputs pointing to the same output address. The receiver claims they only received 0.00042 BTC when they should have received a total of 0.00128615 BTC.

She is using the wallet Jaxx which shows the amount received as 0.00042 BTC. Also, the "Estimated BTC Transacted" field on Blockchain.info shows a similar value 0.00042815 BTC.

However, Block Explorer shows the correct value 0.00128615 BTC.

So is this an issue with how I constructed the transaction or is it simply a display issue in both Blockchain.info and Jaxx?

I suspect that maybe the blockchain explorer is confused by the fact that I batched several different inputs to the same output address.

Your transaction is fine, and she should have received 0.00128615 BTC.

There is likely some confusion since not only do you have multiple inputs, you also have three outputs going to her address. They add up to 0.00128615 BTC, but each individual output is around 0.00042 BTC. It is possible that Jaxx shows her these as three separate line-items, leading her to believe you only sent 0.0042.

The explorer is not going to be confused by multiple input/outputs, they are a common part of Bitcoin. The estimated BTC transacted about is blockchain.info's best guess at it, and should not be taken as a fact. It is often wrong.


Why does it take 15 minutes for my Bitcoin client to start? I use Ubuntu 11.10 and have recently installed the standard Bitcoin client 0.40. But the GUI only appear around 15 minutes after started. My machine is an AMD64 Athlon 4600x2 with 6GB RAM. Is this normal? (I don't think so) Any idea?

I can't be sure why your client specifically took 15 minutes to start. But I have benchmarked the client's startup process. Most of the time is spent validating the database to ensure the client has a sensible view of the hash chain.

It is "fast verified" up to the most recent checkpoint and then "slow verified" to the current block. Fast verification entails checking only that the header is valid. Slow verification is a much more complete verification that can only be done at about 20 blocks per second on hardware like yours. (Upgrading the client will help, since newer version of the client will have more recent checkpoints.)

If you passed the -rescan option, the client will check every transaction in every block to see if it relates to any account in your wallet. That will add some time to the client's startup time.

When you run the Bitcoin client for the very first time, it will take several hours to sync up to the network. The downside of a decentralized system is that you cannot trust anything and must check everything yourself. This literally requires you to fully verify every Bitcoin transaction that has ever taken place. I've seen that take 9 hours on Pentium 4 class computers with 100Mbps Internet connections. (Though I think it should be a bit faster now, thanks to bugfixes in the client.)


Launch bitcoind at startup on Ubuntu I have bitcoind installed on my VPS runing Ubuntu 18.04, and I want to configure it to launch bitcoind on startup.
What the best way to do so with my configuration ?

To start bitcoind at startup on a system using systemd, use the service configuration provided in contrib/init/ from the root of the bitcoin-core repository.
You can then manage bitcoind as any other systemd service (and possibly have some other rely on it, such as a Lightning Network implementation's service).
systemctl start bitcoind
systemctl stop bitcoind
# This enables launching the service at startup
systemctl enable bitcoind


What exactly is a bitcoin? So I understand how blockchains work[1]. I understand how proof-of-work works[2]. And I understand how they work together. I also understand (or at least I think I do :) how transactions work (A block can contain arbitrary data inside of it, so it can contain a message signed by A that he transfers 5 btc to B).

But where does the bitcoin itself fit in this picture?

Is it a recalculated number every time (so if A gives 1 btc to B, then if I want to confirm, I verify that A has 1 btc to give away by checking who sent him anything, and make sure that he has what to give away, etc. up until the miner's bounty)? If so, this would have to be done whenever a block is mined (if not, I (who have 0 btc in my "wallet") can certify that I give B 100 btc, mine a block, and include that transaction. And while the blockchain on its own would still work (meaning that the hashes work out and solve the proof-of-work), the accounting wouldn't).

Am I making sense or am I totally off?

[1]. It's a linked list, but instead of linking-by-address, it's a link-by-hash.

[2]. Change a part of the Node so that the node's hash would start with 100 zeros, for example.

There is more to a blockchain than just a linked list of hashes and a proof of work. There's more to Bitcoin than just a linked list of hashes and a proof of work. What defines Bitcoin and its blockchain are the consensus rules. These are a set of rules that determine what constitutes a valid block and a valid transaction. The blockchain is a linked list of blocks which contain transactions that conform to the consensus rules. Every block in the blockchain must also conform to these consensus rules.

One of the consensus rules is that a transaction cannot create more value in its outputs than it spends in its inputs. It can create less value, and the difference is the transaction fee. But it cannot create more value as that would lead to infinite inflation and Bitcoin would not work as a monetary system. This rule is completely independent of the linked list of hashes and completely independent of the Proof of Work.

Furthermore, there is no such an object as a Bitcoin. What people refer to as Bitcoin are simply values associated with transaction outputs. There aren't actually Bitcoins; it is solely based around the transactions and their outputs.


Is it possible to calculate a public key from the message hash and signature? Is it possible to calculate a public key from the message hash and signature?

It is possible to create a public key from the signature. It will be equivalent to the key used to generate the signature but not necessarily identical.

You can find an example implementation here.


What "Identity Verification" features will be part of the QT client? When Patrick Murck testified today at the Homeland Security Digital Currency committee, he mentioned that an identity verification feature will be added to the QT client.

What is this identity verification feature, and how does it work?

He was probably referring to the payment protocol, which lets merchants (optionally) attach their online identity to payment requests, so customers can be assured they are actually paying who they think they are paying.

The payment protocol leverages the existing identity infrastructure that we all use every day on the web-- the same infrastructure used by every https-secured website.

There is lots of controversy about certificate authorities and lots of noise about building a better identity infrastructure for the Internet, and I personally look forward to the day when a better, decentralized identity infrastructure replaces the system we have now for both web browsing and Bitcoin payments.

And, again: if you don't want to use the payment protocol, you won't have to -- paying using a Bitcoin address will likely be supported forever. But if you are a merchant with a reputation to uphold, it will give your customers a much better payment experience if you do use it.


Keeping consistent market depth using Mt.Gox API I'm trying to write a program using the Mt.Gox API to keep an up-to-date consistent view of their market depth. My current approach is as follows:

Connect WebSocket and subscribe to depth updates
Wait for 1 minute, collecting updates
Request full market depth data via http://data.mtgox.com/api/1/BTCUSD/depth/full
Merge the collected updates into the market data by time-stamp (more recent wins)
Continue merging all future updates into data

After playing around with this for a while, I noticed that the full depth data download doesn't always match the data generated from updates. That's why I added the 1min delay, thinking that maybe the Mt.Gox server only updates the full depth data periodically, but doesn't generate it on the fly.

But even with this protocol, if I run the program twice in parallel, I end up seeing different data in both instances.

Any idea what I might be doing wrong?

In my experience requesting the full market depth from MtGox, often results in flat out incorrect information. To deal with this I've resorted to constructing my own, in a similar manner as you described above.

What I do is, using the websocket api, I look at all incoming depth events. I then keep two ordered arrays of bids and asks. On depth events if the volume is positive I add the order to the respective array based on the type_str property. If the volume is negative I remove the object from the array.

Make sure to combine objects of the same price, but with different volume. Likewise when removing objects if the negative volume is less then the volume of the same prices object then only deduct from the volume instead of removing. This is how it is done on MtGox's server and it will lead to errors if done differently.

After letting this run for a little while, though not deep, the order book is quite accurate and representative of what the MtGox order book should be.


What is the price of an ask order bought if a bid order is placed at a higher price? What is the price of an ask order bought if a bid order is placed at a higher price? For example, if there exist two ask orders at $50 and $49, and I place a bid order at $50 of an amount larger than amount of the two ask orders, will I buy the $49 ask order at $49? Or will I pay $50 for both orders, losing $1 on the lower one?

If you bid a higher price than a buy order, you will purchase that buy order at the ASK price, you won't pay more than they were asking for. Your order will fulfill all sell orders up to the amount and price you set your bid. This is known as a limit order.

If you requested to buy more coins than the $49 sell order, you would fulfill that order at $49 and then buy the rest at $50.

See also: How will Mt.Gox select matching orders if asking for a price that is higher than available prices


Bitcoin too large file I installed the bitcoin program and now it's synchronising, and although I installed it on my very large D: disk it's moving all of the stuff on my little C: disk.
It's now around 6 GB in size with 45 weeks to go and I'm out of room. Is there a way I can safely move it to my D: or make it synchronise onto my D: instead?

You can specify where to store the blockchain by starting QT with the following command argument:

-datadir D:\BITCOIN


QT wallet never syncronizes; often crashes; is locked and not showing attempt to send BTC Running Windows 7;
I'm not really sure what is going on. The wallet has stolen my BTC.

The wallet never synchronizes, it never finishes. If I leave it on all day -I will come home to see it crashed.

The application is also not visible from anywhere except possibly from Task Manager. When I try to start it.. it says:

cannot obtain a lock on data directory ... Bitcoin is probably already running.

My goal here is to get the bitcoins that I have and move them back to the account I have with the vendor. Then I will purge my system of this so called "program" and never use it again.

Additional information: Bitcoin Wallet version 0.5.0.1

This is old -can I upgrade without losing my secure key? WHERE IS MY WALLET.DAT FILE? I CAN'T FIND IT.

http://img19.imageshack.us/img19/2080/qk0m.jpg

ANY HELP IS GOOD.

Two actions here:

Back up your wallet.dat file

You will most likely find it here, based on these instructions:
https://en.bitcoin.it/wiki/Securing_your_wallet#Windows_2

  C:\Documents and Settings\YourUserName\Application data\Bitcoin
  (Windows XP)

  C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Windows Vista and 7)

Update your bitcoin-qt instance to the latest version:
http://bitcoin.org/en/download


Candle decimal places What is the query param to specify the decimal precision in Bitfinex API v2?
Seemly the default precision is ####.0, but i want a "precision more precise" than only one decimal place

The Bitfinex:BTC/USD pair seems to be traded with one decimal figure precision.

There is no way to get more accurate data, as this is the most accurate data.

In my opinion one decimal figure is enough. Since BTCs price is so high, the first decimal figure is actualy the 5th significant figure. Most forex exchanges only go to 6 significant figures.


How can Bitcoins be sent without Blockchain.info knowing your private key? Blockchain.info is a hybrid bitcoin wallet with client-side javascript encryption. I understand that the wallet.aes.json where the private keys are stored is encrypted (client-side). But how can transactions be made without the server-side knowing the UNencrypted private key?

The private key is needed only to sign the transaction, to authorize it to spend your coins. This is done on the client side. The signed transaction is sent back to the server, which will take care of transmitting it on the Bitcoin network.

A defining feature of public-key cryptography is that it is not feasible to deduce your private key from the signature.


Segregated witness soft fork: how is the funding Tx made "ANYONECANSPEND" Reading the BIP:

https://github.com/bitcoin/bips/blob/master/bip-0142.mediawiki

I see that the scriptPubKey in a transaction that funds a segwit redemption is the same as a normal P2PKH but merely prepended with OP_0.

Is this opcode what tells older clients that the Tx is "anyone can spend" meaning that there will be no signature data in the redemption Tx?

Of course upgraded nodes will know to look for the actual scriptSig in the witness data to verify the Tx. But how does this OP_0 fool old nodes into ignoring the scriptSig on the redemption Tx?

It's not prepending a script with OP_0. It's a data push that contains the witness program hash, prepended by OP_0.

Old nodes will evaluate this as a script that just pushes two data items onto the stack (a 0 and a hash). That's obviously spendable by all, as the requirement is having a non-zero item as last element on the stack.


Why is Poisson instead of Negative Binomial used for computing attacker's potential progress? In chapter 11 of the Satoshi's paper it is claimed that:

  The recipient waits until the transaction has been added to a block
  and z blocks have been linked after it. He doesn't know the exact
  amount of progress the attacker has made, but assuming the honest
  blocks took the average expected time per block, the attacker's
  potential progress will be a Poisson distribution with expected
  value zq/p.

I think the precise model should be a negative binomial distribution instead of a Poisson one.

My question is: Is Satoshi's solution an approximation or is it supposed to describe accurately the problem?

I have found the answer in this article by Meni Rosenfeld, page 7. The problem should indeed be modeled with a Negative Binomial distribution, and the computations done on Satoshi's paper are approximations.

The fact of matter is that the quality of the approximation does not rely on the expected high number of trials required to mine a block, but in the general similarity between the negative binomial and the Poisson distributions. This leads to non-negligible differences between the actual probability and the probability computed by Satoshi, e.g. for q=10% and 5 confirmations, Satoshi says P=17.73523%, while Rosenfeld says P=19.762%.


How to run bitcoind in a low memory environment I have a Raspberry Pi with 925 MB of memory. Bitcoin Core, operating as a full node, uses between 600-900 MB. How can I reduce bitcoind's memory usage?

I tried setting maxmempool to its minimum allowed value, 5. What about maxreceivebuffer and maxsendbuffer? Would setting these to a low value reduce memory usage?

The largest consumers of memory are:

The memory pool (reduce with -maxmempool, or disable entirely with -blocksonly if you don't care about unconfirmed transactions).
The UTXO cache (reduce with -dbcache, at the cost of potentially much slower syncing).
The signature cache (reduce with -maxsigcachesize).

In addition, you can also reduce the maximum number of connections (-maxconnections) or the number of RPC threads (-rpcthreads).

A viable minimum configuration without mempool could be -blocksonly -dbcache=20 -maxsigcachesize=4 -maxconnections=4 -rpcthreads=1.


Are there examples of scripthash transactions in the blockchain that do not use MultiSig destinations? BIP 16 uses an example of a one signature required transaction as a scripthash example:

scriptSig: [signature] {[pubkey] OP_CHECKSIG}
scriptPubKey: OP_HASH160 [20-byte-hash of {[pubkey] OP_CHECKSIG} ] OP_EQUAL

Has this been used in the blockchain?  Additionally, what's an easy way for me to grep through the blockchain looking from scriptSigs or scriptPubKeys that meet strange conditions?


How secure would it be to use my toy bingo machine to generate a bitcoin private key? Am I right in thinking there are 90! possibilities.
Would it be random?
Would you trust this technique?

http://i.stack.imgur.com/4RYbc.jpg

The address space has 2160 possible addresses, so to fully benefit from that space, you'd need to surpass a space of

  2160 = 1.46E48 combinations.

This is achieved by picking 26 numbers from your toy bingo machine as

  90!/64! = 1.17E49

while you keep track of the order in which they are picked.

To achieve at least 64 bit of entropy, you'd need 10 numbers (order recorded) from your toy bingo machine:

  90!/80! = 2.07E19 > 1.84E19 = 264

Which was suggested as a minimum on the related question: How many throws of a dice are necessary to defeat a brute force attack?

All numbers are assuming that the toy bingo machine acts reasonably random.


How to extract all the bitcoin addresses with bitcoin-cli? I am trying to get all existing addresses on the bitcoin blockchain with bitcoin-cli.
It seems that I can get addresses from vout that are of type "pubkeyhash".
If the type of vout is "pubkey" there are no addresses.
pubkeyhash type:
  "vout": [
    {
      "value": 0.00000001,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 b04e3fb6f6c96ba23233c809e42d8e6a0e0e31ca OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914b04e3fb6f6c96ba23233c809e42d8e6a0e0e31ca88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1H5DfbDtCnKUdke9xH9svwwxqga41Z5xbz"
        ]
      }
    }

pubkey type:
  "vout": [
    {
      "value": 50.63517500,
      "n": 0,
      "scriptPubKey": {
        "asm": "04b0bd634234abbb1ba1e986e884185c61cf43e001f9137f23c2c409273eb16e6537a576782eba668a7ef8bd3b3cfb1edb7117ab65129b8a2e681f3c1e0908ef7b OP_CHECKSIG",
        "hex": "4104b0bd634234abbb1ba1e986e884185c61cf43e001f9137f23c2c409273eb16e6537a576782eba668a7ef8bd3b3cfb1edb7117ab65129b8a2e681f3c1e0908ef7bac",
        "type": "pubkey"
      }
    }

Is there an easy way to get ALL the addresses on the blockchain?

Answering this question requires first defining what an address means.

Historically (before BIP16 activated in 2012) an address was a synonym with a "public key identifier", as there were no addresses for multisig constructions or anything like that. Under this interpretation, pay-to-pubkey or pay-to-pubkey-hash outputs would be seen as having the same address - after all, the key is the same. This is problematic, because sending to the "address" corresponding to a pay-to-pubkey script would not actually send to that script, but to its corresponding pay-to-pubkey-hash script. Sufficiently old software, and some newer software (including some block explorers) use this interpretation, leading to confusion.

Most software now treats an address to be a human-readable notation for encoding specific scripts (corresponding to the script that would be constructed if a wallet were to be instructed to pay to said address). Under this interpretation, pay-to-pubkey outputs simply don't have an address (as there is no way to make wallet produce such outputs), and certainly not the same address as for the pay-to-pubkey-hash output with the same key.

The software you're using follows interpretation (2), so the question makes little sense. It is showing you all addresses observed, but in this case, there just isn't any address involved. Transaction outputs in Bitcoin are freeform scripts, and only some of those have a corresponding address notation. Others are just scripts.


Which Venture Capital firms are especially interested in Bitcoin? Which have invested into Bitcoin or Bitcoin companies?
Which have shown "more interest than average" (e.g. Pamir from Hummingbird Ventures organized the Bitcoin London Conference)?

There hasn't been a definitive survey of the venture Capital industry but Boost VC has made several bitcoin investments. Its founders Adam Draper and Brayton Williams are responsible for organizing the Boost Bitcoin Fund which several venture capital firms are participating in. There are also currently 7 bitcoin companies in their 2013 class of startups.