How much should I charge a client if they pay me in bitcoins?

For the scenario of a retail or ecommerce purchase, one approach is to have an expiration on the price quotes.  For example, when a merchant uses BitPay, the invoice is good for 15 minutes.  If the funds aren't received, then the payment is recalculated as-of the time it arrives and if it overpaid, the customer gets a refund and if it was underpaid the customer has to send more funds.

Also, you can pad the exchange rate to your favor a little so that while some transactions lose value because of a change in the exchange rate, others will be in your favor but when you net it (overall gains minus losses) it ends up about a wash or a small gain.

Coming up with the pad amount can be aided by using a calculation that looks at recent volatility.

As far as contractors, you would want to contract that in advance.  So if both parties agree to a contract at a certain rate quoted in BTCs, then that is the agreed upon rate that is paid.

For salaries, you probably want to establish that in terms of fiat, and only after withholding for taxes and other deductions only them convert the net check amount into bitcoins at the prevailing rate at the time.

A company that has BTC-denominated contracts may want to hedge against exchange rate risk by either acquiring sufficient coins in advance, or using derivatives (e.g., CALL options or futures contracts).


Can I develop an API which will accept bitcoins and regular currency using existing API's such as coinbase and stripe?

tl;dr It could be done, but doesn't seem to be incredibly useful as there are already systems that already do this, combined multiple payment methods into one easy to use system/API. (e.g. WooCommerce)

I don't know much about Ruby or Stripe, but the blockchain API is pretty easy to use and has some fairly decent docs. (API Docs) It just requires you to open the web page it specifies using a simple get request which will return a JSON string. Just unencode it and all of the informations is right there. It only requires one call to create the address to give the user. It will forward the bitcoin to the bitcoin account of your choosing. It will also send a callback to your URL of choice which will tell you when they send a payment. Make sure you don't send the user anything until the payment has at least one callback to prevent double spends. Six is the recommended number for high value payments.

I guess you could make an API of sorts where you specify what kind of payment method the user chooses then having it respond with just a single callback that would alert you when the payment complete was what ever the payment method. Which would have the benefit of the merchant using your API only needing to know your API instead of every API. However WooCommerce and other ecommerce tools acomplish this by allowing you to use multiple payment methods. For example you could use WooCommerce with their default credit card payment method in conjution with my Bitcoin payment method.


How to add additional information to transaction?

Note that you should only do this, putting extra data into the block chain, if it is really necessary. The block chain has to be stored by every full node, so try not to take up all our hard drive space with unnecessary stuff whenever possible.

With that said, if you do want to add extra data to your transaction, then add an additional output to the transaction, for which the scriptPubKey has the following form:

OP_RETURN {80 bytes of whatever data you want}

This transaction output is automatically un-spendable, and so will not be kept in the UTXO set. The other UTXOs from your transaction will still be safe.

For more info:

https://bitcointalk.org/index.php?topic=414886.0
https://bitcoinfoundation.org/2013/10/core-development-update-5/

This will embed extra information into your transaction. Be aware, though, that the software that made the transaction and the software that reads the transaction have to be compatible in order for the user to be able to read the given information when the transaction is received.

You can see an example of a transaction that used OP_RETURN to encode extra information here: https://blockchain.info/tx/6dfb16dd580698242bcfd8e433d557ed8c642272a368894de27292a8844a4e75?show_adv=true.


bitcoin node take transactions fee and validate them

Transaction fees are paid to the miner that includes that transaction in their block. Nodes do not earn transaction fees (or any other fees) for validating transactions.
You can reduce fees by using segwit inputs, and by waiting for periods when the mempool is relatively empty.


What is the collective name for Bitcoin, Namecoin, etc?

distributed digital currency, or distributed digital crypto-currency. the "distributed" bit is a key issue - anyone can make a centralized digital currency, even with crypto thrown in.


The short answer is no.

Each exchange that deals in bitcoins has it's own pricing, there is no single exchange from which to draw data.

The exchanges may or may not have have an api to access their pricing history with, you would need to check that exchange to see.

https://btc-e.com/api/documentation is one such exchange, but they don't appear to have their trade history available, for example.


Why new public key for every new request?

The reason is privacy.

If you reuse the same key for every transaction, everyone who ever transacts with you can infer your entire balance.

No, public keys should not be identities, exactly because the transactions to them are public too. Your ability to create many pseudonyms in the system the only way through which it has any privacy. By reusing addresses you hurt your privacy, but also that of others who interact with you.


How to get _integer_ satoshi values from JSON RPC?

bitcoind internally treats all amounts as an integer and only displays the value as a decimal for the RPC. Formatting for display does not introduce any floating point precision issues as it still just does integer conversion with some string formatting to make it look like a decimal. So it is perfectly safe to multiply by 100000000 to get an integer amount of satoshis.


Explain Coinomi and Edge fee difference?

Given that you are looking at two different wallets on two different pieces of software, the transactions that the wallets are proposing are different:

they may be using a different count of inputs
one may be using segwit inputs while the other uses non-segwit
one might be a multisig wallet while the other is single-sig
one of them might be able to avoid a change output, while the other doesn't

This will cause the two transactions to have a differing size. Lastly, the two wallets may be using different price sources to translate it to dollars.

As the transactions' priority is determined by their fee rate, both of these transactions are equivalently prioritized at 200 sat/B. The size difference is unlikely to make a big difference for block inclusion.


If there is a need for them, additional decimal places can be added with concensus of the network. This is why some refer to "infinite" divisibility, because we can select the level that we need as time goes on.

The current level selected in the code (by Satoshi) is 8 decimal places (1 satoshi = 0.00000001 BTC) hence the nickname for the smallest unit currently possible for bitcoin today.

As a thought exercise, if a consensus of the network (miners, but also clients and server applications for compatibility reasons) decides to update to a version of the protocol that includes 16 decimal places inspired by your post, we could end up with a new base unit (1 satoshi = 100,000,000 gracchi) as well as nanobitcoins (nBTC), picobitcoins (pBTC), and even femtobitcoins (fBTC, 10 gracchi)

I have trouble imagining the need for such a thing, unless destroying bitcoin becomes a prevalent method of use. If it is needed the potential is there and will never dilute your held bitcoins, which actually makes it a problem some would love to see the need to solve.


Is there a rpc/cli method for payment protocol in bitcoin-core?

The payment protocol is only usable from the GUI (i.e. bitcoin-qt). It is supposed to be an interactive protocol so you cannot use it from the command line which is non-interactive (in the sense that you issue commands and get a response back instead of issue command and interact within the context of that command).


You can't do internal transfers within Kraken, but you can create a deposit address and send it to your relative. Then your relative can withdraw their money in Kraken to the address you provided. Make sure it's the same cryptocurrency! Hope that helps :)


How many confirmations does bitpay wait?

The number of Bitcoin network confirmations required for a particular transaction to be considered complete is determined by the BitPay account holder on a transaction-by-transaction basis.

Entities set the Risk/Speed of a transaction to "Low" (6 confirmations), "Medium" (3 confirmations), or "high" (1 confirmation) via the API when an invoice is created. The entity's default Risk/Speed setting for new transactions can also be changed in the merchant's settings after logging in.

For clarity, due to the way in which the Bitcoin network secures transactions, "speed" correlates directly with "risk" in that the entity is taking a (relatively) high risk by only waiting for a single confirmation before releasing the product or service. The entity can decrease its risk that the payment will become invalid by waiting for further confirmations that the rest of the network accepts the transaction. This is a choice the bitcoin acceptor must make, weighing the risk of losing the payment vs keeping the buyer happy (by giving him/her the product faster).


How can I determine the address from a private key?

Both "1LoVG.." and the other one are valid legacy (1...) addresses made using the same private key. They are different since one of them uses the compressed public key (you might want to look this up) while 1GAehh7 uses the uncompressed public key. Always use the same compress-format for an address, and it's advisable to create new addresses in compressed format since it saves bytes and transaction fees.
To make the uncompressed-public-keyed address (compressed is the default in BitcoinJ):
ECKey key = ECKey.fromPrivate(privkey);
key = key.decompress();
String address = LegacyAddress.fromKey(params, key).toString();


Begin by asking your local tax authority.
They would be the ones able to give you a proper definitive answer.


Sorry, I think I have found how to calculate transaction fee.
So we have to subtract sum of out values from inputs.prev_out.value.


Yes, for most people it is an easier option to obtain bitcoins through an exchange (or a private trade perhaps) than through mining.

The current market price of Bitcoin is essentially based on a balance between 2 outcomes:

the anticipated probability of Bitcoin becoming completely worthless in future (eg if the encryption failed, or maybe if multiple countries outlawed it)
the anticipated probability of Bitcoin becoming far more popular (and more highly valued) than it is now

The first outcome would probably lead to a price of around zero, and the second outcome could lead to a very high price.

No matter what you believe, Bitcoin is dependent on many factors beyond the control of an individual.

If you hold on to bitcoins, you're essentially hoping for outcome number two.


Has there ever been a successful double spend attack on the Bitcoin network? If not, is it really necessary to wait for confirmations?

For what it's worth, MyBitcoin.com claimed that their closure was precipitated by a series of double-spend attacks:

  Our programmer was under the assumption that one block was good enough
  to secure a transaction. Two years ago when the software was written,
  this single confirm myth was a popular belief.

User theymos (an administrator of the bitcointalk.org forums) had publicly warned them that accepting transactions after a single confirmation was "insane."

However, there is no way to verify whether or not any double-spend attacks have actually taken place because to my knowledge no one is currently scanning for them on the network (doublespent transactions are normally discarded after the event is resolved to the satisfaction of the block-chain).  All we can observe publicly are block-chain reorganisations which also naturally occur from time to time when blocks are found near-simultaneously by different miners or pools.  Perhaps a statistical argument could estimate how often these should be occurring (we've had 14 in the past month) and argue for the existence of double-spend attempts on that basis, but I've not personally seen such an analysis.

Most critically to your question about whether or not to wait for confirmation, however, is the fact that you have missed a possible attack vector, known as a "Finney Attack" after Hal Finney who identified it.  In a Finney Attack, a miner includes one "double" of the two transactions in their own blocks while mining, but does not broadcast it to the network.  When they eventually find a block, they purchase something with a conflicting transaction (the second "double" in the double-spend attack), and then immediately broadcast their block, which will invalidate the purchasing transaction in the blockchain.  If the merchant hasn't waited for confirmation, the attacker would walk away with both the purchased item (hopefully something cashlike) and their original bitcoins.

Since this situation and its variants apply largely to merchants who offer 'on-demand' items delivered instantly, your analysis of "everyday users transferring small amounts of bitcoins" remains roughly correct.  Keep in mind that if accepting 0-confirmation transactions became the norm, the incentive for the "send them simultaneously" attack would rise significantly (requiring even one confirmation prevents this in the vast majority of cases).  But for the time being, regular users should be more worried about regular old "you-pay-first" fraud on non-escrowed transactions, and man-in-the-middle attacks where an interlocutor passes messages between two trusted parties looking to do business, then walks away with the cash while they both yell that the other person is scamming them (this attack has been executed in the wild).

tl;dr Merchants and exchanges definitely need to wait for confirmations any time transactions are of significant value and/or in exchange for cashlike goods.  Individuals transferring small amounts need to be more worried about other aspects of trust in the exchange, and can protect themselves quite effectively with just a single confirmation.


I'm in the UK, how to fund my account at mtgox?

I did a bank account thing with Blockchain.info. Assuming you have a UK bank account you shouldn't have a problem.


Here is a quite detailed Litecoin mining performance collection for different hardwares.

https://litecoin.info/Mining_hardware_comparison


How can I use Ripple to accept Bitcoin, USD, and other currencies on my site?

You may also be interested in an answer to "How to accept payments via Ripple on a website".

It depends on if it makes sense to you to price your product or service in Bitcoin or in some other currency. For example, if your costs and profit margins are based in EUR then it makes sense to set your price in EUR (even if you'll later turn that into bitcoin). No matter what units/currency you denominate your price in, with Ripple people can pay using whatever assets they hold which Ripple can find a payment path for.

Assuming you want to set your price in bitcoin and end up with bitcoin in your private bitcoin wallet you could do something like the following:

Create a Ripple address
Chose one (or more) of the Ripple gateways that support bitcoin. You're looking for one that you trust to (temporarily) hold your bitcoin for you, that has low (or zero) fees, that has good liquidity, etc. Add trust lines to in BTC to that gateway for an amount that you are comfortable with (or to multiple gateways in various amounts).
Use Ripple URIs on your site to help customers initiate Ripple payments with their client. The customer will then be given the option to pay with any of their assets for which paths exist.
Periodically use the bitcoin bridge or withdraw via your Ripple gateway to get your BTC Ripple balance as bitcoin into your bitcoin wallet.

Alternatively you could use a service such as DividendRippler to attach a Bitcoin address to a Ripple address. Using DividendRippler you can generate a Ripple payment URI that sends BTC to their Ripple address with a destination tag generated for you and DividendRipple then forwards recieved BTC onto the blockchain to the address you've provided.


What is signed is a simplified version of the transaction (replacing the scriptSig, since that is what we are creating). There is a lot here so hopefully I covered it all:

 * `version` (4 Bytes) - Transaction format version
 * `flag` (2 Byte Array) - Optional flag, if present, must be 0001, which indicates there is witness data in this transaction
 * `input counter` (Variable Length) - Number of inputs in the transaction represented by a Variable Length Integer.
 * `inputs` (based on Input Counter) - List of all transaction inputs which will be spent and which reference unspent transaction outputs from previous transactions.
 * `output counter` (Variable Length) - Number of outputs in the transaction represented by a Variable Length Integer.
 * `outputs` (based on Output Counter) - List of all transaction outputs where the coins will be sent and which will become unspent transaction outputs to be spent in future transactions.
 * `scriptsig` (variable) - First, a one-byte varint which denotes the length of the scriptSig, then it is temporarily filled with the scriptPubKey of the output we want to redeem.
 * sequence number (4 Bytes) - Used as a relative lock time if transaction version is >= 2. See BIP68.
 * one-byte varint containing the number of outputs in our new transaction
 * 8-byte field (64 bit integer) containing the amount we want to redeem from the specified output (in satoshis)
 * one-byte varint denoting the length of the output script
 * output script
 * `locktime` (4 Bytes) - If non-zero and sequence numbers are < `ffffffff`: it represents either the block height or timestamp when transaction is final.
 * four-byte "hash code type" (1 in our case): 01000000 see [Sighash types][1]

Then, double-SHA256 hash this entire structure and the hash is what is signed. For an example, see https://bitcoin.stackexchange.com/a/5241/60443


Are transit fees supposed to be common in Ripple?

For now, gateways are using transit fees as their primary revenue source. Bitstamp currently charges 0.2% and that's pretty typical.

We hope that those fees will go down over time for two reasons. First, competition and increased volume should bring the fees down. Second, when interest rates start to rise to more historically normal levels, gateways can use the interest on money they hold as a revenue source.

We've been asked to have a "transit fee cap" so a single transaction can't have a transit fee above a limit regardless of transaction size. And we've been asked to have a "fee exempt" flag so gateways can exempt particular accounts from paying transaction fees (perhaps in exchange for a monthly fee). These changes are under active consideration. For technical reasons, they're not as easy to implement as they might seem.


Is it possible to send Bitcoin without the passphrase to the wallet?

No, you need the password to spend any money in the wallet.
The keys are encrypted with the password you provided.


Anonymity:

Every transaction ever made in Bitcoin is public. You can see the most recent here:
https://blockexplorer.com/

What makes it anonymous, is that you may not know who owns which account number (Bitcoin address). If Privateinternetaccess picks a new receiving address for every transaction, it's very difficult for an outside person to see who is receiving your bitcoins.

Also, there are 'mixer' services which will send on the correct amount to an address, but maybe not use the same coins, so there's no visible link. blockchain.info has such a 'mixer' service.

Buying Bitcoin outside of US:

This question pops up a lot, so I'm making a site right now to show how to buy bitcoins from each country:
http://howtobuybitcoins.info/

Feel free to throw me any questions you have.


Posting my comment as an answer

Make sure your client is up to date... it's possible your wallet in the old testnet got coins that is separate than the more modern testnet3.

Each version of bitcoind has the possibility of being associated with a different test network.  It would be interesting to see if there was a matrix listing releases against test networks (and why the new network was created).

I assume that it's possible to launch older versions of bitcoind and see each testnet independently of each other, but that independence means that there is no way to transfer coins from one network to the other.  (It is test after all, and hopefully one didn't pay for those coins)


What is the difference between ripple blockchain and bitcoin exchange?

XRP runs on an internal blockchain. There are no public blocks/ transactions, but rather everything is done P2P.

They do however track alot more client/user information.

They do not use PoW, neither do i think that you can call the system that they use PoS.(As there is no direct reward eg staking, all transaction fees are BURNED.).

There's no hashpower involved in confirming ripple transactions, every simple node can do it, which means almost every transaction is instant.

Which means there's also no block reward. Every XRP has been generated by Ripple Labs, 100 Million is the maximum amount that can be generated, and there's a dev fund of ~20 million.


Good documentation on starting bitcoind and bitcoin-cli after building them on Ubuntu Bionic

Start with the infamous bitcoin.conf which doesn't exist and nobody knows exactly how it should come into existence.

Well, I know.

It should come into existence by you creating it with a text editor in your datadir directory, if you wish to do so.  It's completely optional.  If there are command line options you want to use every time without having to specify them (such as -txindex=1), you can put them into bitcoin.conf.  If you're happy continuing to give them on the command line, then there is no need for bitcoin.conf to exist at all.

And now you know too.

As for your other issue, if you use getblockchaininfo instead of getinfo, you'll get more detailed information.  Current versions of Bitcoin Core try to download block headers before getting the blocks themselves.  You'll see a headers field in getblockchaininfo which perhaps will be increasing.

Otherwise, any and all diagnostic information would be in a file called debug.log in your datadir directory.  Look at that file.  If it isn't self-explanatory, then you can post the last several lines of it in a question here, or to your other favorite Bitcoin support forum.


What are the downsides of Hodl Invoices?

I didn't attend the conference but here is my take on Hodl invoices. In a normal Lightning payment, the sender pays an invoice which contains the payment hash and the payee releases the pre-image to that payment hash for the successful resolution of the payment. In a hodl invoice the sender pays an invoice to the receiver, but the receiver does not release the pre-image instantly. Instead it waits for other conditions to be satisfied for the payment to be released. To cite an example, let us say you are in an apparel shop and you did not find a T-shirt of your size. The owner tells you that they need to check in their inventory to see if the item is available and they will courier it to you if it is available. But for they ask you to pay in advance. In this case, you pay the invoice, but the shop owner will only release the pre-image if the item is available.

This can possibly create some routing issues. Since hodl payments are identical to normal payments, intermediate nodes cannot tell the difference. So, by forwarding hodl payments the intermediate nodes are locking in their liquidity in invoices that will take long time to settle, thus hindering their ability to route more payments. Even if the amount is small, Lightning implementation allows only 483 concurrent HTLC payments to conform with the standard transaction size, which will take up the transaction number space. Although this might not be an issue now, but as Lightning gets more adoption it might have he potential to squeeze the liquidity out of the network.

Another issue that I see is that if the receiver does not cancel the payment or send the pre-image within the min_final_cltv_expiry, than the penultimate node will force close the channel with the receiver through an on-chain settlement. If the penultimate node had opened the channel, then under the current specs, it is liable to pay the fees associated with it (including the HTLCs). Moreover, with hodl invoices you are trusting the receiver to do the right thing in terms of releasing the pre-image or not, based on other physical/virtual conditions.


2-factor authentication key formats for Kraken and Bitstamp

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"


Does a private key always generate the same public key and address?

The difference is that the first function uses uncompressed public keys , and the second function uses compressed public keys. Uncompressed public keys are 65 bytes , and compressed ones are 33 bytes.

For more information on compressed public keys see: What is a compressed Bitcoin key?


Any Tutorial to send Bitcoin from Copay to Trezor?

Find (one of) your Trezor address(es). Open this menu on your computer:

You can read the details here: https://doc.satoshilabs.com/trezor-user/receivingpayments.html

Open CoPay wallet, press "Scan" at the bottom. Scan the QR code shown on your computer.

Choose "Send payment to this address"

It should be easy from now on.


How to find a BTC/BCC mining node with modified software?

Looks like the BCC has been claimed. As for the BTC, you are not asking a question about the protocol or the software, you are looking for a person controlling mining equipment, and that question is better suited to https://bitcointalk.org than to this site.


Why is the winner of Pow different everytime?

Because each miner may select the transactions (and the order in which they are included) in each block. Also, they do not all start on the same exact nonce, in fact they are changing more than just the nonce in many cases (e.g. block versions - see ASIC BOOST).

This means that they are not all performing the HASH256 (proof of work algorithm) on the exact same data, so the outcome is random. However, more powerful computers can perform more hashes per second, so they will find a solution on average, more often than a less powerful computer. These computers, by the way, are specialized hardware called miners, not general purpose computers.


Is there such thing as paying a "tax" or "task" on non-spendable bitcoin in a blockchain wallet in order to get the private key?

This is a common scam.

If you don't have the private key to begin with, you have no bitcoin whatsoever, and never had any.

Stop talking to whomever is claiming this, and accept your loss.


When bitcoin forks, how do they decide which fork gets the original name?

One might think that the network maintaining the same consensus rules would be considered the original, and the project introducing a consensus rule change and thus creating a new network would be considered the derivative, but you've already pointed out an exception to that rule with the ETH DAO fork. Various arguments can be made why one or the other network should have been named ETH in that case. Similarly, with Bitcoin and Bitcoin Cash, proponents of Bitcoin Cash had attempted to claim the name Bitcoin for their own network.
Looking at a few fork events, the rule seems to rather be that the dominant fork gets to keep the name. However, it might not be obvious prior to a split which project will end up being recognized by the majority. In the advent of the Bitcoin Cash fork and the Segwit2x fork attempt, futures markets gave some indication how the public valued each proposal. Yet, in the end, it's an emergent social phenomenon. Whatever "everyone" ends up calling Bitcoin is Bitcoin. Often this conflict is resolved when one of the two networks rebrands.


How to read each bitcoin block by python

I wrote the Python script that can parse bitcoin raw dumps. There is no need of any modules or APIs, just Puthon 2.7 and blk00*.dat files. I hope it can help.

Blockchain parser


How to create the data parameter for a PSBT?

A PSBT contains an unsigned transaction that has all of the inputs and output that you want. The other data PSBT allows for are put in around that unsigned transaction.

Here, data just means that the unsigned transaction will have an output that has an OP_RETURN followed by whatever data you want. This directly reflects what createrawtransaction. data is not specific to PSBT nor is it necessary.


What is the best way to implement withdrawal in online service?

As far as I know, there is no third-party ID could be associated with a bitcoin transaction. This means, if the power goes down, you would not be able to determine if the transaction "made it" by looking at block chain for the sender and recipient wallets.

But wallets and transactions are cheap. So you can create a pool of wallets and then intelligently rotate them making sure you lock on one until the entire transaction is complete and confirmed with public records. Then based on exclusivity of access you can determine BTC transaction hash for your system transaction record.

To take this idea to the extreme, you could create a new wallet for every amount you want to send, and use this wallet to identify the only one outgoing transaction.

Hope this would help,
Alex


What is the difference between Dogecoin and Bitcoin at the network level?

TL;DR: small code differences, but many larger ecosystem differences
IIRC, Dogecoin is a fork of Luckycoin, which in turn was forked from Litecoin, which was forked from Tenebrix, which was forked from Bitcoin. As far as I can tell, the main differences to Bitcoin are:

scrypt hashing algorithm
1 minute block interval
accelerated reward schedule:
Full supply emission in less than 2 years via random rewards, then later changed to have a constant tail emission of 10,000 Doge per block.

Dogecoin is merge-mined with Litecoin, so it shares the protection of the hashrate of the incumbent Scrypt-coin and is therefore not trivially majority-attackable as some other minority-hashrate forks. Since Litecoin/Dogecoin use a different hashing algorithm (Scrypt) than Bitcoin (SHA256d), mining hardware does not transfer, it is only compatible with one or the other.
Presumably, people citing security concerns are alluding to Dogecoin Core being about 15,000 commits behind Bitcoin Core, with its master release citing inclusion of "changes from Bitcoin Core 0.14.3" (which was released in Sep 2018). I surmise that this means that a plethora of security fixes and performance improvements have not yet been backported to Dogecoin. The Dogecoin network has only about 220 public nodes at chain-tip. Allegedly, the software is struggling to synchronize the 3.7M block headers.
Dogecoin did also not backport segwit, which means that it still suffers from third-party transaction malleability, the quadratic hashing problem, and cannot support a Lightning Network. Since the upcoming Taproot soft fork builds on segwit, the resulting new features including Schnorr signatures, public key and signature aggregation, scriptless scripts, Merklized Alternative Script Tree (MAST), and Discreet Log Contracts (DLC) are also unlikely to become available.
So, Bitcoin and Dogecoin are practically the same, except that Dogecoin has no infrastructure, no ecosystem, a plethora of security and performance issues, maybe one developer, next to no code review, and none of the new shiny features. However, it is a great meme and a funny parody on all altcoins, so it will always have a special place in our hearts.


How can I limit who connects inbound to my bitcoind

figure the --rpcuser setting is not what I need, right?

That is correct, -rpcuser is completely unrelated to what you want to do.

You can start bitcoind with the -maxconnections=<n> option where  is the maximum number of connections that you want to allow (or add the option to the bitcoin.conf file).

Then you can setup an external firewall to manage your connections. With that firewall, you allow through n-8-1 external connections on port 8333. This means that you are allowing other nodes to connect to you, but still keep one unused connection less than your maxconnections setting for your SPV wallet. Then you add another rule to the firewall to allow 1 connection on a different port which just forwards traffic to port 8333. You connect your SPV wallet to that other port.


Transaction with `OP_RETURN` to a particular address

You can't make an OP_RETURN-based output out to any specific address, since the OP_RETURN opcode marks an output as invalid (thus provably unspendable). In fact, an OP_RETURN-based output will not even enter the UTXO.

A zero amount is okay (and even encouraged) for OP_RETURN.  The OP_RETURN is paid for via the fee; putting a non-zero amount in OP_RETURN would just destroy bitcoins, so the miners do not profit from mining it.

However, you can create a transaction that has multiple output scripts: One can be a standard P2PKH of the form OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG while the other can be an output with OP_RETURN. Just call addOutput twice, once with an address and the amount desired, and a second time with parameters for an OP_RETURN script (and a non-zero output value, I would presume).


Help! Tried sending bitcoins to myself and they disappeared

What you are seeing is a "change address".  When you send an amount that is less than you originally received, it sends the whole amount, and returns the difference to your wallet as "change".  This change may not be spendable until the transaction is confirmed.  The change address is different each time, which makes it harder for a third party to tell for sure how much is sent to which wallet.  If you are not interested in privacy, you can use a different wallet (such as Electrum) which has an option to not use change addresses -- in that case the change would go back to your original address instead of to a new change address.


How to Bitcoin Core daemon start automatically each time your reboot your computer.?

The init scripts can be found here: https://github.com/bitcoin/bitcoin/tree/master/contrib/init.


What if any proposed blockchain enhancements that require hard forks would require new ASIC hardware?

I don't think many hardforks would make ASICs obsolete. Developers would surely want to avoid that, and will always have a way to avoid it. Unless they have a reason to make all ASICs obsolete on purpose (extreme mis-behaviour by miners could theoretically cause that). In that case they could chose a different mining algorithm.

The ASIC simply gets fed the prepared header of a block and all it does is run hashes on it while increasing the nonce (32 bits) and possibly a few other bits (in the timestamp field) in case the nonce is too small. So only those bits that it actually touches could possibly cause the block to become invalid. It's highly unlikely that the developers would ever change the meaning of those bits in such a way that it would become more restrictive and cause the found blocks to become invalid under the new rules.

Hypothetically I guess one example could be where the developers decide to restrict the allowed error margin of timestamps in headers. Currently a block is allowed to have a smaller (older) timestamp than the previous block (up to two hours if I'm not mistaken). Suppose the developers decide that from now on it can only vary by 20 minutes. If the ASIC is happily incrementing the enough of the last bits of the timestamp field it could make it exceed that margin, making the block invalid under the new rules.

I guess ASIC manufacturers need to be a little bit careful, or make the ASICs flexible enough so that they can be told which bits to touch. Although I guess the above example might be a reason for the developers to never improve the timestamp accuracy (at least not in the straightforward way).


How to ask donors to send bitcoin if they are not bitcoin enthusiasts?

CoinBase says that they hope to offer a method to purchase bitcoins using credit card.

In the meantime, that's not happening or at least not without going through some method like VirWoX (buy SLLs there and trade those SLLs for BTCs).

There are cash deposit methods.  Depositing cash at a bank or 7-11, Walmart, CVS is going to be the fastest and easiest way.

http://www.BitInstant.com (Deposit at major banks, 7-11, Walmart, CVS, Moneygram, etc., or in Brazil using Boleto or Banco Recomendito, or in Russia, using Qiwi or Cyberplat.)
http://www.CAVirtEx.com (Deposit cash at several banks)
http://www.Spendbitcoins.com (Deposit cash at a bank in Australia)
http://www.MrBitcoins.com (Deposit at a bank in U.S., India, Australia)
http://BitcoinNordic.com (Purchase CashU or UKash in dozens of countries)
http://www.MtGox.com (Deposit cash at any Barclay's in the UK)

There are also individual traders in 70 countries and hundreds of cities:

http://www.localbitcoins.com


Would my ISP consider my Bitcoin client to be a server?

Google refers to server as a business grade hosting with a very different usage profile then personal use. This is not intended to catch someone using home server, but if a small business tries to power their rack of servers, then there is grounds for termination.

The Fiber Services are intended for the personal use of you and others with whom you share your residence (including, within reason, guests who are visiting you). You agree not to resell or repackage the Services for use by people other than those with whom you share your residence. If you wish to use the Google Fiber Services to provide Internet service to others, you must enter a separate agreement with Google Fiber that specifically authorizes you to do so.

Google Fiber Terms of Service

Here are some common-sense rules that you should keep in mind when using services provided by Google Fiber:

Your Google Fiber account is for your use and the reasonable use of your guests. Unless you have a written agreement with Google Fiber permitting you do so, you should not host any type of server using your Google Fiber connection, use your Google Fiber account to provide a large number of people with Internet access, or use your Google Fiber account to provide commercial services to third parties (including, but not limited to, selling Internet access to third parties).

Learn about Google Fiber terms of service


Sync too low when using BitCoinJ to create and host own wallet

To make the sync faster and the wallet creation you can do by setting the checkpoints and later at the time of calling the create wallet method you can set the checkpoints for faster sync. Like I am using walletKit method of bitcoinj for wallet creation find the below code for example

WalletAppKit kit = new WalletAppKit(params, new File(walletPath), filePrefix);
kit.setCheckpoints( ReadProperties.class.getClassLoader().getResourceAsStream("checkpoints-bitcoin"));
kit.startAsync();
kit.awaitRunning();


What is going to happen when it is totally infeasible to download the entire bitcoin transaction history?

The default answer to scaling is SPV (lightweight) clients, which allow very good security and control of funds without the entire blockchain. Full nodes will still exist but the cost of running one will not be prohibitive.
In practice many people will use some sort of bank service. If the funds are in full control of the bank it has some disadvantages, but yes - in this case of course the banks will settle intra- and inter-bank transfers with internal records and reciprocity agreements, not with the blockchain.
There are some schemes which allow making a payment without it being recorded as a transaction in the blockchain, and without having to trust a bank with your money. This will greatly reduce the total size of the blockchain.


Is a distributed version of GLBSE possible? How would you design it?

Step 1 - Representing shares in the company.

This is easy enough and has been discussed. The company sends a small amount of bitcoins to one of its addresses. It releases a digitally signed announcement that any bitcoins which can be traced back to this particular output are tokens representing shares in the company. When dividends are to be paid, they are sent (in normal bitcoins) to addresses which contain tokens in proportion to the amount. Initially the company is in ownership of its shares and can sell them to raise funds.

Step 2 - Enabling OTC trades.

Also easy. People who want to trade can broadcast their offers, perhaps on a dedicated Bitstock p2p network. People who want to execute standing orders can contact their issuers and together construct a Bitcoin transaction that sends X normal bitcoins from A to B and Y tokens from B to A, and both sign it. No trust is needed because the exchange happens simultaneously. There can be a Bitstock client that is a modified Bitcoin client, which is careful to distinguish tokens from normal BTC and can communicate with the Bitstock network.

Step 3 - Committing to offers.

Here's the hard part. With a normal OTC trade, there's nothing stopping a trader from backing out of an issued order if it becomes unprofitable by the time he is taken up on it. A market where orders needn't be honored will be inefficient and subject to manipulation. There needs to be some way to make committing orders.

One could conceive concocting some special Bitcoin transaction where the output can be claimed by reciprocating by sending tokens to a specified address, up to a given time. But I think this has too many moving parts to work. The Bitcoin script will need to verify that the tokens indeed originate in the company's address, and the completed transaction will expire if not included by some time - which is said to be impossible since it will be messed up in chain reorgs.

One way to do this is with a distributed trust model such as my own NodeBank proposal, where the bank nodes act as escrow for the trades.

If you want to do this completely trustless, I think you may have to create a separate Bitstock blockchain with its own rules (shared between all companies, but distinct from Bitcoin). I'm not sure it's possible to make a commitment mechanism for offering bitcoins for token bitstocks, so Bitstock will have to be its own currency which can also be used to create company tokens (just like Namecoin is a currency which can be used to create a DNS record). The Bitstock blockchain will have rapid blocks and a relatively strict timestamp requirement, and will be merge mined with Bitcoin. It will have a mechanism for making offers of Bitstock tokens vs. normal bitstocks, which is enforced by protocol if an execution request is made with its hash included in an early enough block. There should be a way to make special rules to make this survive reorgs - for example, orphan blocks will also be considered when evaluating whether an execution was given early enough, but a confirmation of this validity will also be included in the main branch, and require enough confirmations to make sure a validation can't be added retrospectively.

Step 4 - Continuous trade services.

No matter how clever we make the decentralized stock exchange, some things can still only be offered by a centralized service, in particular in regards to the speed with which orders can be placed, retracted and executed. A centralized service can be built on top of the p2p system to offer such features. It should enable depositing and withdrawing normal coins and token coins, and offer advanced features for trading deposited coins.


It's a well known problem described here: https://github.com/lightningnetwork/lnd/issues/1347

LND team works on a fix here: https://github.com/lightningnetwork/lnd/pull/1595

Meanwhile i'd recommend to connect to Eclair based nodes to have receiving ability, such as the recommended ACINQ node.


zero instead of magic bytes means the end of bictoin block data. just skip the rest of file and follow to next blk-file

by the way. it is better to assemble blk-files for future parsing with old clients (I use 0.8.5) because they put blocks in right order


Is Lightning network really a hope for better scalability and low latency?

While Lightning Network payments are off-chain, they are not really removed from the blockchain. In fact, payments on the Lightning Network are merely creatively delayed Bitcoin transactions.

The funds of a payment channel are held in a 2-of-2 multisig address. Since spending money from there requires the acquiescence of both parties, the payment channel partners can set the payout conditions in advance and then rely on them remaining unchanged.

However, they may renegotiate the payouts with each other in order to adjust the respective balances. Since this process only involves the two of them, it is practically instantaneous and by the order of the negotiation protocol still trustless. If the negotiation fails, or one of the channel partners becomes unresponsive, either channel partner can simply broadcast the latest state of the channel to the blockchain for execution.

While LN has different security trade-offs and a different network topology, I don't think that  "compromising security and decentralization" is an accurate description.


What is the current actual cost of mining 1BTC?

You can use a mining calculator to compare the available hardware's output, then add fixed cost (hardware) and variable cost (the cost of manpower, power, replacements, maintenance, etc).

I am assuming you mean ASIC mining cost, as GPU mining has not been profitable for bitcoin for quite some time. I found a site which keeps track of ASIC deployment and also provides a mining calculator: http://minr.info/

Generally miners do a lot of work to find places with cheap power, you can find kWh rates here: http://en.wikipedia.org/wiki/Electricity_pricing#Price_comparison

Even though this may seem unrelated, miners can also use GPU or Scrypt ASICs to generate alternate coins (and then convert them to bitcoin), which may be cheaper than generating/buying bitcoins. You can find a lot of information about various algorithms and a mining calculator for many alternative algorithms here: http://www.coinwarz.com/cryptocurrency

Beyond all of this, it is worth noting that bitcoins can be generated by any computer capable of doing such calculations, and that there are at least some people who do not pay for the power that they consume, and sometimes not even the hardware (such as college students and hackers, respectively). Therefore the price of mining a bitcoin can be next to nothing or actually nothing for some people who do not play fairly, and who will mine full-force at virtually any price.


How to identify a transaction in Bitcoin

It's recommended to give every single transaction its own, unique Bitcoin address to receive the payment at (you should not reuse them). Then, you know any payment made to that particular address should be credited to the invoice that that address was issued for.
Most places don't ask for a transaction ID. They simply automatically check all of the addresses they've given out, then credit the payment according to which address the payment was sent to.


Where can I find a chart of the daily supply?

Such a chart is trivial to create yourself by scraping blockchain.info. The following bash script will do just that:

#!/bin/bash
END=$(date -d 'today 00:00:00' +%s) # Today 00:00:00
START=1354147200 # Midnight 2012/11/29 (days after reward halving)
DIFF=86400 # Number of seconds in a day

for i in $(seq $START $DIFF $END); do
  # Blockchain.info uses milliseconds, hence the additional 0s
  BLOCKS=$(curl -s https://blockchain.info/blocks/${i}000 | grep '(Main Chain)' | wc -l)
  BLOCK_DATE=$(date +'%Y-%m-%d' -d @${i})
  echo $BLOCK_DATE, $BLOCKS
done

This iterates over all days since the block reward halving day (2012/11/28) and counts the blocks that have been mined on that day. The following plot shows the number of blocks per day. Multiply that by 25 and you get the daily supply of bitcoins entering the system.

Notice that the notion of day depends on the timezone you're in, and blockchain.info appears to use GMT timestamps. Also blockchain.info uses the timestamp included in the block, which might be off for up to 2 hours, but that should even out in the long run.

You can find the script and data here.


Having trouble setting up the escrow function - returns transaction ID but doesn't get to blockchain?

Struggled with this for a while as well. You need to announce the transaction to your local node and the network via the sendrawtransaction call with the raw transaction id.


How does the Bitcoin payment forwarding at Blockchain.info work?

The fee for each transaction can be calculated using estimatefee API call. And yes, blockchain.info have to incorporate fee in every transaction, 0.0001 BTC being the minimum. One of the reasons attributed for the necessary fee deduction is the quick inclusion of the transaction in the next few blocks.
You can try creating a transaction with the outputs spending all of the inputs and not paying any tx fees. The client will throw an error stating insufficient priority.
Yes you can, but then are conditions apply. You can check out this link to clear things a bit more.


Can a desktop wallet be tracked using IP address?

Surveillance nodes in the Bitcoin network that mass-connect to many nodes within the network could pin-point and identify your node as the first relay for some of your transactions with some degree of confidence.

Receiving is not so much of an issue.

But spending from the same address consistently will enable surveillance nodes to figure out that a certain IP address is in control of some address.


What does an orphaned tx look like via rpc?

There are two cases here:

Block with the tx became orphaned and the transaction is still valid. In this case it is returned to the mempool. gettransaction will return unconfirmed transaction detail
Another conflicting transaction got confirmed ( having same inputs). In this case existing txid becomes invalid and it is discarded


Is it safe to authorize Coinbase to withdraw cash directly from my bank account?

They don't  need your password to process the ACH in the future. this sounds like they used your banking credentials to verify that it really is your account. You should be able to change your password on your banking account now and be safer.


Ubuntu Linux, Unable to set bitcoin datadir to a folder in different drive

Applications in a Snap run in a container with limited access to the host system, you can install bitcoin-core with full filesystem access via the Luke-Jr repository:
sudo add-apt-repository ppa:luke-jr/bitcoincore
sudo apt-get update
sudo apt-get install bitcoin

or download the release from here:https://bitcoincore.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz
unpack and run bitcoind executable inside the bin folder.


Based on a Bitcoin address you cannot get your money back. You also need a private key for that.

As the developer of the real HiddenWallet, which is a desktop application, not an online website I encountered this scam many times. Your money is lost, sorry about that.

One more thing to consider is, if you were using the same password at other places, then you probably want to change it.


How do I move my dogecoins from my DOGE wallet into my VERGE wallet?

Your verge wallet will have made itself a wallet.dat file in its default data directory if you did not specificy a different directory yourself. You can overwrite that wallet.dat file with your one from dogecoindark if you haven't used the new one at all (obviously if you have, you should back it up). I have never used verge wallet before, but if it uses the same default location as bitcoin, you should be able to find the data directory in %APPDATA%\Verge on windows, ~/.verge/ on linux, or ~/Library/Application Support/Verge/ on Mac OSX.


How to generate Ed25519 public key from private key using libsodium?

It's not possible to directly compute the ed25519 public key from the private key.  Instead, use the deterministic private key to create a seed, then use the seed to re-create the private key with its corresponding public key. The following code snippet assumes ed25519_skpk is already initialized:

char           hex_ed_pk[65];
unsigned char  seed[crypto_sign_SEEDBYTES];
unsigned char  ed25519_skpk[crypto_sign_ed25519_SECRETKEYBYTES];
unsigned char  ed25519_pk[crypto_sign_ed25519_PUBLICKEYBYTES];

// COMPUTE ED25519 PUBLIC KEY, REQUIRES ESTABLISHING A SEED
(void)crypto_sign_ed25519_sk_to_seed( seed,ed25519_skpk);
(void)crypto_sign_seed_keypair( ed25519_pk, ed25519_skpk, seed );
(void)sodium_bin2hex( hex_ed_pk, 65, ed25519_pk, 32 );


Why do two different fully synced Bitcoin Core nodes differ in the blockchain size?

The size of the blockchain on disk can vary depending on how many stale blocks your node has seen. Stale blocks are not part of the main chain, but they are still stored on disk by your node. A new node will have fewer stale blocks than an old, long running, node. Well connected nodes are more likely to see stale blocks than less well connected nodes. So it is possible that your node simply has not seen as many stale blocks as other people's nodes.


How could an inflation bug be spotted in grin?

Range proofs for CTs demonstrate that output amounts are positive and within an allowable range, and that no inflation is occuring in a non-coinbase transaction.

The range proofs (eg bulletproofs) are computationally binding.

If the discrete log is broken, range proofs can be generated for values outside the correct range without any way to detect this. This includes correctly validating proofs for a tx with inflation.


How do I view information on the peers my Bitcoin Core full node is connected to?

As 0xB10C posts here you can get a peer dashboard to bitcoin-cli that looks like this.

You can get this dashboard by using
watch ./src/bitcoin-cli -netinfo 4

and you can use the -asmap flag too.
This netinfo feature was merged into Bitcoin Core in September 2020 and is included in the release of Bitcoin Core version 0.21 . (The feature was built by Jon Atack.)
Additional guidance for using this feature was added in this PR.


What coin offers a decentralized ledger, without mining and transaction costs?

If any DLT is working without mining, then it is vulnerable to frauds, double spends, because there is no gaurantee that the nodes are honest upon block broadcasting, and no way to reach consensus between the nodes. This is only feasible in private blockchain if at all.


What stops an attacker from crippling the Bitcoin network?

...could conceivably broadcast a ton of junk/illegitimate transactions to the network thereby consuming the necessary bandwidth and processing power for the network to deal with legitimate ones.

If the transactions are invalid, then they would not be relayed by the network's nodes, making the attack somewhat ineffective. At best, the attacker could consume computational resources of peers they are directly connected to, though if they are spamming invalid transactions then they would probably be banned by their peers soon.
If the transactions are valid, then the attack becomes expensive, which is a disincentive over the long term. It would be extremely expensive to fill every block with 'spam' transactions, and there will still be other users that will compete (in terms of fees) to have their transactions confirmed first.
If some entity attacked bitcoin via IP/DNS blocks, this would not entirely shut down the network, though it would likely cause disruptions to some nodes. I believe that nodes which connect through Tor, or through other methods (such as by satellite) would still function without issue.


Double Spending - Does each node maintain a list of unspent transaction references?

Each full node must maintain a list of all unspent outputs. Currently there are 15 million unspent outputs with a total size of 525 MB. To check whether a new transaction is a double-spend, Bitcoin sees whether the outputs being spent are in this unspent transaction output (UTXO) database. If they are, the new transaction is not a double-spend, and if the transaction meets the other validity requirements, the spent outputs will be removed from the UTXO database.

Searching for a transaction in the UTXO database is extremely fast because the outputs are ordered by transaction hash, so searching can be done using binary search. That means that even though there are more than 15 million UTXOs, finding a particular UTXO given its transaction hash requires looking at only ~24 database locations in the worst case, which a computer can do very quickly.

This is complicated somewhat by the fact that transactions can rarely become invalid after initially being valid (after a reorganization), so full nodes must be able to roll back at least the last few weeks of changes to the UTXO database. Bitcoin Core implements this by keeping a log of each change to the UTXO database and reversing each change in the log in reverse order when a rollback is necessary.

Every full node does have enough information to compute the current balance of any address, though Bitcoin never actually deals in balances directly.


Is it theoretically possible to limit the hash rate?

Given the current proof-of-work paradigm, no. What do I mean by this? A coin which is mined by computing the hash* of data depending on both the previous block (so that the integrity of the blockchain is preserved) and the payload of the current block (so that the integrity of each individual block is preserved) as well as a nonce, such that the hash satisfies certain criteria (typically, being smaller than a certain value determined by the difficulty). In such a case, there is no way of telling whether a hash was found after trying trillions of times or just one lucky guess.

That said, I wouldn't rule it out entirely. But it will be very hard. In fact, I can relax some of the assumptions I just made and it would still not be possible to discriminate based on hashrate. To be able to discriminate effectively, you must have some way of preventing someone with a large hashrate from pretending like they are multiple people with small hashrates.

*Technically, any collision-resistant function mapping to a sequence of n bits will apply. I believe Primecoin's PoW is also applicable.


Should I use a full node as my main wallet?

The only reasons are the syncing time and storage requirement (which can be lowered from about 200GB to 1GB by pruning). A week or so to sync first, then depending on how often you use it, it'll take a some minutes sync. These are major pain in the ass and because of these I would put it into the category of "good reason to not use as a personal wallet". I would definitely not suggest this to my grandma. However I can live with it, and indeed I use it as my main wallet.


Multibit : transferring coins between local wallets

You need to send the coins to an address in your second wallet.  MultiBit maintains each wallet as a separate file on disk, so there is no interaction between them.  One suggestion (which is how I handle this) is to wait until your wallet reaches a large enough amount and then make a single send request to your savings address.  This bundles multiple input transactions into a single output transaction with a single fee.


You can fork Bitcoin Wallet, an SPV implementation of the Bitcoin protocol:

https://github.com/schildbach/bitcoin-wallet

It's GPL licensed.


What could be the consequences of many bitcoins being lost out of circulation if people lose their wallets?

Economic theory tells us the price would rise.  It would have a deflaitonary effect on bitcoin economy.  However because bitcoins are so easily divisible it would not impact the ability for the network to function.

If 90% of bitcoins were lost/destroyed that would leave 2.1 million "whole" bitcoins in circulation.  This wouldn't be an issue because currently bitcoin network supports transactions down to one satoshi (0.00000001 BTC) which is 210 trillion discrete units of exchange.

It is possible to allow smaller units of exchange however I will illustrate that is unecessary.  The world's money supply (M0) is valued at ~ $20 trillion.  If entire world switched to using bitcoin for all commerce the value of a "whole" bitcoin would be $9,524,000 each.  However the smallest unit 1 satoshi would be worth $0.10 Even with 90% of bitcoins destroyed/lost there would be sufficient units remaining to allow commerce down to a 10 cent granularity with Bitcoin replacing the entire world's money supply.

It would result in some changes in language.  Obviously most people wouldn't value things in terms of bitcoins but rather in smaller units like satoshi's (0.00000001 BTC).

As an example a fastfood meal could be priced as $5USD, 0.00000053 BTC, or 53 satoshi's. Obviously 53 is far easier for humans to express than 0.00000053 BTC despite them having equivelent value.  Given the high value of a single BTC, "whole" BTCs would rarely be used other than to express things that are currently express in millions of dollars (like salaries of celebrities, values of corporations, size of national debts, etc).

Satoshi is used as an example but alternatively SI prefixes could be used. For common usage prices in fractional μBTC (micro bitcoins) makes the most sense with 1 μBTC = 1E-6 BTC.

Some examples:

"Man gold broke 200 μBTC today"

"The US Congress raised the minimum wage to 1.50 μBTC effective Jan 1"

"I got the job.  Starting salary is 8,400 μBTC a year"


Is it normal to not "own" your bitcoins? Are 6% transaction fees normal?

There are both custodial and non-custodial online services as well as apps. If it's important to you to control your own funds, you should research the account model your service provider uses and avoid services that manage your funds for you.

Bitcoin transactions are not paid respective to the amount that is being transferred, but rather in regards to the blockchain space that you purchase in order to have your transaction confirmed. Transaction fees have been much higher in the past months than previously, as the supply is capped and demand has been increasing. Personally, I'm hoping that a protocol upgrade by the name of Segregated Witness will be activated soon, as this will increase the blockspace as well as provide access to a payment layer that I expect to work as a valve to curb demand.

For you personally this means that fees are more or less the same size for whatever amount of money you transfer. If you make large payments, the fees will be minuscule, if you make small payments, the fees will be a significant port of the transferred value. Naturally, this is making Bitcoin unattractive for smaller payments.


Why is P2PKH used instead of the simpler P2PK?

The original reason why addresses were a public key hashes is something you'll need to ask Satoshi. My guess however is that it was just shorter and more convenient (note that compressed public keys weren't known at the time).

When compressed public keys were discovered it was simply easier to stick to the existing address scheme (it didn't require any changes at all; wallet and node software happened to already support compressed public keys). Introducing a new address scheme that was both more expensive for the sender (34 bytes of output script rather than 25) would have been nearly impossible to convince the ecosystem of - knowing that deployment of P2SH even took several years.

One often repeated argument in favor is quantum resistance. I believe this is besides the point. We have no idea what the characteristics of a hypothetical machine relying on yet to be invented technology will be. Given the degree of key reuse on the network (so there are addresses with known public keys), the existence of a system that can break ECDSA is likely a death blow to Bitcoin. A real solution to that is to prepare and have real quantum-resistant cryptography in place before it's too late. Relying on a weird hope that those hypothetical machines are somehow too slow to steal from unconfirmed transactions before they're mined is a red herring.


Is it possible to generate bitcoins with a Google Chrome extension?

Well, I cannot speak for that specific generator. However there has been a javascript generator already in use and Chrome extentions are I believe javascript based, so it is very possible.

The javascript generator only uses CPU mind you, and is quite slow.

As for using the GPU, that is a possibility with some of the browser plugins out there, such as Unity. However a native browser? not very likely, they try very hard to restrict hardware access.


How to retrieve all transactions from bitcoind?

Making an RPC call per transaction adds a lot of overhead.

It's not clear exactly what you mean by 'all transactions', but I'll assume you have a way of identifying 'all blocks' for which you want the transactions.

You can reduce the overhead, then, to one RPC call per block, by using getblock with the second option (verbose) set to false (getblock blockhash false), and then parsing the raw block data directly yourself.

There's a bit of work involved in parsing the raw block data yourself, but if you're already working with raw transaction data then I guess you may already have the code to do the relevant decoding.
If not, it's not too hard to set this up, in any case.

As a side effect, note that the full transaction index (txindex=1) is no longer required with this method.

I've written about this specific issue in more detail in this blog post, so check this post for more details, and some example code..


"Failed to connect best block" error when I try to load my wallet

Your database is out of sync with your blockchain.

Restart with -reindex-chainstate to make it rebuild the database. This may take several hours or more, depending on the speed of your machine and storage.


Where can I find market volume data with greater resolution than 24hr periods?

You could do your own price comparison.

So if you scrape every 15 minutes. Store that 15 minute price data and create your own percentage based on the history of the data you collected.

If you have the data every 15 minutes you could even do the difference in 15 minutes intervals.

Example:
Price now is $1.00.
Our database says the price 1 hour ago was $1.15
Change of -13% over the past hour.

Again, store all the 15 minute scraping price data in your database and then use that data to make the percent based on whatever time frame you want.


How does NXT prevent blockchain bloat since it does so many different things with its blockchain?

A special feature called Blockchain Shrinking is supposed to solve this problem.

Every year (or month) a new genesis block ("rolling genesis block") will be generated by every node. This block will contain only actual information (for example, only one depositing transaction instead of hundreds of them).

Blockchain Shrinking requires other features to be implemented too - Service Providers and Distributed Storage. These features are necessary because new nodes may need to make sure that a particular rolling genesis block is legitimate. This will be done by downloading and analysing all (or some) blockchains that existed before the most recent shrinking. Please, note that such blockchains will be stored only by some nodes that decided to do so (they will get extra payments for providing this service). There is still a possibility that none of the nodes will store the old information, in this case Nxt couldn't be called "100% trustless".


Total channel count differs from explorers

I thought we had that question before but the only one similar I could find was this one 1ML shows larger number of nodes comparing to other lightning network explorers which was not quite the same.

So to answer your question: listchannels depicts information your node knows from the gossip protocol. If your node is new this could take some time which is most likely the reason for your lower number.

I once had a corrupted gossip_store file in .lightning folder after upgrading a node in that case shutdown your node delete the gossip store file and restart for a new sync. Pay attention not to delete any other files in that directory as they are critical to access your funds


Will mining significantly increase the power consumption of my PC?

Yes it will. The component you're likely to use for mining is your video card (GPU) which consumes very little power when idle but can consume a great deal under load. Check this list of common cards and consult the Watts (W) column for how many watts your card is likely to draw. Any card worth mining on will probably draw at least 100 Watts under full load. Depending on the electricity costs in your area, it may cost you more in electricity than your coins produced are worth. There is at least one good calculator to estimate your proceeds but you'll need to find out how much your local utility company charges per kilowatt-hour for electricity to determine if it's profitable. For reference Kilowatt-hours per day = Watts * 24 / 1000.


How can I fix this: (Non-canonical signature: S value is unnecessarily high)

It seems as though N is the order of the elliptic curve.

Or in other words, the number of possible points on the secp256k1 curve.

N = 115792089237316195423570985008687907852837564279074904382605163141518161494337


How do you calculate a reasonable transaction fee?

See https://bitcoinfees.21.co/ for mempool size and tx fee. This will suggest fee in satoshi/byte depending on current network conditions.

If you are looking to exact fee in BTC for spending from wallet, you can try  https://github.com/shivaenigma/btxfees.


For deterministic wallets, which key is better to give out?

You give out a single address, as with a normal wallet. The master private key and master public key are both for use locally and should never be shared with any party, especially not the former.


By having the private key you can sweep the wallet using a desktop or mobile wallet, I recommend electrum.

If you are new to the bitcoin world, visit https://bitcoin.org that has a lot of information so you can get up to date and get out of duduas


How can a user or wallet have multiple addresses at all if out of a private key can be generated only a single public key?

Modern wallets are hierarchical deterministic (HD) wallets.
A root key is used to derive an effectively infinite number of private keys using systems such as BIP32.
Each derivation results in a single public/private keypair, and hence a single address at that level.
Prior to the usage of HD wallets, things were a bit more straighforward - every time you requested a new address from the wallet, it would generate a new, random private key and store it in the wallet file, and give you the address created by the public key for the new private key.
The move to HD wallets was done for ergonomic and safety reasons - in older wallets, if you did not make a backup after every new address, you would lose any addresses generated after your most recent backup if the wallet file was lost. With HD wallets, only the root key (commonly a BIP39 mnemonic) must be backed up - all addresses and their keys can be recovered from it.


Is there a Bitcoin gateway for PrestaShop with these specific features?

Check this http://www.prestashop.com/forums/topic/123451-module-free-bitcoin/ it says is free and works without integrating with online payments processors


coin selection - why selecting transactions with confirmations first better

Many wallet implementations prefer spending confirmed inputs over unconfirmed inputs. There are multiple reasons for this preference:

Bitcoin Core (and perhaps other software as well) does not propagate chains of unconfirmed transactions beyond a certain depth. If you continuously reuse unconfirmed UTXOs, eventually your transactions will not be seen on the network until some predecessors confirm.
Transactions using unconfirmed inputs are susceptible to become invalid due to a parent transaction being replaced or doublespent.
A transaction building on top of an unconfirmed change cannot be confirmed until the parent transaction is confirmed. This dependency is used by child-pays-for-parent transactions positively to increase the priority of the parent transaction, but can also be a handicap, when a low fee transaction essentially puts the onus on the recipient to bump the transaction in order to gain access to their funds.


How do exchanges automate transfer of Bitcoin from a cold storage wallet?

They don't and that's the point.
The actual process varies probably from company to company, but generally, deposits into cold storage are automated, and withdrawals from cold storage require varying degrees of manual involvement.
The process usually involves some of the following components:

Air-gapped signing system
The signing device is not connected to other networks in the company or let alone the internet. An unsigned withdrawal transaction is produced by means of a watch-only wallet on the "hot-side", then manually input to the signing device either by means of QR codes or USB stick and signed. The signed transaction is then manually transferred to the hot-system for broadcast.
Hardware Security Modules (HSM)
The private key to the cold wallet is stored in a system with a narrow API which cannot dump the key itself but will only produce signatures. Access to this signing request interface should be further locked down by requiring the requests to be signed as well as subject to additional security requirements and policy checks.
Multi-factor setup
The cold wallet is locked to a quorum of multiple public keys. Each signature is produced by independent signers with isolated security procedures. Preferably, the signing protocol ensures that multiple stakeholders verify the transaction and sign off. The protocolshould record the involved parties for accountability. Similar outcomes can be achieved via MPC or by sharding, in which case the signing protocol must ensure that the reconstituted key cannot be extracted by any signing participant.

Security and convenience are often at odds, but the inconvenience can be managed by automating all processes around the manual steps, and by limiting the events in which manual involvement is necessary. E.g. funds should be consolidated before depositing into cold storage so that the cold wallet has fewer UTXOs. An intermediate security level can be introduced with a warm wallet, that e.g. is not airgapped but requires manual 2FA for each transaction.
An example flow with three wallets could look thusly:

a hot wallet that issues batched withdrawals. The hot wallet gets restocked from the warm wallet to have operational funds for at most a day.
a warm wallet that holds funds for a few days of operation but requires sign-off on each transaction that sends funds from the wallet. Deposits are received to the warm wallet. Funds from the warm wallet get consolidated regularly in an automated fashion. Excess funds are deposited into the cold wallet. When running low on funds, the warm wallet gets restocked from the cold wallet.
a cold wallet which holds the majority of the funds and should not issue transactions more than a few times per week.


How to create unsigned tx in a watch-only wallet?

Hi it's moral_agent from the reddit post.
https://www.reddit.com/r/Bitcoin/comments/ir308h/watch_only_balance_not_spendable_in_bitcoin_core/g5gg33f/
I do not know whether this will help you or not but I will tell you what helped me and what I think I was doing wrong.
In order to create a PSBT that spends a watch-only output, it is not always sufficient to import the address of the output.
For a pay-to-script-hash address you will also need to import the script of the output. This makes sense, since creating a valid P2SH transaction requires that you include (and satisfy) the script. Your cold-signing wallet is only expected to supply the signature, not the script, so the PSBT needs to contain that information, so your hot computer must have it to create a PSBT.
I was able to import the required script by doing importmulti. I actually didn't import the script, I imported the script descriptor sort of like this:
importmulti "[{ "desc": "sh(multi(2,BLAH-BLAH-HEX))" }]
I didn't check that syntax for bugs so you're on your own there. Importmulti takes a bunch of args, most of which are optional.
I got the output descriptor for the address I was trying to spend from by runnning getaddressinfo on the address on the computer where the address was originally generated, and which therefore knew what the script was.
Hope that helps. Let me know if you have success!


The code you are linking to is for simulating network-like effects of various mining technologies and policies. It does not actually mine, and will not teach you about mining itself.

You may look up projects like cgminer of bfgminer for actual mining software.


What does "Safe mode: Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues." mean?

When Bitcoin detects that there is something seriously wrong with the network it gets into safe mode, disabling the majority of the methods exposed via its RPC API (only the okSafeMode methods will still work). It does that by filling up the error JSON node with an error code and the the generic error message you received so that the response will not be parseable:

The reasons that push it into safe mode can be a large valid/invalid fork, an invalid longest chain, etc.

Try adding these lines to your bitcoin.conf

checkblocks=10
checklevel=1

then restart bitcoind as well as your app and see if the issue is resolved. If not, try reindexing the blocks on your disk (via the -reindex param).

Also, consider using the -alertnotify hook to get custom notifications and/or to shut down your bitcoin apps every time this happens.


Should boost be installed in /usr/ or /usr/local/ for bitcoin-core?

Libraries should be installed in /usr/include.

For Boost, the path to it should be /usr/include/boost. That's where the linker would be looking for the libraries.

Otherwise, you may elect to install the libraries in some different directory and symlink it to /usr/include anyways.


How to secure a Linux node running satoshi 0.16.1?

As a quick answer, some wallets allow you to specify a node that they will connect to. You can run your own node, and point your wallet at it. Beyond being trustless, this has an added bonus of increasing your financial privacy, especially if your node is connected to the tor network.

Note that many such wallets are ‘light wallet’ mobile applications, but I would trust a mobile wallet over a desktop full node wallet myself. This offers a good solution of maintaining sovereignty for a day-to-day use wallet in my opinion.

For larger amounts, using a HW wallet or other cold storage mechanism is highly recommended!


Do PCI USB risers lower the hashing rate?

The general consensus is like Robert said: there SHOULDN'T be any difference, but there is!

Having the same problem here!

I'm running Windows 8.1 Pro (64-bit) with five (5) of the new GeForce 750 Ti cards by EVGA (FTW model).

They hash at 320 KH/s when connected to the PCIe 16x slot, but get capped/maxed at 295 KH/s when connected using 1x to 16x riser cables.

All riser cable molex plugs are connected to power supply.
All cards have their PCIe 6-pin power plugs connected as well.
Updated BIOS of cards to take up 65 watts max (or even up to 100 W) to no avail.

Power supply: 1000 watts (more than enough)

Motherboard: BIOSTAR H81S2 (made for mining) ver. 6 - latest BIOS

UPDATE: I thought the culprit was the motherboard, so I bought the ASRock H81 Pro BTC (made for mining) motherboard.  SAME EXACT STORY!

I was about to try a USB riser cable instead, but I see that the OP (Scott) has the same issue with those as well.

Now I'm leaning towards a driver or OS issue, but I'm quite certain it's because of using the 1x slots, though, AMD cards are hashing at much faster rates!  So that's interesting.  What's going on here?!

I will try running on Linux.

I contacted BIO-STAR for tech support and they'll get back to me.  Their R&D department is looking into this.

I already tried setting the PCI speeds for the slots, in the BIOS, to Gen2, manually (instead of Auto), and that didn't help.  (Because I found someone on the internet with a similar issue and they said this fixed it for them, but it's not exactly this issue they've had).

In the BIOS I tried changing PCI Latency Timer up to 248 PCI Bus Clocks - didn't help!

In the BIOS I tried changing the Maximum Payload & Maximum Read Request to 4096 bytes - didn't help!

I've disabled redundant services and components in Windows - didn't help!

I ran the DPC Latency Checker tool and things seem stable so that's not the issue either.

Interesting to note:

While overclocking above a certain MHz for the core or memory, through the 1x riser, once the hash rate reaches 295 KH/s, it does not go any higher no matter how much you overclock, however, the overclocking utility of choice (EVGA Precision X, ASUS GPU Tweak, MSI Afterburner) will confirm the higher clock rates running on the cards.  If connected through the full PCIe 16x slot, this 295 KH/s limit is non-existent, and the more you overclock past that same amount of MHz as before, the higher the hash rate.

Doesn't matter which version of CUDAminer is being used.

UPDATE: Looks like it's a CUDAminer issue:

http://www.overclock.net/t/1468166/gtx-750-ti-mining/190#post_21890197

  Cudaminer apparently has a high PCIe bandwidth utilization...thus when
  going from x16 mode to anything lower, as you get closer to x1 mode
  (risers or not), you're going to see degradation of performance (10-30
  kH/s for 750 Ti in my experience). Cudaminer author is apparently
  going to be working to fix this ASAP since he'll soon be operating a
  750 Ti rig with riser assemblies.


Avalon AUC2 converter for Avalon 6? Can I use a USB controller of sorts?

Yes, you do need an AUC to run any avalon miner.  AUC3's will work on AV6.  But AUC2's will NOT work on AV741.

I've been looking for a spare as well and have tried a few generic USB2I2C devices from china with no luck.  I'm just not that skilled with these sorts of things.


How to obtain the private key of an Armory wallet?

This is how you obtain the private key for an Armory wallet:

In Armory-Qt, click on Wallet Properties (or in the newer versions, double click on your wallet to open your Wallet Properties), then click Backup this wallet>See other backup options>Export Key Lists then click the button Export Key Lists. Enter your passphrase and Armory will show your wallet's list of public addresses and private keys. If you are --offline or didn't download the blockchain, the list may be empty (Armory thinks no addresses were used), but checking "include unused" will allow you to see the entire list. Note that a watch-only copy of a wallet uses the same private key as the original wallet it was created from.

This is useful if you want to send coins from an Armory wallet without using Armory, for example from an armory wallet address you imported into blockchain.info. In order to do so, you need to enter into the chosen service the private keys to the wallet you want to send from. In the case of BlockChain.info, the key it accepts is the one in PrivHexBE format, after you remove the spaces.

Word of caution: after you enter a wallet's private key into any online service that wallet is no longer secure. You should considering transferring all the coins it holds out - do not use that wallet again.


You're getting this error because bitcoind isn't running. Once it is, it will create an authentication cookie, and bitcoin-cli will be able to connect.

To start bitcoind from cmd prompt, type:

cd C:/Program\ Files/Bitcoin/daemon/

Press enter, then type:

bitcoind

And press enter.


Why does the "global lottery" prove the validity of the blockchain?

Miners do not prove validity. They solve the problem of needing to decide between two potentially conflicting but otherwise valid versions of history.

The rule that full nodes follows is that they accept the longest valid block chain, where valid is defined by the network's consensus rules, and long is defined as having more mining work performed. If a miner produces a block that is invalid according to those rules (for example, it spends a coin without valid signature), full nodes will ignore the block and any block built on top.

There are also lightweight nodes ("SPV nodes") which do not verify validity at all, and will accept whatever block chain has most work. Their security however relies on the fact that blocks are expensive to produce, so a miner wouldn't create one that isn't accepted by full nodes.


Litecoin was created as a fork of the Bitcoin Core client in 2011. There were some initial differences: a maximum of 84 million coins (21 million Bitcoins), 2.5 minute block times (10 minute Bitcoin block times) and a different proof-of-work algorithm (Scrypt replacing Bitcoin's SHA256). It is arguable whether this made Litecoin "more advanced" than Bitcoin. Most of the subsequent Litecoin development merely merged updates to Bitcoin Core into its codebase. However, in April 2017 Litecoin activated SegWit that had not been activated into Bitcoin despite being coded and announced by Bitcoin Core developers. This resulted in Litecoin being a more attractive testbed for second layer technologies such as Lightning. There are multiple efforts to activate SegWit on Bitcoin in the next few months (UASF, SegWit2x). Until that happens there is a stronger argument that Litecoin has "more advanced" technology.


For those who are having the same problem, please note that rpcminers are not supported by many BitCoin Miners, this was my problem.

I started to use GUIMiner and it accepted my first block just yesterday. No more blocks besides those yet, but well I'm just starting.

Regards

Thanks for all the help!


Backtesting mtgox for historical trade analysis?

bitcoincharts.com will let you download their entire trade history of any exchange (for free) here: http://api.bitcoincharts.com/v1/csv/. Given the raw trade data (amount, price, timestamp), with some code, you can construct candles. I'm not sure this is of any use, though, because I don't know what kind of backtesting you're doing and whether you are dependent on some existing software that may or may not work with raw trade data (or whether you can make candles from it).


According to this bitcointalk thread, it can be done via the JSON-RPC API:
Code:

verifymessage [address] [signature] [message]

This feature has also been included in the GUI of the Armory client:

  To Verify a Signature Block with Armory (works fine in offline mode):

Open Armory, go to the menu, "Tools"-->"Message Signing"
Click on "Import Signature Block" at the bottom of the screen.
Paste the signature block, and click "Okay"
Address will be checked against public key, public key checked against signature for the given message

  None of this requires the blockchain, so if you are on a system that
  couldn't normally run Armory, you only need to run with the
  "--noblockchain" option.  This allows you to verify Armory signature
  blocks without even having an Armory wallet!  If you're intrigued, try
  this one:  (get Armory if necessary)


How exactly do I decode the block file info in leveldb?

You are deserializing every value as an integer but that is incorrect. The values are serialized as variable length integers with high bits signalling the length of the integer which are dropped for the actual integer value itself. So you need to fix your code to deserialize the bytes as varints instead of just integers with fixed lengths.

The following code was able to deserialize the entry correctly.

#! /usr/bin/env python3

import binascii

def get_max(long=False):
    if long:
        return 18446744073709551615
    else:
        return 4294967295

def read_var_int(s, pos, long=False):
    n = 0
    while True:
        chData = s[pos]
        pos += 1
        if n > (get_max(long) >> 7):
            raise IOError("ReadVarInt(): size too large");
        n = (n << 7) | (chData & 0x7F)
        if chData & 0x80:
            if n == get_max(long):
                raise IOError("ReadVarInt(): size too large");
            n += 1
        else:
            return n, pos

entry = binascii.unhexlify(b'86a825befef44588a5a77d0086a87283c9fdd52983ecd3a14e')
pos = 0

nBlocks, pos = read_var_int(entry, pos)
print('nBlocks: {}'.format(nBlocks))
nSize, pos = read_var_int(entry, pos)
print('nSize: {}'.format(nSize))
nUndoSize, pos = read_var_int(entry, pos)
print('nUndoSize: {}'.format(nUndoSize))
nHeightFirst, pos = read_var_int(entry, pos)
print('nHeightFirst: {}'.format(nHeightFirst))
nHeightLast, pos = read_var_int(entry, pos)
print('nHeightLast: {}'.format(nHeightLast))
nTimeFirst, pos = read_var_int(entry, pos)
print('nTimeFirst: {}'.format(nTimeFirst))
nTimeLast, pos = read_var_int(entry, pos)
print('nTimeLast: {}'.format(nTimeLast))

The result was:

nBlocks: 119973
nSize: 134216389
nUndoSize: 19502205
nHeightFirst: 0
nHeightLast: 120050
nTimeFirst: 1231006505
nTimeLast: 1303712078

The nBlocks and nHeightLast are expected because early blocks were extremely small yet the block file is fairly large. I think that your calculation of 134 blocks in the block file is wrong. With 134 blocks, the blocks would have to be more than 1 MB in size which is simply untrue for early blocks.


Addresses can both be used both for sending and receiving transactions. However, some online wallet services share addresses between different users, so you want to be careful if you are using one of those. Use a "receive payment function" or "my address", or whatever it might be called, to get the address that can receive payments for you.

If you are using the standard client, all your addresses are fully under your control and are safe to receive transactions.


Raw transactions - SubtractFeeFromAmount flag

When you create a raw transaction, you must specify all inputs and outputs, and any leftover will go towards the fee (to the miner). The raw transaction does not do any fee calculation.

Example Transaction:

input1: .1BTC
input2: .2BTC

output1: .299BTC

The resulting fee would be:

fee: .001BTC

This amount gets added to the coinbase transaction (by the miner) of the block which includes this transaction.


What about the second one ? That can be 61 bytes long ?

Yes.

  Also, does each transaction carry a counter ?

No. There is a global counter in the block that is right after the block header. That counter is the number of transactions included in the block. It is not part of any transaction and its size does not affect the size of any transaction in the block (compared to when that transaction was unconfirmed and in the mempool).

The transactions come after that counter just listed one after another with no additional information separating them (transactions follow a specific format so it is trivial to know when one ends and the next starts).


Why does the BFL Single produce ~50% stales with P2Pool?

The BFL single produces high stale rates on P2Pool because of the way its firmware is designed. The BFL does 2^32 hashes and then reports any shares found. This takes it about 5 seconds.

With solo mining or typical pools, the work unit you get is valid for several minutes or until a new block is found (on average, one every ten minutes). So the average delay of 2-1/2 seconds between when you find a share and when it's reported has no effect. But P2Pool operates with an effectively much higher block rate because you're building blocks for the P2Pool chain.

Essentially, it comes down to which races you're trying to win and whether an average 2-1/2 second handicap matters.

Solo mining: You're trying to find a block before someone else does. That happens on average every 10 minutes. So your 2-1/2 second handicap costs you about .4%.

Conventional mining pool: You're trying to find a share before the block is invalid. You can find multiple shares inside the same work unit. Work units typically last at least 4 minutes. Worst case, your 2-1/2 second handicap costs you about 1% (usually less, especially if the pool has a forgiving stale policy).

P2Pool: You're trying to mine a P2Pool block before anyone else finds a share. Multiple shares in a work unit are useless as only one block can come next on the P2Pool chain. The average time to find a new P2Pool block is 10 seconds. Your 2-1/2 second handicap (plus loss of additional shares per block) costs you about 25%.

Unfortunately, all these penalties should be doubled because the same penalty hits you when a new block is first found. All your units spend, on average, an extra 2-1/2 seconds finishing their work on the old block. (Effectively, the entire 5 seconds spent on a work unit while a new block is found is wasted. Any shares found before the five seconds are over are wasted since it's too late to use them, and any shares found after the five seconds are over are wasted since they were based on the wrong block.)

The fix would be a simple firmware change to make the FPGA report a share as soon as one is found. That would solve half the problem. The next change would be to allow the FPGA to start working on a new work unit when a new one is available without having to finish the previous. That would solve the other half of the problem.


Not receving Bitcoins to my testnet wallet

At last I found this one. this was the only one which was working.
I tested on some coins and send them back.


Is there a Bitcoin Cash explorer that supports Xpub addresses?

Blockonomics supports lookup of xpubs and multiple addresses. They recently announced support for BCH


Why do non-mining nodes listen to transactions?

There are multiple reasons.

Wallets Maybe the node operator also has a wallet, and is interested in seeing unconfirmed transactions that pay him. It's generally discouraged to have a business depend on irreversible actions taken based on unconfirmed transactions, but this is not true for everything. You could for example start preparing a shipping order as soon as an unconfirmed payment comes in, but verify that the transaction is confirmed before it actually goes out the door.
For fee estimation Maintaining a set of unconfirmed transactions in a way that lets you predict what will be confirmed in the near future (specifically, by running the same code as miners do) gives you insight in how fast network transactions with certain properties get confirmed. You cannot base this information purely on what you see in blocks, as that can be trivially gamed by miners (e.g. by stuffing their own blocks with a number of very high fee transactions).
For network propagation Modern block relay solutions (like BIP152 Compact Blocks, FBRP, FIBRE, thin blocks, ...) rely on the fact that most transactions in a block can already be known to the receiver ahead of time, if they maintain a pool of unconfirmed transactions. These protocols massively reduce the time needed to get a block relayed across the network.

Bitcoin Core since version v0.12.0 supports the -blocksonly flag, which disables all downloading and relay of transactions. It comes with a bandwidth reduction, but also loses the benefits listed above.


Should I be running Bitcoin Core or Bitcoin-XT?

The two pieces of software, Bitcoin Core and Bitcoin-XT, are very similar. Bitcoin-XT is actually just a fork of Bitcoin Core with some features added that Bitcoin Core developers didn't deem appropriate, such as a larger block size (BIP 101) and relaying of double spends.
Bitcoin Core is more up-to-date with all of the work that the community doing. Additionally, Bitcoin-XT now has a different consensus protocol regarding the maximum size of blocks. There has been much debate within the bitcoin community about if/how/when to increase the artificially imposed block size limit (of 1 MB), and one attempt to resolve this debate is being done through Bitcoin-XT.
The Bitcoin-XT README.md has these notes on how it is different than Bitcoin Core:

Support for larger blocks. XT has support for BIP 101 by Gavin Andresen, which schedules an increase from the one megabyte limit Bitcoin is now hitting.

Relaying of double spends. Bitcoin Core will simply drop unconfirmed transactions that double spend other unconfirmed transactions, forcing merchants who want to know about them to connect to thousands of nodes in the hope of spotting them. This is unreliable, wastes resources and isn't feasible on mobile devices. Bitcoin XT incorporates work by Tom Harding and Gavin Andresen that relays the first observed double spend of a transaction. Additionally, it will highlight it in red in the user interface. Other wallets also have the opportunity to use the new information to alert the user that there is a fraud attempt against them.

Support for querying the UTXO set given an outpoint. This is useful for apps that use partial transactions, such as the Lighthouse crowdfunding app. The feature allows a client to check that a partial SIGHASH_ANYONECANPAY transaction is correctly signed and by querying multiple nodes, build up some confidence that the output is not already spent.

DNS seed changes: bitseed.xf2.org is removed as it no longer works, and seeds from Addy Yeow and Mike Hearn are (re)added to increase seed diversity and redundancy.

So, if you support these changes and/or the possible future changes on the consensus-block-size-limit, run Bitcoin-XT. The releases are available here: https://github.com/bitcoinxt/bitcoinxt/releases