Does bitcoin have enough resolution to replace all other currency? Does bitcoin have enough resolution to replace all other currency?
Bitcoin is intended to be used globally, and ideally it would be used in place of government issued currencies.  For the purposes of this question lets assume that all transactions in the world will take place in bitcoins and that all governments and people have accepted it as legal tender.
There are 100 million satoshis per bitcoin and 21 million bitcoin.  That means the total wealth of all bitcoins can be divided into 2,100,000,000,000,000 units.
If there are 7 billion people in the world then there are only 300,000 satoshis per person.
If each satoshi ultimately became equivalent to say a penny, that means that we can only have $3000 per person, which seems sort of limiting.  If we make each satoshi something larger than a penny (like $3.00), then each individual could have up to $900,000 in wealth.  But then there would be granularity problems (like having to charge $3.00 minimum for any item no matter how small).
The granularity problem gets even worse since prices for mass produced items (like small electronics components) are often specified in units as small as 1/100 of a penny.
Clearly there is a resolution problem that will only get worse over time.  To estimate the required resolution we can consider the following.

need to account for very small prices (as small as 1/100 of a penny), so 10,000 units per dollar
need to account for reasonable wealth (say $1,000,000 per person).  Not that I expect all people to have that much, but wealth is not evenly distributed, and we wouldn't want to be even close to hitting the cap.
need to account for population growth (say up to 20 billion)
need to account for lost coins (say at least half are lost over time).

$1,000,000 per person * 10,000 units per dollar * 20 billion people * 2 = 4E20 units needed.  This would require at least 69 bits.
4E20 / 2.1E15 = 190,476.
So it looks like the resolution of bitcoins smallest unit will ultimately need to be at least 200K smaller.

The question is good (and has been asked before) but contains a misconception
No one buys rice a grain at a time

The granularity problem gets even worse since prices for mass produced items (like small electronics components) are often specified in units as small as 1/100 of a penny.

Sure, but you will never order just one 120 ohm 0402 SMD resistor from Mouser. You always have to respect the minimum order quantity. You never ask your bank teller to hand over a coin worth $0.00001 so that you can pay Mouser. Your credit card company or bank never has to track account balances to hundredths of a cent. The monetary system you use today also doesn't have currency units as small as that. It isn't a real-world problem. People can and do buy those 0402 SMD resistors using a currency system whose smallest unit isn't small enough to buy just one.
So this issue has no practical effect on the lowest denomination coin available in the currency. A one cent coin is a smaller amount than you'll ever need for any real-world transaction.

Satoshis may be too big?

If there are 7 billion people in the world then there are only 300,000 satoshis per person.

This is indisputable. However there are solutions.
MCCCS pointed out that the Lightning network can already be used for transactions smaller than a Satoshi.
The general view seems to be that the Bitcoin protocols, or related payment systems, can be adjusted in a timely manner to provide for higher resolution in advance of any requirement for it.


How does the network know my current balance? Maybe I haven't yet fully understood how transactions work. And if so, please forgive me my stupid question.
But I assume it to be "just" a digitally signed message like "send 1 BTC to Bob" where Bob is identified by its public key (of course obeying to some protocol). The transaction is then signed with my private key which prevents later modification and then sent to the network for hashing and block-building...
I'm not sure how Bob is notified of the transaction.
Does his client software really have to parse the block chain to find the transaction where his public key is listed?
And even more interesting is the question how the sender of the money is restricted to only send as much money as they have? Is this all managed by the Bitcoin client?
If so, I could write my own software which just uses the (or: any) amount of (Bitcoin) money together with the recipient's public key and build the transaction ASN specified somewhere in the protocol.
Who checks the balance and when is it checked?
Does my Bitcoin client fully dive into the block chain and calculates the balance?
Is this then trusted by the network?
Or does the network (e.g. when building and hashing the block) also a verification of all the public keys from their first transactions on?

The network doesn't know your current balance.

The bitcoin network doesn't use the concept of "balances".  Instead the Bitcoin ledger tracks assignments of value.  So every bitcoin that exists was initially claimed by a miner, and then there have been assignments of value ever since.

Now a bitcoin client can show a "balance" for an address but that balance is simply the result of looking at all the transactions for an address and determining which payment assignments made to that address remain unspent.

An unspent transaction is referred to as an UTXO (unspent transaction output).

So a balance for an address is simply all the UTXOs for that address.   This can be determined from the blockchain.  This is a huge amount of transaction data but that's why the Bitcoin-Qt/bitcoind client uses LevelDB which is very efficient at retrieving from a dataset like the blockchain.


scriptcode, scriptsig, pubkeyscript confusion I've been banging my head on a desk for a few days trying to understand the segwit protocol properly.

Another roadblock has thrown me off-guard and I am struggling to grasp the concept of "scriptCode:" used in the signature examples of bip0143 https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#specification

I understand that a scriptPubKey is basically the locking conditions put on an output when spent. And I also understand that scriptSig is to redeem a previously locked output (destined for my pubkey/pubkeyhash).

I had come to pretty good grips with what I have just stated above, with the scriptSig data items being pushed onto the stack then getting evaluated by the pubKeyHash ect. But now there is this weird "scriptCode" field delcared that looks suspiciously identical to a p2pkh pubKeyScript.

So I came to the conclusion that it is just used the same in every hashPreImage:

DUP  HASH160  <keyhash>  EQUALVERIFY  CHECKSIG

But then I started thinking about stack evaluation order and got confused again. What is the order of stack evaluation? Is it: scriptSig data push > pubKeyScript evaluation > scriptCode? What about if there is witness data invloved? When is that pushed onto the stack? Or am I totally missing the point here?

Another thing I am confused about is p2sh-p2wpkh evaluation. I do not understand why the scriptSig has to be a push of the redeemScript:

 0 <20-byte-key-hash>

re-emphasising my main question. I am struggling with the concept of scriptCode and script evaluation order in general. I would like to know if the scriptCode is always the same format if I am only planning to sign p2sh-p2wpkh, pk2pkh, pk2pkh

The execution order is:

scriptSig/witness to construct the initial stack
scriptPubKey (which may invoke redeemScript evaluation in case of P2SH, and witness script invocation in case of P2WSH)

The scriptCode is simply a name for "the code being executed". Inside scriptPubKey evaluation, it is equal to the scriptPubKey. Inside redeemScript evaluation, it is equal to the redeemScript. Inside witness script evaluation, it is equal to the witness script.


sp20 jackson vs Bitmain Antminer S7 for personal bitcoin mining Background:
I am thinking about getting some bitcoin mining hardware. I am hoping to make some money (at least what I spent on the hardware), but mainly I am doing it to learn about bitcoin mining.
Specific info:

I live in Seattle. Energy costs are about 13.0 cents per kilowatt hour
I am planning on putting this in a semi-small room in my basement. There is no AC in this room, but I would be happy to invest in it if it is necessary.
I am planning to spend less than $5,000 on this.

My question:
I am considering two different pieces of hardware, and I want to know what you think would be better. Also, I would love to know if the calculations of the website that I am using are accurate.
Scenario one:
I buy 21 SpondoolieTech SP20 Jackson's for $3,999. These should run at 1.3 TH/s, according to this website that means I would make around $452.05 a month - or $5,424 a year.
Scenario two:
I buy 6 Bitmain Antminer S7 for about $2,400. These should run at 4.7 TH/s. According to the above website, they should make around $466 a month - or $5,592 a year.
The obvious choice seems to be the 6 Bitmain Antminer S7. Is this correct? Or is there something that I am overlooking?
Thanks!

You are overlooking a very important part of the costs, that you already mentioned. The energy!

Roughly at 13.0 cents per Kw/h your yearly energy costs are:

Scenario one:

21 x 1.2Kw x 24h x 365d x $0.13 = $28697.76 USD! you are down quite a bit.

Scenario two:

6 x 1.293Kw x 24h x 365d x $0.13 = $8834.81 USD! you are down a bit less but still not enough..

So the only way you will make $$ its that BTC value raises in price, in which you are better off just buying off BTC right now for whatever value you are planning to spend.

You need to add into account that mining difficulty will rise and payouts will be even less.

Hopefully this brief info helps you decide (I was a miner myself 2 years ago)

Best of luck!


How to calculate the risk-free rate of cryptocurrencies? For a conference, I need to show the Sharpe ratio's of Bitcoin portfolios using different trading strategies. To calculate the Sharpe ratio, I need Bitcoin's risk-free rate. The risk-free rate for normal stock markets is usually taken from Treasury documents. But cryptocurrencies have no central government and are not affiliated to any country. So how to determine the risk-free rate for, for example, Bitcoin? Is it simply 0?

Bitcoin itself has no returns: 1 Bitcoin is worth 1 Bitcoin, always.  Presumably you actually want to discuss the returns of a Bitcoin plus ordinary currency pair, such as BTC/USD.  In that case you'd would treat it the same as you would treat any other asset trading against USD and use some presumed near zero risk bond rate, like US treasuries, in your analysis.


If I received two blocks at the same time, which one should I choose to mine the next block? Is the situation could happend?

If true, What's the role? Is the Bitcoin pick one block randomly?

If I received two blocks at the same time, which one should I choose
  to mine the next block?

Up to you. You can take the first one. Or the smallest one. Or known by the majority of your peers. Nobody cares.

In worst case you will mine the orphan chain. But nobody cares about you in decentralized system.

In fact you should compare two chains by total work. But this algorithm gives you poor results on comparing two latest blocks with the same height.

  Is the situation could happend?

Depends on what you mean by "the same time". Sometimes the blocks with the same height happen. They came in few seconds ( up to 10-20 seconds ) one after another.

  Is the Bitcoin pick one block randomly?

You can look to the source code on github. But this does not guarantee that the mining pools use it unmodified.


Where are the user's bitcoins actually stored? On the person's computer?

On bitcoin.org? :)

Where does that information reside that tells others and me how much bitcoins I have?

I assume it can't be on my PC because I could easily hack the file that contains that data and get myself more bitcoins, right?

It seems like what's called for here is a basic explanation of two of Bitcoin's big concepts: the wallet and the blockchain:

A "wallet" is a collection of ECDSA keypairs. For those not familiar with cryptography, a keypair consists of a "public key" and a "private key" which can be used to encrypt or sign bits of data. The public key, as the name suggests, is known to everyone and can be used to encrypt messages in such a way that the holder of the private key alone may decrypt them. The private key may also be used to sign messages in such a way that anyone holding the public key may verify that the message truly came from you. Every Bitcoin address consists of such a keypair - the "address" you send people is the public half and the private half resides in your wallet.dat file.
The "blockchain" is a constantly growing database of transaction information which is sent out to all nodes in the Bitcoin network. When you perform a transaction, that transaction is distributed to the network and assuming the transaction is valid, will be included in the next "block." This is where the coins themselves are stored. When you initiate a transaction, all previous transactions to or from that address are scanned and a balance is calculated. If your transaction exceeds this available balance, it will be rejected by the network and will not be included in a block.

It's also important to note that the blockchain technically doesn't store "coins" it stores transaction information. The coins themselves are not discrete things which need storage - when coins are mined the miner's balance is credited via a "generate" transaction which adds to his or her available balance. When coins are sent from A to B, that transaction subtracts from A's balance and adds to B's balance. This is similar to the way that your employer may, via EFT, send "money" to your bank and you can use your debit card to spend that "money" in a store, all without anyone ever seeing a discrete physical dollar bill. Most money in the world today exists merely as transaction histories and balances - Bitcoin is no exception.


A question about mining difficulty I have read quite a few threads about this topic. I understand the general concept now but with a few holes:

Why is mining being compare to lottery?

The total number of possible hashes = hashes below the target + hashes above the target

As I start to mine, I am reducing the numbers of hashes in the "hashes above the target" group", so as I make many attempts, my chance of getting the right one should be raising (because the total number of hashes is finite and I crossed out many bad attempts). If this is the case, then why does this article say:

  After working on it for 24 hours, your chances of solving it are equal to what your chances were at the start or at any moment

Why does a lower target mean higher difficulty?

Is it because the number of correct answers become less and less?

A "bad attempt" (i.e. a block whose hash is above the target) isn't "crossed out".  It is entirely possible that you will later find a different block whose hash has that same value.  Nothing prevents it.  Every hash behaves like an independent trial.

It's easier to understand with smaller numbers.  Say you have a 6-sided die and you want to roll it until you get a 6.  If you roll a 3 on the first roll, that doesn't "cross out" the number 3; it is entirely possible that you will roll 3 again on future rolls.  The die has no "memory".  For that reason, there is no guarantee that you will get a 6 within 6 rolls; there's a chance it could be 7 rolls, or 12, or 100 rolls, before you get a 6.

Even if this were true, it wouldn't really make much difference: the number of hashes that you, or all the world combined, have ever computed, is a negligibly small fraction of the total number possible.  2^256 is an extremely large number.

http://bitcoin.sipa.be/ estimates that a total of 10^26 hashes have been performed on the Bitcoin network to date.  That's  100000000000000000000000000.  The total number of possible hashes is 115792089237316195423570985008687907853269984665640564039457584007913129639936.  So about 0.0000000000000000000000000000000000000000000000001% of them have been seen so far.  Even if they had been somehow "crossed out" it would not appreciably change the number that remained.

As to number 2, you are correct: since the goal is to find a hash that is less than the target, a smaller target means it is harder to find a successful hash.  The number usually called "difficulty" is computed as the maximum possible target (which is 2^224) divided by the current target, so a smaller current target means a larger difficulty number.


Failed to build Bitcoin Core from source, Ubuntu 17.10 I'm building from source v0.16.0 on Ubuntu 17.10
I cloned the repo, checked out on v0.16.0, ran ./autogen.sh followed by ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768"

the make command however produces the following error:

Makefile:8224: recipe for target 'qt/qt_bitcoin_qt-bitcoin.o' failed
make[2]: *** [qt/qt_bitcoin_qt-bitcoin.o] Error 1
make[2]: Leaving directory '/home/angelag/src/bitcoin/src'
Makefile:9462: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/angelag/src/bitcoin/src'
Makefile:747: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

from the output of make command the errors started here:

...
...
CXX      qt/qt_bitcoin_qt-bitcoin.o
In file included from ./qt/paymentrequestplus.h:10:0,
                 from ./qt/paymentserver.h:35,
                 from qt/bitcoin.cpp:25:
./qt/paymentrequest.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^~~~~
./qt/paymentrequest.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^~~~~
./qt/paymentrequest.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^~~~~
...
...

That error means that protoc was updated since paymentrequest.pb.h was generated (it is not part of the source distribution, protoc generates it). Do make clean and then make. That should fix this error.


How much would it cost for a government to undermine Bitcoins? Articles by for example the Economist stating that Bitcoins are being used for drug trading (Silk Road), I believe that the biggest risk to Bitcoins is that a government will pull a stunt similar to Stuxnet. This was also the answer of David Schwartz to a previous question of mine.

Therefore, I believe that we should make a metric, similar to Bus Factor for software projects, which indicates risk of such an event with a single number. I propose that the metric should be called CSU (Cost of Secret Undermining). Later we could calculate the cost of undermining in other ways, like by banning businesses that accept bitcoins and so on, but that will be much harder.

Therefore, my question is: What is the current lowest CSU (Cost of Secret Undermining). This means, what is the cheapest way for someone (for example a government) to secretly undermine Bitcoins to the extent that Bitcoins are no longer useful as a medium of exchange, for example by utilizing the method suggested by David Schwartz. We should compare the number that we find with the current budget of the US fight against illegal drugs. Of course, the expected impact on the fight against illegal drugs is a deciding factor. Even though it will be very hard, we should try to estimate the development time needed to launch such an attack as this will be a cost the attacker would have to calculate with.

This question is related to this question, but now I would like to know the cost of undermining Bitcoins instead of just launching one single 51% attack.

As I suggested in my Bitcoin master thesis, a 51% attack would cost in a bulk part of about 7 million dollars to execute. The figure will change depending on the technology used, the current difficulty and so forth. This option would make Bitcoin or any other Bitcoin-like currency useless.

However, if the USA goverment was to crack down on Bitcoin as a terrorist activity, it could detain any Bitcoin developer in the country indefinitely, which would probably be cheaper. This option would most likely generate a lot of backlash from the community, and could encourage other programmers to take over the project.


String-along, is this possible and is it an attack? I haven't seen this discussed before, if it has been please provide a link.

If I find a block while mining but then discover that another miner broadcast a block mere moments ago, I could begin mining the next block based on the network accepted block. Or I could begin mining based on my rejected block. I'm not trying to double spend, I'm including all the same transactions.

It seems like I have nothing to lose by doubling down at this point. Based on my hashing power I expect the same chance of finding the next block, but if I mine my own block successfully I'll get the coin for mining both blocks. Same risk, double reward.

If I control 51% and I do this, it seems that a successful fork is the most likely outcome. Taking it a step further with the 51% scenario: If I find a block after 3 minutes and I compute that 95% of recent blocks have been found after 6.5 minutes can't I withhold my block from the network briefly, risking the 5% chance of being beaten in order to get lead time on the next block?

If I control 51% and use this strategy, isn't it inevitable that at some point I will mine 2 quick blocks back to back and that I can use my position of being ahead of the network as leverage to get farther ahead?

For example, I find block 1000 and the network accepts it. We all begin mining for block 1001. I find 1001 after 3 minutes, I keep it to myself and start on 1002. I get lucky and find 1002 before anyone else broadcasts a 1001. I begin work on 1003. Someone broadcasts a 1001 and the network moves on to mining 1002. At this point I don't immediately broadcast my block 1002. I've computed that 99% of recent blocks are broadcast after 4 minutes. So i continue mining 1003 for an additional 4 minutes, taking only a 1% chance of being preempted.

Then, only after the network has wasted 4 minutes mining 1002 do I transmit my 1002 which invalidates both the other miner's 1001 and the whole networks expenditure on 1002. This leaves me with winning blocks 1001 & 1002 a 4+ minute head start on 1003.

If I control 51% and use that strategy, where every quick block I find and every long block the network finds will fuel my head start, isn't it inevitable that at some point I will gain the power to string the network along where all their work is wasted on blocks I have already found but not shared.

Wouldn't this be invisible to users and merchants yet devastating to miners? Wouldn't this disincentivize mining thereby increasing my relative hashing power and the length of my string along chains?

A miner can always lose out if someone else mines a block at approximately the same time as he does. A miner will always continue building on his own block if he finds one before he processes a block found by someone else. It is never to a miner's advantage to ignore a block found by someone else unless he himself has found a block at almost exactly the same time.

So this is all behavior as expected.

When you mine a block, everyone else who has not found a block has a strong incentive to mine after your block. If they don't, they have to find two blocks to get any credit at all. If they find one block first, the rest of the network will ignore it.

If you control 51%, you effectively control 100%. That is also expected behavior.


Why has Bitcoin Core stopped shutting down when Windows cleanly shuts down? Every night, I do this to turn off my Windows 10 machine:
shutdown /s

Note that there is no "forcing flag" or anything (/f).
Up until recently, Bitcoin Core appeared to always get the signal and cleanly shut down, just like every other application.
However, recently, whether it was a new version of Bitcoin Core or an update to Windows 10, Bitcoin Core has stopped shutting down when it gets the signal. The reason I'm convinced of this is that, every day when I turn the machine back on, Bitcoin Core (and only that program) appears to have been uncleanly shut down/killed suddenly, as it keeps having to resync the last several days. (Perhaps just verifying the local data rather than actually downloading it.)
I even tried keeping the Bitcoin Core GUI window open while shutting down one day, and I noticed that it didn't say the usual "Shutting down" text.
Whether this is Bitcoin Core's fault, Windows 10's fault, or a combination, the fact remains that this happens every single time now, and it's very annoying and worrying.
Is this issue known? Is it being worked on? What could be causing it? Would MS really change something fundamental about how applications are signaled when shutting down the OS in a minor update? (Not unthinkable.)

According to https://github.com/bitcoin/bitcoin/issues/20052#issuecomment-702659790 you can use the PowerShell Stop-Computer cmdlet.


What is the largest number of blocks a transaction has ever waited for confirmation? What is the largest number of blocks a transaction has ever waited before eventual confirmation?

Please exclude:

Transactions with no fee
Transactions delayed because of unconfirmed inputs
Transactions that were signed but never broadcast to the Bitcoin network
Transactions that were never confirmed

Transactions with very low fees and or/are dust amounts acceptable. Please link the txid if available

This is not a full answer, but a partial answer somebody may use as a stepping stone to craft a complete answer.

E.g. blockchain.info shows both "received time" and the time of the block a transaction was included in.

It appears to me that the "11 minutes" in the "Included in Blocks" time for this transaction corresponds to the difference between "Received Time" and "Block time" of the first confirmation.

If this information is available on blockchain.info's API, someone could parse all transactions to find the maximum.

By additionally evaluating the fee of a transaction in comparison to fee levels at that time, and confirmation times of each input of the transaction, the additional constraints of this question could be addressed as well.


Sending using blockchain.info According to https://github.com/blockchain/api-v1-client-node/tree/master/MyWallet#send-bitcoin wallet.send doesn't require a from field. When I run wallet.getBalance() it states that I have BTC in my wallet (received days ago). However if I do:

const balanceResponse = await wallet.getBalance();
console.log(balanceResponse);
// { balance: 100000000 }
wallet.send("<receiving address>", 510000, {
  fee: 10000
})

  {"error":"Insufficient funds","available":0,"needed":0.0051,"sweep_amount_satoshi":0,"sweep_fee_satoshi":0}

I've only ever received BTC once in my wallet. If I use that address in the from field:

wallet.send("<receiving address>", 510000, {
  from: "<sending address>",
  fee: 10000
})

I now get

  {"error":"Error signing and pushing transaction"}

What am I doing wrong?

The Wallet Service requires the from option to be specified when sending from an account. It's only optional when your BTC is located in your normal, imported addresses.

Assuming you received funds to your first wallet account, you would set from: 0 and the send should succeed.


After creation, what I have to do with a coinbase transaction? I have create a coinbase transaction successfully with the command:

createrawtransaction '[{"txid":"0000000000000000000000000000000000000000000000000000000000000000","vout":0}]' '{"12Evb28oMpkP76HRS2CZ7VjNMD25B84VMv":12.5}'

what give a hex string for the transaction. But when I try signrawtransaction I got this error:

{
  "hex": "...",
  "complete": false,
  "errors": [
    {
      "txid": "0000000000000000000000000000000000000000000000000000000000000000",
      "vout": 0,
      "scriptSig": "",
      "sequence": ...,
      "error": "Input not found or already spent"
    }
  ]
}

with sendrawtransactions i got:

Missing inputs (code -25)

what I have to do with this transaction after create it?

A coinbase transaction is not one that is signed or broadcast to the network. Rather it should be the first transaction in the block that you are mining. Also, the first 4 bytes of the scriptSig must be the block's height (1 byte for pushdata 3 bytes for the height).


Is there a Bitcoin gadget for Windows 7? Is there a Bitcoin gadget for Windows 7, which features conversion rate with EUR? (i.e. EUR/BTC)

This is the one I'm using: http://www.domchi.cc/mybitcoins/


What is the reference algorithm for validating a Bitcoin address? I need to validate Bitcoin addresses in an application I'm developing; I have found various code samples for various languages (even on StackOverflow), but none specific for the one I am using (C#); also, all of those samples seem to come from volunteers around the world, but I've been unable to find an "official" reference algorithm for address validation.

This links explains how an address is generated, but even it has some dubious statements, like "this is the most commonly used Bitcoin Address format" at the end of the article; also, it doesn't explain how to actually validate one if you're not doing the address generation.

What is the official, reference algorithm for checking the validity of a Bitcoin address?

Of course, I'm only interested in syntactic validity; I don't care if the address was ever actually used, if it has any Bitcoin balance, or if the user really is in possession of the associated private key.

Please avoid code samples, as they are language-specific; what I'm asking for is a detailed description of the steps required for validation, so that it can be implemented in any language of choice.

Please avoid code samples, as they are language-specific; what I'm asking for is a detailed description of the steps required for validation, so that it can be implemented in any language of choice.

You won't find any documentation other than the wiki which is generally out of date and incorrect, so code samples will have to do. Check the reference client Bitcoin Core, and some of the JavaScript implementations in BitcoinJS. It's not difficult, just base58 encoding with a version byte of 0x01 at the front and a truncated hash at the rear. P2SH transactions have a different version byte but are still valid in the same fashion.


Bitcoin library - how to check number of confirmations when I use bx fetch-balance I get this output:

  $ bx fetch-balance 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

  balance {
      address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
      confirmed 1538241483
      received 6538241483
      unspent 6538241483 }

it doesn't show the number of confirmations.

how can I check the number of confirmations using bx command?

"confirmed" in this case means the transaction is included in at least one block that belongs to the current best chain.

If you want to find out exactly how many confirmations each transaction has you can use fetch-history to get a full list of all transactions sent to and from your address. fetch-history will return the block number that the transaction has been included in. You can then use that along with the current height to figure out how many confirmations your transaction has.

bx fetch-history 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
bx fetch-height


Need help with a .conf file to run a lighting node? This is my configuration file and i followed all of the instructions for the program but it always gives me the error message about something missing. I don't even know what programming language .conf files are written in. if someone can give me some guidance that would be much appreciated.

eclair.chain=mainnet
eclair.bitcoind.rpcport=8332
eclair.bitcoind.rpcuser=foo
eclair.bitcoind.rpcpassword=bar
eclair.server.port=9735
eclair.node-alias=<myalias>
eclair.node-color=00ff00
eclair.bitcoind.zmq="tcp://127.0.0.1:29000"

I got this code from https://medium.com/@crypto_coffee/how-to-set-up-a-bitcoin-lightning-node-b54733fbcb7f.

eclair.chain=mainnet
eclair.node-alias=”node-alias”
eclair.bitcoind.rpcport=8332
eclair.bitcoind.rpcuser=username
eclair.bitcoind.rpcpassword=password
eclair.bitcoind.zmq=”tcp://127.0.0.1:29000"
eclair.server.public-ips = [“xxx.xxx.xx.x”]
eclair.node-color=”ffffff"

Just replace the generic text with your computer's info.


Under what circumstances would a server submit new work to a miner? This is asked in a context to better understand why a submitted share by a miner might be rejected.

I know when a new block gets solved that would require a work update, which is approximately every 10 mins on average. Are there any other circumstances where miners in a pool would get new work from the pool server?

I'm mainly asking this question to better understand the explanation given here:

  The cause of this problem is low overall hashrate. Phoenix maintains a work queue to reduce hashrate disruptions caused by momentary connection problems. This works great on faster hardware like the ATI 5870, but it can cause issues with miners that get <100 Mhash or so. The reason for "unknown-work" rejects is that those shares were from work that has been sitting in the queue for long periods of time(>1 min). Some pools "forget" about assigned work after very short time periods (1 minute for example) and any results returned based on that work are rejected as unknown...

It sounds like a pool ignores submitted shares that's over a 1 min even if no new blocks were solved in that time. The submitted share clearly shouldn't be considered stale yet so why would a pool do this?

The problem you are describing could be due to pool optimisation, as it is easier to prune 1 minute old shares than probably it is to look through 10 minutes of shares in order to validate them.

As for why a miner would request new work from a pool, other than as a result of longpolling or finishing a work, might be due to the work becoming invalid with time (with standard protocol a miner would request work every second). Alternatively, the miner is trying to be malicious and trying to make the pool do extra work.


Received Random Unconfirming BTC I've been using BTC for years now. This is the first time this has happened.

Woke up yesterday to an unconfirmed transaction of around $30. Completely confused, I wondered where this came from.

Anyway, it's been 30+ hours since receiving the funds. Still not confirmed, and still completely confused.

My question really, could this be fraudulent BTC? How the hell did they get my address, and how long until I could possibly see this confirmed?

Txid: 987ee6a4930d7610ea081250dfc49d4fdd0ade093d740b4c18c5f78db2bc05c7

My question really, could this be fraudulent BTC?

Not sure about fraudulent, but there are parties that send (near-dust) amounts of Bitcoin to existing addresses, hoping the wallet will merge the output with those sent to different addresses, as to figure out correlations for tracking.

$30 is a bit much for this, though! It could also be that someone copy/pasted a wrong address and accidentally sent to you.

  How the hell did they get my address,

Have you used it before? If so, they probably just found it in the block chain.

  and how long until I could possibly see this confirmed?

Depends on how much fee they attached. You could help it by creating a CPFP transaction spending it.

On the other hand you might not want to. If someone sent it by accident it is better for it to never confirm so that they can reclaim it at some point.


How does the structure of a segwit block differ from a non-segwit block? Is there any difference in the structure of a segwit block in comparison to a traditional non-segwit block? A diagram would be helpful if possible.

A segwit block's coinbase transaction must contain an output with a commitment to the witness root hash, see BIP141.

  The commitment is recorded in a scriptPubKey of the coinbase transaction. It must be at least 38 bytes, with the first 6-byte of 0x6a24aa21a9ed, that is:

1-byte - OP_RETURN (0x6a)
   1-byte - Push the following 36 bytes (0x24)
   4-byte - Commitment header (0xaa21a9ed)
  32-byte - Commitment hash: Double-SHA256(witness root hash|witness reserved value)

  39th byte onwards: Optional data with no consensus meaning

  and the coinbase's input's witness must consist of a single 32-byte array for the witness reserved value.

  If there are more than one scriptPubKey matching the pattern, the one with highest output index is assumed to be the commitment.

At the transaction level, a segwit transaction must set the witness flag to 0001, and provide the witnesses before the locktime. A non-segwit transaction contains neither of these properties.

See Bitcoin Wiki - Transaction


In order to send more hashes for mining do you need to connect into a bigger mining pool? After the rate at which you can generate hashes, what determines the rate at which you can send hashes to be checked?

I'm guessing connecting into a bigger pool would help spread your load?

The difficulty determines how many hashes it takes for you to produce a share. Most modern mining pools will raise the difficulty as your hash rate increases. The idea is to keep your share generation rate roughly constant, regardless of your hashing rate. This allows the mining pool to still accurately measure your hash rate, still collect an actual block should you find one, but not have to process an absurdly large number of shares. Even a small pool can handle a client with an extremely high hashing rate. It's not more difficult, so long as you aren't using obsolete protocols like "getwork".


Can two or more transactions sent from the same address be mined in the same block in Bitcoin's blockchain? Imagine a person Bob has 10 bitcoins in his wallet. He wants to send 5 bitcoins to Alice and another 5 bitcoins to Uncle Tom simultaneously (in separate transactions). Will both Bob's transactions be confirmed in the same block?

If yes, than consider the case when Bob sends all 10 bitcoins to Alice in one transaction and simultaneously issues another transaction to send Uncle Tom the same 10 bitcoins. How is the double spending problem prevented in this case (I would like a technical answer for this one)?

Will both Bob's transactions be confirmed in the same block?

This cannot be guaranteed. They might or might not.

  consider the case when Bob sends all 10 bitcoins to Alice in one transaction and simultaneously issues another transaction to send Uncle Tom the same 10 bitcoins.

Bob's wallet will not allow him to double-spend. If Bob circumvents this, one of the transactions will be rejected by the network. In the worst case there may be a short period where it is unclear which transaction will win.

Each node in the network, whether a miner or a wallet will verify incoming transactions and mined blocks and will reject any that attempt to spend TXOs that are not UTXOs - i.e. which that node knows are already spent.

It can be that one miner selects the payment to Alice for inclusion in a block and another miner selects the payment to Tom. Other nodes will reject the second of such blocks that they receive, eventually the blocks with the most proof of work will be the only ones accepted, including by both miners.

Related questions:

How to return Tx to mem pool from orphan block
What's the longest chain of orphan blocks? (How many confirmations have been necessary?)
How is a blockchain split resolved?
Selfish Mining: stale or orphan?
Is there a correct way to refer to "orphan" blocks?

and

What is an "unspent output"?


Bitcoin Wallet Mining Can I process my own transactions from my wallet on my miner? I would like to process my own transactions because then I could have my transactions go faster and not have to pay extra because it would be processed locally? I know this might sound dumb but I would still like to know.

The only miner that gets to decide which transactions go into a block is the one that is lucky enough to find the next block. So, yes, if your miner is successful in finding a block, then you get to decide which transactions are included.

If you are mining in a pool, your miner probably doesn't get to decide which transactions get included. The above only applies if you're solo mining.


tradehill.com alternative? I am constructing a small online store where I would like to accept BitCoins as payment.

I have not had any luck running the Deamon on my server, so I was planning to use tradehill.com and then make use of the API.

But every time I log in i get the

  "Socket not connected Sorry, our notification socket isn't connected
  yet. Try again in a few seconds!"

Error... And it's making me kind of anxious to use the system, since it seems a bit derelict.

Does anyone know any similar systems ? Or know what's going on backstage of TradeHill.com ?

Any suggestions will be much appreciated.

If you have technical problems with Tradehill, your first step should be to contact them about it.

It's not clear to me in what capacity you want to replace Tradehill. If you want an exchange then Mt. Gox is an obvious possibility, or any one of the exchanges listed here. If you want an eWallet, most exchanges are good for this too, and flexcoin is another possibility. If you want merchant solutions, check out bitpay.


Apart from its main purpose, what is bitcoin network used for? In the Ethereum Homestead docs there is a paragraph

  But as bitcoin began attracting greater attention from developers and technologists, novel projects began to use the bitcoin network for purposes other than transfers of value tokens. Many of these took the form of “alt coins” - separate blockchains with cryptocurrencies of their own which improved on the original bitcoin protocol to add new features or capabilities.

Questions are:
1. What are the best examples of such 'other purposes' and projects, especially the ones that are not altcoins?
2. What are the most prominent altcoins that haven't lost their significance?

What are the best examples of such 'other purposes' and projects, especially the ones that are not altcoins?

Things that do proof of existence like OpenTimestamps are not for transfering money but rather committing something (in this case, a hash) to the blockchain so that it is essentially preserved forever.


Scanning QR codes with Electrum 3.0.1 When trying to scan QR codes with Electrum 3.0.1 it asks for zbar software. I'm not sure which one to download as some of them might be unsafe. Which Zbar QR scanner should we download?

Electrum does not support QR code scanning on Mac OSX as stated on download page:

  Note: The QR code scanner is not supported in OSX binaries

There has been several related bugs, but as of v3.2.2 the issue has not been resolved by anyone.  Some related discussion and attempts to debug.


Why does this script return an error ? I'm trying to understand how Script validates transactions.

I have taken this transaction as an example 55e5bbdba33050bbe6584e896b4a20575cf3fe3f29114467f17f67f6b172eb73

When showing the scripts, we can see as input

ScriptSig: PUSHDATA(72)[3045022100c70904b2925a6822fd3dc2d236bcba1fa1518fdfdadbda8f25a89a339879c82a02200bd7ca7d502d46ebc6fbc97f51af3d0ab4f290d73931ada9abb76fb1b6d3b55b01]
PUSHDATA(65)[043fd05d2490b2b8496da3b8498f1aee08634c43eef40aa58b66e36271632571d6dbda0ec7fb6fcec09409597e38e3b968648ed10ad6402647bb6143f0f9f09b3f]

And output :

DUP HASH160 PUSHDATA(20)[57d713220076f8298b54e9eea84d2e1dde62e4a1] EQUALVERIFY CHECKSIG

So, from what I understood, if these script bits are run one after another, the result should be true (please correct me if I'm already mistaken at that point).

I have used an online Script debugger but these bits did not return a success.

Has anyone an explanation on why I couldn't get this right ?

You are not supposed to be using the output scripts of the outputs created in the transaction but rather the output script of the output that is being spent. What you are using is the output script of the output in that transaction.

Rather you should click the output link next to the input and get the output script from the referenced output that the link takes you to.


Why are pre-softfork blocks are not causing problems for post-softfork clients? i read the answer to this question and got some new one.

As far as i understand how a soft fork works, it means that post-softfork clients with new consensus rules accept only blocks that follow those new consensus rules, while older, pre-softfork clients accept both, pre- and post-softfork blocks. If a old client mines a block, that gets rejected by the newer clients, therefore causing a temporary blockchain fork that is resolved eventually after at least 51% of all clients are upgraded, because the clients then switch to the blockchain fork of the newer clients.

My questions are:

Don't this bear the risk of invalidating all transactions still made by the old clients, but that where rejected by the newer ones? If i made a transaction that gets mined by an old client by the time the old clients still have 51% of the hashing power, but it then switches to the chain of the new ones that previously rejected this block, it disappears from the chain altogether, doesn't it?
Since the blockchain don't change, a lot of old blocks that were following old consensus rules are still in there. When i'm starting a new, post-fork client and download the whole blockchain, how isn't this causing problems for the client when it tries to validate the whole blockchain with all the old blocks in it? Isn't it checking for old blocks following new rules?

Thanks for any help.

Your question is about deployment.

Softforking changing generally are not applied unconditionally to every block in history. Instead, an activation mechanism is used so that all clients know when they need to start being enforced. Before that activation point, new clients still enforce the old rules but not the new ones.

Activation mechanisms that have been used in the past:

Time-based (apply to every block whose timestamp is past a fixed point in time). Used in BIP16 and BIP30.
nVersion signalling (apply to every block after the first range of 1000 blocks in which at least 750 have a nVersion field that is higher than a specified value). Used in BIP34, BIP66, BIP65
Versionbits signalling (using signalling on individual bits of the nVersion field; see BIP9). Used in BIP141/143/144/147.


Bitcoin core node is not starting after -prune is applied in bitcoin.config file I have a bitcoin core full node version 0.17.1 running on my machine. I want to enable prune on the node to save space on the disk. When I apply -prune=15000 in bitcoin.config file and restart bitcoin core GUI, it shows -txindex is incompatible with prune. So I want to start my node with prune enabled. Is there any way for that?

By pruning the blockchain you:

  Reduce storage requirements by enabling pruning (deleting) of old
         blocks. This allows the pruneblockchain RPC to be called to
         delete specific blocks, and enables automatic pruning of old
         blocks if a target size in MiB is provided. This mode is
         incompatible with -txindex and -rescan. Warning: Reverting this
         setting requires re-downloading the entire blockchain. (default:
         0 = disable pruning blocks, 1 = allow manual pruning via RPC,
  =550 = automatically prune block files to stay under the
         specified target size in MiB)

So, -txindex cannot be enabled when the blockchain in pruned


Intermediate pool server Is it possible to make "intermediate" pool server, which will be gateway to real pool?

I have about 200 pc's, each pc connects to my intermediate pool using own login pass. Intermediate pool should get work (using stratum) from real pool using own login and pass, and submit shares using own login password.

There are bitcoin mining proxies, some code is available on github (use the search).
For example https://github.com/cdhowie/Bitcoin-mining-proxy
(*pls make your own security evaluations on opensource code)

Im not aware of a "intermediate pool", of course proxies are popular for mining.


Where to buy non scam bitcoin with ICBC credit card? I've tried several bitcoin sites which accept credit cards, but they didn't accept my bank's credit card (miicard require bank verification and ICBC is not on the list), so where can I buy bitcoin from a reliable exchange with an ICBC credit card?

You are likely to have trouble finding a place to buy Bitcoin with a credit card. A credit card transaction can often be charged back, in which case the seller has no way to recover the  bitcoins. Honest sellers may not want to take this risk, meaning they are probably far outnumbered by scammers.


how to setup p2pool for dogecoin? I try use --net 'dogecoin',but display errors:invalid choice: 'dogecoin',How should I do to make p2pool join dogecoin Network

This repo https://github.com/Rav3nPL/p2pool-rav

contains an updated version of p2pool that i know working with dogecoin network


Blockexplorer.com API POST error I'm trying to write Python code which utilises the (Insight) Blockexplorer.com API , particularly the POST functions. I'm testing using the iOS REST app, Restler (see screenshot).

The call I'm trying to make is fine when I use GET (https://testnet.blockexplorer.com/api/addrs/2NF2baYuJAkCKo5onjUKEPdARQkZ6SYyKd5,2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f/txs), however for POST, I'm having problems. I use "addrs" = "2NF2baYuJAkCKo5onjUKEPdARQkZ6SYyKd5,2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f" as my params (and have tried using dumped JSON, ie"{ "2NF2baYuJAkCKo5onjUKEPdARQkZ6SYyKd5,2NAre8sX2povnjy4aeiHKeEh97Qhn97tB1f" }", but I'm always getting the following error message:

  Invalid addrs param:Cannot call method 'split' of undefined. Code:1

It's clearly a parameters issue, so what gives? (FWIW I'm not versed in JavaScript)

Relevant screenshot of Restler (L) and API documentation (R):

I was able to get the POST working. The error you're getting back seems to indicate the key "addrs" is not in the POST payload. Just a guess, but maybe you don't need the quotes and spaces around the payload?

Screenshot here:


Migrate from blockchain.info to bitcoin-qt I currently have my wallet with blockchain.info.

Is there any way that I can import this address into the bitcoin-qt client?

Login to your blockchain.info wallet
Select Import/Export
Select Export Unencrypted
Select Bitcoin-Qt Format from the drop-down list

You'll then see information that look like this:

"priv":"5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS"

Ignore the other information, what you're looking for are your private keys that look like this: 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS

Then just follow Rick's instructions to import each of your private keys into the Bitcoin-Qt client:

  Run Bitcoin-QT
  Select Help (to the right of Settings)
  Select Debug Window
  Select Console
  Next to the > input box type importprivkey <bitcoinprivkey>

  Example: importprivkey 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS


How is the P2SH address obtained in decodescript Im trying to understand how to obtain the p2SH address when decoding an output script.

r.push_back(Pair("p2sh", CBitcoinAddress(CScriptID(script)).ToString()));

source

As far as I understand CScriptID is the hash160 of the script.

So, a P2SH scriptPubKey looks like this:

OP_HASH160 <20 byte script hash> OP_EQUAL

Serialized, in hex, that looks like:

17a9140000000000000000000000000000000000000087

^ ScriptPubkey len
  ^ OP_HASH160
    ^ Data element len
      ^ Data element
                                            ^ OP_EQUAL

where the zeros can be any byte.

How does that transform into an address starting with 3? You transform it the same way you would a normal Bitcoin address, but with a different version byte. Instead of 00, you would use 05.

See also the P2SH address specification.


Cannot allocate memory EXCEPTION: 11DbException
Db::get: Cannot allocate memory
bitcoin in ProcessMessage()

Downloaded 250k blocks, now it won't run anymore i'm running ubuntu 12.04, I have 20GB HD and 1gb ram. any way to fix without redownloading?

bitcoind uses a ton of memory while it's downloading the blockchain. Check out these steps on how to set up your swap space correctly on Ubuntu:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Additionally, you can check out the torrent download of the blockchain. As long as you trust the file, this can help speed up the time to download the blockchain.

http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bootstrap.dat.torrent/download


Can I connect to Litecoin, Dash, BitcoinCash, Doge, etc. RPC with Bitcoin RPC client? I want to set up a few nodes for different Bitcoin-derived cryptocurrencies and regularly query them for data via the JSON-RPC API.

The thing is: I can't find much information on any other RPC API except for Bitcoin one. I'm assuming it's because all the Bitcoin-derived cryptocurrency nodes have the same API. So, can I just use, for instance, Python Bitcoin JSON-RPC client to connect to all of them just by changing connection strings?

Sorry for the sloppy wording and stuff. I'm just stunned that there's so little information I was able to find.

Yes, you should be able to use a Bitcoin JSON-RPC client to interact with JSON-RPC servers for other cryptocurrencies if they are using software that is based on Bitcoin Core (which most are). Such JSON-RPC clients and libraries don't really have anything in them that is Bitcoin specific; they just handle the connection to the RPC server for you and return you the JSON formatted result.


how do nodes verify that a block has been solved and can be added to the blockchain when a miner solves a block it gets sent out to the network, when other nodes receive it, how do they verify that the block received was indeed solved and can be added to the blockchain.

So you don't know what the answer is but if you got the answer you know what the question was.

StephenM wrote a good answer to that:

  The difficulty (or nBits as it is called in the code) is shorthand for how difficult it is to solve the block. Essentially, it encodes a target value, and the hash of the block (when treated as a 256 bit integer) must be below that target value to be considered solved.


Bitcoin safe if ECDSA is broken? I've read that one reason to use a new address for each transaction is because it hides the pubkey behind a hash, so that even if ECDSA is broken and someone is able to derive my privkey from my pubkey it would still be impossible to spend the output of the transaction, since they would need to be able not only to reverse the hash but reverse it into a valid pubkey. Assuming that's impossible, and assuming people use a new address for each transaction, what would be the full security implications for bitcoin if ECDSA were broken? How much protection does hashing the pubkey give from broken-ECDSA attacks?

First, if ECDSA were broken, a lot of other things would be broken, like ssh, https and a bunch of other things, including banking websites.

Second, if nobody reused addresses, then yes, bitcoin would be protected by SHA256 and RIPEMD160. There is currently no known way to get a preimage of a hash used by either of those functions so your bitcoin would be safe. Again, this assumes nobody reuses addresses.

As far as how much protection this gives, it's hard to say because it depends on the exploit used to break ECDSA.


Trial recovery of blockchain.info Wallet to MultiBit HD wallet Situation at time of writing:

Written as of 29 May 2016; web based Blockchain.info wallet is HD; MultiBit is also HD.

The Query/Story

Since its become a little uncertain whats going to happen with Armory as a wallet; I decided to explore some other wallets.

After signing up with blockchain.info (and getting the N word recovery phrase) I transferred a small amount of BTC into my new Blockchain.info wallet. So far so good.

Now my understanding is that a Hierarchical Deterministic wallet (HD) such as MultiBit HD should be able to restore the wallet using those N words.

So effectively playing the disaster recovery game; I have installed MultiBit HD; Gone through the recover process using my recovery phrase. MultiBit had downloaded some 130K+ blocks. And I end up with a wallet that seems operational BUT... and this is the but.... no BTC.

My blockchain.info account is showing the BTC; but MultiBit is not.

Therefore either
a) My understanding that I should be able to restore the wallet - and its BTC from the recovery phrase is incorrect (pretty sure that that's the whole point!)

or
b) I am doing something wrong with MultiBit.

Yes this scenario would mean that I would have (as Blockchain.info is not down) 2 wallets with the same BTC but this would be on the same address(es) and the blockchain would protect again any attempt to spend twice.

Basically looking to feel protected in that with my recovery phrase I can recover the wallet (either to blockchain.info / to multibit HD or other wallet) should PC's blow up, web sites crash etc.

Any advise? I have repaired the MultiBit HD wallet a few times - but always sits at 0 BTC

Thanks in advance

MultiBit HD supports BIP39 seed phrases for BIP32/44 wallets. If a different deterministic algorithm is used then the seed phrase is not compatible. Also note that due to the limitations of SPV mode MultiBit HD is not currently able to support accounts other than 0.

You can read more on this here: https://multibit.org/en/help/hd0.3/how-spv-works.html


Which cryptocurrency server software supports the walletnotify feature? I am looking to build a realtime service for crypto payments and would like to know which currencies are based on server software that supports "walletnotify" out of the box in the way Bitcoin does - specify the script to run on payment received and confirmed.

Am I correct to assume BCH, BCG and LTC support this since they are forks of the Bitcoin code?

What are other cryptocurrencies I should look at?

Yeah, All bitcoin forks support walletnotfiy.

most digital-currencies have a walletnotfiy with some a few code changes.

that's a list of all Bitcoin forks


Trying to receive a payment. Signed up for Bitcoin I don't know if I signed up for the right one I think I just signed up for Bitcoin correctly. I'm trying to receive payments from an online casino that pays in Bitcoin. What do I need to do and what kind of wallet do I need to open, so I can receive my payment? Also, is Bitcoin used like a a bank where I can spend money out of it?

I think I just signed up for Bitcoin correctly.

  I'm trying to receive payments from an online casino that pays in Bitcoin. What do I need to do and what kind of wallet do I need to open, so I can receive my payment?

To receive payment in Bitcoin what you need is a Bitcoin wallet.

There are several types of wallet available. Wallets are available as desktop software (full node and, SPV wallets) and, as a web service from certain sites.

For desktop wallets you can make your own choice, the official download of the software is on bitcoin.org. I have liked Bitcoin Core (which is a full node and requires to synchronize with the Bitcoin network before it will show all transactions) and Electrum (an SPV client wallet that is setup in seconds but, is not a full node).

Personally, I would always avoid web wallets since you must trust their security and it is a big, attractive target. Online services have been hacked in the past and much Bitcoin stolen.

A Bitcoin wallet on your computer is as secure as your computer, be sure to also keep a secure, private and, up to date backup of your Bitcoin wallet or passphrase. If you lose your wallet all of your BTC are gone and cannot be recovered. When using a web wallet it is not only the security of your computer at question, it is also theirs.

  Also, is Bitcoin used like a bank where I can spend money out of it?

A Bitcoin wallet allows you to spend Bitcoin. It is more like a wallet than a bank. Online web wallet services are a bit more like a bank since you are trusting a third-party to hold your Bitcoin.

Note: If you are downloading software from other than bitcoin.org it might not be Bitcoin software or, it may be modified so that it is not trustworthy.


Arbitrage in the Bitcoin / Bitcoin Cash fork So assuming BTC and BCC are both viable and tradeable for some period after August 1st, is it not inevitable that some people will double spend, by trading a coin on BTC and also the same coin on BCC?

Any ideas what that will look like from an arbitrage perspective while the fork works itself out?

A coin on either fork is distinctly a coin on its respective fork. Sure you can send someone BTC and then send someone else BCC that spent the "same" input, but no one will care because that is entirely a different coin using a different blockchain. With the kind of fork that will be happening, no sort of fraud (outside of any normal fraud) can occur. The fork implements two way replay protection so receivers cannot replay transactions and get money on both forks, and double spending cannot happen because this will be a persistent chain split with no possibility of blockchain reorganizations.


Bitcoin and Bitcoin Cash blockchain split What is the safest way to make sure on August 1st that I get the amount of BTC I own in BCC?

For example Coinbase is going to keep all the BCC. So if you have BTC in Coinbase you won't get the equal amount of BCC.

I want to make sure I get the equal amount of Bitcoin Cash as I have of Bitcoin once the blockchain splits.

Ensure you have your private key of the address the BTC was sent to backed up. As long as you have the private key, you will be able to spend those UTXOs on the fork and BTC itself.


I used multibit years ago - now what? (BTC, BTG, BCC etc...) I have some old wallets from multibit era (~2013).  There is no way I can now download the full blockchain, so I need to import these keys into somewhere.  Worse still, I also need to import the same keys for BCC and BTG.

Try as I might, I can't seem to find clients that allow me to import old base58 keys.  I have a few files called something.key which came from multibit and are human readable with the private key in.  Everything seems to be "mobile" and "QR codes", "passphrases" and whatnot.

It's not a lot of money, and fragmented over multiple wallets, so with transaction costs stupidly high now, sweeping is infeasible.

How can I spend these old coins?  Is the only way to free up 150GB and wait?

Edit:  Ultimately I just want to create a transaction from all these wallets, to send the coins to an exchange.  So sweeping to a new wallet just doubles all my transaction costs for no reason.  Also I need a way to repeat the process for Bitcoin Cash and Gold...

Is there no simple tool to just "create" a transaction?

So I found a solution that worked for me:

BTC
Blockchain.info have online wallets but you can also just create your own transactions without using their wallet.  Add an address using import and then spend them directly using your private key.  You can manually set the fee and i managed to transfer with ~75sat/byte even though recommended was 225.

BCC/BTG
Transaction costs are still small for these so sweeping works fine using practically any wallet.


"Cannot afford transaction" version 0.7 clightning

Listfunds shows me:

963692 satoshi available to fund channels
6280512 satoshi owned in channels
14832105 satoshi total channel capacity

When I try to fund a channel with 400000 I get:

lightning-cli fundchannel 02b414e4e29a685b8699152be47a0420fa3c8ab59629d2da2d6c0a95c582636350 400000
{ "code" : 301, "message" : "Cannot afford transaction" }

Why?

Could it be that the outputs depicted in listfunds do not have yet enough confirmations? Maybe you got them after you closed a channel and c-lightning did not allow you to use them right away. Could you check again?


MtGox API Overview and explanation of steps required to create connection I am trying to write a simple app that uses the Mt Gox. (bitcoin exchange) API.

It's very simple to use the price API it's just a http request that returns a .JSON string.

However now I want to do more with my app, I was thinking it would be good to be able to log into the users mtgox account and show their balance of bitcoin.

I have an API key (you can generate one on their site) but I'm finding it really hard to understand whats required to generate a connection and pull the balance.

Is there anyone who might be able to point me in the right direction?

I have researched quite a bit and turned up very little information - API Overview: https://bitbucket.org/nitrous/mtgox-api/overview

In the above link they have some python code, but i'm finding it difficult to translate into Objective C.

So if anyone can:

A. Give me a highlevel overview of the steps required to log in and get a bitcoin balance using the API.

B. Give me some pointers on how to turn their Python example into Objective C I would really appreciate it.

I understand to use the API I need to use this URL to Get my current balance    mtgox.com/api/0/getFunds.php -- however first I need to get a "nonce" parameter to the post data (which must be an ever-increasing interger, for example with PHP in 64bits: (int)(microtime(true)*1000000)) and two HTTP headers: Rest-Key (your key) nad Rest-Sign (a signature generated by doing a sha512-hmac on the POST data with the secret as key, encoded in base64).

I found this documentation: bitbucket.org/nitrous/mtgox-api/overview -- still not clear however, how to code in Objective C thanks

Take a look at the Java XChange project

While it is not Objective C it will provide you with all the details you'll need to get your library off the ground including the HMAC authentication process and websockets.

You'll also find a range of other exchanges supported so you can implement those as well thus providing your application with a broader range of potential users since not everyone uses MtGox these days.


Why is target stored in the block at all? Currently, target is stored in each block. Why is that? Why it is not simply computed by each client based on the previous timestamps from previous blocks? Why it has to be stored within the block?

In other words, doesn't allowing miner to choose the target remove that it is exponentially harder to create a new block? Other miners might have to mine 256 consequent blocks, but I have only to be lucky once and get one block with 8 more zeroes to replace those 256 blocks. While it is less probable, it grows linearly (256x less probable) and not exponentially.

You're presenting it as a choice between either allowing miners to choose the difficulty, or having it be implied by previous history.

In fact, neither is true. The target is determined by history (for the reasons you bring up), and the target stored inside the block header has to match the value determined by history.

At this point, there is no good reason for this anymore, and a design from scratch could IMO drop the nBits value from the header.

I don't know the original reason, but my guess is that it allowed for stronger contextless validation of block headers. Before version 0.10, Bitcoin Core did not use headers-first synchronization, and thus often did not have all parent headers available when a particular block was being received. Being able to verify that the block has valid PoW (even though the difficulty might be wrong) was a very valuable mechanism for preventing DoS attacks.


Is a peer connection maintained for the life of the node, or is it recreated on every request? Lets assume we have 2 bitcoin nodes, A and B. A is already up, and B is now coming up. B lists A as a peer node and attempts to establish a connection. A accepts, a handshake is completed and they confirm they are in sync. Is the connection then terminated until there is a need to communicate with each-other again (ie a new transaction is broadcast)? Or is the connection persisted for the life time of the application?

If it is persisted, what prevents a well known public node from being swarmed with peer requests?

Or is the connection persisted for the life time of the application?

Persistent. Subsequent messages will be transmitted across the same connection.

  If it is persisted, what prevents a well known public node from being swarmed with peer requests?

The Core implementation has a Connection Manager that increments the ban score for a peer if the peer behaves erroneously (e.g. spamming peer requests). Once a ban score of 100 has been accrued, the peer will be disconnected and banned from connecting until ban time window has been served.


If Bitcoin time value is 4 bytes, is that Unix time from 1970? I assume that when January 19, 2038  rolls around, there will be a plan for extending the time to more than four bytes.
 or is it the case that the four bytes are not UNIX time, or do not begin in 1970?

It is a Unix timestamp, but let me correct a minor detail:

The Y2.038 problem applies to a signed 32 bit number. The Bitcoin timestamp is unsigned, so it can represent the date for twice as long. Therefore, it will become a problem in 136.1 years, or in the year 2106.

Somewhen before then, there will need to be a hard fork.


Why is decentralized e-commerce good or better? All of the promotional materials (videos, papers, articles, etc.) on Bitcoin bill it as a decentralized solution for e-commerce/online financial exchanges that bypasses traditional banks, federal reserve, etc.

My question: why is this a good thing? Is it better, or just different? What shortcomings in traditional e-com are now solved by Bitcoin? Thanks in advance!

Stealing directly from Satoshi's original paper:

  Commerce on the Internet has come to rely almost exclusively on
  financial institutions serving as trusted third parties to process
  electronic payments. While the system works well enough for most
  transactions, it still suffers from the inherent weaknesses of the
  trust based model.  Completely non-reversible transactions are not
  really possible, since financial institutions cannot avoid mediating
  disputes. The cost of mediation increases transaction costs, limiting
  the minimum practical transaction size and cutting off the possibility
  for small casual transactions, and there is a broader cost in the loss
  of ability to make non-reversible payments for nonreversible services.
  With the possibility of reversal, the need for trust spreads.
  Merchants must be wary of their customers, hassling them for more
  information than they would otherwise need.  A certain percentage of
  fraud is accepted as unavoidable.

In other words, it's cheaper and safer to not to have to trust the other party, or to have to pay someone else to trust the other party.


How to join a mining pool? I'm running a Bitcoin node on my computer.
Can I configure it so I can join a mining pool?
If so, how to do this, or where can I find the documentation?

To join a mining pool go to their website and create an account. Connect the ASIC machines (which you already bought) to their server using the stratum link they give you.
The mining pool has its own bitcoin nodes which will be used for mining. There is no way to connect your node to the pool - they don't want to use it. Your bitcoin node is only used for your mining if you run your own pool.
Miners just do the work the pool asks them to do, without knowing which blocks they work on.
In theory miners could use their own bitcoin nodes for a couple things:

You could verify that the mining pool is mining on the longest public blockchain. If you detected that this is not the case then you could automatically switch to another pool. This would ensure that you never assist a pool in performing a 51% attack.
If the pool allows you to mine with getblocktemplate instead of the stratum protocol then you could control which transactions go into the blocks you mine (if the pool allows this). Your bitcoin node would give you transactions to put in the blocks.

But in practice noone is doing either of these things.


When was getheaders added? Bitcoin 0.10 uses getheaders to synchronize. How long has this message been supported by other clients? How many existing nodes support it?

How long has this message been supported by other clients?

It was added by Satoshi in Bitcoin v0.3.18 (released on december 8th, 2010)

  How many existing nodes support it?

All of them. It has been used by SPV clients for a long time to do fast synchronization without downloading all historical blocks.


Telegram ICO technical whitepaper - does it exist? Telegram provides a "marketing whitepaper" here:
http://ico-telegram.org/files/gram_whitepaper.pdf

The authors do refer to a technical whitepaper but I can't find it on their website. If it sounds like a scam, reads like a scam it is probably a scam?

There is a post on Reddit with TON Whitepaper uploaded to Google Disk.
The source is said to be TON telegram channel.


I bought Bit Coins while on a Bidding site. They were bought with my Credt card. How do I trace them? I bought Bit coins on a Bidding site that only used Bit Coins. I never used them. How can I find them?  This was almost 6 years ago. It was $10.00 worth and that bought 10 bitcoins... Thanks

You can go back and check your credit card records for the purchase.  That should at least give you a name of a company.  Contact that company (if they still exist), and see if they can give you access (assuming you lost your credentials).  If they can, and they were storing your bitcoin for you, then you can transfer it to a wallet you control.  If you already transferred then out when you bought them, but lost the key/password/data to your wallet...then you are just out of luck.


2-factor authentication key formats for Kraken and Bitstamp Does anyone know how to format the string that you type into the Google Authenticator app in order to generate 2FA codes for Kraken? For context, the following URL is highly relevant:—

https://github.com/google/google-authenticator/wiki/Key-Uri-Format

I accidentally deleted everything from my 'phone, so I had to re-install the Google Authenticator app. Unfortunately, my backup file just contains the secret component of each key, and I don't know the format for the rest of the string. For Poloniex, it's enough just to enter the secret while setting up the app, but other exchanges reject this minimalism. Presumably, they want something in the style of

otpauth://totp/BobsExchange:alice@example.com?secret=ABCDEFGHIJKLMN12&issuer=BobsExchange

…where I know that I'm Alice, that Bob owns the exchange and that my secret is ABCDEFGHIJKLMN12. What I don't know is the exact format.

Bonus marks if anyone can answer this question for Bitstamp as well as Kraken. Official support is likely to be overwhelmed during the present cryptocurrency boom.

EDIT: If you've got 2FA set up on your Android 'phone, it means that you have an sqlite database file on it somewhere, with the answer to my question. This page suggests that it's at /data/data/com.google.android.apps.authenticator2/databases/.

otpauth://totp/TOTPID?secret=XXXXXXXXXXXXXXXXXXXXXXXX&period=30
otpauth://totp/username@Bitstamp?secret=XXXXXXXXXXXXXXXX

Where for Kraken TOTPID tells what the TOTP secret is for. Example: "Kraken%20CZNY%20trade"


What Happened 12/30/17 Last Recieved Transaction into Bitcoin Core Wallet I have found a different receiving address within my wallet that is not mine... at least I did not create it. It seems to me that all of my transactions are now going to this new address instead of into my wallet. is there anything that I can do to recover these missing or stolen transactions?

In the debug log file on 1/1/18 I found that Bitcoin 12.0 was restarted and this shortly after, among other things:

InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1

Seems like someone got in and redirected my transactions. Am I paranoid or did I just get robbed?

I have found a different receiving address within my wallet that is not mine.

If it is in your wallet then by definition it is yours (unless you added it as a watch-only address which I doubt in this case).

It could be a change address, automatically generated by your wallet to receive change from another transaction you sent. Without more info it is hard to say though.

The -whitelistforcerelay=1 parameter is nothing to worry about, that only relates to the relay of blocks between peers and is nothing to do with your transactions or wallet.


error message : "com.googlebitcoin.core.ProtocolException:Peer does not have a copy of the block chain"? I sent a Bitcoin yesterday at 8pm using Hive and this morning an error message popped up

com.googlebitcoin.core.ProtocolException:Peer does not have a copy of the block chain

Does it normally take this long for the transaction?  It still appears as pending in Hive.

To make matters worse the transaction is not found on blockchain.info.

Can someone help figure this out?

ok, so this problem resolved itself. I think the main reason it occurred was because the transaction fee was to low.

So there should be more information out there regarding the fact if the fee is too low payment will get delayed by two whole days ?

or

Maybe it was because I held on to Hive on my desktop ?


Why can't they use super computers to mine all the bitcoins? I have very limited knowledge of bitcoin, but, I hope you don't mind my asking this question:

As I understand it, "mining bitcoin" requires "significant" computational prowess. A lot of dedicated mining rigs have been built out of FPGAs, ASICs and GPUs. But, I have always wondered: would it not be possible to mine ALL the bitcoins if you had access to some of the most powerful computers? So, for argument sake, if the NSA decided to stop snooping upon people and instead decided to, you know, mine bitcoins… would they be able to mine all the bitcoins in just a few hours if they redirected all their super-computational-power towards this one problem: mining bitcoins? Other potential candidates for this game include, but are not limited to: NASA, DoE, etc.

I realize that running a supercomputer to mine bitcoins may NOT be efficient (because a super computer consumes too much power, costs a lot of money, etc) but for a govt agency all that money comes from taxes so ...

Now, hypothetically, could "they" mine all the bitcoins in a few hours, or even in a few minutes if they redirected all their super-computational-power towards this one problem: mining bitcoins?

A supercomputer is way slower than mining with ASICs. A supercomputer only has much CPU power, not even GPU power and ASICs are way more powerfull than GPUs. ASICs represent the hashing algorithm as hardware which means they can't do anything else, that's why they are so fast.

At http://bitcoinwatch.com/ you can see the current network hashrate in PetaFLOPS, which is 1534782.24 at the moment. Currently the fastes Supercomputer Tianhe-2 has 33.86 petaFLOPS.

  but for a govt agency all that money comes from taxes so ...

If they would use all the money to buy ASICs and start mining bitcoins, it still would not be enough because of the difficulty factor. But they would be able to get a lot of blocks because the difficulty only changes every 2016 blocks.


What does the 'Estimated BTC Transacted' value mean on blockchain.org? After reading this question on how it is calculated, I was wondering what it means.

What does the 'Estimated BTC Transacted' number on blockchain.org refer to? What does it mean?

From Blockchain.info:

  The total estimated value of transactions on the Bitcoin blockchain (does not include coins returned to sender as change).

The salient point in the above description is "does not include coins returned to sender as change".  Since there is no reliable way to definitively know what outputs are change outputs, there is no way to be 100% certain of the actual volume of BTC transacted.  Blockchain.info makes educated guesses about the likely change outputs, which it deducts from the total transacted to obtain the estimated BTC transacted value.

For instance, if you look at this transaction, you can see a single input of 0.565975 BTC, with two outputs, one for 0.00145 BTC and one for 0.56 BTC.  While it seems reasonable to assume the transaction "spent" 0.56 BTC, with "change" of 0.00145 BTC, it may very well be the other way around.  In fact, blockchain.info believes the 0.00145 BTC is the actual transaction amount, with 0.56 BTC being the change amount.


How do Golomb Coded Sets work? From my understanding Golomb coded sets are a probabilistic data structure that encodes the deltas of an order set of elements.

With things like txids, which are evenly distributed, Golomb coded sets are an efficient way to encode things inside of a block.

What is the ordering used to determine how txids are encoded in the set? It seems we need a base txid, and then compute deltas from that original txid? Is it just as simple as the lowest big endian numeric interpretation of a txid in a block?

The data-structure is encoding a set which means it is not encoding an order.

If you draw numbers uniformly at random from some universe then sort the result (thus destroying the order information), the differences between the numbers follow an exponential distribution. The GCS uses a golomb coder to efficiently store these differences. The sort method used is irrelevant so long as its consistent with the differencing method used.

There is nothing probabilistic about the set encoding itself. But for BIP158 the set being encoded is not TXIDs but short hashes of relevant outputs. Because the hashes are short they can have collisions, making the result probabilistic.


How do I recover from a cryptocurrency scam? I lost about $45,000 to crypto investment scam just recently. The
company posed as an investment company that could deliver a certain
percentage in returns if you deposit your Bitcoin with them. At first, it
seemed real, it worked twice. I didn't realize they set up a bot(robot)
that will completely shutdown your account after you have decided to invest
high. I suddenly couldn’t access my profile, I complained to the admin, he
gave a excuses that they had a downtime and needed to upgrade their
website, this took over 2 months. Within that period,I begin to suspect i
have been scammed. I contacted my bank to see if they could do anything about this situation, they couldn’t. Local police say it’s impossible to get my money back.

Can anyone help me ? This has made me really frustrated as I invested all my savings.

How do I recover from a cryptocurrency scam?

You don't. At least, you don't recover your money. I guess you recover by learning from the mistake and doing things more safely in future. It may be worth asking an accountant if the financial loss on your investment can be offset against other taxable income.

  I contacted my bank to see if they could do anything about this situation

The whole point of cryptocurrencies is to take control away from banks.

  Local police say it’s impossible to get my money back.

True. for any loss less than $100000 the police are likely to only hand out advice. It isn't worth their while to try and investigate most cases where people willingly give their own money to unknown people in faraway countries. Foreign police forces often just ignore any requests for help in such matters.

Although there's nothing I can find in the writings of Satoshi Nakamoto about law enforcement and Bitcoin, the blockchain is deliberately designed to promote privacy and an effect of this is to make it harder for police to investigate Bitcoin related crime. It is obvious that privacy was important to the designers of Bitcoin.

  Can anyone help me ?

No.

However plenty of scammers will offer to help you. Ignore them.

  This has made me really frustrated as I invested all my savings.

This is understandable. Sorry for your loss, I hope you are able to put this behind you and move on.


Why won't my bitcoin miner detect any of my hardware? I recently set up a bitcoin miner on my gaming pc just to test it out and I can't seem to get it working. I am using bfgminer on Ubuntu and when I start it up it says this:

NO DEVICES FOUND: Press 'M' and '+' to add

I have tried pressing M and + and then selecting auto but it still gives me that message, I have also tried selecting all and the same thing happens.

my computer:

Processor: 8x AMD FX(tm)-8320 Eight-Core Processor

Memory: 8074MB (1255MB used)

Graphics: Sapphire HD, ATi radeon 4800

Operating System: Ubuntu 14.04.1 LTS

According to the release notes, current versions of bfgminer only support FPGA and ASIC mining hardware out of the box. It  sounds like you don't have any such devices.

CPU and GPU mining are not enabled by default, since they are not economically viable. See the files README.CPU and README.GPU for information about how to enable them if you really want to.


What makes blockchain technology so attractive to non cryptocurrency applications? I have often seen articles claiming bitcoin's demise is iminent but yet others state the blockchain technology that powers it is being considered for other uses. What features make it attractive for those purposes versus alternatives?

There are two basic categories of applications for the type of distributed ledger technology behind Bitcoin.

The first category are public systems like Bitcoin, Ethereum, and Ripple. These are systems with no central authority that provide open access to the world. The blockchain technology ensures eventual agreement on the state of the system so that changes in that state (whether they represent payments or something else) can be agreed upon. Anyone can participate in these networks so long as they follow the rules, with the rules being enforced by the software ignoring people who violate those rules.

The second category are private/permissioned systems. These are systems that don't require a central authority for their day-to-day operation. They are generally run by a group of interested parties which formally manages group membership. The blockchain technology gives them data replication. Byzantine fault tolerance (protection even if some of the participants are malicious), and eventual (typically very rapid) agreement on the state of the network. The cryptography also ensures that the past is tamperproof and provable.


Does Decentralized Cryptocurrency Exchange work for Bitcoin? I know ETH works because it has a smart contract feature, what about Bitcoin?

Yes, bitcoin have a simple but working scripting language so why not ? The most famous one is Bisq


Why does the standard Bitcoin client not display the balance per address? Any Bitcoin wallet holds several bitcoin addresses. Such addresses are either generated manually from the GUI addressbook or automatically collecting the "change" of a "Send" transaction. The total balance is the sum of the credit of all addresses.

Why does the Bitcoin software not tell me ADDRESS1 holds 1 BTC while ADDRESS2 has 5BTC?

The standard Bitcoin client automatically selects an address to send from. (From the comments, I learned that there exits a patch, which allows a user to choose an address to sent from.)

Does the behaviour of the standard client described here have any advantages over letting the user choose?

The balance of an address is almost always useless, since money is sent from random addresses.


Bitmain Antminer U3 keeps going Zombie I got 2 U3 running on Linux Ubuntu cgminer 4.9.0.

Dedicated Power Supply
New short USB cables
Cold room ambient 5 degrees celcius (heat sinks don't go over 40 degrees)

Not once have I managed to run them longer than 24 hours. Does anybody know why they keep going ZOMBIE?

Once they go ZOMBIE like this they are not detected by cgminer and sometimes show in lsusb but not always. The only way to fix this is to remove USB cable and Power, restart cgminer, then plug power back in and USB.

This is a known and notable problem with Antminer U3s.  It's discussed at various locations around the Web.

The design couples the USB and miner +5V power rails, which is not good practice.  USB interfaces should be both electrically and optically isolated.  When a unit goes ZOMBIE, it generally requires unplugging and replugging to restart it, which fits with the above.  Some commenters claim that cutting the power lines in the USB cables improves reliability.

However, the maintainer of cgminer comes right out and says that the design is inherently unstable.  In light of my own experience I agree.  I ran three Jalapenos on a dedicated Pogoplug linux system for a year with no problems.  Two U3s have been on the same Pogoplug for two weeks now, and neither has run for 24 hours straight.  They're going back to the seller tomorrow.

Long and short of it, if you get a stable unit it will serve you well.  But most of them are unstable to at least some degree.


Are there advantages to having more than one private key per wallet? Suppose I was to design a bitcoin client that supports the ability to have multiple wallets (i.e. multiple users).

Is it safe to assume that each wallet is identified by one private key?

Is there a disadvantage (from a privacy/anonymity aspect) to having only one private key per wallet?

Are there any advantages to having more than one private key per wallet? If so, what are they?

EDIT

I was under the impression that a private key can generate many many public keys, that's why I asked the question. Given that a private key will only generate one public key, the question becomes meaningless and it becomes obvious that each account should have lots of private keys (without limit).

Well, you don't really want one private key per wallet, you want one private key per transaction (and this is what the default client does anyway).

But you may want to have more than one wallet, because otherwise you might be mixing "accounts" that you want to keep separate: If a single transaction output is not enough for a given payment, the default client will use multiple, and that way your otherwise unrelated "accounts" become connected.


Example of data that is hashed in the merkle tree for a transaction So I am reading this (excellent resource) on the Bitcoin merkle tree for a transaction.

  The merkle tree is constructed bottom-up. In the following example, we start with four transactions, A, B, C, and D, which form the leaves of the merkle tree, as shown in Calculating the nodes in a merkle tree. The transactions are not stored in the merkle tree; rather, their data is hashed and the resulting hash is stored in each leaf node as HA, HB, HC, and HD:

HA = SHA256(SHA256(Transaction A))

  Consecutive pairs of leaf nodes are then summarized in a parent node, by concatenating the two hashes and hashing them together. For example, to construct the parent node HAB, the two 32-byte hashes of the children are concatenated to create a 64-byte string. That string is then double-hashed to produce the parent node’s hash:

HAB = SHA256(SHA256(HA + HB))

  The process continues until there is only one node at the top, the node known as the merkle root. That 32-byte hash is stored in the block header and summarizes all the data in all four transactions.

That makes sense, but I have a few questions. First is how the Transaction like Transaction A is hashed, and what is included in a transaction in practice. For example, if it's a JSON object stringified, or a byteArray in JavaScript, or if data must be in a specific format, etc.. I would like to see for example how a record would be hashed, like { a: 'foo', b: 'bar', c: 123, ... } or something like that.

Second is, if this is where the idea of the Patricia Merkle Tree (or perhaps even Merkle DAG, which I have seen somewhere) comes in, to shorten the amount of stuff you have to store in memory because the hashes don't completely overlap and so would have a lot of empty tree nodes.

Finally, what an example set of transactions would look like in a single block where they say on average they have 1900 transactions. This would be a pretty deep merkle tree, and I would like to see what the transactions are actually called and some more info on their data structure. For example, if they go all the way down to the ISA (Instruction Set Architecture) operations, or they are much higher level. That's basically all I'd like to know. I didn't see that in the book linked to above yet, but will take a closer look.

1) Transactions don't contain merkle hashes. Pre-SegWit transactions' hashes are calculated by serializing the transaction (you can search for "the hex format"), and then hashing the byte array. After SegWit, signatures are excluded from transaction hashes.

2) (I can't understand what you're asking for)

3) 1900 transactions is not so deep. The height can be calculated by ceil(log_2(number_of_tx))+1. Plug in 1900, and the height is 12. If you want to learn how merkle trees could be used for ISA, I'd suggest searching for MAST. It allows hiding the unexecuted parts of Script.


How is IOTA's Tangle different than classical blockchains? How is IOTA's Tangle different than classical blockchains? What are the main differences and how do they translate to real world usage? What are the strengths and weaknesses of the Tangle?

Bitcoin is based on a Blockchain approach, meaning we build a chain of blocks, each referencing the previous block. For the creation of each block, a Proof of Work (PoW) needs to be done by miners. These blocks are a means to reach consensus which transactions have taken place and can be considered safe (e.g. 6 blocks)

IOTA is based on a Distributed Acyclical Graph (DAG) approach, which they call the "Tangle". No more blocks, no more mining, instead when you broadcast a transaction, you first need to do PoW validating two previous transactions. You "attach" your transaction to those two previous transactions (see image)

The consensus about a valid transaction is not reached by number of blocks, but applying the socalled Random Walk Monte Carlo Algorithm. More details can be found here: https://forum.iota.org/t/iota-consensus-masterclass/1193
In short: your transaction is considered valid (green in the image) if you can reach it from every unconfirmed transaction (grey).

Since there is no necessity for blocks, there is no issue with the block size (see scaling debate). The theory - which remains to be practically proven - is that a DAG can hypothetically scale infinitely and that a greated number of transactions actually makes the network faster, since a transaction means confirmations.

For more info, I recommend the following videos:
https://www.youtube.com/watch?v=UwEp5cexTJE&t=251s
https://www.youtube.com/watch?v=MsaPA3U4ung&t=3s


Am I screwed? Transferred USDT from Polinex to USD dollars in Coinbase and now it's gone I've seen others post where they transferred their USDT to a bitcoin address and it got lost.  I specifically clicked on my USD instead of BTC and it provided me with an address to send it to.  However, the same thing happened where it says it's pending and only .0000273 getting transferred.  I transferred a decent chunk of change.

So here's where it's interesting, if I going to omnichannel and type in the address where the USDT was sent, it shows the full amount still available.  I know it's there and the omni wallet shows it but it doesn't let me get access to it.  If I try to import a private key and add an address on to my omniwallet, it let's me put in the TXID associated with the transaction but pulls up zero as the balance.

Any ideas or options out there?  I know the amount is still out there but I can't seem to get it.  I've heard something about importing private keys but I don't know how to find it.  Or am I just plain ole screwed and will have to learn my lesson.  Thanks for the help.

You do not have access to your Private keys on coinbase, as it is considered a custodial wallet, which means only they have access to it. I highly doubt they would give you these private keys as its not standard practice. You only option is to email support. I doubt they would care. Another option is to ask someone inside coinbase to help you, but you'll need connections to do that I imagine.


How to find the shortest unused FirstBits? I am interested in generating a bitcoin address with the shortest possible FirstBits. By random trial and error I found that 1ijj1 is untaken. Is there a way to find the shortest possible untaken FirstBits? (So I can generate it using vanitygen)

Yes there is a solution, it is brute-force. Make a loop and add variable characters, test them one by one. Start with one variable characters, try all combinations, add another variable character, try all combinations, rinse, repeat until you find unused firstbits.


Why does `connect` perform worse than `addnode` for synchronization? I've manually set many nodes in my bitcoin.conf file via the connect= property.

I can see that, when run, bitcoind connects to most of these nodes successfully.

However, I never see any blocks being downloaded.  I can only get blocks downloading if I either change the connect= properties to addnode=, or remove the connect= properties altogether.

Does anyone know why this is the case?

If you use connect your bitcoind will exclusively connect to the nodes that you have specified in conjunction with connect.

When you use addnode your bitcoind will preferably connect to the specified nodes, but will also announce itself to other peers that are connected to them and try to make more connections.

The nodes that you had specified with connect might have been overloaded and therefore hadn't sent any data or even didn't accept the connection request. On the other hand, using addnode might have allowed your daemon to find additional peers that have seeded the data instead.


If I was developing a Bitcoin wallet, should I support both legacy and compatibility addresses? To receive funds, I was thinking of giving a user the option of displaying two QR codes:

Legacy - p2phk e.g. 1AKDDsfTh8uY4X3ppy1m7jw1fVMBSMkzjP
Compatibility - p2sh(p2wpkh) e.g. 34nSkinWC9rDDJiUY438qQN1JHmGqBHGW7

Is it safe to only give them the option of receiving to a "compatibility" address?

Displaying two would be justified if you were asking about a BC1 p2wpkh vs a 3xxx p2sh(p2wpkh) because not everything supports BC1 but its pretty good to use when supported.

Displaying two isn't useful between p2pkh/p2sh as you've asked about because p2sh is supported everywhere and many wallets and services have used p2sh exclusively for a long time.

Supporting plain p2pkh is not something I'd recommend a new wallet bother doing. That development and testing effort would better be spent on newer functionality.