What key is used to create a script? I'm trying to sign an input in my transaction. The question is: which key has to be used in the "script," private or public? It would be silly to disclose a private key there, right? But how will the network be sure it's me, if I provide a public key (which is known by everybody)?

The public key is used in the script. Technically, it is the pubKeyHash, which is RIPEMD160(SHA256(publicKey)), which means the public key isn't revealed until the transaction gets spent.

The way that validators can ensure it is you who spends the money locked up with a specific public key is by digitally signing the transaction which spends it, with the private key matching the public key. A digital signature can be verified against the public key to ensure that only the corresponding private key could have possibly created the signature.

Assuming a P2PKH transaction having scriptPubKey of the form:

OP_DUP OP_HAS160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG

The input script to spend simply has the form

signature publicKey

When the output is spent, the signature of the spending transaction and the public key are pushed on the stack before the scriptPubKey is evaluated.

The script first duplicates the public key on the top of the stack with with OP_DUP, and performs the OP_HASH160 on the top item. (HASH160 performs the same RIPEM160 and SHA256 which created the original pubKeyHash). This removes the duplicated public key from the stack and replaces it with the public key hash.

The script then pushes the pubKeyHash which was embedded in the scriptPubKey onto the stack. The two items at the top of the stack are then compared for equality (OP_EQUALVERIFY), and popped off the stack. If equality test fails, the script fails early.

The remaining public key and signature at the top of the stack become the arguments to OP_CHECKSIG, which verifies that the signature of the entire transaction corresponds to the public key. The signature and public key are popped from the stack and replaced with either true or false, indicating the final result of the script evaluation.


Very slow sync on low end PC - what to upgrade? [Hi, I have to re-ask this question because I cannot recover my account from the last one. Sorry about that.]
I am a newbie to bitcoin. I am trying to sync a full node on my low end PC: 2g RAM, dual-core 2ghz, 250 gb regular HDD. Fresh install Linux. It is in pruned mode. The internet connection tests at 5mb download/1mb upload speed. The initial 15% synced in a few days but now the process is fluctuating wildly around 2-7 weeks. It's been on for a month & is only at 35%  right now... Suffice to say it is very slow.
My main questions are: how much will adding some RAM improve the syncing speed? And will adding new RAM reset the blockchain download? Also, I have heard repeatedly that using a SSD HD will help. Is there a way to carry over my present 35% progress onto the SSD, or do I have to re-start the process?
I have already adjusted these settings: dbcache=900, banscore=10, listen=0, server=1 (upnp=0 also shows up on the bitcoin core gui/options, but not in the config file.). I don't really understand what these settings do, I am just going off recommendations. So hopefully they are good(?).
I am worried that putting in the RAM will "reset" the blockchain download and I will have to start syncing from 0% again. This already happened to me when I was tinkering with the dbcache setting - Which I will have to do again in order to take advantage of any new RAM. (right?)
Anyway I hope that was coherent. Any response is very appreciated. :)

Probably you are limited by slow hard drive. Even if you're pruning, the hard drive is still accessed. That means you should get a SSD hard drive.
There's a tool on Linux called iostat you can use to see where your computer is spending the most time.
iostat -y 1  # will repeat at 1 second intervals

If your operating system is installed on the non-SSD, then you probably will want to move that also, because operating systems read and write files while they work. For transferring the bitcoin sync progress you basically just need to copy the .bitcoin directory in your home folder, assuming you're on a Linux computer. Probably same for Windows but the directory location is going to be somewhat different.


Is it legal to convert bitcoin to USD? I've been told by many people that bitcoins are fully legal to use as currency, but not legal to convert to USD and use as US currency.

Is this true? If so, what references back this up? If not, what references deny it?

I'd actually like to see a reference to someone saying that it's illegal.

...because it's legal.

FinCEN guidance establishes who must register with government and when one must pay taxes (sell bitcoin for USD, pay taxes on gains).


When Schnorr signatures are part of Bitcoin will it be possible validate each block with only one signature validation? In a recent talk Pieter Wuille talked about speed up verification when using Schnorr signatures and various algorithms for verifying multiple signatures.

Would it really be possible to verify one single block by aggregating the keys and signatures of all transactions? (In theory even more transactions over several blocks)

I assume this does imply that the old ECDSA scheme would not be used anymore. If we were backwards compatible we could probably only do this for transactions that used Schorr signatures where as the other ones would have to be verified one by one.

(Leaving aside politics of drastic protocol changes) Couldn't we even save more space if we adopt the block header to include one aggregate Schnorre signature for the block and leave out all the schnorr signatures of the single transactions within that block?

Did I miss anything? The talk did not give many details but just mentioned the idea.

Yes, one validation per block, but not one signature per block.
To clear up confusion, there are 3 distinct technologies involved here:

(1) non-interactive aggregation is the ability for a third party (who does not hold any private keys) to combine multiple signatures, each with their own message and public key, into a single signature that can be verified by someone who knows all messages and public keys.
(2) interactive aggregation is the same, but when the signers need to be aware of the aggregation, and communicate with each other to jointly produce a single signature.
(3) batch validation is the ability for a verifier to verify whether multiple (pubkey,message,signature) tuples are all valid or not, faster than verifying the individual signatures. If one or more of the tuples are invalid the verifier will not learn which ones, in this case.

Schnorr signatures (and any other known discrete logarithm based signature schemes) support (2) and (3), but not (1).
The lack of (1) means there cannot be a single signature for an entire block (*), as the miner who constructs the block is a third party who isn't participating in signature creation.
Due to (2), the best we can hope for (as long as we're restricted to DL-based signatures), is one signature per transaction. Even that requires cross-input aggregation, which has complexities beyond just the implementation of on-chain Schnorr signatures (see this post for example).
However, because of (3) it is correct that there can be a single validation per block, however not a single signature per block. The speedup that is possible through batch validation does become nontrivial, in fact. Each of the 4 lines is an optimization technique that is currently implemented in libsecp256k1, which will pick the best one based on the size of the problem and the memory constraints.

(*) There exists a form of non-interactive "half aggregation" for DL based signatures, where N signatures can be non-interactively combined into a single signature of size (1+N)/2 original signatures. This could be used for blocks, though the gains aren't that great, and there are complexities around block-wide aggregation that make it less interesting.


How to refund money send to an address already used I sent money to a block chain wallet address which had once been used to receive money. Now money is not found in the account. What do I do to recover the money. Thanks

money is not found in the account

If you sent your money to an exchange market wallet then you should ask their support about that issue.

Otherwise, please give us your transaction ID so we can look at it. You may have sent your coins without enough fees or to a wrong address.


Device not found. NO GPU output 3 Computers same issue? I have 3 computers that I want to use for mining when idle. 2 of them are windows 7 one of the is windows 8 all three are x64 base. two of them have 7700hd ATI cards and the third has a 7870HD XFX. All three are having same issue. No output. No GPU found on the devices. All three computes have same look on the screen no devices found. I have used catalyst drivers from V12.8-V13.11 and same with the SDKs I have used different versions of CGminer (V2.11.4 just crashes on startup). I would like to blow out the CPU's as well but that's another issue all together. My command lines along with my startup screens are below.

Please include your bitcoin/litecoin address with reply.

Thank you for your time!

        cgminer -o ltc.give-me-coins.com:3333

CGMiner

 cgminer version 3.8.5 - Started: [2013-12-14 16:02:44]

(5s):0.000 (avg):0.000h/s | A:0  R:0  HW:0  WU:0.0/m
 ST: 2  SS: 0  NB: 1  LW: 2  GF: 0  RF: 0
 Connected to ltc.give-me-coins.com diff 16 with stratum as user

 Block: cd82d7df...  Diff:2.93K  Started: [16:02:44]  Best share: 0

 [P]ool management [S]ettings [D]isplay options [Q]uit

[2013-12-14 16:02:38] Started cgminer 3.8.5
 [2013-12-14 16:02:40] No devices detected!

        bfgminer.exe -o ltc.give-me-coins.com:3333

BFG miner

bfgminer version 3.8.1 - Started: [2013-12-14 16:01:01] - [  0 days 00:01:08]
[M]anage devices [P]ool management [S]ettings [D]isplay options  [H]elp [Q]uit
Connected to ltc.give-me-coins.com diff 16 with stratum as user
Block: ...9616fd46 #479102  Diff:2.93k (20.95Gh/s)  Started: [16:01:01]
ST:2  F:0  NB:1  AS:0  BW:[631/ 20 B/s]  E:0.00  I: 0.00 BTC/hr  BS:0

0            |   0.0/  0.0/  0.0 h/s | A:0 R:0+0(none) HW:0/none

[2013-12-14 16:01:00] Waiting for devices; press 'M+' to add, or 'Q' to quit
[2013-12-14 16:01:00] Probing for an alive pool
[2013-12-14 16:01:01] Pool 0 http://ltc.give-me-coins.com:3333 alive

Cgminer stopped supporting GPU mining after version 3.7.2  The packages are still available for download in the repository.  You will also want to tweak your settings for optimal mining consider the following resources:

Bitcoin hardware mining comparison
Litecoin hardware mining comparison

You will likely find litecoin mining to me most profitable with your setup, however it is up to you to determine your own results.  You will also need to launch cgminer with the --scrypt flag to mine Litecoins.

Per your request

BTC address:
16N1P6fDDbV2cLNFe5ZthMeMMZvrEHU2Ug

LTC address:
LN2T5Stvk6HNUpNCcV6dNzv9k7BoHFA9th


bitcoin fork getblocktemplate keeps reporting downloading blocks I got my own hard fork of bitcoin from forkgen.tech.
The fork has happened after block 506016.

I have 2 nodes running and after syncing up to block 506016, I want to run a pool server.

But the getblocktemplate command keeps returning:

error code: -10
error message:
MyCoin is downloading blocks...

Also getpeerinfo returns:

"id": 0,
"addr": "xxx.xxx.xxx.xxx:37912",
"addrlocal": "xxx.xxx.xxx.xxx:6703",
"addrbind": "xxx.xxx.xxx.xxx:6703",
"services": "000000000000000d",
"relaytxes": true,
"lastsend": 1517579099,
"lastrecv": 1517579099,
"bytessent": 1783,
"bytesrecv": 1807,
"conntime": 1517578379,
"timeoffset": 0,
"pingtime": 0.001438,
"minping": 0.000366,
"version": 70015,
"subver": "/MyCoin:0.15.0.1/",
"inbound": true,
"addnode": false,
"startingheight": 506016,
"banscore": 0,
"synced_headers": -1,
"synced_blocks": -1,
"inflight": [
],
  "whitelisted": false,
  "bytessent_per_msg": {
  "feefilter": 32,
  "getheaders": 1021,
  "ping": 224,
  "pong": 224,
  "sendcmpct": 66,
  "sendheaders": 24,
  "verack": 24,
  "version": 168
},
  "bytesrecv_per_msg": {
  "feefilter": 32,
  "getaddr": 24,
  "getheaders": 1021,
  "ping": 224,
  "pong": 224,
  "sendcmpct": 66,
  "sendheaders": 24,
  "verack": 24,
  "version": 168
}

Whereby the values synced_headers and synced_blocks should not be -1. The mining pool software complains about this and the blockTemplate and does not start but keeps on waiting for the synced headers and blocks.

Does anyone know what's going on and how to fix this?
Or what further checks I can do to confirm my fork is running correctly.

I am an experience programmer but have no knowledge of c++ but I do know C# and Javascript.

For reference here is the blockchaininfo:

{
  "chain": "main",
  "blocks": 506016,
  "headers": 506016,
  "bestblockhash":"shortened by OP because this value was too long",
  "difficulty": 2603077300218.593,
  "mediantime": 1516861026,
  "verificationprogress": 1,
  "chainwork": "shortened by OP because this value was too long",
  "pruned": false,
  "softforks": [
    {
      "id": "bip34",
      "version": 2,
      "reject": {
        "status": true
      }
    },
    {
      "id": "bip66",
      "version": 3,
      "reject": {
        "status": true
      }
    },
    {
      "id": "bip65",
      "version": 4,
      "reject": {
        "status": true
      }
    }
  ],
  "bip9_softforks": {
    "csv": {
      "status": "active",
      "startTime": 1462060800,
      "timeout": 1493596800,
      "since": 419328
    },
    "segwit": {
      "status": "active",
      "startTime": 1479168000,
      "timeout": 1510704000,
      "since": 481824
    }
  }
}

Because block 506016 happened ~1 week ago, when you start your node software, it thinks that it is still in the initial block syncing phase because the timestamps are off of real time by a lot. The only way around this is to mine a block now. You can modify the source code to bypass this warning so that you can mine a block.


Is pre-image attack useful for mining? I know that SHA256d is strong enough and it's not likely that will be broken soon but let's say someone knows how to find pre-image. The adversary chooses random hash starting with n zeroes (less than target) and finds pre-image (valid block header), let's say 100 times faster (I know it is possible only in theory) than he would need to do this by mining in classic way. What are the benefits that he gets? I think that he can mine faster, so it is easier for him to acquire over 50% of the network hashrate. He can also modify last n existing blocks to remove his transactions (double spending) and create longer blockchain that will be accepted widely in the network. Am I right?

Second but related question. Let's assume we use 8 bit hash function. Is it easier to find pre-image for hash that has to start with 4 zeroes than excatly the same hash? I mean, is finding pre-image for hash 0000xxxx easier than for example 01010101? In the first example there are exactly 16 hashes that can be accepted.

If a miner normally has X hashrate so it takes Y time to find a block, and that miner is able to find a preimage attack that results in him finding block in Y/100 time, then it would be as if he had 100X hashrate. So the attacker would be able to do whatever anyone else with 100X hashrate can do. If this is more than 51%, then the attacker can modify the blockchain history and everything else that can be done with >51% of the hashrate.

  Is it easier to find pre-image for hash that has to start with 4 zeroes than excatly the same hash?

In terms of a preimage attack, it depends on the hash algorithm.

Via brute force, it is easier because there are more possible values that you can get a preimage for rather than just one specific value.


How hard is it to transfer money between Bitcoin exchanges? Say I had a 100$ in a Mt.Gox account and wanted to send it to my TradeHill account, how hard is it to perform a transaction like that without going through a separate bank account? I'm mostly asking in a context of automated trading bots, buying and selling Bitcoins at different exchanges.

That's exactly the service https://www.bitinstant.com/ provide, it should be fairly simple and I think they and mtgox have the API necessary to do this by a bot.


Can a BIP39 12-word mnemonic be used to restore a wallet through bitcoin-cli? I could not find documentation on using a 12-word BIP39 Mnemonic to restore a wallet through bitcoin-cli.  It seems that importprivkey might be the right RPC call but when I provide the 12 words, it says "Invalid private key encoding"  I also tried the following formats which were generated by Ian Coleman's page from https://github.com/iancoleman/bip39:

BIP39 Seed
BIP32 Root Key
Account Extended Private Key
BIP32 Extended Private Key

Perhaps the master seed mnemonic is useless if all you have is bitcoin-cli and the bitcoind to which it's attached.  Is that the case?

Bitcoin Core does not currently support BIP 39 mnemonics nor the size of the BIP 32 seed produced by a BIP 39 mnemonic. BIP 39 produces 512 bit seeds, but Bitcoin Core currently only supports importing a 256 bit seed via sethdseed.


Do all Tx's have UTXO? I am trying to understand how UTXO works. I came up with these charts https://statoshi.info/dashboard/db/unspent-transaction-output-set

I don't understand why the 1st chart (total Tx's with unspent output). As I understand it, the UTXO represents the "change" you keep after sending some funds.

Using this logic all Tx's should have a UTXO, right? As any time I send money to someone else, it should be an output for the remaining balance.

Transactions are money orders to the Bitcoin network that reassign value from one owner to another. To that end, transactions reference pieces of Bitcoin in the inputs and reassign this value to recipients in outputs. When the transaction is accepted on the network, the pieces of Bitcoin referenced in the inputs are spent and new "unspent transaction outputs" (UTXO) are created according to the transaction's outputs. UTXO are how every participant in the network keeps track of where the money in the network is. UTXO are not only created for change, but any time a transaction defines a recipient. UTXO are spent whenever they get used as a transaction input. However, even so the transaction remains part of the blockchain and everyone can look up later where the transaction output was created and (eventually) spent.

Therefore, after a UTXO is spent, it's still a transaction output (TXO), but no longer a UTXO.

Take this example:

Input(utxo1)               Recipient Output
                 ---->
Input(utxo2)               Change Output

When the transaction is created, it spends the two UTXO referenced in the inputs. As the transaction is confirmed, every participant removes them from their UTXO database. However, the reference still exists in the blockchain as the outputs of the transactions that created those UTXOs. The transaction also creates two new UTXOs, the Recipient Output and the Change Output. Every participant in the network adds these two UTXO to their database. Let's say that the sender spends the money in the change output quickly thereafter, removing the change output from the UTXO database, but the recipient TXO remains unspent. In that case, (or any other where at least one of the two outputs remains unspent) the transaction would be counted in the "Total Transactions With Unspent Outputs".


Help in recovering BTC from seed phrase So 6-7 years ago I had some bitcoin, and as with many I forgot about it...
I since found my notes which contain a 12 word seed phrase. I think (I may be wrong) I used Multibit so I reinstalled and fired this up and tried to restore the wallet from seed.
Multibit asks for the seed, then syncs, then asks for a date - which I don't have. If I leave this blank and continue  it just reverts back to the start dialogue where you can create a wallet, restore etc.
I also tried importing the seed into Electrum using this guide: https://bitcoinelectrum.com/restoring-your-multibithd-wallet-in-electrum/
I.e. setting the derivation path etc. But the wallet just comes up blank listing no transactions.
Is there anything else I could try?

Like MCCCS said, the fact that it goes back to the start screen is a bug. Try installing an older version of MultiBit, and use that.
EDIT: Don't use Multibit. From the readme:

Dear Bitcoin Community,

It is time for us to let Multibit go.

KeepKey acquired Multibit a little over 1 year ago. At the time, the engineers who originally built and supported Multibit had announced that they would no longer be working on it or providing support. Multibit played an important role in the Bitcoin infrastructure. We felt that it was important for Multibit to continue and hoped that with our existing support and development teams, we would be able to keep Multibit alive.

The reality is that Multibit is in need of a lot of work. It has stubborn bugs that have caused us and Multibit users much grief. Additionally, Bitcoin has gone through a fundamental change in regards to the way fees work. The addition of SegWit in the coming weeks will mean the Multibit software has fallen still further behind.

Unfortunately, KeepKey simply does not have the resources to support the current issues, nor to rebuild Multibit to ensure ideal user experience. By focusing our attention on the KeepKey device, we will continue building and improving the best hardware wallet available.

Thus, KeepKey will discontinue support and maintenance of Multibit, effective immediately.

We recommend that all Multibit users discontinue using it and you move your keys to other wallet software of your choosing.

I would try using the electrum wallet, but DO NOT select to use SegWit addresses. Use the legacy addresses when restoring the wallet.


How to validate bitcoin address How I can validate a standard bitcoin address?

If it is the format and the checksum then that can be easily done. Specifically you can use steps 4 to 9 in the technical description of Addresses to check for typos. Beyond that however it gets difficult

If you want to access blockchain information such as the current balance you cannot unless you have a copy of the blockchain somewhere, and on a phone or tablet disk space is still too precious for that. For that you'll need to rely on some external service or sacrifice disk space to track the blockchain in its entirety.

Notice that Andreas' Bitcoin Wallet only selectively tracks addresses that were known while synchronizing with the network, so if the addresses you'll eventually be interested in are known in advance you could also selectively sync those.

EDIT: as requested here is the reversed example from the documentation, as python code:

import hashlib

# Take the address as input, using the sample address from the
# technical description to follow along
address = "16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM"

# Decode into 25 bytes (0x00 for the network identifier, 20 byte
# RIPE-160 hash and 4 byte checksum
decoded_address = b58decode(address,25)

# Print as hex, should match step 8 in the docs
print decoded_address.encode("hex")

# Slice into its components
network_id = decoded_address[0]
private_key_hash = decoded_address[1:21]
checksum = decoded_address[-4:]

if network_id != chr(0):
    print "ERROR: not a Bitcoin Main Net address"

# Print the private key hash as hex, matches step 4 in the docs
print private_key_hash.encode("hex")

# Print the checksum as hex, matches step 7 from the docs
print checksum.encode("hex")

# Now we can check the checksum to reduce chances of typos
# Print first round of hashing (docs step 5)
hash1 = hashlib.sha256(network_id + private_key_hash).digest()
print hash1.encode("hex")

# Print second round of hashing (docs step 6)
hash2 = hashlib.sha256(hash1).digest()
print hash2.encode("hex")

# And finally verify that the checksum we extracted from the address
# and the one we just calculated match

if checksum == hash2[:4]:
    print "Everything ok, checksums match"
else:
    print "The end is nigh"

Sadly we can't go any further in verifying without further information, like the actual public key.


Updating a Bitcoin wallet I have a harddrive with an old wallet but I am not sure what I need to do to see how much BTC I have.

I have read quite a few notes, but I am looking for the latest information. I want to continue leaving my BTC in my private wallet until I decide to move it to an exchange or online.

How do I see how much BTC I have?

To see how much BTC you have, you just need to open your wallet up, make sure it is fully synchronised, and then check your balance. If you don't want to wait for it to synchronise, you can copy and paste your addresses into a block explorer to see the balances on there.


How to completely empty wallets - problem with fees I have some Bitcoin and Litecoin wallets with very small amount of BTC/LTC in them.

I want to completely empty these wallets - send all the BTC/LTC them to another address. This address can belong to me or to the others (donation etc.).

The Bitcoin-Qt doesn't allow to send from these wallets because transaction fees are higher than the amount in the wallets. It seems that I cannot "force" this client to use smaller fees or even no fee at all.

Can I use other wallets to do this? Which ones (Electrum?)?

What alternatives do I have with with Litecoins? There seems to be only one reasonable client (Litecoin-Qt).

Two options, depending on your skill level and comfortability with command-line:

Try updating your settings in bitcoin.conf to allow a low (or none) transaction fee:
https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File
Try running in ./bitcoind in command-line with the option -paytxfee=<amt> with whatever amount you can pay to transfer these balances out. https://en.bitcoin.it/wiki/Running_Bitcoin#Linux_Quickstart


hash versus hash pointer I am doing coursera online course on Bitcoin and Cryptocurrency Technologies. It defines the concept of hash pointer in the first lecture as pointer to where some information is store and cryptographic hash of that information. I am confused on what is the difference between hash and hash pointer. I understand hashing of the information but how can a pointer store both the hash of the information and the address of where the information is? Please correct me if i am wrong.

Can someone explain the difference, how each is calculated and then give an example.

I believe that the use of the term "pointer" in the this sentence is not referring to the low-level data type, such as int *pointer_to_int; would be in C.  I think it's more referring to a "pointer" as a key into a data structure or database table.  In this sense, the hash is a pointer/key used to retrieve the information you are looking for.

For example, in Bitcoin, transaction hashes are used in this way.  The hash of a transaction can both be used to look up the transaction and to verify that the transaction retrieved has not been tampered with since it was stored.


The bitcoin address space seems to be closer to 2^40, not 2^160 The Base58 Encoding of a public key hash outputs:  "A set of 58 alphanumeric symbols consisting of easily distinguished uppercase and lowercase letters (0OIl are not used)"

This set is a fixed string of 34 characters.

That is to say, "A bit coin wallet's address is 34 characters, each character being one from a possible set of 58"

So the total possible addresses is 58^34 which is just slightly less than 2^40.

I understand that the hash space is 2^160, but the final result is much smaller at 2^40.  What am I missing?

  Edit:  I made a simple math mistake reducing 58^34 to a power of two
  by adding not multiplying the exponents...  The bitcoin address is
  sufficient to contain the 2^160 possible hashes:  58^34 is 904
  octodecillion (60 decimal digits), and 2^160 is 1 quindecillion (49
  decimal digits)... the larger number accounts for the version byte and
  checksum.

No, 58^34 is greater than 2^160: http://www.wolframalpha.com/input/?i=2*160+%3E+58*34

Note, that the address also contains a checksum and a network id not carrying additional information. That's why the numbers are not equal.


What if a transaction is made to a wallet that doesn't exist? Wallets can be created offline, and transactions can be made to that completely offline wallet through by obtaining that wallet address. Now, when the guy owning the offline wallet goes online, his wallet will sync with the network and he will get his coins.

Now, if the above is true, that means the transaction has been completed without the network actually knowing that such a wallet exists, and has been created by someone. The network will actually validate a transaction to a wallet that has never gone online before.

What if that wallet wasn't actually created? What if, while making the transaction, the sender accidentally misspelled the destination wallet address by changing a number or letter? If this happens, unless that same exact (misspelled) wallet address is created again (very unlikely) those bitcoins have gone poof. Nobody owns those bitcoins anymore, because they got transferred to a wallet that doesn't even exist. Those bitcoins have completely disappeared.

Bitcoin is probably too awesome for the above to happen. So what really happens?

This seems to be a few related questions in one, so I will try to rephrase them individually and answer each one separately.

First it is important to understand that a wallet is just a place to keep bitcoin addresses, in the same way that a leather wallet is just a place to keep cards and notes. Bitcoin amounts are sent to an address, not to a wallet. A wallet may contain many addresses, but a transaction output sends to one specific address. So all my answers will refer to an address, not a wallet.

The questions raised:

1. Can an amount be sent to an address that the network is unaware of?

Yes. An amount can be sent to any address, regardless of whether that address has been seen before. A transaction tells the network which address to take an amount from, and which address to send it to. The address to take an amount from must contain at least that amount, or the transaction will be rejected. There is no requirement on the destination address. Even if it has never before been seen by the network the transaction will still be confirmed.

2. What if the destination address has not been created?

If the address has not been created the network will have no way of knowing this. The amount will still be moved. However, since no one has a private key for this address, no one can ever spend the amount held at this address. The amount is lost forever.

3. What if the sender misspelled the destination address?

This is unlikely to happen due to a typo, since a bitcoin address has built in error checking. Changing one letter or number in a valid bitcoin address will not give a different valid bitcoin address. The mistyped address will be invalid and your wallet software should recognise this and refuse to send the transaction.

4. Bitcoin is probably too awesome for the above to happen, so what really happens?

Built in error checking makes it very unlikely that someone would accidentally send an amount to the wrong destination due to a typo. However, it is perfectly possible to lose money through other types of accident. If you accidentally type in the valid bitcoin address of the wrong person, the amount will be sent successfully but not to where you intended. Bitcoin transactions are not reversible. Sending to the wrong person cannot be undone. If they choose to they may return the amount to you, but you cannot force this. It is also possible to send an amount to an address that you thought you had the private key for, only to later realise the private key has been lost. Sending to an address for which the private key has been lost means the amount is permanently lost.

For more technical detail please see Meni's answer.


Must mining pools use the same address? Must all members of a mining pool use the same address?  Is there ever an exception?

I know nothing of mining pools so can provide more information if possible, but what I mean in specifics is can a mining pool use every member's address in the blocks, or do all members have to use one address in the blocks and be repaid later on trust?

Your address is not in the blocks being mined.  All of the coins go to the pool operator.  He then takes his cut and divides the rest among the members of the pool.  The pool usually keeps the coins in your mining account until it reaches a payout threshold or you request a manual distribution.  This is done to reduce the number of very small transactions.

So, yes, you have to trust the pool operator.  But all blocks can be viewed on the blockchain, so you can audit the results if necessary.


Which is the smallest hash that has ever been hashed? Let's assume, the hash 00000000000000000024c0bdbec66a889778c00bc69be0a96cbbd98b75c3ce09 of block #499644 is smaller than
0000000000000000002d429f39afec70c938e888c3417d690bbc85e83529991c of block #499645.

They both have 18 Zeros, then 2=2, but then 4<d.

Which is the smallest hash that has ever been hashed during cryptomining? How many zeros? Which block?

I don't think there is a site that will show you this information, but it is fairly trivial to find out.

Here's an old Bitcointalk thread that discusses this: https://bitcointalk.org/index.php?topic=29675.0

Here's a python script that will calculate it for you. You will need a bitcoind for it to connect to:

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import binascii
import struct

def uint256_to_str(u):
    rs = b""
    for i in range(8):
        rs += struct.pack("<I", u & 0xFFFFFFFF)
        u >>= 32
    return binascii.hexlify(rs)

def uint256_from_str(s):
    s = binascii.unhexlify(s)
    r = 0
    t = struct.unpack("<IIIIIIII", s[:32])
    for i in range(8):
        r += t[i] << (i * 32)
    return r

def byteswap(a):
    return "".join(reversed([a[i:i+2] for i in range(0, len(a), 2)]))

# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_user = "user"
rpc_password = "password"
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))

best_hash = uint256_from_str("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
best_height = 0
counter = 0

while True:
    try:
        commands = [ [ "getblockhash", height] for height in range(counter, counter + 10000) ]
        block_hashes = rpc_connection.batch_(commands)

        for block_hash in block_hashes:
            block_uint256 =  uint256_from_str(byteswap(block_hash))
            if block_uint256 < best_hash:
                best_hash = block_uint256
                best_height = counter
            counter += 1

        print("Processed " + str(counter) + " blocks")
    except Exception as e:
        print(e)
        break;

print("Lowest Block Hash: " + byteswap(uint256_to_str(best_hash).decode()) + " at block height " + str(best_height))

This script gave me the following output:

Lowest Block Hash: 00000000000000000000011246f099d94f91628d71c9d75ad2f9a06e2beb7e92 at block height 458091


Is it possible to have my blockchain on a different folder than that of my wallet files? I am trying to implement bitcoin payments for the project I'm currently working on, and I need to create a bitcoin wallet that should be inside a USB stick. This USB stick should be at the hands of the project manager, and every developer that wants to make test bitcoin payments should ask for the USB, plug it on their computer, make a payment with that wallet and return it. Since this wallet will be filled with company money for testing purposes, we can't just use our personal wallets.

What I want to do, is having the blockchain in a shared folder in the network, in a place that it's accessible by all dev machines, and at the same time having a single wallet in the USB stick that should be usable by everyone.

So my questions are:

Is this even possible?
I know that I can set the data directory on Bitcoin Core with the datadir="/data/directory/whatever" but for this to work, I'll propably need an external hard drive instead of a usb stick since this also points to the location of the blockchain. Can I somehow set the wallet folder separately from the blockchain folder?
If bitcoin-core doesn't make it, is there any other client that allows this to happen without having to use an external service?

For safety and integrity reasons, the wallet file must be held within the datadir. You can choose a different file with -wallet=<file> (config or startup argument). But only a filename not a path.
Don't try to share your wallet between multiple bitcoin-core instances.

What you really want to do is multisig.

You could have a bip32 watch-only wallet with a 2of2 multisig (you can watch the funds, but not spend/sign).
With additional hardware wallets (like an USB stick), something like Trezor or digitalbitbox.com you could – in theory – sing the desired transaction and therefore complete it and make it ready for broadcasting.

But, unfortunately, it's not possible with current version of bitcoin-core without entering the RPC world and also patching and self-compiling bitcoin-core.


HD wallet getting every time diffrent derivedPrivatekey from same derivation path every time i am getting diffrent orderPrivateKey and address for same derivation path. but it should be same as i am not changing derivation path.

var bitcore = require('bitcore-lib');
var DerivationPath = "m/44'/145'/0'/0"
var hdPrivateKey = new bitcore.HDPrivateKey('testnet','xprv8ZgxMBicQKsPdsKyyKSwTJtBXWB1rbDwEAxW3xV6xwNeCHs3n9kvFsCZim8KKMgc3wVGRJR4kJ82t9mRRr8TZ3Ybpxqp8brRA7aMVDJgCt2');
var orderPrivateKey  = hdPrivateKey.derive(DerivationPath).privateKey;
var Address = orderPrivateKey.toAddress().toString();

can anyone explain it??

You have the data and network arguments swapped when you create the hdPrivateKey, see Private Key | Bitcore. Try this:

var bitcore = require('bitcore-lib');
var DerivationPath = "m/44'/145'/0'/0"
var hdPrivateKey = new bitcore.HDPrivateKey('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi', 'testnet');
var orderPrivateKey  = hdPrivateKey.derive(DerivationPath).privateKey;
var Address = orderPrivateKey.toAddress().toString();
console.log('Address: ' + Address);


What is the exact difference between combinepsbt and joinpsbts They seem to do pretty much the same thing.
The only apparent difference being that combinepsbt seems more for updating the same psbt with imcremental signatures while joinpsbts seems more for joining different transactions but given in combinepsbt you can also add different inputs and outputs I don't see the difference.

combinepsbt takes multiple PSBTs that have different input data and merges them. The base transaction must be exactly the same, i.e. the same inputs are consumed and the same outputs are created. The information for each input is combined into the same input. Inputs and outputs cannot be added or removed. This allows for people to send the same PSBT to be signed by multiple different people and then merge the resulting the PSBTs back together.

For example, suppose you have a PSBT that consumes 2 inputs, with input 1 requiring person A to sign and input 2 requiring person B to sign. You give both person A and person B copies of that PSBT to sign. Person A returns you a PSBT which has input 1 signed (i.e. they fill in input information like UTXO, partial signatures, final scriptSig, etc.) but input 2 is not. Person B returns you a PSBT which does not have input 1 signed but input 2 is signed. combinepsbt allows you to merge the PSBTs from both person A and person B into a single one which has both inputs signed.

joinpsbts is very different from this. joinpsbts joins multiple PSBTs that have different underlying transactions into one transaction. It requires that the inputs of those underlying transactions be different from each other. Furthermore, joinpsbts will discard any signatures and finalized input fields from the original PSBTs (meaning the resulting PSBT will contain no signatures) as those signatures will likely be invalidated when joining.

joinpsbts lets you make transactions which has other people involved in them (such as CoinJoins) more easily. Each person can specify the inputs and outputs they want in a PSBT and then all of these PSBTs with different inputs and outputs are merged together using joinpsbts.


How are UTXO forwarded to other addresses? this is a pretty general, conceptual question. I feel I do not yet completely understand the blockchain transaction dynamics.

Let's say, we have A, B and C trading on the Blockchain:

A has previously transferred 10BTC to B. So B has an unspent transaction output
(that it can spend) referenced by the address of A.
Now, B wants to pay 5BTC to C and does so by using the UTXO that it has from A's earlier transaction and routing it to C.
So, B forwards the UTXO with A's address to C and also gives 5BTC change to himself.

So, now, doesn't the transaction list look like this?

Inputs:

address_A 10BTC

Outputs:

address_C 5BTC
address_B 5BTC

Now, to me this seems correct from B's view, but it actually looks like A has transferred money to C and B, instead of B transferring money to C. I guess my understanding is wrong then, because it cant work like this. So where is my error?

From the view of C, shouldn't it look like this:

Inputs:

address_B 10BTC

Outputs:

address_C 5BTC
address_B 5BTC

Otherwise, also C would have again the unspent output of A and this output from A would sort of be forwarded again and again.

Don't judge me for my bad understanding please :D, if there is any good reads that you can recommend that would be great.

Thanks!

Best,
JC

A first thing to correct is that UTXOs are not referenced by address, but by the txid that created them. The addresses are purely a human abstraction about locking conditions to help think about ownership.

So in your example what happens is that in the initial transaction tx0 created by A, B was credited with 10 BTC. Assume that transaction only had one output. That means that there is now the state of the UTXO is:

tx0:0 (10 BTC, spendable by B)

When B now wants to pay C, he creates a transaction tx1 with input (tx0:0, (signature by B)) which consumes the UTXO listed above, and has outputs (tx1:0, 5 BTC, (spendably by C)) and ((tx1:1, 5 BTC, (spendable by B)). Note that the tx1:0 and tx1:1 are not actually stored in the transaction here; they're implicit as the 0th and 1st output of tx1.

The state of the UTXO set is now:

tx1:0 (5 BTC, spendable by C)
tx1:1 (5 BTC, spendable by B)


Where can I find per-second bitcoin price & volume data? I am looking for per-second (or any time interval less than one day) bitcoin data for bitcoin price and volume on any given exchange. Do you know where I can find this sort of data? Have found Coinbase's price data for every 10 minutes which is good, but can't find any associated volume data.

Your best bet is probably to utilise the various exchange APIs to log the data in your own database.

NB: I don't think Coinbase provide volume info publicly.


Will I be losing my BTG by sending BTC to bitfinex I have my BTC in my trezor wallet (had it for a while before the BTG fork), now I would like to send some BTC to Bitfinex, but I am worried that if I do so, it will also send my BTG to the same address on Bitfinex and so losing my BTG. Can anyone tell me if my assumption is correct ? Thanks

until the BTG fork is complete, sending bitcoin to a 3rd party might risk your access to BTG.

that said, sending anything to bitfinex might be a risk in itself, given that there is accusations public that bitfinex has no bank accounts and may be involved in multiple accounts of fraud.

always do your due diligence.
never trust random strangers (me included).


Are there performance implications using the "timestamp" property of ImportMulti in the following way? Based on the Developer Reference for importmulti, it seems the the timestamp property is purely used to determine how far back to rescan. If I have, say, 100 addresses and I simply set all of their timestamps to the same value (the earliest known timestamp), does this have any performance impact compared to setting each address' timestamp uniquely?

If the answer is no, then I'm wondering why this property was implemented as opposed to having a 3rd parameter holding a single "timestamp" for the entire list of addresses.

importmulti finds the earliest of the timestamps, and rescans from that point after all imports are done, yes. The wallet stores metadata about keys including the timestamp, which is why a timestamp is provided individually for each address rather than a single timestamp overall. Other commands like dumpwallet export a timestamp per key as well so this makes sense to provide it per-key when importing too, to save you having to look for the earliest before passing them in.


Is brute forcing a private key with unspent coins getting easier? Is the likelihood of correctly guessing a private key with unspent coins increasing due to:

More addresses being used resulting in more private keys with unspent coins (i.e. higher chance that a random private key might have coins).
The fact lots of people use deterministic wallets (i.e. one could discount billions of deterministically generated private keys if the first 20 are empty).

Is this significant in terms of security?

It's increasing from approximately zero to approximately zero.
Since the starting seed of HD wallets is essentially random, I don't think this helps.
This isn't significant.


How is “days destroyed” different from “amount of BTC” in existence? According to https://en.bitcoin.it/wiki/Bitcoin_Days_Destroyed , if I have 100 BTC for seven days and then spend them, that’s 700 days destroyed.

But if I didn't have them, someone else would have them.  So how does the metric differ from the amount of BTC that exists?

Days destroyed are measured in BTC * days
Amounts of BTC are measured in BTCs

The two concepts are as different as Power (Watts) vs Energy (Joules).


Where can I trade BTC/USD with a small transaction fee? I don't need a leveraged account. I just want to trade with real money.

The Mt. Gox transaction fee is 0.60%. Is there a place with a lower transaction fee?

Base fees:

Mt. Gox: 0.6%
Bitstamp: 0.5%
Intersango: 0.65%
Bitcoin-Central: 0.498%


Open bitcoin-qt wallet with bitcoinj I try to open the bitcoin-qt wallet with bitcoinj, I write this code:

private static final File WALLET_FILE = new File("C:\\Users\\Bapt\\AppData\\Roaming\\Bitcoin\\wallet.dat");

public static void main(String[] args) {
    NetworkParameters networkParameters = NetworkParameters.prodNet();

    Wallet wallet;
    try {
        wallet = Wallet.loadFromFile(WALLET_FILE);
    } catch (IOException e) {
        System.out.println("Couldn't open wallet: " + e);
        return;
    }

    System.out.println("Balance: " + wallet.getBalance());
}

But I have an error:

Couldn't open wallet: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).

So I have two questions:

Is is possible to do what I want ?
If yes, what do you think could happen here ?

Thanks for your answer.

BitcoinJ has its own wallet format, and official bitcoin client its own.


How to retrieve all transactions from a public address? I run a Bitcoin node with txindex=1 so I can retrieve any transaction from the txId.
My question: if I have any public address, how can I retrieve all transactions involving this address (inputs and outputs) with the Bitcoin Core commands ?

You can't. Bitcoin Core does not index transaction based on address.

If you want to do this, you'll either need an indexing tool/service, or implement the P2P protocol yourself to be notified of all transactions.


is there any API like blockchain.info and bitcore with tutorial? is there? I'm finding it hard for starters to look it up without tutorials via the net, blockchain.info tutorial(on youtube and a single one) seems to be good but getting API key on blockchain.info is pretty hard. meanwhile bitcore has nothing but a 48-hour reply community. is there an API with a tutorial while they have an active community? TIA

Check out 21. There are some bitcoin tutorials as well as a developer community.


bitcoin core 0.13.1: Inconsistent getbalance result from RPC I have a node which is giving inconsistent results from RPC:

$ bitcoin-cli getbalance
0.01647763
$ bitcoin-cli getbalance "*" 1
1.90937153
$ bitcoin-cli getbalance "" 1
1.90937153
$ bitcoin-cli getbalance * 1
0.00000000
$ bitcoin-cli listaccounts
{
  "": 1.90937153
}

Not sure how can I interpret this. Does my wallet have 0, 0.01647763 or 1.90937153? Documentation for getbalance says that if you don't pass any arguments, the defaults are * (all accounts) and 1, but when I specify those arguments, the result is not the same.

What are the real defaults when not specifying arguments to getbalance?

I think I've hit a bitcoin-core bug that may happen in weird circumstances (such as when trying to send a transaction which the node refuses to send, by returning a "rejected" error code). After I restarted the server, the transaction showed up in the bitcoin network, and the getbalance RPC calls started to be consistent again.


Is there a way to buy or sell Bitcoins for Iceland Kronas? Say I was living in Iceland and wanted to convert my local currency to Bitcoin and back. What are my options?

Trade with others who might be local:

http://www.LocalBitcoins.com

Forum users might check in on a thread like this:

http://bitcointalk.org/index.php?topic=109453.0


How likely is it that the structure of a raw transaction will change? I've written a script that decodes raw transactions, as it's faster than calling the decoderawtransaction RPC.

How likely is it the structure of a raw transaction will change in the future?

All transactions people can reasonably create today will likely still be valid in the foreseeable future, the devs try really hard to stay as backwards compatible as possible.

But new features are introduced regularly. For example SegWit might require you to update your script. The recent Locktime BIPs may have already. SegWit also allows easier updates (or whole alternatives) of the scripting language, which will likely be put to use fairly quickly after SegWit rolls out.


Geographical distribution of mining power/work Is there any information on how the mining power is distributed geographically? I.e. where the computers are located that do the work.

This is important as one measure of centralization of the system, and thus of the trust in the proof-of-work concept.

Of course, there are many different ways to measure centralization, but that's not part of this question.

Thank you!

PS: I'm open to suggestions for better tags of this question.

Not that I can find. You could work out the geographic distribution of mining pools based on information provided by blockchain.info, but they receive mining power from pool contributors from around the world, so that wouldn't really give you a complete picture. If a major pool went down (or was blocked off from the rest of the internet) most miners would just switch to another pool.


How would you recommend parsing a private bitcoin core node with nodeJS? I just need to parse a private node and lookup one bitcoin address and get all transactions going in or out of the address preferably using nodeJS within the last 200 or so blocks. Any recommendations?

This question is pretty broad as parsing a node involves decoding every transaction within a block(which would require txindex to be enabled), and recording each output and input until you end up with a list of all outputs that have not been used as an input aka an unspent output.

With a fully synced node and txindex=1 you can begin iterating through each block of the last 200 blocks with loops using the rpc calls getblockhash getblock getrawtransaction and decoderawtransaction, storing the outputs in a database. On each new block you should check every input to see if there is a transaction id matching an output in your existing output database, if there is that output has been spent. The node-bitcoin JSON-RPC wrapper should work fine for implementing these calls to your node. As you can imagine this would take some time.


Pending BTC transaction for more than 30 hours I have made a transaction 0.0387621 BTC yesterday, its been more than 30 hrs, the transaction is still in pending status.

I have put the right address and BTC value (excluding the token charges).

Kindly let me know any solutions that can resolve it.

Any help would be highly appreciated.

You should take a look at this: Why is my transaction not getting confirmed and what can I do about it?

It would seem you did not attach enough of the fee. How many sat/byte does your transaction show?


What happens to the mining reward if the blocks gets replaced? When a block is added to the blockchain, the miner gets rewarded. But what would happen to the mining reward if the network replaced the block's branch with another because the latter is longer? If it was legit then how would the miner reference to the block which generated his coin?

P.S. - I'm new to SE, so I really don't know much about it.

If the block doesn't end up in the main chain, the miner effectively doesn't get the reward.  Attempts to spend it will not be accepted as valid payment by others.

There is a "maturity" rule that rewards cannot be spent at all until 100 more blocks have been added to the chain following it.  This helps ensure that a miner doesn't spend coins from a reward which is later invalidated, thus leaving the recipients of those payments in the lurch.


How was the dust limit of 546 satoshis was chosen? Why not 550 satoshis? Is there a reason why 546 satoshis was chosen as dust limit instead of 547 or even 550 satoshis, historically?

The dust limit is not actually fixed, technically - it varies based on the type of output. 546 satoshis is simply the most commonly known one, for a p2pkh output. Being the longest-lived output type, I suspect some wallets/blog posts/literature might treat it as a hard coded dust limit.

As to how to arrive at 546 satoshis, we must first know what "dust" means. A dust output is an output which costs more to spend, than it is worth. In other words, an X BTC output that costs >X to spend, is a dust output. This is directly proportional to the amount of data required to spend an output, since fees in bitcoin are commonly denoted "per-byte". The more bytes you must add to your tx to spend an output, the higher its dust threshold.

A very basic tx consisting of 1 p2pkh input (~148 bytes), and 1 p2pkh output (~34 bytes) comes out to 182 bytes. The dust limit is 3 times this number (assuming a relay fee of 1 satoshi), or 182*3 = 546 sats.

For more complex txs, such as p2sh, this number is larger. For less space-intensive ones such as the newer segwit options, this number would be lower.

The code used in Bitcoin core to determine the dust threshold can be found here.


Is it possible to build a blockchain explorer to put on aws? Can I download the blockchain onto a cloud service then build an api to search it? maybe put it on a noSQl database?

What would be the best way?

Or even better, is there a way to not download the whole blockchain but, build an api that uses SPV to get just the transactions of a certain public address?

I have been trying to use the apis out there such as blockchain, block.io, insightpay, etc, but they all limit me in terms of API usage and I they are all bad at dealing with transactions where there are hundreds of inputs. Not sure how common this is, but it is a problem.

Thanks

There are open-source projects available that make building your own query service possible. A good example would be Libbitcoin, see their github and official website.

You need to install libbitcoin server - this is a full bitcoin node with a database, and libbitcoin explorer - a set of tools among which you will find one for querying the server about addresses (balances and whatnot).

Be aware that the server will download the whole blockchain. It is not possible to have your own query server without having the blockchain on hand.


Won't ASIC miners eventually break SHA-256 encryption? I might be confused as to how Bitcoin works, but as far as I can tell, ASIC miners are getting better every year and faster at cracking SHA-256 encryption.  Won't this cause the eventual complete obsolescence of SHA-256 encryption entirely, much faster than previously estimated?

Another way to look at it is to take a look at a recent block that was mined, for example, block 388368.  Looking at this block on blockchain.info, you can see that the hash for this block is:

0000000000000000021ff110a589e44f56979254a204557311204f803910fdfa

It took roughly 10 minutes for all of the miners (doing a combined 700,000,000 giga-hashes per second) to find the above hash which has enough leading zeroes (17) to meet the difficulty requirement of the network at that time.  Since the remaining digits after the first 17 leading zeroes could have been anything, there are 16^47 (i.e.16^(64-17)) possible hashes that could have been found which would have satisfied the difficulty requirement (which is 3.92 * 10^56), yet it took all of the mining power of the entire bitcoin network ~10 minutes to find just one hash that met the requirement.

To crack a hash, you need not just the first 17 digits to match the given hash, but all 64 of the digits to match.  So, extrapolating from the above, it would take 10 * 3.92 * 10^56 minutes to crack a SHA256 hash using all of the mining power of the entire bitcoin network.  That's a long time.


Is Ripple an anti central exchange that makes Bitpay and Mt.gox almost obsolete? I just learned of Ripple and it still seems a bit fuzzy to grasp the concept, but from what I gathered so far its a decentralized exchange that basically has the potential to overtake Bitpay and Mt.gox. I read that there are Gateway points that do the currency conversions from bitcoin to fiat. Now the other question I have is how does Ripple derive the bitcoin exchange price if everyone starts abandoning traditional exchanges that kind of dictate the price exchanges from fiat to btc. Obviously not everyone is going to abandon those exchanges anytime soon.

Ripple supports a distributed currency exchange; anyone can offer to exchange from one currency to another. These offers are taken when a counter offer the same or better is made.

Like any exchange between two parties, the price would be based on supply and demand, world events, what the market will bear, etc.

The advantage is there’s no single point of failure that would cripple the market. We’ve seen what happens to bitcoin when Mt. Gox goes down or is under a denial of service attack. That’s obviously not a problem with decentralized exchanges.

And with the new Bitcoin Bridge feature of Ripple, you can pay anyone in Bitcoin from a Ripple wallet. The currency exchange is done by an organization (a.k.a a gateway I believe) running the freely available Bitcoin Bridge protocol, like Bitstamp. You can see as of this moment, the Bitstamp rate is $98 per Bitcoin. You can see the exchange rates of the exchanges at Bitcoin Average.


How can I pass Multiple addresses in Move command I have to pass multiple addresses in move command but I am not able to pass as it is not accepting more than one wallet address Is there is any another way to move the balance to multiple addresses.

You can't pass multiple addresses to Move commands, also move will be removed in a later version of Bitcoin Core.

Please consider using sendtoaddress instead


How does Elements integrate Simplicity? Greg Maxwell noted that there are two ways to integrate Simplicity into Bitcoin. One is to make only a few select high-level constructs available (like SHA256, CheckSigHashAll), the other is to expose a full bit machine as specified in the Simplicity Technical Report.

Now that Simplicity is being integrated, presumably a decision must have been made on how it will work.

Which approach was chosen?

It has always been the case that the full Bit Machine would be "exposed"[1] by allowing arbitrary Simplicity.  This is because the combinators that let you compose the high-level jets are exactly the same combinators that define low-level Simplicity.  Thus even if only a few high-level jets are chosen to be exposed, it would still be the case that the low-level combinators could be used to define any function (at great expense, of course).

The real question is, what selection of jets will be made available and at what cost?  That question, while really important, gets decided near the end of development, so technically it hasn't been addressed yet.  I'm inclined to be quite liberal on accepting lots of jets.  For example, I'd like to have all functions from fiat-crypto extracted (both as Simplicity and as C) and implemented as jets.

That said, Elements is a platform, and users of that platform will have the ability to choose whatever selection of jets they wish, which may vary depending on how far along the proofs of correctness are and how comfortable they are with the risk-level for greater or fewer number of jets, or even add their own jets.  Furthermore, as Maxwell noted, we really need to get some experience with using Simplicity to understand what are and are not useful jets.  We will want this experience this before Simplicity would be integrated into Liquid.

[1] Just to be clear, the Bit Machine is never directly exposed.  The Bit Machine can only be run through interpreting well-typed Simplicity programs.  This is important because the Bit Machine relies on the type-safety of Simplicity for its memory safety. Otherwise the Bit Machine could crash.


Is there any reason for an alternative Bitcoin implementation to use Berkeley DB? The primary reason Bitcoin's C++ reference implementation uses Berkeley DB 4.8 seems to be backwards compatibility. It doesn't appear that BDB4.8 (or BDB at all for that matter) has any superior advantage over current-day alternatives like Redis or RocksDB, at least based on the limited research I've done (source). To the best of my knowledge, most alternative full-node implementations steer away from wallet support (source, source).
Performance benchmarks seem to indicate that there is no performance benefit to sticking to Berkeley DB (source) yet I cannot seem to see any widespread adoption of anything else except for recent introduction of SQLite support (source) for Bitcoin Core despite the growing pains of BDB4.8. I can't imagine any other reason as to why BDB wasn't dumped altogether if it wasn't for backwards support.
Is there any reason why alternatives like RocksDB (which supports at rest encryption though it isn't well documented), ArangoDB or Aerospike (all that seem to have existed at least five years ago) were not considered? Is there any security benefit to sticking with BDB? Any redeeming properties of BDB that make it a definitive choice over what is available currently?
Should a new implementation stick to BDB or use another library for wallet support and if so, what should it be?

Backwards compatibility is a massive priority for Core and it is generally very conservative in its technology choices. I don't think it would consider a new (database) technology until it had been proven over many years on other projects. It is providing a consensus engine and infrastructure and doesn't have the same tolerance as startups or bigger corporations for cycling through different options and experimentation if it is going to endanger backwards compatibility or require many developer hours to revamp shortly afterwards.


Accepting Donations For Your Charity In BITCOIN The tutorial is here: https://developers.coinbase.com/docs/wallet/tutorials/donations

First step: Sign up for a Coinbase account

Problem: "Merchant Services: We're no longer accepting new merchant services businesses. Stay tuned for new offerings that are coming soon."the

Is there currently a way to enable BitCoin donations for my favorite charity? I wanted to use Coinbase because they will generate a donor letter which will enable the contribution to be tax deductible in the U.S. While it is possible to create a wallet and publish the QR Code, it will be non-trivial to return Donor Letters and to immediately convert the Bitcoins into USD and to automatically deposit the donation into the nonprofit's checking account.

Try to use btcpayserver. Fully non-custodial bitcoin payment processor.


Lacking OpenCL support on macbook pro I've a macbook pro and I tried to mine, but there is a problem, I can mine only with CPU because I get the error

No OpenCL-compatible GPUs detected
2013.04.11 [15:16]  Lacking OpenCL support. If you want to use GPUs, please install the latest drivers from your graphics card manufacturer.
2013.04.11 [15:17]  Warning: Electricity-wasting slow CPU implementation in use

How can I use my GPU??

I started down the same path as you with my Macbook Pro early-2011 model, and got the same error. My model includes the Intel HD Graphics 3000, and there are no Intel-based OpenCL drivers for it. When I did enable a miner on the Core i7 CPU alone, I got 1.8Mh/s using the CPU, which is poor.

AFAICT, even if you have an OpenCL-compatible Intel GPU, (the Core i5 and i7 are OpenCL compatible on Windows, and Xeon and Xeon Phi on Linux) I've read nowhere that states it's even possible to "GPU mine" with it, either Linux/Windows/Mac... I may be wrong :)

If you have an earlier Macbook Pro, a model that includes an NVIDIA GPU, like the GeForce 650M or 9600M GT, you may have some luck getting OpenCL to work. You can try reading the How to Run Bitcoin Miner on Mac OS X guide, but even if it works you'll only get 3.8Mh/s (still not very good).

In short, unless you can get at least 300Mh/s, like from an AMD GPU, it's probably not worth the cost in electricity.


Can the Bitcoin network boycott a misbehaving miner? If a miner misbehaves, can other miners “boycott” him/her by refusing to build on top of his/her blocks in the future? Will such a “boycott” keep the miners from behaving badly?

I'm not sure what you mean by 'misbehaves', but if a miner creates an invalid block, the rest of the network will ignore it.

And in any case, a specific miner cannot be banned from participating in the network. The network only cares about whether a new block is valid or not, the origin/creator of that block is not even necessarily known. There is no 'ID' or anything like that that links blocks to certain miners. Anyone that submits a valid block hash can create the next block on the network.


How to determine the remaining Bitcoin Cash after the hardfork? This is some thought I had in mind for sometime which I couldn't come up with a proper explanation. Please excuse me if this is a stupid question.

I have read the following on few articles on the internet,

That Bitcoin Cash (BCH) has the same amount of limit like bitcoin (BTC), which is 21 million
When the Bitcoin Cash hard fork happened, people who owned Bitcoin by the date of hard fork, continued to own the same amount of Bitcoin Cash

My Questions are?

Is it correct that Bitcoin Cash has already been mined the same amount that Bitcoin had been mined by 1st of August 2017, so the remaining Bitcoin Cash amount was equal to the remaining amount of Bitcoin at that point?
Did it create new transaction id s for Bitcoin Cash in the Bitcoin Cash block chain? OR did it duplicate the same transaction ids on the bitcoin cash block chain?
Can the people owned bitcoin at the point of hard fork exchange their bitcoin cash to bitcoin and vise versa? which I doubt has a clash with the bitcoin limit and mining

OR is my understanding wrong? Please clarify?

1.: yes. BTC and BCH have the same transaction-history until 1st of August 2017. "...Bitcoin Cash has already been mined..." no, BitcoinCash did not exist before 1st of August 2017. BitcoinCash only "copied" the blockchain of bitcoin. (the bitcoin-cash developer had also been able to start a new blockchain theoretically for example. technically there are many possibilities.)

2.: the transactions before 1st of August 2017 have the same ids/hashes in both blockchains.

3.: yes. you can use a normal exchange-website. you can sell/buy/exchange BTC and BCH like every Altcoin too. this requires obviously that you find somebody who can and want to trade with you. you can not change BTC and BCH "directly between their blockchains" without any normal trade.


Bitcoin confirmed but have not received anything Transaction number 2f1271a411b296ee2fbc5941809cbf4d4718a0c564de4a437f505073a92da3b8
Why have my not received the Bitcoin

You probably have to wait for your node to sync i.e. download 200+GB of the blockchain. I suggest making a thread on https://reddit.com/r/bitcoinbeginners and posting a link here so we can help you further. Stack exchange is not suitable for a back and forth diagnoses session.


Does a brokerage firm have its own price matching engine? or it is only that exchanges can do this all matching stuff? Is the location of price matching for a trade can optionally decided ? i.e. Does a brokerage firm have its own price matching engine which gets the Market depth updates and runs price matching algorithms against that data for its customers? or it is only that exchanges can do this all matching stuff?

Which is the generally followed method in practice?

In a financial world, no broker offers his own matching engine to execute the orders of his client with another trader, all trades have to go through echanges (except FOREX market). They typically contract the exchange or another data feed vendor. By doing this they transfer the risk to the data vendor that if anything happens with the data feed, they are not in charge.


Can the wallet's balance be deduces from the wallet's address and the blockchain's history? Is this concealable? Since all bitcoin transactions are public, I guess that all transactions could be summed up to get any wallet's balance. Thus sharing a wallet's address means sharing the whole wallet's data. Even using a proxy wallet would not hide the pattern of expenditure thus potentially revealing where the Bitcoins are being spent. Is there a way to be able to receive payments in Bitcoin, yet keep the balance concealed?

Looks like you misunderstood what is the wallet  and the address. Wallet is not an address, wallet is a bunch of addresses.

An address is a single-use token

Addresses are not wallets, and do not carry balances.

  Thus sharing a wallet's address means sharing the whole wallet's data.

Addresses in this particular wallet doesn't related each other, therefore if you know one address you can't calculate the balance of all wallet.


How to determine custom synchronization status? Context:

I'm working on an application in which we'd like to know if the current node is sufficiently synced to be able to handle RPC requests. The method we would like to use is to see if our node has at least 2-4 peers and if a majority of the peers are reporting the same best height / best block hash.

Previous research:

I know the version network call gets the height of the peer at that time, but it isn't updated. In addition, any further version requests result in an increase of the ban score of a node, so this cannot be used frequently.
Bitcoinj keeps track of the height of the best known peer by using the height given in the version message and then incrementing whenever the peer processes an inv message showing they have a new best-block height. This seems fast, but tricky/error prone.
This question is similar, but it asks about how to do this with RPC calls, and it doesn't seem to want to use the same method for determining whether the node is synced as the one I've proposed.
This question helped provide a temporary solution (calling get work and seeing if it fails), but this method is not accurate enough.

Is there a way to just ask a peer what the height of its best block is without getting banned?

Could I just make multiple getheaders requests and see if the peer returns any headers later than the header I have, or would the peer ban me for requesting the same headers again and again?

Bitcoin Core 0.10.0 may provide the solution you need thanks to its headers-first synchronization.  The getblockchaininfo RPC in 0.10.0 provides both a blocks field (the number of verified blocks) and a headers field (the number of partially-validated headers).

Any time the numbers differ, you don't have all the blocks.  During Initial Block Download (IBD), they'll be hundreds of thousands of blocks apart.  (According to a Wireshark sniff I did during IBD a few weeks ago, it took my node less than two minutes to download a complete headers chain; syncing the blocks then took another three hours.)

Bitcoin Core 0.10.0 has two other new fields you might find useful, both in the getpeerinfo RPC.  The fields are synced_headers and synced_blocks.  The headers field is based on the last P2P headers message the remote node sent you.  The blocks field is based on the last P2P block inv message the peer sent you.  In both cases, they let you know the last header or block you have in common with the remote node (as best as can be determined).

I don't know how useful these getpeerinfo fields will be, as your node can't tell you the height of a block until it has the corresponding block header---at which point the getblockchaininfo RPC will already tell you that you're out of sync.  However, they are kinda fun to look at.

  Could I just make multiple getheaders requests and see if the peer returns any headers later than the header I have, or would the peer ban me for requesting the same headers again and again?

As far as I know, there's no ban score there (as long as your packets are valid).  However, the remote peer should send you an inv message as soon as it validates an incoming block---so there's no need to poll it as long as your app handles inv messages with a MSG_BLOCK type.


How do I get all the latest transactions from Bitcoin network using Python? Is there a Python client to listen to all latest transaction from the Bitcoin network? How does blockchain.info doing it?

Blockchain.info uses a special system that doesn't involve Python (as far as we know), they're most likely using a modifed node that notifies them of transactions.

The easy way

Just use Blockchain.info's transaction notification service. Their websockets api lets anyone subscribe to any bitcoin address.

The hard way

If you want to listen to all latest transactions, and not to addresses you own, you're going to need more in depth control. Otherwise use Bitcoind and its walletnotify parameter. Check out PyNode, a Bitcoin node implementation in Python.


Import multisig change addresses into Bitcoin Core using "importmulti" + descriptor I'm trying to fill my wallet's internal/change address keypool by passing a multisig descriptor to importmulti, but the wallet's internal keypool is 0 before and after running the following shell script:

keypoolinitial=$(bitcoin-cli -testnet getwalletinfo | jq -r '.keypoolsize_hd_internal')
echo "internal keypool initial: $keypoolinitial"

rawdescriptor="wsh(multi(2,tpubD6NzVbkrYhZ4YgUWMmeBh1b7hrYyHwXowUrMn3mQ6QRxJNaLiVEA3jGLJDdaSpzEMTCgNF2JRukSqUxEkgX3J8Mf8tMParwTWABsjFzTsUA/*,tpubD6NzVbkrYhZ4XaWhpCwqSPgdnmqHxjPksHjdt6sgsBmQ37ohNNUFnyykgstn1UTKz21SzdKM6C3V7qEiXHkeEKWRALWMb1am8voLW72ZXDr/*,tpubD6NzVbkrYhZ4X3DR4FgNdjBjmdxvnX2TjmbkoNWquXaXQz6uMfF7kUF6rsXA26vRMzW3WP4iQgP1A8gJCSYD47qAQbsCCtnvhtRiD57jAEw/*))"

descriptor=$(bitcoin-cli -testnet getdescriptorinfo $rawdescriptor | jq -r '.descriptor')

bitcoin-cli -testnet importmulti '[{"desc": "'$descriptor'", "timestamp": "now", "range": [0, 10], "watchonly": true, "keypool": true, "internal": true}]' >> /dev/null

keypoolfinal=$(bitcoin-cli -testnet getwalletinfo | jq -r '.keypoolsize_hd_internal')
echo "internal keypool final: $keypoolfinal"

Running it gives me:

internal keypool initial: 0
internal keypool final: 0

But the same script works if I change the rawdescriptor line to use a simple P2PKH descriptor such as:

rawdescriptor="pkh(tpubD6NzVbkrYhZ4YgUWMmeBh1b7hrYyHwXowUrMn3mQ6QRxJNaLiVEA3jGLJDdaSpzEMTCgNF2JRukSqUxEkgX3J8Mf8tMParwTWABsjFzTsUA/*)"

Then it outputs:

internal keypool initial: 0
internal keypool final: 11

The keypool (currently) is not an address pool, it does not hold individual addresses, it holds keys. Those keys are then converted to addresses when you want them. Because of this, you cannot import P2SH or P2WSH addresses into the keypool as you are trying to do.


Creating a nothing-up-my-sleeve public key I am trying to create a public key whose x starts with "34" and is followed by the minimum number n such that the concatenation of "34" and n is the x of a valid point (x, y) on the elliptic curve secp256k1. Submit the concatenation of 04, x and y in hexadecimal form. This is a valid bitcoin public key, the corresponding secret key of which is not known by anyone.

I was told that the minimum number is 0.

My understanding is that the answer is supposed to be like this: '0434' + hex(n) + y_value.
I am not sure how to approach this.

Is it true that x-coordinate is supposed to be 32 bytes and y coordinate 32 bytes too?

Is it true that each coordinate is represented in hex mode of 64 chars?

Is the public key represented by 130 hex chars?
I have tried some online tools: e.g. https://iancoleman.io/bitcoin-key-compression/ and some python code but I always get a wrong answer.

X = '0x3400000000000000000000000000000000000000000000000000000000000000'
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
print("x coordinate = %s " % X)
x = int(X,16)
print(x)
ysquared = ((x*x*x+7) % p)
print("ysquared= %s " % ysquared)
y = pow(ysquared, (p+1)//4, p)
print("y1 = %s " % hex(y))
print("y2 = %s " % hex((y * -1 % p)))
print("-----------------")
print('04' + X[2:] + hex(y)[2:])
print('04' + X[2:] + hex((y * -1 % p))[2:])

I was told that the minimum number is 0.

That is correct. 0x3400000000000000000000000000000000000000000000000000000000000000 is a valid x-coordinate on secp256k1.

  My understanding is that the answer is supposed to be like this: '0434' + hex(n) + y_value. I am not sure how to approach this

That is also correct. However, you will have two y-coordinates. One even and one odd and hence two uncompressed public keys. That is the reason why we append a prefix to the x-coordinate to tell us whether the y-coordinate associated with that x-coordinate is even or odd.

  Is it true that x-coordinate is supposed to be 32 bytes and y coordinate 32 bytes too?

That is the maximum size. It can be below that as well.

  Is it true that each coordinate is represented in hex mode of 64 chars?

Related to to above. One byte representation needs two hexadecimal characters.

  Python code

I'll use the below one.

p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
def modular_sqrt(n, p):
    ''' Find a quadratic residue (mod p) of 'n'. For Bitcoin p is an odd prime, that satisfies
        the identity p % 4 == 3. As a result, this is a simple solution where the modular square
        root of y^2 is : y = pow(y^2, (p + 1) // 4, p).
        If p did not satisfy that identity we would have had to use the Tonelli-Shank's algorithm
    '''
    return pow(n, (p + 1) // 4, p)

def y_coordinate_from_x(x_coordinate_with_prefix):
    public_key_x_coordinate = int(x_coordinate_with_prefix[2:], 16)
    public_key_y_coordinate_sign = int(x_coordinate_with_prefix[:2])
    y_squared = (public_key_x_coordinate**3 + 7) % int(p)
    public_key_y_coordinate = modular_sqrt(y_squared, int(p))

    # check the sign (odd or even) and match that to the sign provided by x-coordinate
    sign_check = 0 if public_key_y_coordinate_sign == 2 else 1
    if int(str(public_key_y_coordinate)[-1:]) % 2 != sign_check:
        public_key_y_coordinate = int(p) - public_key_y_coordinate

    return '%064x'%public_key_y_coordinate

x = '3400000000000000000000000000000000000000000000000000000000000000'
y1 = y_coordinate_from_x('02' + x)
y2 = y_coordinate_from_x('03' + x)

so your uncompressed public keys are '04'+x+y1 and '04'+x+y2


Any pool that value those who mine during low difficulty more? Imagine a pool having 2 people.

A mines for 1 minute when difficulty is 1000. Then B mine for 1 minute when difficulty is 1. Let's for simplicity sake difficulty change from 1 to 1000 to 1 to 1000 to 1 to 1000 every minute. Say they both got the same machine.

Every 1-2 hours the pool solve some blocks.

The way I understand it is that the pool got far more contribution from B than from A. B contribution to solve some blocks is higher because B provides hash when difficulty is lower.

However, A and B will get roughly the exact same payment.

They submit the same number of shares for the same stratum difficulty.

Am I correct here?

This is important for those who are buying nicehash hash to sell to some other pool. Even though you time your buying when difficulty is low you are rewarded as much as anyone with worse timing,

Are there any pool that rewards you more when you mine at lower difficulty?

I would disagree with Murch's answer.

According to https://arxiv.org/pdf/1112.4980.pdf

Only 2 kind of pools do that. PPS pool. And certain variants of PPLNS pool.

I got to ask the guy that author this.


Why is halving the best time for block size increase hard fork? Gavin Andresen said the best time to launch the block size increase update / hard fork would be the next reward halving (when mining discovery bounty would go from 25btc to 12.5btc).
Why has halving anything to do with increasing odds of success of a hard fork?

Source: Gaving Andersen said that at the Dev Core conference London on April 19th in his keynote "Why we need a bigger chain". There was a live broadcast of the event but I can't find a video link.

There's definitely no reason for that from a technical perspective. Success is entirely dependent on convincing all the wallets, nodes, and lastly miners in the network to make a breaking change to their software.


In bitcoinj, why is MemoryBlockStore not used by default? My understanding of bitcoinj is that it is used to implement a "thin client" that doesn't store the entire blockchain- just the headers.

When I use the WalletAppKit, it creates a file "default.spvchain" that is 626Kib. This could easily fit in memory, so why is SPVBlockStore (using memory mapped file) used? Wouldn't MemoryBlockStore be a better choice?

If you don't persist the headers in some way then you'd have to reload them each time you launched. Loading the headers from scratch isn't a free operation. Its not just a matter of downloading 626k. It may be a small amount of data in the end but each header still needs to be verified (targets calculated and checked, etc). Not only that, but there are less obvious privacy implications of requesting the block chain from the network each time.

SPVBlockStore still uses memory mapped IO so its not like you take a performance hit, it just makes subsequent launches of the software faster.


Claiming Bitcoin Cash From Mycelium How do I claim my bitcoin cash (BCH) from a single address Mycelium wallet?

You simply import the private key of the single adress wallet into a bitcoin cash wallet such as https://electroncash.org/


Transfer BTC to wrong address I made a BTC transferred from the Luno exchange into my CEX exchange account, but I accidentally entered the CEX's BCH (bitcoin cash) wallet address instead of BTC and Luno did not blocked this receiving address.

Now, the transfer had transaction confirmation in blockchain public ledger

My CEX's BCH or BTC wallet did not reflected this deposit. Please advice me if any action for the recovery and how to make the deposit reflected in the CEX's wallet. I already raised urgent support tickets to both of the exchange, no reply from them yet.

Thanks in advance for you guys advices

contact CEX and explain to them, they should be able to give you the money since they control the private key.


Passphrase works in Bitcoin QT, but does not in Bitcoin Core I found an usb stick with a wallet.dat.

There is also an old notebook with Bitcoin Wallet v.8.6-beta on it.
Unfortunately I can't sync it on my old notebook and therefore I am not able to send BTC to another wallet.

I then installed Bitcoin Core on my new PC and put the old wallet.dat in the directory.
The bitcoin showed up in the Bitcoin Core Wallet on my new PC; BUT when I tried to send them it says "passphrase is incorrect".

I then doublechecked my passphrase using "change passphrase"-feature on the Bitcoin Wallet on the old notebook and it worked, meaning the passphrase must be correct! I could even do a transaction and put the passphrase (BUT as you know, because it is not synced - the network will not accept the transaction...)

In other forums they recommended using Electrum instead to import wallet.dat.
This did not work for me.... I am not expirenced with bitcoin and IT in general....

So, do you guys have an idea what causes the incorrect passphrase in Bitcoin Core?
Or could you recommend a trustworthy company to solve the problem?

The problem described seems quite strange. I don't know what's preventing you from unlocking the wallet.dat. I think this might be caused by InputMethod/halfwidth and fullwidth forms/CapsLock/NumLock... Double check these things before typing your passphrase.

At last, if you still cannot figure out what's preventing you from unlocking the wallet, you could try to export your private keys on your old PC, one by one.

On your new PC, if you have finished the initial syncing with latest version of Bitcoin Core, you may open the debug window, switch to the console tab, then try the rescanblockchain command. This should make your wallet balance up-to-date, which would take some time to complete.

Then, listunspent command would indicate which addresses your bitcoins are currently stored in. You may save the text, then copy it to the old PC.

On your old PC, launch bitcoin-qt. It doesn't matter whether the blockchain syncing is complete or not. Open the console, first use walletpassphrase 'YOUR_PASSPHRASE_HERE' 3600 to keep your wallet unlocked for one hour, then use dumpprivkey ONE_OF_YOUR_BITCOIN_ADDRESSES_HERE for each of your Bitcoin addresses.

Once you get all the private keys, you will be able to import them to almost any Bitcoin wallet.


Installed Bitcoind on my Ubuntu server, but where does the blockchain get downloaded? I have a fresh install of Ubuntu 12 and just installed bitcoind. How do i find out where its installed and where is it downloading the entire blockchain?

Based on the bitcoin wiki, it is shored here

Linux
By default Bitcoin will put its data here:
~/.bitcoin/


bitcoinpaperwallet.com scam lost 14.5 BTC Last night I made the mistake of using the website (while offline) to generate a wallet. I sent 0.1 then 14.5 BTC to it, and then 1 min later 14.51 was sent out to another paper wallet
here is the wallet I created and you can see the transactions
https://www.blockchain.com/btc/address/1BxPiuddFh7vz83BCFM9ZKUV75jUJyvJUv
any advice on what I can do. I've accepted the loss and the lesson (should have used the offline generator) but want to make sure this doesn't happen to others

I am really sorry for your loss, unfortunately, there is no way to get those Bitcoins again.
I have seen other people who got scammed by this website like this one: https://www.reddit.com/r/CryptoCurrency/comments/cyd6uj/bitcoinpaperwalletcom_scam_or_not_4_btc_stolen/
The best way to make the private key offline is using trustworthy software and when the computer will never connect to the internet again, otherwise, it will be possible to send the private key created to someone else when the computer is online again.


how to get bitcoind to launch on startup/reboot? ubuntu 16.04 Is there an easy way to ensure that bitcoind restarts on system reboot? I tried placing the systemd service file in /etc/systemd/system but that didn't seem to work... thanks in advance

After putting the systemd file in /etc/systemd/system, make sure that your systemd file is set up to work with your installation (binary path, datadir path, etc. are correct). Then run sudo systemctl enable bitcoind.

Alternatively you can do edit your crontab with crontab -e and add the line

@reboot bitcoind


worker showing offline in nanopool my rig shows it is hashing. Need help please! I am using nanopool and it did work after initial start up. I rebooted the rig and now my worker is offline. I am hashing and connected ot pool1 us-pool pool2 eu-pool.
Has anyone else had this problem?
Please help and thank you in advance for any assistenace.

Same here. Glad to hear I'm not alone but still curious what is going on. Are you using SMOS or Windows for mining? I have a rig on Windows and rig on SMOS and both show offline but are hashing fine.

I do have a rig that has been running for weeks just fine and today it shows it has rebooted 5 times. I wonder if nanopool is having issues or something.


In the above blockchain.info link I gave, what are those strange-looking addresses starting with "bc1...", and

Those are bech32 addresses. These are specified in BIP 173

  Is there a way to extract such data from the output of getrawtransaction?

No. The latest release of Bitcoin Core does not have functionality for converting native witness outputs into bech32 addresses. However blockchain.info does so they are displaying those outputs as bech32 addresses. Bech32 functionality in Bitcoin Core will be released in Bitcoin Core 0.15.1 along with segwit wallet functionality.

  If not, how did blockchain.info did it?

Blockchain.info does not use Bitcoin Core. They have their own custom software and it seems that they have implemented bech32.


Percentage of mined Dogecoins On http://dogepay.com/ I read that 19% of Dogecoins have been already mined.

Is this measure accurate? (So much mined, wow.)

How long it takes to mine them all?

When all dogecoins have been mined, how can transactions happen?

How long it takes to mine them all?

DogeCoin has a block time target of one block per minute. According to its bitcointalk thread it follows a block reward schedule where the first 100,000 blocks get a random reward between 0 and 1,000,000 dogeCoins and every subsequent 100,000 blocks halves the of the previous reward's maximum.

Beginning with the 600,001st block, the reward will be a constant 10,000 dogeCoins per Block until the maximum of 100 billion dogeCoins is found.

Since there is a random process underlying, it is not possible to accurately predict which block will provide the last scheduled block reward until the first 600,000 blocks have been mined, however, the first 600,000 blocks should produce an estimated ~98.44 billion dogecoins, so there would be about 156k blocks with a 10,000 doge reward.

At 1 minute per block, 756k blocks would take 525 days, or just shy of 1.5 years.

  Is this measure accurate?

Yes. According to dogechain.info also, 21.45 billion dogecoins (21.45%) have been mined.

  When all dogecoins have been mined, how can transactions happen?

In short: Mining rewards are composed of both the block reward and transaction fees. The transaction fees will remain, and should suffice to reimburse the miners to continue just as before.
Please refer to Will the proof of work system end when all bitcoins have been mined? for a more comprehensive answer.

Update: Flat 10k reward forever

On February 1st, 2014 the Dogecoin developers announced that Dogecoin would not be capped at 100 billion dogecoins after all, but would continue to have a flat 10k dogecoin reward for each block after Block 600,000.


What happens to my transaction if it is not accepted by miners? Let's say I haven't any fee or I paid a little fee. Miner didn't accept my transaction and still haven't got one confirmation. What will happen to that transaction? Will it rollback or Will it be in an unconfirmed state forever? Please explain.

Nodes will eventually drop transactions if they remain unconfirmed for too long (or if the inputs for a tx are confirmed in an alternate transaction). The time this takes to happen can vary from 3-14 days usually, depending on the nodes' config. Block explorers may cache transactions for longer than that, however, and may continue displaying them long after they have been dropped from the mempool.


When is it a good time to invest in Cloud mining? I bought bitcoins a while ago, an investment, but have now been reading up on cloud mining.

Due to the cost of bitcoins rising, is now a good time to invest in cloud mining?

TL;DR: Never.
Lack of Control
I don't think there is ever a good time to invest in Cloud Mining. I remain utterly unconvinced of the whole business model.
Mining itself already has an inherently slim return rate, then putting both your investment and the hardware into the hands of a third party that wants an additional cut seems counterintuitive. With regular mining you can at least switch the pool when you are dissatisfied, with Cloud Mining you make yourself a hostage to changing circumstances.
Scams in the space
Definitely have a look at Cloudmining 101 (ponzi risk assessment). There are a lot of scams in the space.
Buying bitcoins directly may be better
A lot of people interested in investing into Cloud Mining point out that it may be a profitable investment if Bitcoin prices rise in the future.
Under the expectation of rising prices, the reader should consider the value increase of the same investment directly into bitcoins instead, though.

Also see this related question: How do cloud hashing companies profit? (leasing hashing power).


What is the useful work done during the mining of Bitcoin? What is the work that the computer performs while it does Bitcoin mining? Is it useful work in any case?

Mining secures the Bitcoin blockchain and confirms transactions, solving the double-spend problem without the need for a central authority.


Bitcoin Core ZMQ "hashTx" Bitcoin Core ZMQ messaging system has hashtx along with 4 other topics. But nowhere it is documented whether the transactions that comes from hashtx are confirmed transactions which are added in a block or unconfirmed transactions that is yet to mined.

Both. A notification will be sent when a transaction is added to the mempool. For newly added blocks, a notification will be sent for every transaction in that block, so when a transaction is confirmed, there will be a notification for it.


How come this formula predicts more than four years to the next halving? So I was looking at https://www.binance.vision/halving and it shows that their formula for halving is

(Halving block height - Next block height) * Average time between blocks - estimated time until the next block

However, their countdown seems off as it exceeded 4 years, is this accurate?
What's the correct formula to calculate countdown for halvings?

The formula is correct - a halving occurs every 210000 blocks. If the average time between each block is exactly 10 minutes, you wind up with a total time of about 3.995 years.

However, if blocks are mined slightly slower, you will take slightly longer than 4 years - if they are mined faster than 10 minutes, it'll take less than 4 years to get to the next halving.

Predicting the next halving's date right now is pretty much impossible, as it would vary immensely based on hashrate and difficulty changes over the next few years.