How can I avoid transaction malleability consequences? Please note that this question is NOT a duplicate of other questions regarding transaction-malleability.

My question is regarding a following scenario, that could happen on an exchange that uses on-chain wallet management:

user deposits funds on address A, belonging to his account on an exchange. Exchange waits n confirmations before it credits user account.
user then moves funds from address A to address B, which also belongs to his account on the same exchange. Exchange doesn't wait for any confirmations here, because the it knows it won't double-spend itself. Exchange thus notes the TXID of this transaction for future use.
while transaction is unconfirmed, someone exploits transaction malleability issue and pushes its tweaked version, which gets picked up by miners instead.
in the mean time, user wants to withdraw funds to address C, which is another exchange or external wallet. Exchange creates this transaction using TXID that it stored earlier. Unfortunately, Blockchain doesn't know this TXID because it was rejected by majority of miners. The exchange though doesn't get immediate feedback about that, because it doesn't know that a tweaked version of that transaction exists (since both are still unconfirmed)
in effect, funds are not withdrawn, and exchange operators are left wondering why this happened.

Now the following situation has NOT happened to me (yet), but I'm wondering:

is it realistic enough that it could happen, or is there something I missed?
how I can guard against this? For me it seems that the best fix for this would be use of the new NTXID instead of TXID in transaction inputs. But that will probably not be possible in near future, because required quite a big change in the protocol.

This is the new issue, the one that's causing all the trouble. You basically have two choices:

Don't spend any of your own outputs until you're quite confident they're fully confirmed. For example, you could wait for three confirmations.
Be prepared to deal with this problem by monitoring your outstanding transaction chains and re-issuing any orphaned transactions with new input transaction IDs.


the 12 - word phrase dilemma Just started with exodus. downloaded it and set up an account.
after a couple of days, I want to log in, but can't. The password doesn't work. When I want a prompt, I am asked for some 12- words -phrase that I never heard of before!
If I was never asked to set my 12-word-phrase before or given one (cause I don't know how it works, really) does it mean I never successfully started / opened my account?
the help guys didn't answer to my 2nd message....

See

https://support.exodus.io/article/37-how-do-i-get-started-with-exodus

Backup your wallet to keep it safe
Once you have had a look around the Exodus wallet and you like it, it is time to go through the backup. During the backup process you will receive your (randomly generated) secret phrase of your wallet. This is a secret phrase that functions as a master key to all of your assets, if you would like to know more about your secret phrase then please check out this article: 12-word secret “recovery phrase”

If the password to the wallet doesn't work and you haven't transferred money to the wallet then you can probably just start again.


Trying to find an efficient method to process all transactions directed to my BTC address I am building a website which involves in the processing of transactions of BTC. My current and most efficient plan to complete this would be to call these bitcoin-cli commands and process the data accordingly:
getblockcount - get block height
getblockhash blockheight-5 - get the block hash for the last 5 blocks
listsinceblock blockhash - list all transactions since then

I would run this order of commands every 5-10 seconds. I would like to know if this method wont screw me over at all (skipping transactions, etc). I might just be too paranoid about clients not getting what they paid for and just want a guaranteed method that no transactions slip by. I was hoping to call a method that can list all transactions since a certain time but that wasn't available. Now to the question:

Is this method CPU/Network intensive?
Is it a safe method?
What are my alternatives?

I have found the answer to my own question
To make sure every transaction goes through my script I have decided to use walletnotify. This is a feature of bitcoind and will run a bash script every time there is a new transaction with the transaction id. I was able to place this in my .bitcoin/bitcoin.conf file with the parameters like so:
walletnotify=/bin/echo %s | /bin/nc -U /root/nodejs.sock
I used netcat to bridge my requests from bash to NodeJS however you can use your %s transaction data any way you like.


Is the UTXO set size important for non-mining full nodes? Recently, I have seen a lot of development effort going into techniques for different ways of storing, pruning UTXO/TXOs. The main motivation cited is reducing block orphaning, which is mining-fullnode-only problem. My personal fullnode does not care about if the UTXO is fetched from disk and takes time to verify. (as long it's well under 10 mins)

Miners (referring to pool owners who actually run the full node) today are rich people with huge amount of investment costs. Buying extra RAM should be relatively small investment compared to other things.

I understand that bitcoin is a open source project and anyone can work on whatever they like, but I fail to understand the real motivation/need for UTXO set pruning.

1) Is there some other reason for research behind UTXO set size other than preventing block-orphaning (large UTXO set so that it does not fit in RAM ==> longer time to validate blocks for miners ==> More orphans)?

2) Directly related to the first question, is making sure that UTXO set fits in RAM really that important for non-mining full nodes?

The main motivation cited is reducing block orphaning

Where do you see this being cited?

AFAIK, the motivation is to reduce the resources required to run a full node which has nothing to do with reducing block orphaning. Furthermore, the size of the UTXO set does not really effect block orphaning that much, especially with compact blocks and FIBRE allowing blocks to be relayed without being fully validated.

  My personal fullnode does not care about if the UTXO is fetched from disk and takes time to verify. (as long it's well under 10 mins)

Your node does not just need the UTXO set when verifying blocks. It constantly needs it to verify the transactions that it receives. Your node does not just sit idly doing nothing between blocks, it constantly receives transactions, verifies them, and relays them. If access to the UTXO set is slow, then verifying these transactions is also slow. It also means that your computer may be devoting a lot of extra resources in order to try to process transactions quickly which will impact its performance in other tasks if you use your computer for more than just a Bitcoin full node.

  1) Is there some other reason for research behind UTXO set size other than block-orphaning?

As mentioned earlier, block orphaning is really unrelated. The main reason is to keep the cost of running a full node down to allow full nodes to be run on as low end hardware as possible (e.g. a raspberry pi) so that there are more nodes. Having more full nodes is better for the network, and keeping the size of the UTXO set small helps allow for lower powered hardware to be used for full nodes.

  2) Directly related to the first question, is the UTXO set size really that important for non-mining full nodes?

Yes. All full nodes need the UTXO set in order to validate transactions. If the UTXO set is too large, it becomes more expensive to retrieve data from the UTXO set which thus increases the costs of running a full node.

Presumably you do other things on the computer that runs your full node. You don't want the node to take up all of the resources of your computer, otherwise you wouldn't be able to use it to do other stuff. Part of keeping the node performant is to reduce the size of the UTXO set.


Coins sent - visualise shows coins moved on - so I didn't send to another wallet of mine? Transaction ID:
6a1d9ab775f6b028a037deef37723fbf506947103f2c2f6e9c32149e0dffca34

I sent bitcoins in the above transaction.  I'm trying to determine if I sent to another wallet of mine, or to another person.

If I sent it to another wallet of mine, they would still be there, as I haven't spent them.

When I go to:
https://blockchain.info/tree/267511038

I see that the bitcoins have moved on to
1Lw536Fvjg6KkCeAYetn7wopF3XEWbrY9y
and
32Vh3B83zoaRUsTahWTxpmcgnNXG727u7n

I'm concluding that I didn't send the coins to another wallet, but to another person, who has spent them.

amiright?

The transaction you posted has one output of 0.06193935 BTC to 1L6RYKMx4neDxVngWtsw59EteCxDfvADBk. The last time somebody spend an output from this address was today.

Based on what you describe, it's probably not your address.


How to generate Electrum address with pybitcointools I want to create a payment service where I want to be able to charge each client according to its invoice. I picked Electrum as my underlying wallet and pybitcontools as my Python interface.

I would like to assign for each invoice a separate address. However, using wallet GUI it requires a person doing so and would like to automate that. Sadly, I am unable to replicate the Electrum addresses and am a bit lost at what is going wrong

My current test code:

import bitcoin as btc

electrum_master_public_key = 'xpub67xegn2C1yS...'

for i in xrange( 5 ):
    print btc.pubkey_to_address( btc.bip32_descend( electrum_master_public_key, [0,i] ) )

All my generated addresses start with a 1 whereas Electrum's star with 3. Would appreciate if somebody would help me to link the two.

Electrum's addresses will only start with 3 if you are using some sort of Multisig (i.e. you either have a Multisig wallet or are using the TrustedCoin 2FA thing). With Multisig, you will need to get the master public keys for the other signers in order to create the right addresses. If you do have those keys, then you can use the bip32_hdm_addr function to create those addresses.

Non-multisig addresses will start with 1, and that is what most wallets will create by default as multisig requires multiple parties.


What precautions to take when working with only one or two confirmations? I am providing a service that accepts Bitcoin. In order to speed things up a bit, I am planning to reduce the number of confirmations I require before I consider the money to have arrived.

I have read that it is quite safe to work with even a single confirmation if you take some precautions measures. What are those?

More specifically, with which options should I run bitcoind ?

At the moment there's very little orphaning of blocks, and next to no occurrence of two-block side chains. Unless you're dealing with large amounts (larger than two block rewards worth, probably), your chances of attack are incredibly incredibly low. If you're dealing with amounts less than a few BTC, I'd personally be happy accepting one-confirmation transactions.

There's no specific flags for bitcoind that you can use to control confirmations, it's all in your software's side. Generally if you're a merchant, you should avoid having a listening node (set listen=0) just to be on the safe side. Be sure to be using cold storage if your server accumulates a target-worthy amount of currency, by sending off to an address that the server does not know the private key of.

If you're not using walletnotify to control your internal accounting system, you probably should.


How do I enable segwit in Bitcoin Core 13.1? Bitcoin Core 13.1 includes the segregated witness (segwit) soft-fork. The release notes say:

  Segregated witness (segwit) is a soft fork that, if activated, will allow transaction-producing software to separate (segregate) transaction signatures (witnesses) from the part of the data in a transaction that is covered by the txid.

How do I activate segwit in Bitcoin Core 13.1? I couldn't find a command-line option for enabling it.

SegWit has to be activated on the network first. Signaling will start on the 15th of November. When there is a difficulty period where 95% of the blocks signal readiness for SegWit, it will be activated after another two weeks of fallow.

Creating SegWit transactions before it is activated on the network can lead to complete loss of funds.

After it has been activated, you can use SegWit by providing the sender a SegWit address (similar to a P2SH address). Likewise, to send a SegWit transaction, the recipient has to generate a SegWit address for your use.

This means that only wallets that already support SegWit will be recipients of SegWit transactions.


BitCoin miners working on confirms With so many confirms on any one bitcoin trade, how do the multiple miners make any money. do they split the fee between them until it's so minuscule it's ridiculous?

The number of confirmations a transaction has is a measure of how many blocks make this transaction permanent. The number of confirmations a transaction has minus one is a measure of how deep a transaction is in the blockchain.

The deeper a block is in the blockchain – that is: the bigger the difference between its block number and the highest block number in the longest blockchain it is apart of is. –, the exceedingly less likely it is that it is ever going to not be part of the longest blockchain.

For a transaction, this means that they are more permanent the further down they are because it then becomes exceedingly unlikely that the block it's in is ever going to not be part of the longest blockchain.

In any valid blockchain, a transaction can only appear at most once.

If a transaction is not part in any block of the longest blockchain, it has 0 confirmations. If it is included in the newest block, it has 1 confirmation. Once there is another block on top of that block, it has 2 confirmations. Another block on top of that one, and it has 3 confirmations, etc.

A transaction's fee can only be collected my the miner of the block it is included in. And it usually is collected by that miner, of course.


How long does it take to receive bitcoins? I bought 1.25 BTC but after 2 days I see nothing. What is wrong?
This is the transaction.

Also, I went to freebitcoins.appspot.com, since they claim thay they give for free 0.005 bitcoins per visitor. I did everything correct and the site said that I could see the transaction at freebitcoins.appspot.com/recent_sends.

But when I clicked on my transaction, it said: No such transaction

http://blockexplorer.com/tx/1eaf91e7d4ae3a8f976eaa346f4332d8bfd999d209ef899612e5b2995db0eeb9

Please guys tell me what is wrong?

You should check the following:

Are you sure you entered the right address to receive the Bitcoins?

If the address is not correct, the coins are lost

Did your Bitcoin client download all the blocks in the chain? (>150000)

If not, you need to let it run for awhile, until it downloads all the blocks, making sure that you have a couple connections and the block number is slowly increasing in your client application


China is 98% of the bitcoin market? I saw the following graphic listing the source as Bitcoinity claiming that the Chinese exchanges are 98% of the "global bitcoin market".

Is this true?

Chinese Bitcoin exchanges don't take a fee per trade and some actually reduce the withdrawal fee if more trades were made.

Outside of China, exchanges usually take a fee on each trade. The volumes therefore are not really comparable, and I sincerely doubt that the actual economic activity is so much bigger in China.


Inflationary (no total coin limit) cryptocurrency where miners keep all new coins Is there an inflationary cryptocurrency with following features?

No fixed limit on total coins (coins will be emitted forever).
Miners are the only source of new coins.
Mining reward (new coins) go all to miners.

I found several inflationary ones like Freicoin or Devcoin, but they seem to have various hybrid models where newly mined coins are (at least partially) transferred to other subjects than miners (various foundations, developers etc.).

PPCoin and its offspring NovaCoin have an infinite money supply - even though the reward for blocks gets diminished over time (as in Bitcoin et al.), as the money supply increases there will be more and more coins offered as reward for simply hoarding the coin.

There are also built-in deflationary mechanisms for destroying coins with every transaction, so hopefully the money-supply would self-adjust: increasing or expanding as needed, depending on how much it's actually used.


Can you use non-standard characters for creating a Bitcoin Brain Wallet? Can you use non-standard characters to create a bitcoin brain wallet? Ex. Chinese characters, ascii characters using the numberpad with ALT key.

Is there downsides to this?

In short words: yes.

But you should know the algorithm how brainwallets are generated. Nobody guarantees that brainwallets on different services are generated with the same algorithm.


Mining profitability sounds too good, where is the catch? I am a beginner looking into Bitcoin mining. I don't want to waste time (or electricity) so I started looking into hardware mining rigs, for example:
Saturn

priced at $3000 USD,
275GH/s, consumes ~400Watt
(or even Monarch from butterfly labs which claims 600GH/sec @ 350W, priced $4700)

I put these numbers + my local electricity price + current difficulty into a decent calculator,
and I get >7,000 $USD profit for 3 months time frame (or >18,000$ for the Monarch). Sounds a bit too good to be true.

I know BTC/USD rate might fluctuate, and that the miner will produce heat, but still. - Where's the catch/mistake, if at all?

Keep in mind that difficulty also evolves over time: the more hashes the network produces, the higher the difficulty becomes.  As of this writing the difficulty is 148,819,199.  By my computation, each additional 275GH/s rig that joins the network will increase the difficulty by about 40,000; if 4,000 of them are sold, the difficulty will more than double (not counting all the competing mining rigs that may join the network).  And of course, in a few more months, there may be even more powerful rigs available.  So you should expect difficulty to rise, perhaps sharply, and this will decrease your profitability over time.


Change difficulty using bitcoin-cli/bitcoind in regtest mode Is there an RPC command which would allow me to generate blocks under a given difficulty? For instance, I would like to do something like this:
bitcoind -daemon -regtest
bitcoin-cli -regtest setdifficulty 100
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
bitcoin-cli -regtest setdifficulty 1
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u

I am aware that it would result in an invalid blockchain, since it would not match the expected target recalculation of the Bitcoin protocol. This "detail" aside, is there any way to use bitcoind/bitcoin-cli to perform something like this?

No there isn't. Regtest is not designed to test mining ASICs and the motivation for such a RPC seems limited given regtest is for local testing.
However, if you want to experiment with mining on a network with limited network hash rate you could either try mining on the default Signet administered by Kalle Alm and AJ Towns or you could set up your own custom Signet network and then use the Signet mining utility in this PR (19937) to mine blocks. AJ Towns lays out some examples in a PR comment.
e.g.

Generate blocks indefinitely, at 10 minute intervals, paying block
reward to the given address, using bitcoin-util to do multi-threaded
proof-of-work:
 ./contrib/signet/generate.py --cli='./bitcoin-cli' generate 10 --block-time=600 --address="tb1..." --grind-cmd='./bitcoin-util grind'


Why is the winner of Pow different everytime? I just read about how miners have to change the nonce bit in order to find an hash below a certain result.

Granted each miner process it the same way, incrementally, adding 1 and hashing, adding one and hashing, what prevents the most powerful computer on the network to snatch all rewards?

I feel like beside the moment each miner starts mining a block, there's no room for luck and a lesser powerful machine, to ever add a block.

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.


Does Ethereum support the features necessary to create the Lightning Network? The Lightning Network of micropayment channels is a concept first conceived by Joseph Poon and Thaddeus Dryja. It requires a few features of bitcoin that are not available yet.

OP_CHECKLOCKTIMEVERIFY - to make scriptPubKeys which cannot be spent until some predefined time.
OP_CHECKSEQUENCEVERIFY - to make scriptPubKeys which cannot be spent until some set time after the original transaction. (Also called OP_RELATIVECHECKLOCKTIMEVERIFY)
Segregated Witness - Referencing which output you are spending by (TXID, n) should not reference the malleable signatures of the transaction with the output.

Does Ethereum support these, or equivalent, features?

They don't need to support those. As mentioned by Roman you could build the entire LN in one contract. You can even implement the LN Relative OP_CHECKLOCKTIMEVERIFY requirement in a much better way.

In fact you can add more functionality than is possible with the Bitcoin LN, you could allow people to add more Ether to their side of the channel with offchain transactions.

Tx malleability also doesn't need to be solved (a very difficult probelm in Bitcoin) because it doesn't pertain. A LN contract wouldn't have to chain offchain transactions in any way, just passing signed offchain 'notes' of a sort that contain information relating to amounts, blocknumber for available release, etc...

It is also somewhat trivial to add the hub and spokes part where a random value R is hashed to create H and allow payments to hop through multiple parties (but in Ethereum you could do it without the problem of locking up funds that they need an extra OP CODE to solve).

Disclosure: I'm actually working on this in my spare time.


Script - Is it possible to build an addresss that allows retrieve a certain amount per address? Is it possible to define a multi signature address that allows spending only certain percentage to each signature?

For example, three different people with different public-private keys build an pay to script address with a script that allows spending only 34% of the total amount.

So instead of requiring multiple signatures to spend the amount, it define limits on each signature.

Each output can only be spent atomically. Either the entire amount or not at all.

The scripts are not evaluated for any “amount”. The script machine evaluates to true or false.

Of course, it is possible to spend this multisig output to multiple other outputs, each with a separate amount and output script (spending destination).


Pledging mechanism using Bitcoin Is there an obvious way that I can achive the following with Bitcoin?

An organizer sets a goal: an amount of bitcoins must be gathered within a specific amount of time
Random pledgers send an amount within specified boundaries (min/max amounts).
If the goal is reached within the specified amount of time, the organizer collects the pledges
If the goal is not reached within the specified amount of time, the pledges are returned to the pledgers

AFAIU the above model is similar to Mike Hearn's LightHouse project, however I cannot use this great platform for my project and on top of that I would like to be sure that I'm headed in the right direction, so any ideas and alternatives on how to achieve the above are more than welcome.

Have a look to https://bitcoin.org/en/developer-guide#term-sighash-anyonecanpay
SIGHASH_ALL|SIGHASH_ANYONECANPAY

Organizer creates transaction with one output and none inputs. Any person can add his funds to this transaction. Once the needed amount is collected the transaction can be sent to a network.

  An organizer sets a goal: an amount of bitcoins must be gathered
  within a specific amount of time

Seems to me that specifying amount of time is not possible

  Random pledgers send an amount within specified boundaries (min/max
  amounts).

Fixed amount.

  If the goal is reached within the specified amount of time, the
  organizer collects the pledges

Let us say "if the goal is reached one time the organizer sends this transaction to a network".

  If the goal is not reached within the specified amount of time, the
  pledges are returned to the pledgers

Any pledger can re-spend his funds at any time before organizer creates valid transaction


After mining a block and getting a hash. What do i do next? I am pretty new to bitcoin.Suppose I mined it with a mining software. Now what do i do to earn a reward? How do i see the transactions? How do know what the block is? Most importantly, where do i submit the hash? Please help me. I am very grateful.

As a miner you first pick a set of transactions that you want to include in a block. Then you calculate the block header fields, add some randomness, and check whether that block candidate passes the difficulty requirement. If it does not, you create a new block candidate and try again.
When a block candidate fulfills the difficulty requirement, you have found a valid block. Your node then announces the block to its peers.
As the transaction set is picked as an input to the mining process, the block's content is already known. The block reward is paid out by the miner to themselves: the first transaction in the block, called the coinbase-transaction, pays the transaction fees and block subsidy to the miner. Each miner includes their own address in their block candidate's coinbase transaction, so whoever finds a valid block gets paid. Outputs of coinbase transactions can only be spent 100 blocks later, so only blocks that become part of the best-chain get paid.


How do I read a script? How does the processor separate "data" from "commands"? I'm trying to understand how a script works but am having trouble reading a script (the output of one Tx... and the input of a second Tx) and figuring out how the computer (bitcoin-qt) knows which input in the script is data and which is a command.

Please correct my assumption:

The script is read left to right and is the concatenation of the output of a preceding Transaction to the input of a consuming Transaction
A script output can have only one corresponding transaction script that consumes it.
There are several script commands and several are disabled in the current version of the client
The script can not rely on outside information (stock ticker) but can rely on an Oracle for these dependencies.
The script commands that are "commands" require certain data to be on the stack in order to function correctly
There are "standard scripts" (but I'm unclear if this means non-standard scripts may never get incorporated into a block)
If the concatenated evaluation of a preceding Tx Output and a subsequent Tx Input evaluates to true, then the transaction is valid.

Question

Can anyone tell me if those thoughts about scripts are correct?
How does the forth like processor know the difference between data on the stack and commands on the stack?
Does the processor think everything is just data until it hits data that matches a known "function"

The script is read left to right and is the concatenation of the output of a preceding Transaction to the input of a consuming Transaction

Basically, though the scripts are not actually concatenated. The scriptSig is run, and then the scriptPubKey is run on the resulting stack. This distinction is occasionally important.

  A script output can have only one corresponding transaction script that consumes it.

There are many possible scriptSigs that could "solve" any scriptPubKey, but each output can only be spent once in a valid block chain.

  but I'm unclear if this means non-standard scripts may never get incorporated into a block

They can get into blocks, though miners using the standard client will never add them to their blocks.

  How does the forth like processor know the difference between data on the stack and commands on the stack?

Data is preceded by bytes 1 through 78, the pushdata ops.


Why wouldn't miners change the protocol? (e.g. change difficulty) How about a scenario where a few miners change their protocols by setting difficulty to something easy. Let's take it to the extreme and say they are able to accept any block.

They would keep publishing blocks which they think are valid and those would get rejected by the network. What if more miners start joining that scheme though (by changing their protocols)?

Because they are able to publish blocks extremely quickly (because they set their difficulty low) they might actually be able to compete with the whole network and their branch might overtake the network branch even if they are not that many of them.

What am I missing here?

The rest of the network, which uses the existing difficulty parameters, will reject the new blocks generated by your modified miners. There will be a longer blockchain, but there will not be a longer valid blockchain according to the established rules.


Buy bitcoins with my regular AMEX (american express card) I can not find any website or service to buy bitcoins with my AMEX.
www.bctquick.com does not work aymore ? (webpage inactive)

any advise ?

You can try virwox.com but it will also depend on the country that you choose for sign up. I know that when you use Germany as the country for sign up, you can pay with AMEX but you will have to covert to SLL first before you can get the bitcoins. I hope this helps eventhough you asked this question long ago!!


c-lightning node backup-restore How do I restore a c-lightning node from  a backed up hsm_secret ?
I have tried running lightningd by replacing the generated hsm_secret with the backed-up one. It shows no output and no channel.
How can I retrieve the funds in the node from there ?

The hsm_secret is used to derive keys for both onchain and offchain (channels commitments) transactions.
On chain
To retrieve on chain funds you can rescan the block chain for your utxos by using the --rescan startup option of lightningd.
Off chain
You can not re create the whole state of your channels just from the hsm_secret, which are stored in the database. Moreover it's very discouraged to restore from a backed up database (penalty transactions...).
Fortunately, with the option_static_remotekey now enabled by default you can now claim your funds onchain after your peer force closed the channel (if the channel was opened when both peers signaled this option).
The process is detailed here as part of the C-lightning FAQ draft.
How do i backup, in practice ?
The different backup solutions currently available are detailed here.


Scripts within Scripts I have read the following:

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

https://darkwallet.is/bip16-17

However, I would like to know, can one specify a pay-to-script hash that includes another pay-to-script hash?

E.G.

Script for payer:
DUP HASH160  EQUALVERIFY CHECKSIG

scriptA:
DUP HASH160  EQUALVERIFY CHECKSIG

Can one include a CHECKSIG operation for another script inside a script referred to by a pay-to-script hash?

I'm probably not communicating this clearly, but I would basically like to know whether I can "daisy-chain" pay-to-script hashes together.
Let me know if I should add more examples, or what changes I should make to this.

No.

BIP-16 says that client executes script and if it matches P2SH - removes top item from the stack and executes it as script. That's all. No inner loops and checks.


Edge cases for BIP32 I'm trying to code up BIP0032, with full test coverage and I hit a snag with these very rare edge cases:

Private parent key → private child key
In case parse256(IL) ≥ n or ki = 0, the resulting key is invalid, and one should proceed with the next value for i. (Note: this has probability lower than 1 in 2^127.)
Public parent key → public child key
In case parse256(IL) ≥ n or Ki is the point at infinity, the resulting key is invalid, and one should proceed with the next value for i.

I have not written any code around these conditions as without test cases to show I have done it correctly, it's pointless.
I've successfully tested my code with 30 million addresses generated from another library, but I think to stand a better than 50/50 chance of finding one of these edge cases I would have to check in the order of 10^19 (source: Birthday attack).
So my question is, does anyone have any test vectors for these cases?
The alternative is to have a whitebox test that passes bad IL values directly to an otherwise private function, but I'd rather have a blackbox test.

I doubt anyone will have such a value since it would require a tremendous amount of computation. One approach would be to monkey patch your HMAC-SHA512 function to return a value with 32 leading zero bytes for the purpose of the test.


When adding funds to wallet via snapswap, what exchange rate is in place? I just added $1500 to my ripple wallet, but its showing up as XRPs in my wallet. Not only that, but the exchange rate is incredibly terrible, for 500 dollars, ripple gave me 500XRPs?  How is it that I only get 1500 XRP in my account when XRP is trading at $0.03???? How is this possible?

This exact question was asked and answered on the Ripple forums.

It appears as if SnapSwap doesn't give appropriate instructions on what the procedure is for sending funds into a brand new Ripple account/wallet.

The general procedure is approximately this:

First you send then USD via your bank and provide them with your Ripple address.
Then they send you a small amount of XRP to initially fund your account. A brand new Ripple address cannot receive anything other than XRP so they cannot send the USD to you yet.
You extend a suitable amount of trust to their issuing address. This requires a small amount of XRP from step 2 be reserved.
They send your funds to you as a USD/SnapSwap balance in Ripple.

For future use, when you send funds into Ripple via SnapSwap to an already funded Ripple account, they should directly send the USD to your Ripple account as step 2 (assuming you have a sufficent trust line aka payment path setup).

After that you can use the USD/SnapSwap in Ripple in payments or to trade. In particular, if you want XRP you can use the "convert" page in the Ripple client to covert all or some of your USD into XRP at the best current market rate Ripple can find.


How would I generate a valid vanity address for destroying coins? I want to generate very long vanity addresses, with the relaxed constraint that I don't need the corresponding private key, they only need to be valid Bitcoin addresses. How would I do this?

Example:

Input Prefix: 1XXXXXXXXXXXXXXXXXXXX
Output: 1XXXXXXXXXXXXXXXXXXXXUW9j3f3

You can do this manually using the hex/base58check converter (such as the converter on brainwallet.org)

Remove the starting 1 and convert from base58 XXXXXXXXXXXXXXXXXXXXXXXXXXX to hex: 25c7415deb828c49ccb799c452ae17589bca1af2 (make sure result is 24 bytes)
Remove last 4 bytes to get a 20-byte hash:
25c7415deb828c49ccb799c452ae17589bca1af2 -> 25c7415deb828c49ccb799c452ae1758
Convert from hex 25c7415deb828c49ccb799c452ae1758 to base58check: 1XXXXXXXXXXXXXXXXXXXXXYDgWVE

Final result is valid 1XXXXXXXXXXXXXXXXXXXXXYDgWVE


Is libsecp256k1 faster than OpenSSL? Bitcoin Core is eventually going to replace OpenSSL with libsecp256k1 for all ECDSA operations. As I understand it, this is motivated by wanting consensus-critical rules to not depend on OpenSSL.

Is libsecp256k1 signature verification also faster than OpenSSL? I've heard conflicting information about that.

Yes it's a lot faster. For example from one of the core developers:

reddit - Pieter Wuille / 2015-02-19 18:13

  Just did a benchmark on libsecp256k1's current master, without GMP,
  without hand-written assembly, and it's around 3.6x faster than
  OpenSSL on my machine (64-bit code, i7 cpu). When the assembly is
  compiled in (which does not require any extra dependencies anymore),
  it's 4.9 times faster.

http://www.reddit.com/r/Bitcoin/comments/2weymr/experiment_bitcoin_core_0100_initial_sync_time/coqghm2

This talks about signature verification, which is currently the bottleneck when catching up to the blockchain.


Restore Wallet From Jaxx to Coinomi: ETH missing (but BTC and LTC are fine) I have some BTC, ETH and LTC in a wallet created with Jaxx, but I want to use Coinomi instead. I downloaded Coinomi and chose Restore Wallet and entered my 12 words. My BTC and my LTC popped right up, but the ETH is nowhere to be seen (even after several hours).

I've tried adding some additional ETH wallets as suggested in this thread: https://www.reddit.com/r/COINOMI/comments/7b8wxb/help_lost_ltc_when_restoring_my_old_wallet/

I can still access all currencies in my Jaxx wallet, so I could just transfer the ETH to my wallet in Coinomi, but I'd quite like to keep my transaction history.

Should my ETH be showing in Coinomi? Or am I wrong in my assumption that I can use my 12 words to restore in another wallet?

Jaxx uses a different derivation path than Coinomi when handling ETH. Coinomi opted for the path as described in the ETH specification. Ledger has the same scheme as Coinomi.

Jaxx: M/44H/60H/0H/0
Coinomi: M/44H/60H/0H

You will have to do the following:

Delete any existing ETH wallets you have added by long pressing them (2 sec) in the Overview tab and clicking on the trash icon that appears.
Add another ETH wallet, but before clicking ADD, click on the gears icon next to the coin name in the coin list and then click on "ADVANCED SETTINGS" link on that popup, and enter this entire text in: M/44H/60H/0H/0 Then click add.

You should now see your ETH balance in Coinomi.


How to upgrade bitcoind in docker? I am running the docker version for c-lightning 0.7

On a raspberry I need to clone the blockchain, but it needs version 0.17.1

Looking at the docker-compose.yml file I see:

version: "3"
services:
  bitcoind:
    image: nicolasdorier/docker-bitcoin:0.16.3
    container_name: bitcoind
    ...

How can I upgrade to 0.17.1?

Nicolas' docker-bitcoin image has 0.17.0 tag available, so changing that image to that version should just work:

version: "3"
services:
  bitcoind:
    image: nicolasdorier/docker-bitcoin:0.17.0
    container_name: bitcoind
    ...


What is more effective than ASIC mining? Considering that mining progressed from CPU, to GPU, to FPGA, and now ASIC mining... have we finally hit the end of the road for technological advancement?

What future optimizations can occur after ASICs are widespread?

Well, the ASICs machines would probably be more and more refined over the years (like processors), they can get bigger and so forth. So that will probably be the progress for a long while.

Asides that, we have the quantum computers that might be the next big leap forward for all fields of computer science, but for now they can only do really small calculations (3x5=15... on 5 atoms, or something like that). However, there is no telling if and when quantum computers might become viable enough to do anything Bitcoin-related with them, or even whether they might be used to destroy Bitcoin's algorithms altogether.


I had money on MtGox, can I get it back? From what I understand mtgox lost bitcoins but I had traded the bitcoins for dollars before the bankruptcy. Am I understanding it correctly or am I wrong?

MtGox has millions of USD missing according to the latest news reports. The final draft of what, where, how and why has yet to be published by the administrator however.

Some customers who lost money with MtGox are under the false impression that since their funds were in fiat currency instead of Bitcoin they would be safe and receive all of their money back, this simply isn't the case.

The administrator has already hinted the remaining coins would be sold and all assets pooled for even redistribution. There has been strong support for receiving Bitcoin instead of fiat amongst some creditors but it has yet to be seen how the administrator distributes the remaining funds.

If however MtGox is sold to another entity then this would obviously change the dynamics of the situation. For now there is not much to do but wait for the administrator to finalize his report and wait on an outcome for redistribution or sale.


Why do exchanges have a buy/sell column in their trade history? Why is there a type column in the trade history on exchanges like btc-e.com and vircurex.com? If all the trades are between two users on the exchange why is a buy/sell type needed? And if there is one entry for buy shouldn't there be an equal entry for sell because the person buying is buying from someone who is selling.

Yes, if someone buys at a particular price, someone else must sell at that price. But they didn't place their orders at the same time. The buy/sell indicates the direction of the filled order. This is needed to make sense of the price.

Imagine an apple exchange where no trades are occurring. Then someone walks in and buys or sells an apple for $1. Do you care whether the person who walked in bought or sold? Well, yes. If the person bought an apple for $1, that means before they walked in, someone was willing to sell an apple for $1 but nobody would buy it. If that person sold an apple for $1, that means before they walked in, someone was willing to buy an apple for $1 but nobody would sell it. So without knowing the direction of the transaction, you can't tell what the price is telling you about the state of the market prior to that transaction.

This is very important in a market that isn't very liquid. For example, say the cheapest anyone is willing to sell a Bitcoin is $1,000, but the most anyone is willing to pay for a Bitcoin is $900. If it stays that way for a while, all the executing buys will be at $1,000 and all the executing sells will be at $900. If you just saw alternating $1,000 and $900 prices without knowing all the buys were at $1,000 and all the sells were at $900, you'd think the price was changing when it's actually constant. Orders that don't execute at all aren't listed because no money changes hands. So the people selling at $1,000 and buying at $900 won't be listed as transactions.


How to send my 2X coins to an exchange from a private BTC wallet I had during the fork? So, I have a private Bitcoin wallet for which I own the private key, it is not in an exchange.

Despite the segwit2x fork was canceled, some people are still trading it and the segwit2x fork seems to still be user-activated. So it exists somewhere, isn't it?

I'd like to keep the BTC intact in my wallet and to send the 2x coins from the fork to an exchange.

Which wallet or software could I use to send the 2x coins? I googled and nothing comes up except a website that suggests using eth wallets, which is a non-sense and seems scammy.

Also, I would think of sending the 2x coins to another private wallet and then the BTC coins to another new wallet (so as to prevent replay attacks), and only then move my 2x coins to an exchange.

The 2x fork did not activate (there was a fatal bug in the code, perhaps more than one), so there is no 2x network on which to send coins.

On some exchanges, people are trading financial contracts issued by the exchange, which are related to the expected outcome of the 2x hard fork situation. This is different from an actual 2x coin (which does not exist).


Bitcoin "accounts" feature - Is it practical or scalable? On the bitcoin wiki's "Accounts explained" page:
https://en.bitcoin.it/wiki/Accounts_explained#Account_Weaknesses

It clearly states:

  The accounts code does not scale up to thousands of accounts with tens of thousands of transactions, because by-account (and by-account-by-time) indices are not implemented. So many operations (like computing an account balance) require accessing every wallet transaction.

So my question is that should the standard web developer creating a bitcoin web app using the RPC interface use (or ever use) accounts?

Should we always use the default "" account since we technically always have to use accounts when accessing the RPC for things like getting the entire servers balance?

Should we just handle our users accounts on our own databases and ONLY use bitcoind for things like listsinceblock() to store transactions and user balances in our databases?

As mentioned in the page you linked, it is a bit awkward to use Bitcoin-qt's accounts system. Don't bother with accounts as they are intended to be a way to manage your money within the program. When you're having thousands of accounts you are already doing it wrong.

So how do you structure a service to do this?

Handle accounts completely on your database. When you generate an address, store it as a field under a user in whatever database table/collection you have for users. This will allow you to quickly and easily scale your address counts in the event you grow large, Bitcoind does not scale well.

Handling receives

This is awkward to do with the current state of Bitcoind, the program never really intended to support large services. Bitcoind can efficiently detect receives to addresses in wallet. When you use the RPC interface and use the "getnewaddress" command, Bitcoind will store it in it's wallet. I've tested out Bitcoind with a million addresses before, it takes a solid half hour to start up but receives are snappy with no noticeable slowness.

Use walletnotify and/or blocknotify to get new transactions and blocks. Those two are arguments you can put in the bitcoin.conf file that specify a program to run when one transaction or block happens. Walletnotify is called per new transaction to or from an address in wallet.dat and gives a notification when it receives the transaction (unconfirmed) and then again when it's in a block (1 confirm). Blocknotify works per block. See the suggestions on how to use walletnotify here.

Just load the hashes walletnotify gives you in a database and then on block check if each one has enough confirmations, be thoughtful of the fact that Bitcoind usually has 2 walletnotify events per txn (one for unconfirmed and one for when a txn makes it into a block). And make sure the program you call is light weight and quick.

The pro method

This ways a bit advanced, rarely used and you will need some C++/Java/Python/Go proficiency. The community have made many Bitcoin implementations available as open-source libraries you can link to. Many larger services simply need more complexity with receiving transaction and better scalability, which Bitcoind struggles to provide.

It's a lot more work but you can make your own "node" with features you need easily with the libraries available for a wide range of languages. For Java there's BitcoinJ, widely depended on and reliable. For C++ there is Libbitcoin, which has pretty good examples and looks simple. Python has a bunch of node implementations and modules. Even Golang has something pretty popular.

If you need examples, Github has a lot you can find on search.


Increase maximum number of outgoing connections for full node If incoming connections are disabled, Max full-relay connections are 8: src/net.h#L64 and Max block-relay-only connections are 2: src/net.h#L68
How are these decided and how can a user change these values?
Its mentioned in doc/reduce-memory.md that each connection takes up some memory. What if the user is okay with it?
Will changing MAX_OUTBOUND_FULL_RELAY_CONNECTIONS to 32 or above help in faster sync? Or dbcache and par are the only options to improve sync?
I tried changing it to 40 but extra nodes keep disconnecting. I see this line in the logs src/net_processing.cpp#L4581 and not sure if its related to DoS protection or something else.

Update 1: I commented the if statement here: src/net_processing.cpp#L4577 Compiled successfully and tests passed. I could see more than 15 peers connected but sync almost paused after few minutes and nothing happened. Couldn't find anything useful in logs.

Issue resolved. I was able to get 16 outgoing full relay connections that are stable using the below changes in code:
Adding below lines in src/init.cpp
argsman.AddArg("-maxoutfullrelay=<n>", strprintf("Maintain at most <n> outbound full relay connections to peers (default: %u)", MAX_OUTBOUND_FULL_RELAY_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);

int nMaxOutboundFullRelay;

nMaxOutboundFullRelay = args.GetArg("-maxoutfullrelay", MAX_OUTBOUND_FULL_RELAY_CONNECTIONS);
nMaxOutboundFullRelay = std::max(nMaxOutboundFullRelay, 0);

connOptions.m_max_outbound_full_relay = std::min(nMaxOutboundFullRelay, connOptions.nMaxConnections);

And maxoutfullrelay=16 in bitcoin.conf. Tried with 20 as well and it works fine.


Lightning Network on testnet - listchannels and listnodes returning empty values I have setup a lightning node on testnet using c-lightning.
The lightning-cli getinfo command output:

{

"id" : "0315a5746114ab9f3e8f0a3f2f73153ef1e4a8fb58daa54fa97c9603dfab989a30",
   "alias" : "snjnode",
   "color" : "ff9900",
   "num_peers" : 0,
   "num_pending_channels" : 0,
   "num_active_channels" : 0,
   "num_inactive_channels" : 0,
   "address" : [
      {
         "type" : "ipv4",
         "address" : "103.72.61.18",
         "port" : 9735
      }
   ],
   "binding" : [],
   "version" : "v0.7.0-408-g0c189fe",
   "blockheight" : 1519822,
   "network" : "testnet",
   "msatoshi_fees_collected" : 0,
   "fees_collected_msat" : "0msat"
}

But lightning-cli listchannels and listnodes return empty values:

{
"nodes" : []
}

It should return the list of all nodes in the testnet network right? What is wrong?

In order for your node to be aware of all (public) nodes and channels on the network it need to download them first.

If you look at your output of getinfo you see that you don't have any peers. You should peer with at least one node for example with mine which you can find at https:ln.rene-pickhardt.de you do this via:

lightning-cli connect 03efccf2c383d7bf340da9a3f02e2c23104a0e4fe8ac1a880c8e2dc92fbdacd9df@144.76.235.20:9735

The gossip deamon of your node will then query my node for the network. Once the syncing is complete you will see all channels and nodes with the commands you mentioned.

Not that you will see some channels nodes right away as the output lists the nodes and channels it is already aware of


Get transaction after certain (tx, block, time or other) using insight-api Bitcoin CASH Now i can get all transactions by address (Bitcoin Cash) using this request to api:

https://test-bch-insight.bitpay.com/api/txs/?address=qptaxxrqcz7qunclcvlcza9an6qlqqhzlya2d4e4fn

But i want to get transactions only after certain moment(tx,block,time..). Can you help me with this?

We can cheat and use the query for Multiple Addresses, where search is available in a certain range of transactions, specifying the parameters from and to.

https://github.com/bitpay/insight-api#transactions-for-multiple-addresses

https://test-bch-insight.bitpay.com/api/addrs/qptaxxrqcz7qunclcvlcza9an6qlqqhzlya2d4e4fn/txs?from=2

If I want last tx:

https://test-bch-insight.bitpay.com/api/addrs/qptaxxrqcz7qunclcvlcza9an6qlqqhzlya2d4e4fn/txs?to=1


Is verification of a blockchain computationally cheaper than recreating it? One of the advantages of cryptocurrencies like Bitcoin that is often repeated is how hard it should be to manipulate past transactions. The reason that is often stated is that you would have to re-calculate all the headers with all the hash values of the whole chain which is practically un-doable.

My question is: How do you verify the blockchain integrity? Don't you also have to recalculate all the values to see whether they are valid? Or is the complexity class of verification different from creating a new chain? In other words is there some asymmetry at work here and if yes how does it work?

Is verification of blockchain computationally cheaper than recreating it?

Yes, far easier

  How do you verify the blockchain integrity? Don't you also have to recalculate all the values to see whether they are valid?

No.

The miner has to find a value for parts of the block they can choose a value for, such that a hash of the block has a certain number of leading zeroes. This is impossible to predict without actually calculating the hash. So miners have to try a very large number of different choices before finding one that produces the hash with the required number of leading zeroes.

The verifier only has to recalculate that hash once because they don't need to vary any part of the block.

(note, the above is a simplification but the principles apply)

Reference:

Nonce
What exactly is Mining?


sendrawtransaction RPC format across core versions Has there been any changes across core versions for the sendrawtransaction interface. I am trying to understand if upgrading the core version from say 12 to 15 needs a change in serialization. I'd also like to know if there are any versions across which such upgrade would fail.

sendrawtransaction takes transactions in the network serialization format. There is a new network serialization format for segwit transactions, so such transactions would be broadcast in one format for 0.12 and a different one in 0.15. If you are not making segwit transactions, then sendrawtransaction has not changed and you can use it in 0.15 as you did with 0.12.


Unacceptably slow bitcoin sync Bitcoin core is currently 15 hours behind as I'm writing this and the piph (progress increase per hour) is at a STUPIDLY low speed. There are 95 blocks left but it says its going up 0.04% per hour. I've read that inscreasing the cache helps. Anyone else got some ideas on a fix? Or is this just how it is supposed to be?

Edit: Bitcoin core is also apparently using 50% of my disk which is not true. An application was using 12mb/s of disk and it was only using about 20% of the disk total. Bitcoin core however is using 3mb/s and is using 50%

The usual bottlenecks for syncing are in CPU speed, memory limitations, or disk IO limitations. There isn't really a "fix" short of getting better hardware. The software is already doing as much as it can to sync quickly.

The only available "fix" is to increase the dbcache. Doing so will mean that more RAM will be used. To increase the dbcache, add dbcache=<n> to your bitcoin.conf file where  is the amount of memory you want to dedicate to this cache (note that Bitcoin Core will use more memory than you specify as it does other things that need memory besides the dbcache), or add -dbcache=<n> to the startup command, or, if using the GUI, increase the dbcache in the settings.


Are transaction ids always the same length? Do all bitcoin transaction ids (hashes) have the same length?

I guess it's defined somewhere here: https://en.bitcoin.it/wiki/Protocol_specification but still I couldn't find it.

Yes. The transaction ID is SHA256(SHA256(transaction)) as described here and thus always has a length of 256 bits (32 bytes).


How does the Bitcoin client make sure transactions were accepted by the network? When announcing a transaction, how does the Bitcoin client make sure network peers accepted it? For example, if I put in no transaction-fee but all peers I’m connected to require a fee and therefore reject my transaction, how will I notice it?

The client doesn't ensure peers accept it. If none of your peers relay the transaction, then it will likely never get into a block and will remain unconfirmed forever. Your client will continue to make attempts to relay the transaction periodically, and you may eventually connect to a client that will relay transactions that have no fee or your coins may eventually get old enough that the standard client will relay them with no fee.


Is the "recovery phrase" generated by a wallet app platform independent? I recently started a wallet with Coinbase Wallet, and I was asked to backup a 12 word "recovery phrase" that is supposed to be able to recover my wallet in the event that I delete the app from my phone. I have previously used other wallet apps, which often give "recovery phrases" of varying word count. I read online that the phrase is passed through an algorithm and used to recover a key or a group of keys.

I am now curious if these recovery phrases are platform independent (meaning you can recover your keys just by way of knowing the phrase), or if the app must exist with a specific algorithm in order to recover keys (your keys are lost if the recovery implementation is destroyed, e.g. Coinbase shuts down operation and removes their app).

The mnemonic words that is given to you by the wallets is a representation of entropy. This entropy is then passed through PBKDF2 hashing function to generate seed. The industry standard for this conversion of mnemonic to seed is documented in BIP 39 and most wallets follow that method. The seed is then passed to HMAC-SHA512 to get a master extended private key.

Until this point the implementations are standard and you are unlikely to face any issue with different wallet implementations. But after this step, the derivation gets a bit trickier. There are a number of methods to go from here. You could use BIP 32, BIP 44, BIP 49 or the BIP 84 derivation methods to generate individual private keys from the master private key. Then there will be distinction between hardened and non-hardened derivation between different wallets. Each derivation path will give you a completely different set of keys as compared to other paths.

There is a spreadsheet tracking these derivation paths of numerous wallets here (please verify the data yourself as it may be dated or incorrect). I have pasted the derivation paths of different wallets below from the linked spreadsheet.

So, when using a wallet you should note the derivation path the wallet followed in order to recover it later. Also note that use of a passphrase along with the mnemonic words will generate a completely different set of keys as compared to only using the mnemonic words.


What technical reasons exist for off-chain transactions? I'm trying to get a grasp on off-chain transactions, as they seem more common than I initially realized but they are not the way that I originally perceived bitcoin being used as an outsider looking in. What technical advantages exist for off-chain transactions?

Speed
An off-chain transaction can complete instantly, without waiting for confirmation.

Naming
With off-chain transactions, you can send Bitcoins to another user by referencing their username, rather than typing in an address.

Possibly lower transaction fees, possibly fewer on-chain transactions
Depending on how many transactions happen off-chain, it can save space on the blockchain. However, if there's only one off-chain transaction, it will end up consuming more space. (The coins will travel from User A -> Off-chain transaction provider -> User B instead of User A -> User B)

(Related to #3) It makes it feasible to have lots of very small transactions. For example, you might use off-chain transactions to pay someone a microfee for every minute that you use their wifi.


SegWit and SPV-mining. What if...? Is the following scenario valid?

Some unhonest segwit mining pool takes top-1000 segwit utxo and mines a block at height N with a transaction which transfers all funds to his p2pkh address
This block does not have segwit data portion, but it can be broadcasted to all non-segwit nodes on the network
All other pools have a dilema - wait the segwit data associated with this block or start mining block N+1 on the top of N
What if miners will use SPV-mining on the top of this block? They will create blocks at heights N+1, N+2... etc without checking the segwit-validity of block N

Also asked here: https://bitcointalk.org/index.php?topic=1434842.0

Yes, they can do that.
Correct, though the switchover requires a 95% threshold to make the chance that old nodes see confirmations on such blocks very small.
Segwit nodes never accept blocks that have a witness commitment but no witness section. Either the block must not have a commitment (in which case it will be invalid, as script validation fails), or it is outright not accepted (because there is missing data; similar to a block with missing transactions isn't accepted).
Miners that don't validate a block before mining on top of it violate the security assumptions of the network. We can't prevent them from doing so (with or without segwit), but that is one of the reasons why block propagation and block validation needs to be low-latency: so that the potential advantage miners get from SPV mining is not too significant.


Why was BIP34 (Block v2, Height in Coinbase) not implemented via the coinbase tx's locktime or nSequence? At some point in 2011/12 miners started using custom mining algorithms ignoring the best practise to mine to a different new public key (hash) for each subsequent block. This lead to a lack of uniqueness of the coinbase transaction id and destroyed some bitcoins forever.

So it became mandatory with BIP34/v2 blocks to put the height of a block in a special encoded format into the coinbase transaction's input "script".

But why not use existing datastructures like the coinbase transaction's very own locktime field?

That would have made perfect sense, and I see no reason why that wouldn't have been the superior way of doing it.

However, as far as I remember, nobody suggested this at the time.


Why Segwit makes blockchain faster? In Bitcoin blockchain, Segwit takes the script, which containers the signature and sender's public key, out of each transaction and stores them into an extended block. However, why having an extended block can make the blockchain faster? Since I think each miner now has to process the original block plus the extended block, thus the amount of data each miner needs to be processed has not been changed. Please advise!

First of all, your understanding of segwit is incorrect. There is not extended block, the witness data is still part of the transaction.

Segwit also does not "make the blockchain faster". What part of it does is it redefines the maximum block size metric to be something called block weight. Witness data is weighted differently from non-witness data, which means that a block containing witness data will have more spare weight units to contain more transactions. This means that Bitcoin's transaction capacity will increase, as will the size of blocks.


What is the cheapest fee based bitcoin / altcoin mixing service to keep myself anonymous and from being tracked? I purchased some bitcoins from Coinbase and I want to give them away to friends for their birthday this year, but what I'm afraid of is if they end up buying stuff on the dark web with it. Last thing I want to deal with is having to explain to the police it wasn't me. I know there a bunch of mixing services to help protect people from being tracked or traced back to the original account, but which one is has the cheapest fee?

I know the fee pays for the person running the mixing service, but is there such a thing as a decentralized bitcoin mixing service that doesn't take a fee?

Even if you use a mixing service it is not guaranteed that the link between the two+ addresses will disappear. Actually, as far as I know it cannot be guaranteed by any mixing service, decentralized or not, including extra fees or not...

In theory, a good mixing scenario would use a purely decentralized service with a consistently huge amount of transactions, which will randomize the mixing better. None of the services I have checked a couple of months ago had both of the above requirements. Personally I believe that doing a non-perfect mixing is worse than doing any mixing since they will know that you tried to "hide" the relationship between the addresses.

Looking around again I found this which has some good advice: in summary, to use mixing services behind the Tor network and send the bitcoins to wallet addresses also created from the Tor network. You can then check if there are any relationships remaining between your original addresses and the new addresses.

By the way, I know a lot of people that would be happy to pay a fee for a proper mixing service.


Does bitcoin validate transactions against the mempool? I want to know whether or not bitcoin checks for the existence of transactions in the mempool as one of the many validation rules it performs for new blocks.

If a transaction most exist in the mempool when a new block is received, how is this rule applied for blocks received during block synchronisation with peers, considering transactions in older blocks will not exist in the mempool?

A transaction that has been included in a block does not need to be in a node's mempool in order for that node to validate the block. Each block contains the transactions, so by downloading and validating a block, the node will have received a copy of all transactions in it (so that it can validate the transactions, as part of validating the block).

As you mentioned, there would otherwise be problems syncing old blocks, because the transactions in those blocks would be invalid if you tried to add them to the mempool today (because their inputs have already been spent!).

Further, a miner can include a transaction in a block, without having ever broadcast that transaction to the network otherwise. So in that case, no other node would ever have included the miner's transaction in their mempool!

Note that compact blocks (BIP 152) is an improvement to the block-relaying process, that allows nodes to compare a new block's transactions to their local mempool, and thus avoid having to re-download transactions they already know about.


Where would a fee come from when I send the remainder of my Bitcoins? Say I have 1 Bitcoin in my wallet. I need to pay my friend for something and it just so happens he will accept 1 Bitcoin as the payment. I send my friend my one and only Bitcoin because he is a good friend and the transaction gets confirmed.

All was fine until I went peeping under the hood. I'm running bitcoind so I ran the command listtransactions and looped over everything with an output of console.log(amount, fee).

See the picture below: (send, fee)

In reality I sent 14.3438969 Bitcoins to another address which was the entire balance of the wallet. Where could the fee (-0.0002) have come from? Since I sent the remainder of my coins there are no more to take to pay that.

First let me state that I actually sent the coins to a different address in the same wallet and if that's complicating the issue then I'm just a big dummy but I still don't get it. AFAIK senders get charged the fee? Is this correct? So that 0.0002 would get applied to the senders account (me). But I sent all of my coins so there are none left? Does this mean I have negative coins or that next time I receive part of that will pay the fee.

If anyone could address this and explain conceptually how the fees in the cases I have brought up would work it would be very helpful. I cannot seem to find the docs and who pays the fee, at won't point it's assessed, etc..

First, you cannot have negative amounts of Bitcoin in your wallet. Just like with cash there can only be a positive amount.
You can, however, depending on what settings you are using, make transactions without attaching a fee.

Perhaps, when you tried to send all your money, the software automatically reduced the sent amount to the maximum you could send in order to still have enough for the fee. This would show up as the full amount leaving your wallet, but only the amount without fee being signed over to your friend.


Are mixing services dangerous? I'm thinking about using a mixing service like Blockchain.info's Shared Sending. I don't have anything to hide, it's just about privacy. My concerns are about where my bitcoins will go. I'm sure some people are using these mixing services to do illegal things like buying drugs, so I'm afraid if I use a mixing service, one day the police will knock my door asking questions because my original bitcoins went to a drug dealer or something worse.

So, are my concerns justified?

It's unlikely that this would be a problem. Yes, coins that you send to a mixing service might end up in sketchy transactions. But they are, by definition, going through an intermediary. It's not that your coins are being sent to a drug dealer. Your coins are going to the mixing service. And then the mixing services are sending new completely transactions to that dealer.

So, it would be like the cops showing up at your door complaining that the $20 you spent at the shoe store was later used to buy drugs. I would hope that any police that were smart enough to try to trace the origin of a BTC would also understand the idea that you can't control the other transactions in a mixing service.

Now, there might be some suspicion just because you are using a mixing service. I haven't heard of any cases of this, but it wouldn't surprise me to find out that police would give a drug suspect a hard time about spending BTC through a mixer. But (at least in the US) I can't imagine this being used to harass you unless you were already under suspicion for some other reason. In part, because using a mixer isn't even that obvious: it just looks like any other BTC address. The government would have to be watching your browser or browser history to know you were visiting mixer websites.


How do I receive my first bitcoin? My first experiences with bitcoin: I downloaded Multibit and then went to the CoinbitGet website. I copied and pasted my address at the site as they instructed and after verifying that it was the correct address, I did some tasks where I earned 240 ubtc. I did all that yesterday. Then this morning on the Coinbitget site it said I was paid - but nothing was shown on multibit. So the Multibit help said I should "reset blockchain and transactions" so I did that and let it run for about 13 hours. But still nothing. (I know Multibit is connected to the internet because it always shows the current bitcoin to dollar price in the upper right - even though it always says "connecting" rather than "connected" In the lower left). So I checked at http://blockexplorer.com/. and it says - "(2014-03-28 04:27:08) Received transactions: 1 Received BTC: 0.00024" - which was 16 hours ago but I still see nothing in Multibit. I read that Multibit is fast since it doesn't keep the blockchain on the disk. So what might I be missing? It is not a lot of money so I am not worried but would like to learn and am not sure what to do now. The address was correct. Any help would be appreciated. Thank you all.

It's possible that your firewall is blocking the BTC node connections without blocking the price data. The price data is probably obtained through a normal port like HTTP or something, whereas the usual port for BTC connections is 8333. Other than that, the only other possibility that comes to mind is that it could have not got enough confirmations yet, blockchain.info can tell you how many confirmations your transactions have. Change the address in this URL to your own and see if the latest (top) transaction has 6 confirmations: https://blockchain.info/address/1DFNwqgF1HToPaveeoGZL4qdBDEZYUmC89.


Purpose of the LN transaction description According to Bolt 11, an invoice may contain a short description. However, what I fail to understand is who is sending this information to whom.

Since the invoice is usually generated by the payee, I'd argue that the short description is some information for the payer, like "Purchase: Product A, Product B". However, I've seen Lapps like tip boxes, where it is the payer who creates the message for the payee.

Or is the idea that the payee could propose a description, but the payer could then change it as he wants?

I believe it is to explain the "purpose of the payment" as described in BOLT11:

  Short description of purpose of payment (UTF-8), e.g. '1 cup of
  coffee' or 'ナンセンス 1杯'

This would be the payee letting the payer know what they are paying for, e.g. in case there are multiple outstanding invoices, just like any normal invoice outside of LN. Like you said, it's perfectly reasonable for the payer to suggest a description, and would probably be preferred in some cases, so the payer knows the payee has agreed to the purpose of the payment and is expecting it.


Coinbase (or other service) conversion to fiat: how is that recorded in the Blockchain? This is probably already answered, but I searched and couldn't find a similar question or answer.
If I use a service such as Coinbase to buy Bitcoin, Coinbase generates a BC address for me and that's recorded in the blockchain.
If I convert to fiat (i.e., USD) all BC at the address and send that USD to my bank account, Coinbase records that in my account. Since my account with Coinbase is private, only I know I have cashed out.
But how is that "cash out" and transfer to my bank account recorded in the blockchain? Does the blockchain show it is a cash out from Coinbase?
Or are there no records in the blockchain, other than the one BC address that shows a last transaction to 0?

If I use a service such as Coinbase to buy Bitcoin, Coinbase generates
a BC address for me and that's recorded in the blockchain.

No, it's not recorded in the blockchain, but in their own systems, basically they associate that address to your coinbase account

If I convert to fiat (i.e., USD) all BC at the address and send that
USD to my bank account, Coinbase records that in my account. Since my
account with Coinbase is private, only I know I have cashed out.
But how is that "cash out" and transfer to my bank account recorded in the blockchain
Does the blockchain show it is a cash out from Coinbase?

the address(es) coinbase create for you, are just used to know, in case you deposit funds on your account, where you can send that money to, but it's not used for anything else
Basically they associate in their own system that :

your account A is associated to AddressX
when you want to deposit funds to coinbase, you have to send BTC to that AddressX

Coinbase then have software that monitor addresses they owns, like AddressX (because not your key, not your money, so technically AddressX is coinbase address,not your)
When they see that a deposit has been done on your AddressX, they update their system (aka their (R)DBMS where they store their users data) and add the received BTC to your Account balance, then very likely they move funds from AddressX to a cold storage wallet (but this may vary) because BTC rarely are left on the deposited address but moved somewhere safer
When you then want to convert, they have just to send FIAT to your bank account and update your account balance, without moving any funds at all (even if I think they move funds not associated to users somewhere else, but this is just a guess and anyway it's an implementation detail)
Basically your AddressX can just be considered like a door to enter in their system, nothing more, and the balance that you see listed on that AddressX is not guaranteed to be the value you have in your coinbase account.
--
A proof that a strict relation between AddressX and your Coinbase account balance
doesn't exists is easily verifiable by looking a transaction when you WITHDRAW from coinbase to some other BTC wallet, in that case you'll see that the INPUTS used to generate the transaction to move funds, aren't related to AddressX


What is the best method for creating a paper wallet? I am looking to move some of my bitcoins from cold storage to a paper wallet.  I have heard that metal stamping is one of the better long term strategies since paper can burn or fade.  Any other suggestions?  Thanks in advance - Kristine

Here are a list of my best practices for creating a paper wallet.

Generate all keys on an offline computer system, this ensures that you are not using an online system that could be sending your keys across the internet.
Verify the integrity of the code as well as the integrity of the author, things to check include MD5, SHA1 sums and that author is a reputable contributor to the community.
Ensure the integrity of the host system being used to generate the keys if your system is compromised your keys could be as well.  To mitigate against this I often use a LiveCD based operating system.
The wallet should not be stored on a live computer system until the fund are intended to be spent.
The wallet should never be displayed, exposed, or photographed and when possible BIP38 encryption should be enabled providing an additional layer of security.
Ensure fully random sources of entropy are being used during private key generation, information/randomness should never be provided by humans (I.E. brainwallets).
Paper wallets should never reuse addresses, and will only store one keypair per wallet.  When spending remember all funds need to be removed from the wallet at that time, many have lots coins due to improper transaction generation which can spend the remaining balance in the form of a fee.
Optional: I prefer to store the paperwallet inside of a tamper evident device, this will ensure that no one else has had access to your private keys (thus protecting them from being stolen)
Optional: Multiple backup locations of the paperwallet all protected and stored using the same techniques, from a backup perspective I am never comfortable unless I have 3 copies stored in at least 2 different physical locations.


How to convert a keyPair to JSON and back? Using bitcoinjs you can generate a keyPair with the following code:

var keyPair = bitcoin.ECPair.makeRandom();

How can I stringify this object to JSON and then parse it back to an object? JSON doesn't play well with circular objects and I'm struggling to understand how one can work around this.

Thanks,

Connor

Wallet Import Format can be used in a Javascript String,  which is JSON compatible.
For bitcoinjs-lib@^2.0.0:

  var prv = keyPair.toWIF()

To recover, use

  bitcoin.ECPair.fromWIF(prv)

Caution: if you store your private key in an insecure location, your funds will be insecure. fromWIF/toWIF does not provide any form
of protection.


How to transfer BTC balance when I have Private Key? I have BTC public address and privatekey with balance. Can I Transfer the balance for another address?

Yes, but first u need import your private key in wallet app, fews mobile apps support this feature, blockchain.info wallet (https://itunes.apple.com/br/app/blockchain-wallet-bitcoin/id493253309?mt=8) is the only that i know,under menu/address/+ (plus button). This will open your camera to scan your QRCode private key in WIF format (51 characters).

In case you dont have private key QR code,  can use something to genarate a QRCode, prefer audited and offline code, for example: (https://raw.githack.com/EquestrianBit/equestrianbitpaperwallet/master/index.html), in menu "2. print front"\"my own key", before put yout private key, turn pc offline, only for security questions. All code run local in browser. After get your QR Code, have attention to recommendations in: (How do I send Bitcoin in paper wallet to other person?), like @ugam-kamat told.


How does a difficulty increase affect a miner's income? At the time I write this, there are a lot of people getting into Bitcoin mining for the first time. Many buy ASIC hardware and are later surprised that their mining income suddenly drops due to a difficulty increase.

If I mine X bitcoins per day, then the difficulty goes up Y percent, how many coins do I get per day after this?

For instance, if my hashrate brings 1 BTC per day and the difficulty rises 30%, what is my average daily mining income with the same hashrate after this change in difficulty?

Your profit relates to the amount of hashing power you contribute to the network. Since your mining power is constant, your share of the total hashing power decreases relatively when the network's hashing power increases. I.e. we can deduce the following formula:

newProfit = currentProfit * currentDiff/newDiff.

At a currentProfit of 1BTC/d and a 30% increase in difficulty, you get:

(1BTC/d)*100/(100+30)= (1BTC/d)/1.3 = 0.76923077 BTC/d

i.e. your profit decreases by ~23%.


How would I prove that I own X amount of Bitcoin to somebody without violating my privacy or sending/risking any coins? Now that people who own a full Bitcoin will be like people who currently own ten million USD or more in "liquid assets", I'm trying to come up with some way that I can safely and reasonably prove to somebody that I own X amount of Bitcoin. Being able to cryptographically convince somebody that you control (have the private keys to) a certain sum of Bitcoin (or "over X amount", to conceal your full wealth) will probably be very important in the near future. I want to prepare for that situation.
If I simply tell somebody that I own X BTC, why should they believe me? I realize that this same goes for fiat money as well. How many attractive females have not been lied to by some guy in a fancy suite who claims to have "ten mills" on the bank, but really is all broke and barely was able to afford the clothes he is wearing?
But Bitcoin is still seen by many as some kind of "joke" or "fake money". So I would have to prove it for sure for them to even speak to me. And if this requires doing scary operations in Bitcoin Core and possibly ending up revealing your private keys or other sensitive data... well... I don't even understand how a normal person would be able to verify your cryptographic "key" or whatever form this takes. They are just not going to bother with that.
In summary: how do I prove to somebody that I own and exclusively control X amount of Bitcoin, in a way which non-computer hackers can comprehend, yet does not rely on some kind of "traditional bank" or third-party commercial service?
For example, those who went on those "Bitcoin rich people" cruises, how were they verified to actually own a bunch of Bitcoin? Can anyone just claim to own X BTC and they will believe you? I don't get how this is done.

The way that this is done is to sign messages using the private keys which correspond to your UTXOs. Your UTXOs are what make up your Bitcoin balance, and by signing a message with the keys associated with them, you are proving that you have the ability to spend those UTXOs.
To verify, someone can verify the signed message, compute the addresses for the keys you used, and then lookup the addresses and see how much Bitcoin are associated with all of those addresses.
For the average person, there is software that can verify the message for you and they will return what address was used in signing that message. Then they can just take this address and look it up on a block explorer.


Is bitaddress.org compromised? When I tried accessing https://www.bitaddress.org with Firefox, I was redirected to https://www.bitaddress.org/bitaddress.org-v2.7.2-SHA1-364542f1ccc5777c79aebb1692a6265cf3e42e7e.html and got a security certificate warning:

The same redirection happened with Chrome, without any security warnings.

Is there a real security problem with bitaddress.org?

The certificate for www.bitaddress.org is issued by PositiveSSL. Chrome trusts them (PositiveSSL), firefox does not.

There are an awful lot of issuers, and different browsers are bound to have slightly different lists.

If you trust them or not is up to you. If you trust Chrome's security, then you can trust that certificate.

If you "add exception", then BEFORE confirm security exception, you can "View..."; you can check the fingerprint (SHA1 & MD5), and if they match, then the security is the same between Chrome and Firefox (not necessarily good, just the same between the two browsers). If they are different, then someone is doing something SERIOUSLY FLAKEY!

Of course, you shouldn't trust a website that throws up a warning, just because some guy on the internet told you to :)


Are there an infinity of public addresses for a wallet? If I understand correctly a private 256-bit integer determines the curvature of an EC curve corresponding to your wallet and that 256-bit integer can be consider the "private key".

Now how many "public address(es)" are there corresponding to that particular wallet?

Is there just one public address or an infinity?

I've got a related question related to change: in typical bitcoin clients, when a change public address (I take it a change address is public, right?) is given, is that change address corresponding to the same wallet that the one where the bitcoin came from?

A wallet contains a collection of keys, not just a single one.

Every private key has exactly one associated public key. Addresses are shortened forms of public keys (they're encoded hashes of the public key).

Change addresses are indeed public. Like every other address, the key for it is independent from the other keys in your wallet. Note that some clients send change back to one of the addresses the inputs were previously assigned to, in which case it's obviously the same key that is reused.


How Bitcoin wallets avoid address re-usability? As we know, address reusability compromises both privacy and security.
My question is how Bitcoin wallets avoid address reusability?
Is wallet generates an address from index 1 and scan blockchain whether an address is used or not, until wallet finds an unspent address?
In case of HD wallets, whenever the user requests to generate a new address to receive address. Wallet generates an address from the very first index and checks whether the index is used or not until it reaches address that has not been used.
Is the wallet keeps state of unused address?
If the wallet is stateless, then determining unused address by generating the address from very first and looking up blockchain for the unused address is expensive?
I tried to find documentation of wallets such as Ledger, Airbitz, but i did not found it.
Edit: Note that I have knowledge of how seed, private and public keys are generated, as it is explained in detail BIP 32.
My question here is When a user requests to generate a new address how does wallet find that the address is previously unused?
If wallet generates an address from the very first index, scans blockchain whether the address is previously spent or not? until it finds the index new address to receive payment.

Is wallet generates an address from index 1 and scan blockchain whether an address is used or not, until wallet finds an unspent address?

No. The wallet software generates a seed (pseudo-random). With that seed, it generates private keys. With those private keys, it generates public keys and with those public keys, it generates addresses. And this address is (almost) always unused.

  and checks whether the index is used or not until it reaches address that has not been used.
  ---- and ----
  If the wallet is stateless, then determining unused address by generating the address from very first and looking up blockchain for the unused address is expensive?

That's not how it works. The probability to hit an address that is already used (by the method seed->SK->PK->address) is almost 0 because you don't know the seed of other people. You don't need to check that because it's almost impossible (unless you have a lot of computer power and want to waste electricity).

  Is the wallet keeps state of unused address?

The wallet simply check the funds of all your addresses, recognizes that your first address is used (has funds on it) and provides you a new one (also created by the same seed (seed->SK->PK->address).


The probability that the entire network generates at least two blocks within 10 minutes? We know that Bitcoin network on average generates one block per 10 minutes.

Is there a formula to compute the probability that the entire network generates at least two blocks within 10 minutes by using current hashrate of the network and current difficulty level ?

Thanks

Since current hashrate and current difficulty level should be matched up usually, we can disregard them. (Although, we could easily accommodate them if they are diverging as well.)

Finding blocks is a Poisson Process.

The chance to find at least two blocks in ten minutes is "all cases" excluding the cases where we find 1 and 0 blocks: P(2+) = 1 - P(1) - P(0)

P(0) ≈ 0.368
P(1) ≈ 0.368

→ P(2+) ≈ 0.264 = 26.4%

I've described the formula here: How can we be sure that a new block will be found?


How to download bitcoin blockchain without core? I tried to download the entire blockchain using bitcoin-core but i took about 9 days and eventually gone corrupted and i had to delete and restart. Any source to download through torrent or regular browser download?

If you torrent or otherwise download the blockchain but do not validate the data received, then you will be unable to know whether or not the data received is valid. This means you could easily download a chain which has been altered by an attacker, to include fake transactions, remove legitimate transactions, etc. You would have no way to know.

This is the reason that bitcoin-core takes some time to download and validate the chain: it is the only way to trustlessly know the current state of the network.

Note that bitcoin-core works most efficiently when it downloads the chain data as it goes. If you download a torrent of the chain and then attempt to validate using that, it will take even longer (you'll need to wait for the full download, and then the full validation, rather than doing parts of each in parallel).

I'm not aware of any software that can perform these validation steps more efficiently than bitcoin-core. You could try increasing the -dbcache option if you have under-utilized RAM. You could also try syncing to an SSD instead of an HDD, if you aren't already.


Can one trace a criminal with his Pubkey? Say FBI arrested a guy who bought some drugs using bitcoin. Then, is it possible for FBI to trace a drug dealer using the arrested guy’s PrivateKey and his transaction histories?

If my understanding of bitcoin algorithm is correct, this is impossible since PublicKey only shows that “there is a user with this public key” and it does not give any more information about a user who owns that PublicKey.

Moreover, transaction that the dealer and the arrested guy made only shows public keys.

Can one trace someone using past trasactions?

Knowledge about his addresses and transaction history will be sufficient to discover addresses with which he made deals. His Private key will not help. This is the consequence of public ledger.

The different case is with deterministic wallets. When you know master private key/ mnemonic seed you can check all derived addresses, even the ones you have no previous knowledge.


Delete watch-only imported address bitcoin-core Is it possible to delete imported watch-only address? I know it's not possible using RPC commands. Any suggestions?

If you are feeling brave, you can edit the wallet.dat file itself to remove those. You can use the db4.8_dump and db4.8_load utilities to modify it. Note that doing so may result in database corruption and I would not recommend it. That is really the only way to delete anything from Bitcoin Core's wallet.


Automatically Get Bitcoin Difficulty, Bitcoins/Block, Exchange Rate Statistics What can I do to programmatically get statistics such as current Bitcoin difficulty, Bitcoin award per block, USD/BTC exchange rate?

You can get...

difficulty from: http://blockexplorer.com/q/getdifficulty
reward per block from: http://blockexplorer.com/q/bcperblock
exchange rate from: http://api.bitcoincharts.com/v1/weighted_prices.json

or from: http://api.bitcoincharts.com/v1/markets.json

You might want to read this.

See list of other bitcoin stats here.


Why Reward Size 50 (21 Million Coins)? I have already read the following answer which is not really meaningful:
21 Million Calculation

  Here's a mathematical explanation:
  Calculate the number of blocks per 4 year cycle:
  6 blocks per hour
  * 24 hours per day
  * 365 days per year
  * 4 years per cycle
  = 210,240
  ~= 210,000
  Sum all the block reward sizes:
  50 + 25 + 12.5 + 6.25 + 3.125 + ... = 100
  Multiply the two:
  210,000 * 100 = 21 million.

The total number is thus derived from the reward size and in either case does not provide much insight. I am a bitcoin fan but I am concerned about the deflationary risks in the distant future.

Since it is open source, if there are deflationary problems in the future can adjustments be accepted by the network to adapt? If so what might the possible solution entail?

The figure of 21 Million is completely arbitrary. It could have been any other number and it would make absolutely no difference, as long as the inflation schedule remains the same.

However, the inflation schedule is universally agreed to be one thing that can never be changed with Bitcoin. Any new code that extends the inflation will no longer be "Bitcoin" and will not be accepted by users of Bitcoin.

To make any change, it is not enough for the majority of nodes to modify, all nodes must eventually change. Usually it is enough for the economic majority to accept the change to trigger this, but with a change like this the worst that could happen is a fork to two different networks.


Only one chain is appearing in Miner Status on Antminer S9 I just hooked up my miner after returning from training. when i first hooked it up all 3 chains were visible but then i moved the miner to a more permanent location and hooked it back up. now only one chain is appearing. i thought it might have been an issue with the 110 outlets, so i unhooked one hash board so only one board is hooked up to my PS (i use 2, one for one board and the miner, the other for 2 boards). Even after doing this only one chain is appearing.

Is there a possibility one of your power-supplies have gone bad? You can further debug this by obtaining the "Kernel log" found on the "System" tab. I would also try re-seating the cables, and test each hashboard individually (power them one at a time to determine if they are still OK -- make sure to shutdown/unplug your miner before performing any work!)

If you can provide that file, more information should be available.


Why blockchain.info pays network fees by themselves I'm exploring ways of accepting payments and thinking about blockchain.info
Receive Payments API.

I can't realise why this service going to pay network fees instead of me. Where the profit? I see only loss.

Can someone explain why they pay fees?

The fees are about 1 cent per transaction - a small price to pay for attracting customers who may later use their paid services.

Offering a service for free to expose a product with paid premium features is a popular online monetization model, also known as "Freemium".


Blockchain.com payments Need some assistance if I need to stop and take my losses. I had Bitcoin mined and the earned profits. I paid the commission fee and the profit was moved to blockchain.com. They requested a payment of $3500 because it’s a new wallet. Unfortunately I didn’t pay it timely due to purchase limits only cash app and coinbase accounts. I paid the $3500. But then they said Bec of the delay i had to pay an additional $2000. Yes I paid that and now they are saying I need to pay $3500 again within 3-4 days.  Is this normal process?  Please help!

Yes, this is a common process used by scammers. It ends up in you paying them lots to withdraw your money that has never been yours without receiving even 1 cent from them.
Don't write to them but seek help from your local authorities.


How do these OpenSSL commands create a Bitcoin private/key from a ECDSA keypair I found the following code online and apparently it works. But I don't understand the lines which extract the Bitcoin compatible private/public key from the created ECDSA keypair.

FILE_NAME=$1
PRIVATE_KEY=${FILE_NAME}_private.pem
PUBLIC_KEY=${FILE_NAME}_public.pem
BITCOIN_PRIVATE_KEY=bitcoin_${FILE_NAME}_private.key
BITCOIN_PUBLIC_KEY=bitcoin_${FILE_NAME}_public.key

echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY

echo "Generating public key"
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY

echo "Generating BitCoin private key"
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY

echo "Generating BitCoin public key"
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY

echo "Files created!"

If someone could explain, that would be nice

Bitcoin uses ECDSA so ECDSA keypairs are Bitcoin keypairs as well.

echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY

This generates the private key in the pem format that openssl uses.

echo "Generating public key"
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY

This generates the public key from the provided private key (which we just generated) and writes it to a file in the pem format.

echo "Generating BitCoin private key"
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY

This takes the private key in the pem format, converts it to the DER format, and extracts from that format the 32 bytes for the private key and writes those as a hex string to a file.

echo "Generating BitCoin public key"
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY

This takes the public key in the pem format, converts it to the DER format, and extracts from that format the 65 bytes for the public key and writes those as a hex string to a file.