Finding the lost Cryptocurrency I have a Ledger Nano S wallet with some cryptocurrencies init such as bitcoin.

I tried to update this wallet. But after that, I can not see my cryptos on the wallet. I used 24-words phrases in order to recovery but the wallet proposed the new phrases. I reset my wallet again with these new words unfortunately now I can not find my cryptos.

Please let me know what can I do?

You may need to perform a factory reset and re-try

The manufacturers instructions for wallet recovery are are:

  Step 1. Restore from recovery phrase

  Connect the Ledger Nano S to your computer using the supplied USB cable. Your device should display Welcome to Ledger Nano S. If you are setting up your device for the very first time, please contact us if the device immediately asks for a PIN code. It may not be safe to continue using this device.
  Press the left or right button to navigate through the on-screen instructions.
  Press both buttons simultaneously to choose the option Restore from recovery phrase.

  Step 2. Choose your PIN code

  Press both buttons when Choose PIN code is displayed on the device.
  Press the right or left button to choose the first digit of your PIN code.
  Press both buttons to enter a digit.
  Repeat the process until you've entered 4 to 8 digits.
  Select the checkmark (✓) and press both buttons to confirm the PIN code.
  Use the backspace icon to erase a digit.
  Confirm your PIN code by entering it once more.

  Step 3. Enter your recovery phrase

  Choose the length of your recovery phrase (12, 18 or 24 words). Press both buttons to validate.
  Select the correct recovery phrase length and always enter all recovery words.
  Press both buttons when Enter word #1 is displayed.
  Enter the first letters of word #1 by selecting them with the right or left button. > 1. Press both buttons to validate each letter.
  Choose Word #1 from the suggested words. Press both buttons to validate it.
  Repeat the process until the last word of your recovery phrase. To correct a mistake, you can restart from a previous word from the suggested words menu.
  Your device will display Processing and then Your device is now ready once you've successfully restored your private keys.
  Press both buttons to access the Dashboard. The Dashboard is where you can access the apps and settings on your device.

If you are having trouble following this procedure you should contact Ledger support


What is the real value of bitcoins I have a lot of confusion about bitcoin. What is the real worth of a bitcoin. For instance currency used to be backed by gold but now a days its fiat currency all around us.

Bitcoin doesn't have a "real worth".  It is not backed by any sort of resource.  Bitcoin is considered valuable for the same reason gold is valuable; it is difficult to acquire, there is a limited quantity of it, and people are willing to pay a relatively high sum for it.  If everyone decided they no longer wanted to participate in bitcoin and sold all of their coins, bitcoin would no longer be worth anything (assuming no one else wanted to buy into it).


Connect a mobile client to wallet on remote Bitcoin Core I run a Bitcoin Core node on my computer and have a Windows tablet. My wallet is on the computer and I want to keep it there. Is there a way to have my tablet create a new Bitcoin address for my wallet by telling my node to do it and sending me the result, thus keeping my private keys and wallet off my tablet?

Yes, you can use the node's RPC API method getnewaddress to create a new public-key pair and it will return the address.


How do block rewards work with a mining pool? I understand there are a number of different schemes for sharing rewards.

My question is about the block reward itself, and how it's shared.  If only one miner (typically a pool) can find a reward, that means that a pool doesn't get a reward for every block processed.  Yet somehow, the miner is still paid, even if no block is found.

Are all the shares submitted between blocks found counted?  ie.  If a pool finds a block every 10 blocks, do the shares from the other 9 get added together and the entire block reward split across all work done on the found and previously unsuccessful blocks based on the share scheme?

As others have said schemes differ. But to try to answer the question you asked:

  Are all the shares submitted between blocks found counted? ie. If a pool finds a block every 10 blocks, do the shares from the other 9 get added together and the entire block reward split across all work done on the found and previously unsuccessful blocks based on the share scheme?

Probably not. That would be a terrible scheme. Assume a pool has a constant hash rate. Right after it has found a block, it's just as likely to find another block in the next minute as it is when it hasn't found a block for a long time. But the reward per share will be much higher if the pool finds a block shortly after finding another block and much lower if the pool hasn't found a block in a long time.

So a pool that counted every share since it last found a block would likely see a huge influx of users right after it found a block, since the expected reward per share will be abnormally high.

And if the pool is unlucky and hasn't found a block in a long time, the number of counted shares will be abnormally high, making the reward abnormally low. This will cause miners to abandon the pool.

So counting all shares since the last found block is perhaps the worst reward scheme possible.


How do I backup my wallet? Using bitcoin-qt, multibit, or any of the others, how do I backup and save my wallet in case I need to reinstall Windows?

bitcoin-qt

open the File menu
click Backup Wallet...
select a file to save the backup as

MultiBit

From http://multibit.org/help_backupWalletUsingPrivateKeys.html:

  You can export your private keys from a MultiBit wallet into a file
  (using the 'Tools | Export private keys' option) and, as long as you
  do not manually create new receiving addresses, you can use the
  private key file as a backup for the wallet.

Armory

From http://bitcoinarmory.com/index.php/start-page/what-is-armory/features:

  Not only are the wallets determinstic, but there is a built-in dialog
  for printing permanent copies of your wallet.  When you first create
  your wallet, make sure your printer is on and click the “Paper Backup”
  checkbox.

Electrum

From http://electrum.org/:

  You do not need to perform regular backups, because your wallet can be
  recovered from a secret phrase that you can memorize or write on
  paper.


How did transaction fees work in the version 0.3.24? Is there a minimum transaction fee for every transaction? When do I pay a fee over the minimal fee?

The minimum transaction fee is zero.

Transaction fees are enforced in two places. First, a client can be configured not to accept or relay a transaction that doesn't include a sufficient fee. Second, a miner can choose which transactions to include in any blocks they mine and will typically try to include transactions with the highest fees.

Most normal transactions will have a required fee of zero. The three most common exceptions are:

If a transaction uses coins that were very recently received, a fee of .005 bitcoins may be imposed.
If a transaction "gathers" bitcoins from a large number of other transactions, a fee of about .0002 bitcoins per input source may be imposed.
If a transaction "spreads" bitcoins to a large number of destinations, a fee of about .0002 bitcoins per output may be imposed.

This is because these types of transactions tend to look a lot like spam transactions used to maliciously load the network. Currently, there are still clients and miners that will accept any valid transaction regardless of the transaction fee. So if you're willing to go to the trouble, you can get any transaction into the public chain eventually with no fee. (Just manually configure your client to connect to them and be patient.)


Do we still need SIGHASH_NOINPUT for Lightning Network? In the original Lightning whitepaper, Joseph Poon advocates using SIGHASH_NOINPUT so that we can create the first commitment transaction which references the funding transaction txid without actually signing the funding transaction. However that paper was written before SegWit was implemented. Given that SegWit transactions do not have signature component in the txid, it removes the need to actually implement SIGHASH_NOINPUT.

However, today I came across a draft proposal of the sighash in BIP 118 which says it would be active with SegWit v1 and higher.

Am I missing anything else that this sighash flag brings to the table that would warrant it to be implemented in future SegWit versions?

The lightning network as is is working without SIGHASH_NOINPUT. Thus in its current form it is not needed.

However Christian Decker came up with the eltoo payment channel construction. In a nutshell this would get rid of the penalty based construction we use right now and reduce a lot of overhead for maintaining channel state as the state becomes symmetrical for all participants.

In particular multiparty channels and channel factories would become much easier.

The eltoo paper however really depends on SIGHASH_NOINPUT as the channel state is encoded as a "linked" list of update transactions which in case of protocol breach are skipped from the breaching point to the current channel state which requires SIGHASH_NOINPUT.

It is my understanding that essentially all lightning network developers agree that lightning network channels should eventually be constructed via eltoo.

You can read a summary of eltoo on my blog or you can read the original publication to learn more.


Can OTC help lessen the cost of slippage and exchange rate risk? Obviously one can transact currency via buying BTCs on an exchange transacting them to another person which itself sells the BTCs received on an exchange - this would limit the possibilities of transacting money to the liquidity of BTC exchanges and exposes the parties involved to the risk of exchange rate fluctuations.

Is there a possibility of avoiding these factors via OTC ?

e.g.: The party which wants to receive a payment, e.g. USD 1000, buys the smallest fraction of a BTC on an exchange (regardless to the value in USD) and "sells" this fraction of BTC to the party which owes the payment in exchange for the USD 1000.

Bitcoin is compatible with almost any financial contract or derivative that exists today.

I think the scenario you are describing is this:

Bob must pay to Alice $1,000 USD worth of bitcoins.
Bob has $1,000 USD to send to Alice but has not yet bought the bitcoins.  What ways are available to Bob that allows him to send the funds to Alice without exposure to exchange rate risk.

You didn't mention a time component so there are two scenarios.  One is where there is immediate settlement -- Bob wants to pay Alice the funds now.

Since there is no "official" exchange rate, what is widely accepted as being an accurate or fair price at any point in time is whatever the "last" trade shows from the BTC/USD market on Mt. Gox.

Other exchanges may have higher or lower spot market rates.  At an exchange with good liquidity, that relatively smaller amount can be purchased at the spot market in a single transaction (without slippage) and the bitcoins can then be delivered to Alice immediately.  Because there was essentially no time that elapsed after the bitcoins were purchased before delivery to Alice, there was then no exposure to exchange rate risk.

Presumably you are inquiring about this for amounts that are larger where slippage would occur.

There are traders who perform arbitrage (automated with bots, or performed manually) and generally remove price inefficiencies between the markets.  This brings additional liquidity to the exchanges.

Even if arbitrage were to keep the exchange rates between the exchange markets in exact synch, they only act after Bob has made purchases, thus he either loses to slippage when buying in bigger chunks or he exposes himself to exchange rate risk when buying over time.  If Bob's purchasing is detected, other traders might become aware of his buying and frontrun him, causing him to realize actual exchange rate risk.  And Bob also loses because the arbitrage providers are absorbing some of the value in the process.

There are few options to Bob to avoid both slippage and exchange rate risk, other than to contract that work out by using a trader or broker who can minimize these factors.

Now if the amount owed to Alice is not until some future point in time, Bob could consider buying a CALL option, ensuring a supply of bitcoins at a future date at price known today (and thus protects hum from a price move to the upside).

Bob could instead buy the bitcoins today and then hedge against exchange rate risk by buying a PUT option (which allows him to gain should the exchange rate fall after he makes his purchase before he delivers the coins to Alice).

Now obviously, if Bob deals solely in fiat, and Alice deals solely in fiat, then why even bring bitcoin in the middle?  A bank wire transfer works pretty well for this for immediate (e.g., same-day) settlement of larger amount, and other methods are less expensive for future delivery.

There is even the ability to use USD vouchers (redeemable codes) for this.  Bob does a bank transfer to his account at the same exchange that Alice uses.  He then sends Alice a redeemable code for 1,000.  Some exchanges allow this, but generally there are limits as the exchange offers these voucher codes presumng the customer overall is using those funds for trading bitcoins and not just withdrawing the fiat after redeeming the codes.

So to summarize, trades of larger transaction amounts cause slippage and there is not currently an efficient method that takes advantage of the supply from the over-the-counter markets to minimize the market inefficiency similar to wha other, more mature, financial trading ecosystems provide.  That may come, it just isn't available today.


Chronological list of transaction ids Is there a way to get a list of the latest transactions IDs? I know I can watch incoming transaction almost live on http://blockchain.info, but is there a way to download the last 10.000 transaction IDs?

Thanks for any hints!

Transactions don't have an accurate timestamp so their chronological ordering comes at the granularity of which block the transaction was included in.

Access to the "raw transactions" is available using the Bitcoin.org client's API, however it is not necessarily trivial to do so.

http://en.bitcoin.it/wiki/Raw_Transactions
Armory provides some methods to pull transactions -- see the code in the extras directory.
Other methods might include libbitcoin
or perhaps the library with picocoin
or maybe ABE (blockchain explorer


Upgrading/converting bitcoin core wallet between platforms After 2 years of being shut down, I am trying to revive my bitcoin full node, while both switching platforms and upgrading to the current version in the process. Everything works but the wallet. The presence of the wallet causes the new node to crash (segfault). The node works when either wallet.dat is missing or when -disablewallet is provided. I do not really need that wallet to be fully imported, just to get the bitcoin associated with it into the an address controlled by the new node.
I read this issue report that blames the version of the berkley db lib files. I compiled bitcoin core locally with the older BDB libs provided via bitcoin/contrib/install_db4.sh per that issue report, and got the same result. The thing is, since (afaik) the windows platform does not provide an implementation of BDB, I have no idea what headers are correct for the wallet file generated by windows bitcoin core.
I want to avoid deleting and re-downloading the entire blockchain. I did run once with -disablewallet -assumevalid=0 to verify the entire blockchain. I retain backups of all pre-upgrade files, if it helps.
gdb backtrace pastebin. Note that this run was only a subset of the cli options I normally run with, specifically missing rpc info.
Old setup:

Windows 7 pro x64 sp1
bitcoin core gui (qt) 0.16.0
last synced early December 2018
BDB version unknown
datadir sat on slow external hdd (ntfs)

New node:

Debian Buster stable
bitcoin core daemon 0.21, compiled locally
syncing now, currently late March 2019
BDB 4.8.30.NC compiled via included script and detected by configure
datadir on slow internal sata hdd (ext4)

Is there any way to import an old/differently formatted wallet.dat file into a newer node? Is there perhaps a way to extract the private key info from said old file, so it can be manually imported? Could the old node software possibly create and send a transaction with the entire contents of the old wallet to a new address without fully syncing first? Is it possible the old version of bitcoinn core could fully sync with the modern blockchain?
e: forgot to mention: the db err logfile /mnt/data/blockchains/btc/blockchain/db.log is empty and retains the last modified date from the first startup of the original node in mid 2017.
e2: after translating the wallet to db version 4.8 as @PieterWuille suggested, the node reindexed and printed a number of lines like
2021-02-18T23:58:08Z [default wallet] Submitting wtx f7b5 to mempool for relay

but after running for a few days, it indexed up to block height just under 500000 and then segfaulted again.

I finally got this. Here is a brief summary for the future searcher:

use the old software to launch the node with the old wallet.db file
run the dump wallet command. This creates a file that is in a text format that is more portable than bdb.
run load wallet command on the new node.
rescan the new node (the default scan does not look very far back)

Note that the file created in step 2 is unencrypted and contains your private keys, so handle with care. Though I did wait for the new node to finish syncing, I doubt that is actually a requirement. I did not allow the old node to sync more than a few blocks.


How specifically is transaction history modeled in blockchain blocks? I understand that each block on the Bitcoin blockchain contains a list of transactions, but let's assume (for the sake of this question) that the block in question contains only a single transaction--and that this particular transaction has a history of previous transactions (i.e., it was not a coinbase transaction). How would I figure out which block holds this single transaction's previous transaction(s)? I know that each transaction contains the hash of the previous transaction--but how do you find that hash without looking into every block on the blockchain? In other words, how can I quickly discern a transaction hash chain for a given transaction ID? Any links to explanations or previous questions would be appreciated--I tried searching and haven't seen anything that answers my question to my satisfaction.

Thank you.

-but how do you find that hash without looking into every block on the blockchain?

You can't. Of course, if you are smart, when you receive a block, you extract the data that you need and put it into a database where you store this information and can quickly look it up. So, starting from the beginning of the blockchain, you read through every block and every transaction, compute their hashes, and store in a separate database the hash and a pointer to where you can find the block or transaction (or something of that sort). So when you need to look up the outputs that a transaction spends, you can just lookup the txid in your database and be able to quickly find the transaction output that you need.

This is similar to what Bitcoin Core does. After it fully validates a block, it adds the UTXOs that are created to a separate database. That database contains the details for all of the UTXOs, so it has each UTXOs outpoint (txid + output index), the output value, and the output script. When a transaction spends a UTXO, it can be quickly found using the outpoint specified in the transaction and then the UTXO is removed from the database. The outputs of that transaction are then added to the database as new UTXOs.


6 x GPU mining rig only installs drivers for 5 I built the following rig:

5x SAPPHIRE TRI-X R9 280X 3GB GDDR5 OC (UEFI)
1x AeroCool Templarius Imperator 1150W 80 Plus Gold
1x HighPower Tech 1200w Gold Plus (HP-1200-G14C-GOLD)
1x Asrock H61 Pro BTC  Mother board
1x W.D Caviar Green 500GB SATA III HDD
1x Kingston KHX1600C9D3B1/4G
6x Powered risers 1x 16x

I Installed Windows 8.1 and plugged one GPU. It automatically installed the Radeon HD 7990 driver. Then connected the second GPU and followed the same process with the other GPUs. Everything works fine for 5 GPUs. But for the sixth one, it won't install the driver.

I try to update the driver of the sixth one but it says that the last driver is already installed.

Regards,

(since I can't comment) I had this problem too about a month ago. Try using AMD Catalyst to install the drivers.


Buying a Gridseed Mini ASIC Miner -Beginner I'm new to the field of cryptocurrencies.It seems that without good hardware i cannot earn anything.As a starter - is  Gridseed Mini ASIC Miner a good choice to buy http://www.makeuseof.com/tag/gridseed-mini-asic-miner-review-and-giveaway/

Will it cost too much electricity? Can i make something out of it?

Please advice

No. It's old, slow and obsolete. Buy modern mining hardware instead.


blockcypher shows much higher amount transacted I sent bitcoin from my localbitcoins.com account to my coinbase.com account. It showed up as 0.00147276 BTC in coinbase but the transaction shows as 0.953 BTC on blockcypher:

Is there a way for me to actually receive that amount?
Thanks

I am making the presumption that localbitcoins.com does as many web wallet providers do, amalgamate transactions.

Most likely your transaction was combined by the wallet provider with some others before being broadcast. No, you cannot claim the additional value of the transfer.


Blockchain wallet showing 0 however app showing balance So my blockchain desktop wallet is showing 0 balance whoever if o go in to the app i can see my bitcoin wallet balance. When again i click on the wallet it goes back to 0 in the app for some reason. Then if i go in to transfer within the blockachain app, my balance is shown in ROI Bitcoin. I try to send From Roi to my BTC wallet and it also shows my total spendable balance but once i want to proceed after following the recomended fee by the app i get this typ of error message Transaction Failed, i then clock on the info and it comes up with Attempt to invoke virtual method intjava.lang.string.length() on null object reference.
I have now run out of options and what is the most suspicious for me is that Blockchain support have been responding to my emails and have been asking me for different screenshots which sounded as they were actually investigating this however now they have just been ghosting me for weeks, If i submitt a new support ticket they respond but then again after realising its me again they ignore any of my emails.
Please can you someone came across this situation where Wallet balance was showing the amount within the App as ROI but werent able to use the coins and in the desktop app it is balance 0 ?
I litteraly do know who to go to since support are ignoring me.
Thanks

If Blockchain support are not able to help you and you have the 12-word "backup phrase" I believe the best course of action is to migrate to a new wallet.
By migrate wallets I mean use your backup phrase with wallet software written by a different organisation. The only important thing stored in a wallet is the private key generated from the backup phrase (also referred to as a seed phrase or recovery phrase). So any wallet that contains that key can be used to spend money that has been received at addresses created from that key.
If you are a frequent user of Blockchain's other services, such as buying and selling Bitcoin or other cryptocurrency trading, you might not want to do this. However there are alternative exchanges that you could use instead.
There are several wallets that have a much better reputation than the Blockchain wallets.
For example see ...

How can I migrate from blockchain wallet to Electrum?

As well as the backup phrase, you need to know the "derivation path" for your old wallet. The accepted answer to the linked question assumes a derivation path of m/44'/0'/0'/0.
Instead of importing the key to a new type of wallet, it can be safer to sweep the keys into a new type of wallet. Sweeping just means using the old key in a new wallet to create a Bitcoin transaction that transfers the money to the control of a new key in the new wallet. If you ever imported additional private-keys into the old wallet you'd also have to either repeat that and import those extra keys to the new wallet or instead sweep those keys into the new wallet. Given your situation I would not sweep any keys at all until certain of the derivation path of your old wallet, it would be safest to first try importing the keys using the backup phrase and, once everything is working, then move the money to new keys.
If all this seems too complicated, you might reasonably conclude that Bitcoin is not for you.


How does Bitcoin Gold difficulty adjustment work? Bitcoin Gold claimed to have per-block difficulty adjustment, how does it work? I find this https://github.com/BTCGPU/BTCGPU/pull/151, but still don't understand how it work by change some parameters.

It's just a simple moving average with a window of 30 blocks:
next_D = sum(past 30 D) / sum(past 30 solvetimes) * 600

This isn't exactly what it's doing, but it's darn close.


How to choose address in BlockChain Android Application? If I want to receive funds using the Blockchain Android application I click on the arrow on the top of the screen which brings up the Request Bitcoin screen, showing the QR-code for easy scanning.

The problem is that the QR-code is for the original address generated when I first created my Blockchain wallet.  Even though I have created additional addresses I don't see any way to change the receiving address with the Android application.

Is the option to specify a different receiving address not an option on the Blockchain Android application or am I missing something?

i think you are missing something :)

Go to the address book and, by long tapping, choose "set as default address".
That address will be the one that generate the qr code.


Is Bitcoin network an overlay application network? Is Bitcoin network constructed with just Layers 1-4 of the OSI model? Or it's an overlay application network?

Can someone please explain about structure of Bitcoin network?

Thank you

It sits in the application layer as there's the Bitcoin P2P protocol that runs on of TCP. The P2P protocol has to be implemented for nodes to communicate with each other (i.e. block, tx, inv messages).


How to run the bitcoin client so as to only accept blocks? I read somewhere that running a full node at full functionality requires 200 GB/month bandwidth. Since that is too uneconomical in my country, I would like to run the client such that it simply adds the accepted blocks and does not take part in the rest of the p2p network activity. So is there an option to do that in Bitcoin-Core ?

I believe what you would like to run is an SPV client.  If you are running a full node, such as Bitcoin Core, you wouldn't want to only get updated blocks without transactions.  The point of running a full node is to independently validate the blockchain.  Blocks can't be validated without knowledge of the transactions in them, so full nodes need to receive both blocks and their transactions in order to independently validate the blockchain.  Otherwise, your client would never know if a block contains an invalid transaction (such as more bitcoin in its outputs than inputs).

UPDATE:  As suggested in the comments by Pieter Wuille, the -blocksonly command line option (https://bitcointalk.org/index.php?topic=1377345.0) can reduce the bandwidth significantly.


Input size smaller than 148 byte How does this TestNet bitcoin transaction have 85 bytes?

is this result wrong or it's possible to have input smaller than 148 bytes.

Array
(
    [txid] => 687fb5d0659ef7e21bd567f9b7677d1847d4cc84839a537ab8da8336101a5ca7
    [hash] => 687fb5d0659ef7e21bd567f9b7677d1847d4cc84839a537ab8da8336101a5ca7
    [version] => 2
    [size] => 85
    [vsize] => 85
    [locktime] => 0
    [vin] => Array
        (
            [0] => Array
                (
                    [txid] => 0ac6f42816611c2ed7b31dc38e0dece1eeaf987d1f373bd6e8109430aba826f6
                    [vout] => 0
                    [scriptSig] => Array
                        (
                            [asm] =>
                            [hex] =>
                        )

                    [sequence] => 4294967295
                )

        )

    [vout] => Array
        (
            [0] => Array
                (
                    [value] => 0.000708
                    [n] => 0
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 c3f01af4ca2ef310c61d2244a22bbbe42739202f OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a914c3f01af4ca2ef310c61d2244a22bbbe42739202f88ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => myNyhGasXAHDoRS58StxuVmRLofCN1kcZ2
                                )

                        )

                )

        )

)

This transaction is not signed. It is not valid and I cannot find it on my testnet node nor on any testnet blockchain explorers. The signature takes up the bulk of the bytes in a transaction, so this is expected behavior.


Why countries like to create their own cryptocurrency? Why countries like to create their own cryptocurrency?  As far as I know, a good cryptocurrency should have independent of a third party.

I'm just thinking now the possibility of government issued crypto currency (maybe blockchain technology) and the miners are the banks only, this way government is not putting banks out of business and there can still be central bank who controls all the banks and issue order if needed more money in the economy (if Etherium based which I think the preferred type of all governments).

This can even go in parallel with government existing fiats so people can have two choices (good publicity for the government).

But the question still remains the same, if ever government wants to push on this, "how can they know who owns what?" If this can be solved I think government will definitely step into the world of crypto currencies....


How can I convert bitcoins to Indian rupees and vice-versa? How can I convert bitcoins into Indian rupees (INR) and get them in paper rupee notes?

If someone will want to sell bitcoins for Rupees, they might list it on LocalBitcoins. It's a good start.


What happens to a p2pool payment with an invalid bitcoin address as the username? I run a p2pool node (http://blisterpool.com) and someone just connected with an invalid bitcoin address. They have significant hashpower, and have already started generating p2pool shares...but their address is invalid, so what will p2pool do when it comes time to pay out the block?

If it's actually an invalid address (that is to say it won't hash) such as Address50 then vanilla p2pool will default to sending you (the node) all of the rewards for that miner.

If the address is valid (will hash) but no one holds the corresponding private keys for said address, like 1BitcoinEaterAddressDontSendf59kuE, then the rewards will sit in limbo for all eternity.


bitcoin protocol: transaction encoding I am writing a program (in golang) to mine bitcoins. Supposing I have this dummy transaction, how may I encode it so it can be used in the block im trying to mine?
Also, supposing I have a block header as below:

// binary header data encoded as a hex string:
000000000000000003e6d3647001d1f455d585cdd3c298093902fe52ea4529ba01000030cd0594ebccfe15b205125165cc3b66986ed5b2a311cd8805000000000000000037022f7a3b9a2b199d53fbf1552be32c141892319966c3ef999d348d74cfb5827f476357a09b0518ae5ae1c1
// original header data that has been encoded to build the above header:
Version: 01000030
prev_block: cd0594ebccfe15b205125165cc3b66986ed5b2a311cd88050000000000000000
Merkle root: 37022f7a3b9a2b199d53fbf1552be32c141892319966c3ef999d348d74cfb582
Timestamp: 7f476357
nbits:  a09b0518
Nonce:  ae5ae1c1
Block header: 01000030cd0594ebccfe15b205125165cc3b66986ed5b2a311cd8805000000000000000037022f7a3b9a2b199d53fbf1552be32c141892319966c3ef999d348d74cfb5827f476357a09b0518ae5ae1c1
computed_hash: 000000000000000003e6d3647001d1f455d585cdd3c298093902fe52ea4529ba

How may I add our dummy transaction to the given header (suppose the header already have the merkle root in it)? What if I wish to add multiple transactions like our dummy transaction data to our block header ?

Feb2018: This is a very generic question of an older request, I answer it anyhow, maybe someone will be searching for this info, just like I was doing :-)

The main point is, that the transaction is not part of the block header.
The block starts with a blocksize number of 4 bytes, a block header of 80 bytes, and a transaction counter (var_int, 1-9 Bytes). Then follows all the transactions in the block. The block header starts with a 4 bytes version field, followed by the previous block hash (32 bytes) and the merkle tree (32bytes). This is followed by three fields of 4 bytes each: difficulty, timestamp, and nonce.

In your example, the block should be composed this way:

Block size: 00000264 (612 Bytes)

Version: 01000030

prev_block: cd0594ebccfe15b205125165cc3b66986ed5b2a311cd88050000000000000000

Merkle root: 37022f7a3b9a2b199d53fbf1552be32c141892319966c3ef999d348d74cfb582

Timestamp: 7f476357

nbits: a09b0518

Nonce: ae5ae1c1

tx counter: 2

transaction: 010000000106af2297b4c9a602be8d866ce644f5a03a4485e973309a7d8a0a64fbd985d1c4010000006b483045022100c37ea6fde87034c0dcc5a62f5fdc8c5292b5b2340c327a4c5d5ff6c1f84a748102203a2ed49ecd0a30f10a1ef77704fcd2c853eecf29c3afd9eea9d44e4fd48d39a50121034ef202077f758c66ad3bf6901c844fd88df6e9889be09b963af1a89fda49f4d3feffffff0271c24413000000001976a914c619073e11f2937f344482ed78a791ec93ca8da988acc0ac0d0d000000001976a914efceeab4cc7010eb07421f7351bf2c22570a5ef488ac9c5f0600

Without the first field, this is a length of 612 bytes, which must be converted into a 4 bytes, which is placed at the beginning of the block. So the full block would be:

<block size>

01000030

cd0594ebccfe15b205125165cc3b66986ed5b2a311cd88050000000000000000

<merkle tree>

7f476357

a09b0518

ae5ae1c1

2

<coinbase ... >

010000000106af2297b4c9a602be8d866ce644f5a03a4485e973309a7d8a0a64fbd985d1c4010000006b483045022100c37ea6fde87034c0dcc5a62f5fdc8c5292b5b2340c327a4c5d5ff6c1f84a748102203a2ed49ecd0a30f10a1ef77704fcd2c853eecf29c3afd9eea9d44e4fd48d39a50121034ef202077f758c66ad3bf6901c844fd88df6e9889be09b963af1a89fda49f4d3feffffff0271c24413000000001976a914c619073e11f2937f344482ed78a791ec93ca8da988acc0ac0d0d000000001976a914efceeab4cc7010eb07421f7351bf2c22570a5ef488ac9c5f0600

Then the merkle tree needs to be re-calculated, and double sha256'd. The length need to be calculated, and put at the very beginning, and the "coinbase tx" is missing (funds calculations!).

The details of the structure can be found here in these two reference pages:
https://bitcoin.org/en/developer-guide#block-chain-overview
https://bitcoin.org/en/developer-reference#block-chain


Why was Bitcoin designed with a decreasing production rate? I have no doubt that the person who designed Bitcoin was many times smarter than me but with the benefit of hindsight was the decreasing number of bitcoins a good design decision given the 'hoarding' it encourages? Wouldn't a steady and low inflation rate increase the incentive to spend bitcoins and make it more attractive to the later adopters?

The main issue with Bitcoin is not attracting late developers, but early developers. At its infancy, Bitcoin was an interesting curiosity - people would play around with it but not necessarily use it as money. But due to its scarcity and many benefits, Bitcoin came to be recognised as a digital currency.

At that point people could either wait and see if it gets bigger, or start using it. If Bitcoin's reward wasn't decreasing, probably a lot of people would put off getting into Bitcoin until it is more stable. If everyone decided to wait, Bitcoin would be going nowhere and fade into obscurity. Nobody would then care for late adopter's benefit. This is why getting early adopters on is so crucial - with them comes incentive for late adopters anyway.


how to hash block header in c++ I want to hash a block header in C++ but dont know how.
Im just using a test block at the moment, so that I know what the expected outcome is. https://www.blockchain.com/btc/block/669892
I have a function which formats the block header into the hex string of 0000ff3fd90c0dfca35c8738aa92e1c5bdf706ba14eaafbb379206000000000000000000ad66d8cda0330c3af011ba6b7bc705789767c55a72a818685b3e06a0b8b9a2b054e82260b9210d17099976a6
Now, im struggling to properly hash this to the expected 000000000000000000064ec839564cc03166184f0a404d82cad9c655f714d886
static void calcHash(std::string hash){
    CryptoPP::SHA256 hash;
    std::string digest;
    CryptoPP::StringSource(data, true,
        new CryptoPP::HashFilter(hash, new
            CryptoPP::HexEncoder(new CryptoPP::StringSink(digest)
    )));
    std::cout << "digest: " << digest << std::endl;

    CryptoPP::SHA256 hash2;
    std::string digest2;
    CryptoPP::StringSource(digest, true,
        new CryptoPP::HashFilter(hash2, new
            CryptoPP::HexEncoder(new CryptoPP::StringSink(digest2)
    )));
    std::cout << "digest2: " << digest2 << std::endl;

   return digest2;
}

When I pass that header through this function, i do not get the expected.
How do I get the expected hash from my formatted header using c++?

Firstly, you have a name conflict; hash is both the std::string argument passed to calcHash(), and also the name of your CryptoPP::SHA256 object. This code won't even compile, so are you sure this is the code you're using?
The code itself is somewhat difficult to read, too, because you pass around anonymous objects to nested constructors in an attempt to be concise, but this just makes things needlessly confusing to the reader. Perhaps you have copy-pasted one-liners from other places?
Anyway, here's the approach you should take:

Use HexDecoder (not HexEncoder) to convert your input string (let's call it headerString) to a byte array of the data represented by that hexadecimal string (call the result headerData).

Hash headerData using SHA-256 twice using the CalculateDigest() method of a CryptoPP::SHA256 object, storing the result in a byte array (call it hash2, because we call the first hash hash1).

Use HexEncoder to convert hash2 into a string which is a hexadecimal representation of the hash (call it hashString).

Here's that in code:
#include <iostream>

using namespace std;
using namespace CryptoPP;

static void printHash(std::string headerString) {
    // Convert hex string to byte array
    string headerData;
    HexDecoder decoder = new HexDecoder(new StringSink(headerData));
    decoder.Put((byte*)headerString.data(), headerString.size());
    decoder.MessageEnd();

    // Hash the byte array twice
    SHA256 hasher;

    byte hash1[SHA256::DIGESTSIZE];
    hasher.calculateDigest(hash1, (byte*)headerData.data(), headerData.size());

    byte hash2[SHA256::DIGESTSIZE];
    hasher.calculateDigest(hash2, hash1, hash1.length);

    // Convert result to hex string
    string hashString;
    HexEncoder encoder = new HexEncoder(new StringSink(hashString));
    encoder.Put(hash2, sizeof(hash2));
    encoder.MessageEnd();

    // Print the hash
    cout << asLowerCase(hashString) << endl;
}


Any guidance to built Simple and Basic trade engine? I want to know how the trade engine works, sites likes cryptsy seems to have trade engine to automate the trade process, At first coin-swap seems to have option for "Accept Trade", but now this also has been changed now it works similar to cryptsy, no option for Accept Trade, suppose i create a buy order in cryptsy it automatically match with sell order then i will get my buying currency

How the trade engine withdraw/deposit coins?

The trade engine itself does not withdraw or deposit coins. It would be terrible for the exchanges, because it slows the trading down enormously, and also the fee they collect is reduced (or the fee you pay is increased).

When you want to withdraw some coins, the site checks the wallets they own who have enough balance. From one of those (Im not sure how that is selected, but there is probably some optimization there) your withdraw amount is transferred to your address. So you get bitcoin (or whatever altcoin) from a deposit wallet from someone else. This last thing does NOT mean you loose money, as cryptsy knows that you have 1 BTC (or whatever) on the site.

Anyway, the system is still the same as your previous question, and it is not completely clear what you are asking now. The trading works as I answered (and in the comments) over there. I hope the withdrawing is a bit more clear now.


Who decides for Blockchain PoW puzzle? In PoW algorithm a miner has to solve a mathematical puzzle whose difficulty depends upon load on network and total computing power. But who decides what would be that puzzle for each block?
For Example I am mining a block and I have to solve following equation A + B = C now I have A and I have to find B
 to solve this equation but who in blockchain network provides C (predetermined number) for each block ?
Or
How do the other miners verify that he really did find the winning hash?

a miner has to solve a mathematical puzzle

Let's be specific: a miner has to find a block header (which you construct with the block content, i.e. transactions) whose hash (double sha256) is a number inferior to the target.

  But who decides what would be that puzzle for each block ?

This can be rephrased as: But who decide of the value of the target for each block ?

Short and abstract answer: The network sets the target value.

  Or How do the other miners verify that he really did find the winning hash?

Not only the other miners but all the participants of the network (full nodes) verify the PoW upon receiving a block, with "verifying the PoW" meaning "check that the hash (double sha256) of the block header represents a number below the current target.

So, how all the nodes can agree on the validity of the block ? Or, how all nodes can share the same target ?

The target is hardcoded for the genesis block and is adjusted (the higher the target, the lesser the difficulty. The lesser the target, the higher the difficulty) every 2016 blocks.
Since all participants share the same block chain and the same formula for adjusting the target, they share the same current target.
And since they share the same current target, they accept the same blocks and hence share the same block chain :-).


Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How? let bip32 = require('bip32');
let bip39 = require('bip39');
let { bech32, bech32m } = require('bech32')

const seed = bip39.mnemonicToSeedSync('rural catch say tooth tell soul road pilot fee board goose wedding');
// ^randomly generated for this question

const node = bip32.fromSeed(seed, bitcoin.networks.testnet);

//legacy account extended private key
console.log("LEGACY: " + node.derivePath("m/44'/0/0").toBase58());
//tprv8giQNMeV5drQbXzAxSaVDj5Q1rAuTDZdGWoSx5oaLfuk9rupqVZXoziLgJSpkuauCToZw7BepygJjJaDBWKx5xQLimyg4KFtKnU2E7b99YH

//segwit account extended private key
//how do I take the same inputs, and get a segwit extended private key / zprv

This is how I'm getting my xprv, I'd like to also test out getting a zprv but I'm having trouble finding the documentation for this. I'm assuming it's going to be something using bech32.

Key derivation for P2WPKH using the zpub/zprv version bytes is defined in BIP 84. So you can use bip84 library.
let bip84 = require('bip84');

const root = new bip84.fromSeed('rural catch say tooth tell soul road pilot fee board goose wedding')
const child0 = root.deriveAccount(0) // m/84'/0'/0'
console.log(child0)
// zprvAce8anvk7mGXLFgryEKx2b8tETAKuJRFXM1SRN4wuZDw2cwzxYuJ9PJdecA9MJAuAuchhh3cfLfN3SSL8agTL3tJARw6TmgvAKVgcfVcANm


getheaders request being ignored by peers It seems my 'getheaders' request is being ignored by peers. I've followed the implementation: https://en.bitcoin.it/wiki/Protocol_documentation#getheaders without success.
If I change it to 'getblocks' then it returns an inv[500] message just fine. But for some reason, it's not returning a 'headers' packet when requesting headers.
I'm connected to over 100 peers, and still no success.
Has anyone else had similar trouble before? Any guidance is appreciated.
The request values are as follows:
    magic=3908297187
    command=getheaders
    length=69
    checksum=1021834552
    payload=[version=70013, hashCount=1, blockLocatorHash=[00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048], hashStop=0000000000000000000000000000000000000000000000000000000000000000]

and the encoded bytes are:
e3e1f3e876657273696f6e000000000069000000a4d49d4e7d11010004000000000000002cb0db5d73010000000000000000000000000000000000000000ffff7f000001208d000000000000000000000000000000000000ffff0fa518f420a100ecfbdaa2585542132f626974636f696e6a2d73763a302e302e372f0000000000

Just to note, when serializing, i reverse the blockLocatorHash bytes as mentioned in the wiki.
Cheers,

It looks like the magic bytes you are using isn't the Bitcoin magic bytes. You have e3e1f3e8 but Bitcoin's network magic is f9beb4d9.


I transfered money to Bitcoin Core wallet. Now, how can I use? If I understand it right, I won't be able to use it till the BitCoin Core finish synchronising.

Is there anything I can do to use the money now? From the sender site transaction was completed succesfully: https://www.blocktrail.com/BTC/address/1CQcKeg9L4zAkNhVaKMntS9kTY8n1rpcqA

And I'm always out of disk space because of sychnhronisng.

1CQcKeg9L4zAkNhVaKMntS9kTY8n1rpcqA

You've just stepped into one of the worst problems with Bitcoin. The "default wallet", Bitcoin Core, is not for beginners.

You'll probably want to use a different wallet instead. The problem is that you've already sent a payment to your Bitcoin Core Wallet.

To recover your funds, you'll need to take a crash course in Bitcoin internals.

Your Core wallet contains private keys. You can move private keys from one wallet to another, although this is really bad practice and should only be used when nothing else will work. This might be one of those times, depending on how much money is at stake and how unwilling you might be to let Bitcoin Core continue syncing for the next several days, but as you mentioned you're running out space so it will never complete.

You sent funds to an address (a long sequence of text beginning with "1").

To get the private key for your address, get to the Core console (Help->Debug window).

Next, click on the "Console" tab. There is a text box at the bottom with a ">" symbol and a blinking cursor.

Enter this into the box:

dumpprivkey <address>

where <address> is your address.

From there, you have the private key (begins with "K" or "L", possibly "5"), which you can import into another wallet.

Elsewhere, you indicated you're using electrum. Here's how to "sweep" funds from your private key into Electrum:

http://bitzuma.com/posts/a-beginners-guide-to-the-electrum-bitcoin-wallet/#sweep-a-paper-wallet

Note that the article talks about a paper wallet, which is simply a private key printed on paper.


Does a segwit based side chain like the lightning network allow for fractional reserve? I'm confused.

I've watched the video The Lightning Network Explained (Litecoin/Bitcoin), and read the following comments by Craig Wright:

  This occurs because schemes such as segregated witness allow for the
  introduction of fractional reserve systems into bitcoin.
  [Sources: coingeek,
   SegWit and the Illusion of Scale]

From the video explanation of segwit/lightning it would seem that a bitcoin is required to open a payment channel and create the "IOU" that is used for the lightning transaction(s).

How can this be considered fractional reserve if there is a 1-to-1 mapping from bitcoins to payment channel balances?

It would actually seem to do the opposite and keep 3rd parties honest.

What am I missing?

Thanks.

A sidechain has its own blockchain which is coupled to the Bitcoin blockchain via a two-way peg. This allows tokens on the Bitcoin blockchain to be frozen in order to make new tokens available on the sidechain. In turn tokens on the sidechain can be either destroyed or frozen to move money back to the Bitcoin blockchain.

Lightning Network is not a sidechain. It's a second layer that builds on top of Bitcoin and uses the same tokens as Bitcoin.
Channels are created by sending money into native 2-of-2 multisig addresses on the Bitcoin blockchain. After a channel is created by sending money to the mutually controlled address, the current state of a Lightning channel is stored in a pair of unconfirmed Bitcoin transactions. When one of the participants wants to close the channel, they can unilaterally broadcast the latest state to the Bitcoin network. When the exit-transaction is added to a block, the final state of the channel is executed. Alternatively, they can collaborate with their partner to close it.

Since the full Bitcoin balance of the Lightning channel is stored in the multisig address that established the channel,  all bitcoins are fully accounted for. Therefore, there is no fractional reserve in Lightning Network.


Questions about Bitcoin Transactions I was playing around with my Bitcoin Node, to try and understand how does Bitcoin Transactions work.

For this purpose, I used the sendtoaddress API call for bitcoin-cli, to send some XBT to my own Bitcoin Blockchain.Info wallet. The transaction was processed, and I was trying to understand the information that I get from gettransaction bitcoin-cli command, and the information that the Blockchain.info website shows about the transaction.

So, here is what I did:

I've generated a receiving address for myself in Blockchain.Info (17tzZwAi722L7V8V27bUGEKwJpRYVNRKVW)
In my Bitcoin node, I used the following command: bitcoin-cli sendtoaddress 17tzZwAi722L7V8V27bUGEKwJpRYVNRKVW 0.001

This gave me back a transaction id: 4f299e7313af7e4e091ea519bbf5983526d18fe4765b679ce1827bd9f75dbaff

I then checked the information that the bitcoin node gives about that transaction with: bitcoin-cli gettransaction 4f299e7313af7e4e091ea519bbf5983526d18fe4765b679ce1827bd9f75dbaff

What I noticed here is that the bitcoin-cli command gave me back the address I sent the money to, the fee it took to get the address, but it didn't tell me from which address the transaction was sent from.

Then I checked the information that Blockchain.info provides about the transaction: https://blockchain.info/tx/4f299e7313af7e4e091ea519bbf5983526d18fe4765b679ce1827bd9f75dbaff

Here, it can be clearly seen that an amount of 0.06611392 BTC was sent from 12bFMAPz7dhKmLxsoipfUqmCCjqENCDzKb XBT address, to two different outputs. One of the output is the address, Blockchain.Info gave me to receive the Bitcoin. The other output is an address unknown to me.

So I started thinking:
Am I correct, that when sending a bitcoin transaction, all of the amount from a specific address gets placed in the input, a part of it(the part which I specify) gets sent to the address I wish to send, and the rest gets transfered to a newly created address on the same wallet, from which the send operation was initiated?

Some other questions which arise to me:
How is Blockchain.Info able to retrieve information from any kind of Bitcoin Transaction, while I, using a full Bitcoin Node, can only find transactions which was either initiated by the node, or which has a receiving address which is in the nodes wallet?

but it didn't tell me from which address the transaction was sent from

Indeed, there is no 'from address' in a bitcoin transaction. (More info)

  Am I correct, that when sending a bitcoin transaction, all of the amount from a specific address gets placed in the input, a part of it(the part which I specify) gets sent to the address I wish to send, and the rest gets transfered to a newly created address on the same wallet, from which the send operation was initiated?

Correct, inputs are spent all at once, there's no way to partially spend it, so you have to send some change back to yourself. The sendtoaddress manages that all for you.

  How is Blockchain.Info able to retrieve information from any kind of Bitcoin Transaction, while I, using a full Bitcoin Node, can only find transactions which was either initiated by the node, or which has a receiving address which is in the nodes wallet?

That's a lot of data that bitcoin core doesn't usually need or use, so it's not usually indexed or accessible by bitcoin core. It's possible to use the -txindex configuration option to index all transactions including those not related to your wallet. But blockchain.info and similar block explorers probably run their own databases of information rather than querying it from a bitcoin node every time, allowing them to do more complicated searches in the data.


Vanity address generation for Segwit? Vanity address generation is currently strightforward for "old" Bitcoin addresses (starting with 1) with multiple software options available (oclvanitygen e.t.c).

Is there any options to generate SegWit Vanity address (starting with 3)? Or it is already possible to configure existing software for Segwit addresses?

Segwit, until BIP 173 is widely used, uses P2SH addresses. These addresses currently begin with a 3 and you can find them on the blockchain right now.

AFAIK, there is no software which will produce vanity P2SH addresses since there isn't just one thing that it can try over and over; the address is based on a script which could have anything, unlike the 1... Bitcoin addresses which are only based on one public key.

Since there are no P2SH vanity address generators, there is not one for Segwit. However it would not be hard to make such a software.


Mining pool performance optimization What are the main components one should focus on when trying to maximize a mining pool's performance? Assuming the code is pretty optimal (there aren't any inefficiencies), what should a pool owner devote their attention or resources to? I'm thinking about factors such as hardware speed, internet speed, latency, or some additional features, like long polling, and what priority should those have.

The code isn't optimal especially not on the merged mining side.  Currently there is no optimal method to handle both block chains without a more advanced miner-pool communication protocol.

Excluding merged mining issues, latency is a large factor.  When a block change occurs every single miner's effective hashing power is zero until they begin working on updated block header.  Thus a pool's effective hashing power goes from total hashing power down to 0 and then rises as miner's are updated. So pool's long term effective hashing power depends on how quickly it can deal with a block change.

This involves three components.

Detecting block change.  A good pool should have large number of connections to the Bitcoin network to minimize the delay in learning of block chain. A good pool operator will ensure they maintain connections "close" (within 1 or 2 hops) of every major pool.
Recalculating block headers.  During a block each miner will complete their work at differing times and thus getwork requests are staggered.  However when a block changes the pool needs to update every miner's block header at once. A pool lacking sufficient processing power to quickly compute block headers will have miners working on stale work longer and thus have a higher average stale %.  Updating miners in the order of their hashing power could reduce the pool's overall stales slightly.  I don't know if any pool currently does that.
Update miners.  The latency of the miner's link is beyond the control of the pool but a pool can improve efficiency by having multiple pool servers reducing the number of hops to all miners.  Pool servers should be located as close to miners as possible.  A pool consisting mostly of miners in Asia shouldn't use US East Coast datacenter for example.

NTimeRolling reduces the number of communications (getworks) required for a given number of hashes.  this makes the pool more efficient as a given amount of hardware can support more clients however it doesn't reduce load at a block change.

Implementing Long Polling ensures that miners are notified when a block change occurs (minus latency indicated above) rather than continuing to work on stale data until complete.  Completing one nonce range takes roughly 10 seconds for a 400MH miner.  Without long polling on average the miner will waste 5 seconds per block change working on data that can never produce a valid block.  Given block changes occur every 600 seconds that is roughly 1% of CPU time wasted hashing invalid block headers. Slower miners have longer period between getworks and thus waste a greater % of GPU time.  No pool can be efficient without a good Long Polling implementation.

Both NTimeRolling and Long Polling (LP) require a miner which properly understands these commands.


How to use the bitcoin client without downloading the blockchain? I would like to be able to use the bitcoin python client to be able to do things like sign transactions offline, create transactions, create multisig transactions, etc.

Is there a way to do this without having to download the whole bitcoin blockchain 20 GB?

I don't mind looking up the bitcoin addresses, outputs and such using an external website (e.g., blockchain.org) using some sort of API.

Is the a client that does this?

Electrum is an SPV wallet which has most of the functionality you mentioned.

Multisig is an issue though, the primary solution I'm aware of at this time is hybrid wallets such as Copay.


How to recover deposit to incorrect address i need some guidance. I deposited Bitcoin from LUNO to an address in Gatehub. The Bitcoin has not arrived in my Gatehub wallet. I believe it went to an incorrect address. How do i trace it and recover it.

Log into Luno and click on transactions.

This should list the deposit that you did to gatehub. In my example in the screenshot this is a transfer I did to the waves platform

If you click on that transaction in the list it will show the transaction number of this deposit. The transaction number will be hyperlinked so you can click on it and it will launch a new page that allows you to view the transaction in the blockchain explorer. Check your transaction in the blockchain explorer and see how many times it has been confirmed and whether it has been added to a block.


How to generate a bulk wallet offline with python, java or c++? I want to generate, say 100000 key pairs (address/private key). It should be done offline, without using websites/javascript , with a program on the command line. Of course, the software should use the best way to generate randomness. There is such function on https://www.bitaddress.org , but it's javascript and is not easy to be used by scripts on the command line. Do you know of such software?

A very simple way is to use Vanitygen with the following command:

vanitygen -k -o output.txt -s seeds.txt 1

-k keeps it going after it finds a hit
-o output.txt will write the key pairs to the file output.txt
-s seeds.txt will let you have different seeds. Create this on beforehand
1 is the pattern Vanitygen will look for. Because all addresses start with 1, every hit will be good. Also nice if you want to have nice addresses, like 1Hristo or something. Keep in mind that it will reduce speed ALOT.

Vanitygen creates about 300 kKey/second on my 2010 MBP CPU. With oclvanitygen it is around 750 kKeys/second. The output.txt will reduce the speed a bit, but it will not take a lifetime. I am not on a computer right now on which I can test the command, but it should work.

This will generate key pairs until infinity. If you really want to have exactly 1000000 (or any other number) pairs, try something with a bash for-loop, and something like

vanitygen 1 >> output.txt

Again, I cannot check this right now, so I don't know how the pairs will be in the output.txt, but it should be appended and readable for you.


How to uninstall Bitcoind from ubuntu server? I installed bitcoind on my ubuntu server awhile ago. How do I go about uninstalling it properly? Do i just delete the ~/.bitcoin folder?

If you installed with a deb package, you can use apt-get to remove it:

sudo apt-get remove bitcoind


How might I reduce the percentage of rejected shares using an Avalon 741 with NiceHash? I have an Avalon741 running on NiceHash with CGminer and I'm new to mining. The command I'm running is as follows:

sudo ./cgminer -o stratum+tcp://sha256.eu.nicehash.com:3334 -u <address> -p d=4096

When I run with this, I end up getting usually between 25% and 50% of shares rejected. Why is this? How can I improve the situation and contribute more effectively?

Here are some representative CGminer run statistics:

[2017-06-07 12:57:08.511] Started at [2017-06-07 02:20:49.716]
[2017-06-07 12:57:08.511] Pool: stratum+tcp://sha256.eu.nicehash.com:3334
[2017-06-07 12:57:08.511] Runtime: 10 hrs : 36 mins : 18 secs
[2017-06-07 12:57:08.511] Average hashrate: 5032956.9 Mhash/s
[2017-06-07 12:57:08.511] Solved blocks: 0
[2017-06-07 12:57:08.512] Best share difficulty: 140M
[2017-06-07 12:57:08.512] Share submissions: 7258
[2017-06-07 12:57:08.512] Accepted shares: 5335
[2017-06-07 12:57:08.512] Rejected shares: 1923
[2017-06-07 12:57:08.512] Accepted difficulty shares: 44435456
[2017-06-07 12:57:08.512] Rejected difficulty shares: 15138844
[2017-06-07 12:57:08.512] Reject ratio: 26.5%
[2017-06-07 12:57:08.512] Hardware errors: 11355
[2017-06-07 12:57:08.512] Utility (accepted shares / min): 8.39/min
[2017-06-07 12:57:08.512] Work Utility (diff1 shares solved / min): 94093.46/min

[2017-06-07 12:57:08.512] Stale submissions discarded due to new blocks: 7
[2017-06-07 12:57:08.513] Unable to get work from server occasions: 12
[2017-06-07 12:57:08.513] Work items generated locally: 274339
[2017-06-07 12:57:08.513] Submitting work remotely delay occasions: 6
[2017-06-07 12:57:08.513] New blocks detected on network: 1960

[2017-06-07 12:57:08.513] Summary of per device statistics:

[2017-06-07 12:57:08.513] AV7 0 (5s):32.99G (avg):5.032Th/s | A:44435456 R:15138844 HW:11355 WU
[2017-06-07 12:57:08.513]

If you live in the U.S. you need to connect to the US server.

stratum+tcp://sha256.usa.nicehash.com:3334

NOT

stratum+tcp://sha256.eu.nicehash.com:3334


Non-Bitcoin Uses for Old ASIC Miners? Can I use an old ASIC Bitcoin miner for other applications? For example, quickly reindexing the blockchain on my computer? Or quickly hashing every file on my hard-drive?

(I really wonder if the hard-drive could even supply the data to the miner fast enough, and the computer's CPU would probably have to be involved, translating the data for the miner, so that would be a bottleneck…)

(Note: My question differs from "Reusability of ASIC miners" because I am only asking about hashing-specific applications, not whether ASICs can do other mathematical operations.)

Anything that makes ASICs suitable for applications other than the Specific Application the Integrated Circuit was designed for would probably slow it down or make it more power hungry or expensive.

One side effect they do have (along with anything else electronic) is that they convert 100% of the electricity into heat. So you could use them instead of an electric heater.

Note that heat pumps are actually more efficient, so it's not optimal. And in a lot of countries burning natural gas for heating is cheaper too.


How would AML techniques work in Ripple? Can anyone explain how AML rules, alerting, and FinCEN reporting would work under Ripple?

AML is only applied to customer relationships. In this case that would be people that have an account with a gateway and are using said account to either deposit or withdraw massive amounts of money/crypto from the gateway.

It cannot apply to rippled balances, as you don't need to provide any information to another entity in Ripple in order to extend a trust line to said entity. I.e. there is no customer relationship in that case.

All of the above is AFAIK and IANAL.


Is there a recommended maximum number of transactions any one address should ever receive? The pool I am with has sent about twenty transactions to one address I gave as a 'send to' addy. Could this one address just go on and on taking more and more of these transactions? A hundred of them? Ten thousand?

You can use it as many times as you like. There is no upper limit.

The reason that people advocate using new addresses is that it increases anonymity. For example, people who know your address can easily look up how much has been sent to it in total. See these questions for some more info on anonymity:

How anonymous are Bitcoin transactions?
How can one remain relatively anonymous while using Bitcoin?


Is it legal in Egypt to sell BTC, and is that available there? My friend from USA is trying to send money to me but he can't do that through Moneygram or WU.
So he asked if it's possible to send the money through Bitcoin.

So, I'm not sure if it's going to work out.

According to https://legal-or-not.com/bitcoin/egypt-bitcoin-status/, Bitcoin is legal in Egypt. On the wiki for list of countries on stances on bitcoin, Egypt is not listed.

In 2016, an Egyptian dentist was arrested for trading bitcoins for USD. Note, he was not trading bitcoins but rather exchanging them for USD. He was arrested for scamming, money laundering, and as I said above, exchanging through foreign currencies.

Thus, because there is very little information about the Egyptian's government on bitcoin, be careful, but it should be ok. Hopefully my answer helps you out.


I bought 1BTC and the transaction was instantaneously, how? So, I went to localbitcoin, I met a random guy at a Starbucks gave him the money and he transfered 1BTC with his cellphone to my blockchain.info account. I thought I would have to wait at very least 10 minutes or so before the transaction would get included in the blockchain and have the first confirmation, instead the guy sent it and literally one second after that the bitcoin was there in my blockchain.info wallet, how is that possible?

New transactions propagate across the Bitcoin peer-to-peer network very quickly.  This is how they get to miners to be included in the block chain (confirmed), but everyone else sees them right away also.  Your web wallet software alerted you that it saw a transaction sending 1BTC to your wallet, and updated your balance accordingly, on the assumption that the transaction will eventually be confirmed.  But it should also have indicated that the transaction was not yet confirmed, with a message like "unconfirmed" or "0 confirmations".  Seeing this, you could decide whether you're willing to let the other guy leave, or if you want him to stick around until the transaction has one or more confirmations.

Of course, it's also possible that you were lucky and a miner found a block very quickly after receiving your transaction.  In that case it might actually have been confirmed by the time you saw it.


electrum wallet console - how to get help on a command I'm trying to use the electrum wallet console to get help on a command.
I can do help() or any other command
but i cannot do help <some command>
cannot find documentation about the wallet console

Of course i can do from my terminal electrum help <some command>

To see the list of Electrum commands you type:

electrum help

To see the documentation for a command you type:

electrum help <command>

The link to the Electrum documentation is here:
http://docs.electrum.org/en/latest/cmdline.html


Bitcoin and ArchLinux on a Pogoplug I'm interested in using a pogoplug to run bitcoin. From my understanding, I should be able to connect to the pogoplug from another device (RasPi with AM BEs) and mine on my own. I'm having trouble figuring out what I'm doing wrong -- I've got bitcoin cloned to the plug from github, but in following what it seems others have done,

make -f makefile.unix USE_PNP=-USE_IPV6=0

nets

make: *** No rule to make target `makefile.unix'.  Stop.

Suggestions?

Bitcoin now (as of a few hours ago) uses autotools to generate makefiles. You'll need to run ./autogen.sh first, then ./configure, then make.


Does node order have meaning in a JSON describing the Lightning network graph? LN clients can export their view of the network as a JSON file. For instance, in a file obtained from LND, a channel (edge) is described by this structure:

{
    "channel_id": "555479871492063233",
    "chan_point": "dbd46c11d740d7554454d2aad0520e18eedbc9c5e282d21dd065f275cbbe8380:1",
    "last_update": 1540396105,
    "node1_pub": "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e",
    "node2_pub": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
    "capacity": "300000",
    "node1_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "546000",
        "fee_rate_milli_msat": "10",
        "disabled": false
    },
    "node2_policy": {
        "time_lock_delta": 14,
        "min_htlc": "0",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "10",
        "disabled": true
    }
}

Does node order have a meaning here? In other words, is node1_pub the one who initially opened the channel?

The nodes are listed in lexicographical order after compressed DER encoding. It is not possible to tell from the public information about a channel who requested to open it.

The ordering is required so that signature verification of a channel_announcement message always passes. If intermediate nodes were able to rearrange the order of information within the message, it would fail verification even though the information is correct.

Additionally, the numerical ordering is used for channel_update messages, as a single bit is used to denote whether the update applies to node1 or node2.


What prevents a knowledgeable person from modifying their bitcoin data? The average person would not have the knowledge, but what is the mechanism that stops a programmer capable of writing a wallet, from modifying the local bitcoin file/data to be, for example, 10 bitcoins instead of 1? Or maybe it should be - what prevents modification and then use of the data.

Bitcoin aren't stored on a machine, but they are held in a distributed public ledger known as the blockchain. The blockchain is a database which is replicated over the machines of everybody who participates by running the bitcoin software. This means that the database you hold locally on your machine is just a copy of the one which the network as a whole agrees is the correct and undisputed ledger.

The process by which all participants agree as to which chain is the true valid chain is called mining, which uses a Proof-of-Work mechanism to enable one participant to commit a new block to the chain approximately every 10 minutes. The process by which a participant is selected is pseudo-random and probabilistic, based on the amount of work they do, which generally corresponds to the amount of electricity they irreversibly consume to perform computation on the current tip of the chain.

The cost of electricity to perform work is one of the game theoretic elements of Bitcoin which keeps it secure, because it means that any participant who attempts to adjust the ledger to favor themselves will have to spend money and consume electricity, but their chance of success is extremely small, as they would need perform more than 50% of the total global work being done on the current tip of the blockchain in order to keep ahead of the honest majority. The majority of participants are honest because it can be profitable to be honest, but being dishonest is a loss-maker unless you are certain to have more than 50% of the global work being performed on Bitcoin.

The chain is secured by cryptographic hashes, so that any attempted change to any part of the ledger produces different hashes. Each block in the chain explicitly refers to the previous block header's hash, and this value is also included in the current block header. This means every block commits to the entire blockchain history, and any attempt to rewrite part of the ledger would require rewriting the entire history of the ledger from the point of modification. Rewriting the history would therefore require an amount of work in excess of the total amount of work which was performed between the block which was attempted to be modified and the current tip of the chain.

The ledger itself is a linear sequence of blocks which each contain a set of transactions, where one of the transactions in the set is a coinbase, which collects the fees of other transactions in the block, and which releases some previously unused bitcoin as part of a predetermined release schedule. Currently around 35/40 of all bitcoin have been released and the remaining 5/40 will be released gradually over the next 120 years.

The other transactions in a block are regular transactions which have inputs and outputs. The inputs of a transaction refer to the output of a previous transaction. The outputs contain a locking script, which is a set of preconditions which must be met in order for that output to become spent. Once a transaction output has been spent, it may not be spent again. This means that there exists at any moment, a set of unspent transaction outputs (UTXOs) in the ledger which are where all of the bitcoin in existence are "held".

The relationship to a wallet is where this locking script comes in. For all regular transactions, one of the preconditions to unlock the output and spend it is to provide a digital signature matching a public key which is stored in the output locking script. Only the person who has the private key corresponding to the public key is capable of producing such signature, and the message they sign is a hash of the transaction which they are attempting to spend - which ensures that nobody else can manipulate this transaction because it would invalidate the signature.

So a wallet is fundamentally a set of private keys which are used to unlock some bitcoin held in some UTXOs on the distributed public ledger. A wallet will compare the set of corresponding public keys against the entire UTXO set of the public ledger to determine which bitcoins are essentially "owned" by this wallet. The amount of bitcoin in set of UTXOs which the user can unlock correponds to their balance.

A regular bitcoin software will obtain a copy of the entire ledger and will listen for new blocks being added by other nodes - who broadcast them over a peer-to-peer network. Multiple distinct connections are used to ensure that peers do not present false or outdated information. Each time a new block is created, approximately one every 10 minutes, the wallet will download the block and look through its set of transactions for any which the wallet has the relevant private keys to unlock. Any which it can unlock are added to the balance, and this becomes newly received bitcoin.

To spend bitcoin, a user must select one or more UTXOs which they have the private key to unlock. They create a new transaction referring to these UTXOs as inputs, and they create a set of outputs which contain new locking scripts - usually by including the public key hash of the person they wish to pay, which comes from the bitcoin address which they use for that payment. The bitcoin amounts in the outputs of a transaction must be less than or equal to the amounts of the input UTXOs referred to in the transaction, with any difference being paid as the fee for the transaction. The user will then sign this transaction and broadcast it over the peer-to-peer network.

A transaction must be valid for any other node in the p2p network to accept it. This means that the participant who receives a transaction will compare the accuracy of the UTXO set against their own copy of the ledger. If you modify anything in your local copy of the ledger, it will not produce changes to the copy anybody else has. If you attempted to spend some amount that other participants do not agree that you own, then your transaction will be invalid and rejected by the network. It will never be included in a block, and the intended recipient will not receive anything.

In other words - any attempt to modify data locally can only attempt to fool yourself, but it can't fool others. Nobody accepts anything you say as truth - they verify it for themselves by verifying the historical accuracy of the ledger.


Blockchain transaction message length limit When I perform a transaction on the blockchain, I can add a message to the transaction, which will then exist forever in the blockchain.

Say for example I wanted to use the blockchain to store digital assets...

Could this type of information be encrypted and stored as a transaction message, and if so, is there any limit to the message length of a transaction?

This message exists only on blockchain.info site. It is not a part of bitcoin protocol. You should not think, that it will exists forever, because blockchain.info is  third-party-service

Point your view to a OP_RETURN output scripts. http://bitzuma.com/posts/op-return-and-the-future-of-bitcoin/


Why is the disappearance of Mt Gox a problem? I'm sorry if this is a stupid question, I'm not a bitcoin user and may lack important information. My understanding was that each bitcoin user has a wallet on his harddrive or wherever, where he stores his bitcoins with the transaction history proving that they are his.  So the system is pretty decentralized. Then why is it such a problem that Mt. Gox disappears? Don't the people losing money have it in their own wallets, if so why?

Edit to add: In case the question was unclear, I was asking for why people lost money with Mt. Gox - not about the wider ramifications like potentially lost trust in *coin etc.

To actually try and answer your question, Mt Gox acted as a trusted middleman in btc trading, and thus had to have control over their users money.

Let's say dude A has a few btc he wants to sell, and dude B has a few dollars he wants to buy btc for. B doesn't want to pay until A sends him the btc, and A doesn't want to send his btc to B until B pays. Unless they trust each other, they can not do business.

By putting money and btc in the hands of a supposedly trustworthy middleman (Mt Gox), A and B can do business. As soon as they agree on the price, the middleman, who has access to both the btc wallet of dude A and the dollar wallet of B, can make sure that both transfers are made, so that each person gets what they agreed on.

So essentially, users had dollar accounts and a btc accounts at Mt Gox, and it is from these that things seem to have gone missing.

As has been pointed out below, it may be that accounts still show the right balance, but Mt Gox doesn't have that money anymore.


Were bitcoins automatically converted to Bitcoin Cash? Don't understand about Bitcoin Cash. It is written here:

  Bitcoin Cash is an altcoin which forked from Bitcoin in order to raise
  the maximum block size from 1 MB to 8 MB.

But:

  Anyone who held Bitcoin prior to the fork had the same amount of
  Bitcoin Cash following the fork.

So, bitcoins were automatically converted to Bitcoin Cash.

But they have different price and actually different currencies.

Some people want to keep Bitcons, some Bitcons Cash.

Or I understand it wrong?

BCH is basically a copy of the blockchain up until the point of the fork so all BTC on the bitcoin blockchain have an exact copy of BCH on the BCH blockchain. That means if you held BTC at the time of the fork, you get an equal amount of BCH as well - you have both. Yes, they are different currencies with different prices, and you can buy and sell them completely separately from each other


How can a third party spend BCH accidentally sent to a BTC address? I transferred BCH to an Electrum wallet address and haven't ever received it because Electrum uses only BTC. As I have been trying to recover it, I looked up the transaction on explorer.bitcoin.com and it was input but has also been output 5 times and the  balance shows 0. So it would appear that someone has access. How is that possible? Shouldn't it be secure? Do I have any sort of recourse?

So it would appear that someone has access. How is that possible?

Excellent question
Segwit addresses
Segwit increases the capacity of the Bitcoin (BTC) network and enables the lightning network. Segwit addresses start with 3 or bc1.
On 21 November 2017 Kai Sedgwick reported on  Bitcoin.com

Someone Just Helped Themselves to $600k of Bitcoin Cash from Segwit Addresses
As anyone with a passing knowledge of bitcoin cash will tell you, BCH and segwit don’t mix. Send BCH to a segwit address and you’re gonna have a bad time. Unless you happen to be a miner with the hashpower and technical prowess to unscramble the mess, in which case you’re gonna have a very profitable time. 493 BCH worth $610k has just been retrieved in that manner by one enterprising individual.

A segwit address is just a particular kind of Bitcoin address being introduced as part of some Bitcoin improvements.
Non-segwit addresses
For a third-party to spend bitcoin-cash (BCH) sent to a non-segwit bitcoin (BTC) address, they would need access to the private-key from which that address was derived.
This might happen through the use of viruses, Trojans, fishing or social engineering etc.

Receiving address I have is 19EsSXxaTParaHqQ7V8o9A9xbZ47fApe7f

(from comment to Problems recovering BCH accidentally sent to BTC address)
Blockchain explorer websites show no transactions for that address
Example for BTC blockchain:
Summary
  Address   19EsSXxaTParaHqQ7V8o9A9xbZ47fApe7f
  Hash 160  5a6084e7e05b44c3805b8372462e876447b28d43
Transactions
  No. Transactions  0
  Total Received    0 BTC
  Final Balance     0 BTC

Example for BCH blockchain
Address
     bitcoincash:qpdxpp88upd5fsuqtwphy33wsajy0v5dgvkmjdckhh

Balance: 0.00000000 bch
Total Received: 0.00000000 bch

Example 2 for BCH blockchain
Address 0 BCH
Address bitcoincash:qpdxpp88upd5fsuqtwphy33wsajy0v5dgvkmjdckhh
Summary confirmed
Total Received  0 BCH
Total Sent  0 BCH
Final Balance   0 BCH
No. Transactions    0

Security

Shouldn't it be secure?

Only if you send Bitcoins to bitcoin addresses and bitcoin-cash to bitcoin-cash addresses.
Groups of people developing different cryptocurrencies don't always cooperate with other groups to prevent this kind of consequence. The split between Bitcoin and Bitcoin cash was a little acrimonious.

Recourse

Do I have any sort of recourse?

No.
Cryptocurrencies are essentially designed as peer-to-peer currencies with no regulatory oversight and with no third parties enabled to intervene in disputes.
You dropped some coins on the floor and someone picked them up.
You could ask the person who found your BCH if they will give them back to you for a 30% bounty. It may be hard or impossible to work out who has your BCH and how to contact them. You will be relying on the kindness of a stranger.
You could report the matter to your local police.

Third Party Oversight

This is me transferring my coins to my account but because they aren't dollar bills the bank teller steals them!

There are no bank-tellers in Bitcoin.
You accidentally sent your bitcoins to the wrong destination. Other people who are unscrupulous can often take advantage of any mistakes you make.

Prevention

Something needs to be done about this

You need to be more careful.
If you ask them, wallet developers might consider changes to their wallet software that might make this kind of error less likely.
I believe the Bitcoin-cash (BCH) developers plan a change in address formats to avoid them looking like Bitcoin's (BTC) Segwit addresses.

Risk.

There is a serious flaw in the cryptocurrency system if it simply allows thieves to pray on people who are new to it without any recourse

Bitcoin transactions are by design irreversible. Bitcoin is a very risky investment. Anyone getting involved needs to take the time to understand the risks before getting involved.
Thieves will always prey on those who make careless mistakes. The nature of cryptocurrencies is that they are conceptually unlike the currencies and financial systems that people were previously used to, this makes cryptocurrencies relatively dangerous for the unprepared. For example, the use of the term "wallet" is misleading because cryptocurrency wallets do not really contain any money. Thinking that Bitcoins exist in the blockchain or are entities that are stored somewhere electronically is an error. This makes it easy for the unprepared to make mistakes and lose money.
Caveat Emptor.

Other useful references

Bitcoin Cash Locked in SegWit Addresses: A Recovery Workaround Discovered


How do you derive the public key from you random 256-bits integer? Once I've flipped a fair coin 256 times and have the random 256 bits integer that I'm going to use as my private key, how is the public key derived?

I've read:

Given a private key, how do you get a public address

And:

https://en.bitcoin.it/wiki/Address

But I don't find the answer to my question. I understand ECDSA curves are used but I don't understand which part is the public key and what's the relation between the (unique?) public key and the addresses which you give out.

If you convert the private key to a public key by performing a multiplication with the curve's base point, then it begs the question: what is the curve's base point?

Is the curve's base point part of the private key?

Which would mean that what is called the "private key" isn't really just a "private key" but more of a keypair from which you can, at any time, derive the public key?

The curve's base point is a well-known constant. Since Bitcoin uses SECp256k1, the base point is:

04 (uncompressed point)

79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9
59F2815B 16F81798 (first coordinate)

483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448
A6855419 9C47D08F FB10D4B8 (second coordinate)

(See page 15 of my link.)

The private key is an integer from which you can derive the public key and produce signatures that can be verified with the public key.


Is the "official client" crash-resistant? I'm running the "official client" (12 MB zipped version) on a Windows platform.

What are the risks (to my wallet) when the computer crashes due to overheating, BSOD, power failure, etc?

Is the "official client" crash-resistant?

Yes, mostly, but there are some things you should know.

Your wallet is stored as a separate file. Your wallet file gets changes written to it as new blocks are received and transactions are made, etc. The chances of a crash occurring during a write to your wallet are probably minimal, but you should have a backup of your (encrypted) wallet anyway. This is by far the most important point. Once your wallet is encrypted with a very strong password (the client provides this function), you can store copies of it in insecure locations, so you always have a copy somewhere - store it in gmail, send it to your family etc. You should only need to make an additional backup every 50 transactions. Bear in mind the receiving address descriptions aren't encrypted though. Running the client with the -rescan option may fix minor issues.

The client will refuse to work if a failed attempt at double-spending is detected, but that's not really what you're asking. Besides, there appears to be a fix for the problem.

The block chain takes a long time to download, so there is a risk that a crash would required you to download it again. If the client is closed (gracefully) while it is downloading the block chain, it resumes where it left off with no issues; I would guess it would probably do the same thing in the event of a crash, but it's only your copy of the block chain that's really at stake.

Realistically, once you've got your wallet encrypted with a strong password and backed up in multiple locations, the biggest remaining risk is from theft through a virus or malware. Quote from Gavin Andresen: "If your computer is infected, then it cannot be trusted, and there is no software in the world that can keep your bitcoins safe if they are stored on it."


How to receive payments online to single address per user in scalable way? Suppose we are building online casino/market and want to receive payments.

To be scalable, safe and have good user experience, we:

cannot generate new address for every single payment. Having single deposit address is a lot easier. Also users always can deposit to old address by mitake even if generated new address.
cannot check listreceivedbyaddress because regulary checking hundreds of thausands of addresses is not scalable. Also large RPC output when single user make thousand of deposits.
we should do not rely on external services online blockchain API.

We absolutely cannot use any RPC call that will list complete and growing list of transactions like all transactions for wallet or all transactions for address.

So, the most sensible way should be checking by listsinceblock to parse all transactions "per analysed block" and joining to user balances by destination address - incrase user amount in our online service and mark this payment as "completed" to not count it second time. Simplest way of marking this transaction as "already resolved" is to store its ID as "already used" in same SQL transaction that incrases user balance.

But I heard that it is possible to change transaction id in block chain, so is such solution safe?

How can I use RPC calls to receive payments block after block and which data can I use to mark payment as resolved to be safe from duplicated deposits on single payment?

TL;DR how "big players" like Cryptsy do receive payments?

Use Bitcoin Core in server mode and use it's notification functions:

server=1
blocknotify = curl\yoururl
walletnotify = curl\yoururl

Set them up to make a call to your app.

This way, you won't be making expensive RPC calls to Bitcoin Core. You will only be receiving notifications for operations  that Bitcoin Core itself already is making. So you won't bring any extra load to Bitcoin Core. You will be limited by it's own scalability.

  how "big players" like Cryptsy do receive payments?

Most big players are relying on Bitcoin Core's scalability running in server mode without bringing extra load to it as far as I know.

  But I heard that it is possible to change transaction id in block
  chain, so is such solution safe?

Not after they have received a confirmation. So the method you described works if you wait for the blocknotify call for a TX before you update your users balance.


Import two wallet.dat into Bitcoin-Qt client This is very closely related to Import wallet.dat into a new Bitcoin-Qt client, but I feel this is not a duplicate because the (great) answer to that Q is for only restoring one wallet.

I used Bitcoin-QT about a year back and had two separate wallets within it.  I have these backed up as two separate wallet.dat files.  After some computer wipe, I now need to restore the two wallets into the one Bitcoin-QT client.

Using the prior Q, I have been able to import one of the wallets back into the Bitcoin-Qt client.  I now need to bring the other one in.

How can I import a second backup into my existing account, without the need of sending my first wallets amount to a separate external wallet?

There is (yet) no multi wallet support in bitcoin-core.

You can try to stop Bitcoin-Qt, replace your wallet.dat (rename the old one, place the new one) and start Bitcoin-Qt. If your wallet is really old, it will perform a rescan for new transactions and this can take some minutes.

To merge your wallets:

Open Console and enter dumpwallet <filename>
Stop Bitcoin-Qt
Replace wallet.dat with your new wallet file (move the current wallet.dat file to a save place)
Start Bitcoin-Qt
Open Console and enter importwallet <filename>.


What is a transaction's step-by-step life cycle? I'm trying to understand a transaction's lifetime and haven't yet found a technical, linear "timeline" of events that occur when a P2P transaction occurs.

This is my understanding so far; please correct it as needed:

A person uses their RSA private key to sign a message saying "deduct X amount from my account and send it to YYY address(s)".  In this message they also reference the current Block number.
The client application (wallet) sends this transaction to 6 nodes for "confirmation". (is the destination a miner or a wallet?)
?? What does confirmation actually do??
The mining nodes add those transactions to single message called a block (and save them in almost any order)
The mining nodes compete to find a SHA256(SHA256(x)) hash of the the block that starts with a predetermined number of zeros.
The first mining node (or node pool) to generate the winning hash collects a prize and increments the block count.  (note this currently appears to take 30 minutes, and the block size is limited to 1MB)
The miners notify a wallet who then replicates the new block to anyone who requests it, and pushes the updates to a certain number of peers.  Any block with a date difference greater than 120 minutes of system time is discarded.
Any in-flight transactions that reference the solved block have to be resubmitted by the original client and refer to the current block.
Conflicting transactions (double spends) are detected in the Bitcoin client and discarded.
The wallet will keep track of any forked chains and the chain with the most computational power backing it wins.  This fork may occur due to netsplits or malicious activity).   In addition no single wallet or central authority currently knows of all the invalid transactions, or forks that have occurred in the network.
Once 100 (or 120) confirms have been sent, the BTC generated with the block may be spent. source

The lifetime of a transaction would be something like this:

You start with a client, a wallet that contains your keypairs, and some unspent transactions (you get those from other people or through mining).
You create a new transaction spending some of your unspent Bitcoins, sign it with your private keys. Your client will store a copy of it.
Your client starts to broadcast the new transaction through the Bitcoin Network. As far as I remember it doesn't broadcast it to every peer, but to every 8th peer in order to protect your anonymity. Every minute the client will also broadcast all transactions it knows about to one of its peers, which would also include your new transaction.
Every client that receives your transaction scrutinizes it - they check whether the signature is okay, whether there are any errors, and whether you are trying to perform a double-spend. If your transaction fails any of the criteria, it is ignored by the client entirely. Otherwise the client keeps a note of the transaction in temporary memory.
All the clients that know about your transaction follow a similar route of broadcasting as you did - send it to 1/8 peers, and then to one peer every minute. They will also not broadcast your transaction if its fee is too small at a given time (which varies on the amount of transactions to be included in a block and so forth). Generally, if you don't pay fees, you get punished with slow transaction broadcast rate right here.
Eventually your transaction reaches some mining pools and the recipients of the transactions. The latter will see the new transaction in their wallets and store a copy of it indefinitely, but it will appear as 0 confirmations. The mining pools will see it as a new transaction and (most likely) will include it in every block they try to create. They will store a local copy of the temporary blocks and give out the corresponding work to solve to their miners.
The miners don't know anything about your transaction, other than with one or more transaction it hashes to a given merkle root. Their job is to crunch numbers, not to check for block validity, as that's a task for the pool.
Eventually your transaction is included in a block that gets solved. It gets broadcasted proudly through the Bitcoin network and everyone keeps a note of it from now on (to know if some new transaction conflicts with it in a double-spend attempt). Now your transaction has 1 confirmations.
The block creation process continues, and as more and more blocks build atop the block your transaction gets included, it gains more confirmations. Eventually reaching 6 and more confirmations, it is considered fully confirmed.
The transaction finishes its live cycle once it is spent by another transaction, meaning that its outputs can be forgotten from the "unspent" memory and disregarded for any other attempts to spend them. It will, however, remain in the blockchain for as long as people will keep track of the full chain.

There are a few complications during 51% attacks and so forth, but this is the main flow of a standard transaction.