Sending Bitcoin from LocalBitcoin to another wallet to secure my funds, does it work? I have an account with LocalBitcoin, that I use to ONLY fund my backpage account. However, this account is on the clearnet, is linked to my email address and bank account, and has been used without any privacy/protection layer whatsoever. I live in a place that do not seems to have any option for cash payment to get bitcoins, that's why I used my bank account to fund it and didn't consider protecting it when I first used it.

Well, now I would like to purchase something with bitcoins, but I do not want this transaction to be linked in any way to my LocalBitcoin account (and all personal information).

My questions are:

If I cannot fund an account by cash payment, can I create another account from a different website, to which I would be safely sending bitcoins from my LocalBitcoin account?
Does this allow me a certain layer of security/privacy considering that this new account would be created with a different identity, and dedicated only to usage with TOR browser?
Does Bitcoin transfer the bitcoins from normal web to TOR Network securely in any way?

Thanks a lot

(I'm really sorry if I do not use the right terms, im not a pro in these languages)

Does Bitcoin transfer from normal web to TOR Network secure in any way the bitcoin?

Transactions in Bitcoin are linkable. In other words, if you anonymously sent me Bitcoins to address 123, I could see that those bitcoins used to belong to address 456. If I also had a copy of LocalBitcoin's database, I could see that address 456 belongs to you. I would have a high degree of confidence that the Bitcoins came from you.

Tor doesn't fix that, but it's still a good idea. Tor can hide your IP address, but in the above example, I never used that anyway.


Fees when withdrawing funds from bitcoin? Does one have to pay a fee to withdraw funds from their bitcoin account into cash?

Does one have to pay a fee to withdraw funds from their bitcoin account into cash

If you have a Bitcoin account you are either storing money in a service like an exchange or are using an obsolete feature of the Bitcoin core wallet. Many people who own Bitcoin don't have a Bitcoin account - they look after their own cash and don't pay someone else to look after their cash for them.
Bitcoin is cash.

If you convert cash from one currency into another, you will pay a fee, sometimes the fee is hidden as a spread between buying and selling rates. This is a feature of currencies in general and has nothing to do with Bitcoin.

If you move control over some amount of Bitcoin from one Bitcoin address to another, you will pay a transaction fee.


automatic wallet.dat I installed a bitcoin-qt  and received a transaction. Few minutes later, the pc crashed,after restoration of the pc,I only saw  an automatic saved wallet.dat file  I tried to recover fund but no avail. Please help me to restore my fund

Bitcoin core has keypool option enabled by default, so when you install it a %n of keys will be generated and saved on your PC so when you generate Bitcoin address the address is coming from keypool which is already saved on your PC.

So, Your bitcoins should be on your PC, just give it some time to reindex.

and check debug.log file.


How do many public keys correspond to one private key? I have read online that hardware wallets can generate new public keys to facilitate transactions. Ie if someone has BTC on an exchange and they want to send that BTC in different installments to a single private key/hardware wallet, that hardware wallet can generate a different public key for each transaction. I'm a bit confused on how this works? Would the ledger not indicate that each of those installments now belongs to a different address? Or is it simply that each time a new public key is generated, the private key in the hardware wallet has the ability to sign for all of those? (Thus creating a persistent, growing list of public keys associated with one private key?).
Additionally, what is displayed on the ledger if that hardware wallet, after multiple installments with different public keys, now wants to send BTC elsewhere? Which of the previous public keys is used? Does it create a new one? Wouldn't this show up on the ledger as a public key sending more BTC than it ever acquired?

The answer is in Hierarchical Deterministic (HD) wallets. These create a tree-like repeatable sequence of key pairs (private and public) from a master private key.
Each public key is associated with one private key.
See BIP-32
Standard ways of spending Bitcoin involve reference to an output of a previous transaction and hence to a previously used public key. It typically needs the corresponding private key to be used to generate a number that will satisfy the spending script.


Which altcoin would be the easiest to fork a cryptocurrency from for educational purposes? Which codebase would you recommend for a novice who wants to create and run an altcoin in order to understand the technology - like a student compiling their own version of MINIX in order to understand operating systems?

If you want an objective criterion for difficulty, that would be how many lines of code are in the repository, not counting common libraries. Personally, I'm not interested in implementations in languages like Python that are considered easy to learn.

Litecoin is a popular choice, but SegWit won't make it easier.
I know Cryptonote is a more complicated protocol than Bitcoin. But what about Nxt, or other cryptocurrencies developed from scratch rather than copying Bitcoin?
Would Ethereum be relatively comprehensible if you removed the smart contract/EVM code?
I know there are tools to generate your own altcoin, but that would defeat the educational purpose, wouldn't it?

You could take a look at Jeremy Rubin's TinyCoin:
https://github.com/JeremyRubin/tinycoin

It is, exactly as the name suggests, a very small cryptocurrency written in python which is designed purely for learning purposes. Might be what you're after :)


How can one estimate the amount of Watts that is consumed by the mining network as a whole? I'm trying to estimate the Wattage used in mining operations over time and compare that YoY cost with mining physical materials (gold, silver, etc).  I hope that the electrical impact is less than that of mining for precious metals, but I'd like to quantify that to be sure.

What are some approaches I can use to measure and extrapolate the electrical and hardware cost of mining over the years?

Some data points that would assist in gathering this information would be

When was CPU mining invented/popularized?  To what extent?
When was GPU  mining invented/popularized?  To what extent?
When was FPGA  mining invented/popularized?  To what extent?
When was ASIC  mining invented/popularized?  To what extent?
What is the average cost of the above components?

For example, do we know how many FPGAs were in the wild on a per-vendor basis?  How much of the hashrate did that consume and what is left over?

The majority of mining occuring with CPUs ended in late 2010, though the plurality may not have (i.e., there were more miners using CPUs but most mining was based on GPUs by the end of 2010).  Most who remained using CPUs were pretty much squeezed out during Spring 2011.

GPUs could be purchased at retail, and were about the only technology that mattered from the beginning of 2011 into early-2012, so estimates could presume most hashing during that period was on GPUs.  Efficiency of various GPU models varied widely, but most miners were using roughly similar hardware because of the combination of price, performance and availability.

FPGAs include custom FPGA designs targeted to Bitcoin (e.g., BFL) and others that were offering commercially available off-the-shelf products. Unit shipment numbers are generally not known.    At their peak, FPGAs might have been less than a third of all hashing combined.

ASICs are just now impacting the hashrates, but in a few months will statistically completely displace all GPU and FPGA mining.


P2WSH-MultiSig fails with documented OP_0 workaround As per the note at Developer Guide - MultiSig and BIP147 when using OP_CHECKMULTISIG an OP_0 needs to be prefaced to the scriptSig to accommodate a bug in the original Bitcoin implementation.

If the same workaround is applied in a Witness Program the script seems to fail the SCRIPT_FLAGS_VERIFY_NULLDUMMY check. What's the correct way to add the OP_0 to a MultiSig Witness Program? Adding an OP_0 as per the sample below results in a final stack element containing 0x00 which fails the check.

auto aliceKeyData = ParseHex("bbc27228ddcb9209d7fd6f36b02f7dfa6252af40bb2f1cbc7a557da8027ff866");
CKey aliceKey{};
aliceKey.Set(aliceKeyData.begin(), aliceKeyData.end(), true);
CPubKey alicePubkey = aliceKey.GetPubKey();

auto keyData = ParseHex("619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9");
CKey bobKey{};
bobKey.Set(keyData.begin(), keyData.end(), true);
CPubKey bobPubKey = bobKey.GetPubKey();

CScript redeemScript = CScript{} << OP_1 << ToByteVector(alicePubkey) << ToByteVector(bobPubKey) << OP_2 << OP_CHECKMULTISIG;
uint256 redeemScriptHash{};
CSHA256().Write(redeemScript.data(), redeemScript.size()).Finalize(redeemScriptHash.begin());
CScript scriptPubkey = CScript{} << OP_0 << ToByteVector(redeemScriptHash); // P2WSH

int amount = 600000000;

CScript scriptSig;
CScriptWitness scriptWitness;
CMutableTransaction tx = BuildFundingTransaction(scriptSig, scriptWitness, amount);

uint256 coinZeroSigHash = SignatureHash(redeemScript, tx, 0, SIGHASH_ALL, amount, SIGVERSION_WITNESS_V0);

CScript op0Script = CScript{} << OP_0;

std::vector<uint8_t> coinZeroBobSig{};
bobKey.Sign(coinZeroSigHash, coinZeroBobSig, 0);
coinZeroBobSig.push_back(SIGHASH_ALL);

CScriptWitness& witness = tx.vin[0].scriptWitness;
witness.stack.push_back(ToByteVector(op0Script));  // <-- Results in 0x00 stack element in Witness Program.
witness.stack.push_back(ToByteVector(coinZeroBobSig));
witness.stack.push_back(ToByteVector(redeemScript));

CDataStream txSpendingStm(SER_NETWORK, PROTOCOL_VERSION);
txSpendingStm << tx;
std::cout << "Spending Tx: " << CTransaction(tx).ToString() << std::endl;

bitcoinconsensus_error err;
auto spendCoinZeroResult = bitcoinconsensus_verify_script_with_amount(scriptPubkey.data(), scriptPubkey.size(), amount, (const unsigned char*)&txSpendingStm[0], txSpendingStm.size(), 0, bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL, &err);
std::cout << "Spend Coin Zero result: " << spendCoinZeroResult << ", error code " << err << std::endl;

One trivial fix is to add an empty vector to the Witness Program stack rather than an OP_0, such as by using witness.stack.emplace_back() instead of witness.stack.push_back(ToByteVector(op0Script)), but is that likely to cause any other issues?

The real requirement is that the extra input to OP_CHECKMULTISIG is a zero (that is: the empty byte array).

For non-SegWit inputs, the only canonical way to get such a zero on the stack is by including an OP_0 in the scriptSig. OP_0 just pushes an empty byte array onto the stack.

In SegWit inputs there is no longer a script to build that stack. Instead, you specify the stack directly. As a result, not just the recommended way, but the only way is adding an empty array to the scriptWitness.


Is it possible to trace BTC or cryptocurrencies? There are input and output addresses in each transaction of cryptocurrency. So everyone can trace the flow back. If someone send me some BTC or other cryptocurrency to my address, and I regenerate a new address in my wallet and send some BTC to other one with the new address. Is it possible to trace it back to the original sender?

You can't send bitcoins from a newly generated address. To send bitcoins, you use as inputs transactions that were previously sent to one of your addresses as an output. (Your client will use more than one previous transaction output if it needs to add up some transactions to reach the required amount.)

The inputs to a new transaction are directly traceable to the output from a previous transaction. You can send bitcoins to yourself, but that just adds another transaction hop in the sequence. The transaction chain can always be traced back.


Does bitcoin mining pool hash randomly and separately When it comes to hashing does each mining entity use total random seed for each of their hashing function or do they have a range like " Im gonna cover from 0 to 500, and you cover from 500 to 1000, then if nobody find it we up 500 more "
And if they do use range does they tell it to other mining pool, so that they are not searching around the same number ?

Most mining pools use the stratum protocol. Part of this protocol includes a field for part of the extraNonce, named extraNonce1. The extraNonce is just extra data that is put in the coinbase transaction and used as a nonce in addition to the block's nonce. Each mining worker can then append their own extraNonce to extraNonce1. This second part is named extraNonce2
Typically what mining pools do is they issue work to each worker with a different extraNonce1. This allows the worker to use the entirety of the nonce field as well as their own space for extraNonce2. The submitted work can also be identified to belong to a particular worker by examining the extraNonce1.
I'm not sure how specific mining pool software determine what extraNonce1 to give out, but an obvious method would be to do so sequentially - each time work is issued, extraNonce1 is incremented so that each worker gets something different to work on.


How do nodes agree on timestamps? While re-calculating the difficulty every 2016 blocks, how do nodes agree on the new difficulty? There is no unique timestamp on the p2p  network, because nodes can lie about their time stamps. Let us say I calculated the new difficulty and found N, another person found N+3. How is the consensus about the new difficulty arises? The formula depends on the time elapsed for the last 2016 blocks, so without a consensus about time stamps, how do we arrive at a consensus about the new difficulty?

Block headers contain timestamps. Those timestamps cannot be changed without redoing the work on those blocks. If we have consensus about which chain has the most work, we also have consensus about what the next difficulty should be. Those timestamps might not be correct: you rightly note that a miner might lie about what timestamp a block was mined at.

What mitigations does Bitcoin have against miners lying? If a block timestamp is before the median of the last 11 blocks, the block will be rejected. If a block timestamp is more than 2 hours later than the clock of the node validating the block, the block will be temporarily rejected.


How hard it is to destroy BitCoin system if the government leaders decide to do this? Just wondering, since the government controls the physical internet. The Bitcoin system could be somehow destroyed by the governments.

I'm just wondering if they want to do this, is it technically hard?

since the government controls the physical internet

They do not (at least in North America or Europe). The internet is a network of communication. An Internet Service Provider (ISP) can be private or public, but either way it's function is to direct addressed transmissions to those addresses (IP addresses).

This network is a kind of base layer. The early days of Bitcoin/crypto found heavy usage in illicit online activities, meaning not allowed by the government. How were these activities carried out in a controlled network? By taking advantage of networks built on top of this base layer internet. TOR, I2P are some examples of these.

If Bitcoin/crypto were to be heavily prosecuted, nodes could (and have) take refuge in these hidden networks.


Are "1" , "3" and "Bech" Addresses (BTC) forward and backward compatible? Wondering if lets say someone has funds in Bech32 and they send to a "1" or "3" address due to less characters to remember ect.

All current addresses are cross compatible.

At a technical level, the chain has no concept of an address, only of locking scripts, which are fragments of a bitcoin script program. You send coins by specifying the locking script, and spend them by providing the unlocking script (also called the script sig), which completes the program by providing the correct inputs to produce a valid output (TRUE, for a valid transaction).

Since there is no concept of an address here, they are all compatible with each other.

Addresses are a secondary encoding performed on standardized scripts to aid human readability, and prevent typographical errors via checksums and error detecting mechanisms.


Effect of media coverage on the exchange rate? When mainstream media or some high-profile blogs etc. report about Bitcoin, does it have a direct effect on the exchange rate?

Are there any examples in the past?

Let’s say an author is about to publish an article about Bitcoin in The New York Times. Would it be smart for the author to buy massive amounts of Bitcoin immediately before publishing the article, in the hope that the exchange rate rises?

There is no way to attribute Bitcoin price changes to news coverage with precision. Because you can never know the exact reason people are buying or selling.

The situation in Cyprus coincided with Bitcoin price skyrocketing to $245. There were lost of news covering both subjects at the same time but we don't know for sure.

It is logical though, to think that Bitcoin related news does have an impact on Bitcoin price. Especially high profile news and articles on high profile media. But, the content and the tone of the news/article will make a huge difference.

NYT article might push the prices up if it has a positive or even informative tone. It might also cause a drop in prices if it has a negative tone.

The larger the economy the harder it will be to manipulate the price.


Can I use Electrum seed as a paper wallet? Based on what I've read so far I'm pretty sure that what I want to do should work, but I'd like to get some confirmation to make sure I won't be causing myself  issues by screwing something up if I'm wrong.

This is what I'd to do:
1. setup an Electrum wallet in offline mode
2. write down the seed on paper
3. send the coins I want to secure from my normal wallet to one of the generated addresses
4. delete the newly setup Electrum wallet from the hard drive
5. Voila, I should be left with a paper wallet, right? With the wallet deleted from the hard drive, the only access point to the coins is through that paper with the seed written down. And whenever I want to use them, I just open Electrum, type in the seed and it'll grant me full access.

Is my thinking correct? I want to be sure I'm not missing something silly that would result in my finding out that I can't actually access the coins further down the line...

You should create your wallet from a pc that will never connect to the internet again if you want to secure your bitcoins 99.99%

If you don't have another PC, use Ubuntu Live CD/USB.

Boot from Ubuntu live cd/usb.
Install Electram, Bitcoin core, or any tools that enable you to generate wallet and create transactions.
Generate your wallet.
Write the seed (or private keys) on a paper.
Re-boot your pc.

But, in this way, you need to install Electram each time you need to sign a transaction.


Comparison between Bitcoin and other currencies I am doing a research about comparison between Bitcoin, Litecoin and Ripple (I am thinking about change it to Dogecoin). One of the comparison criteria is privacy. I need some information about that, for example about encryption algorithms that are used in each currency, any help please?

Ripple is a centralized system with Know Your Customer integration (passports and bank accounts etc.).

Litecoin and dogecoin add zero innovation over Bitcoin, let alone in the privacy department.

Bitcoin itself however does have some exciting privacy enhancing features in store:

Confidential Transactions, which encrypts the amounts in the transactions making them unreadable to anyone but the sender and recipient.
Signature Aggregation makes it much easier to do coinjoin where transactions of multiple people are combined into one so that it becomes harder to identify which bitcoin belonged to whom. And it actually incentives doing this by making combined transactions smaller (cheaper).


Thank you for answer! :) Could you tell one more thing? How can I get
  proper output script? I thought that I have all information needed to
  count in this transaction. If I have for example this transaction link
  , what should I do? What scriptPubKey shoud I use?

Dont get scared by the wall of Text following, I just want to make it as understandable as I can:

Give this TX-Data:

{
  "txid": "1ea183203c2a2b8db9a84b0d90bfc0b072f0484ec6536b95f69733ae251a3288",
  "version": 2,
  "locktime": 0,
  "tx-comment": "",
  "vin": [
    {
      "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
      "vout": 0,
      "scriptSig": {
        "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
        "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]
}

This Transaction got one input:

 "vin": [
        {
          "txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50",
          "vout": 0,
          "scriptSig": {
            "asm": "304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a501 03e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022",
            "hex": "47304402205474316eb33e1c61e4fa099a0a99d9448e0ffa380b1da8d894e0101fd0eecf7e02206b4bd7498894eb626b1ab1945ddff720b240e8d992e756ff9711a7390951d8a5012103e1cc71fe608be3fa01247476d6fbb758c14af7fa269b151e202f4a2e5a530022"
          },
          "sequence": 4294967295
        }
      ]

This input is refering to an output from a previous transaction:

"txid": "8094704e00978c58f3d51d6c44b460af6c04dac86ef1b79c202208e5c65d0a50"
"vout": 0

This is the point where you get your scriptPubKey from. Input:

"vout": [
    {
      "value": 3.04573103,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FLRnVzFCvGbKEpbjsFBSRejBHEcpbKScAe"
        ]
      }
    },
    {
      "value": 29.93357942,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 5eecec983a2105c049b4d1c1a43287ee07bd075f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9145eecec983a2105c049b4d1c1a43287ee07bd075f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FEV2oce6qUAq9zYfJeBMVZTk6qeJfvkQ7n"
        ]
      }
    }
  ]

There are two outputs. The right one is:

"n": 0

because the reference was:

"vout": 0

And here is the Script you need:

"asm": "OP_DUP OP_HASH160 a0207d9ea622db7f63b70223ba4dea67c260a91b OP_EQUALVERIFY OP_CHECKSIG"
"hex": "76a914a0207d9ea622db7f63b70223ba4dea67c260a91b88ac"

Back to your original Transaction and its outputs:

"vout": [
    {
      "value": 1.3491183,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 9aa813b6983a609ebb5992408457dbb814824124 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9149aa813b6983a609ebb5992408457dbb81482412488ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FKvrsYB5dR2xSW1ujUXq7RLdiUxoZHEH58"
        ]
      }
    },
    {
      "value": 1.59661273,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3ea405431679a7d51fb5da6106cb91f4a1d066ec OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9143ea405431679a7d51fb5da6106cb91f4a1d066ec88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "FBYKr3SGVWMrbHngSGVua1LiCN2GYQV8Lp"
        ]
      }
    }
  ]

Those are not needed for checking the inputs of your transaction. They will be needed for the next Transaction spending your coins from this transaction.

I hope I dont confuse you, and if i did we can propably use chat or so.


How can I remove the charity features in my Devcoin clone? I'm trying to produce a SHA256 altcoin which is merge mined with Bitcoin.  I'd like to use some recent code, rather than base in on a 0.8.* or earlier codebase.  I've found this source:
https://github.com/sidhujag/bitcoin-0.9.2-Merge-Mining-fork

However, it's based on Devcoin, so it sends some of the mining proceeds to other parties.  I'm finding it very difficult to extract this feature, while keeping the merged mining.  For instance, in the miner.cpp file I've modified the CreateNewBlock function to remove the "Prepare to pay beneficiaries" section, but when I do so the compiled code segfaults.

Thanks to anyone who can help with this.

EDIT:
I've run the node with GDB, this is the error and backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd49e4700 (LWP 2385)]
0x000055555562ca50 in CreateNewBlock (scriptPubKeyIn=...)
    at miner.cpp:375
375         pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);

(gdb) backtrace
#0  0x000055555562ca50 in CreateNewBlock (scriptPubKeyIn=...)
    at miner.cpp:375
#1  0x000055555562dc4f in CreateNewBlockWithKey (reservekey=...)
    at miner.cpp:513
#2  0x000055555562de51 in GreedycoinMiner (pwallet=
    0x555556502c70) at miner.cpp:597
#3  0x00007ffff7547a4a in boost::(anonymous namespace)::thread_proxy (param=<optimized out>)
    at libs/thread/src/pthread/thread.cpp:164
#4  0x00007ffff5cc2182 in start_thread (arg=0x7fffd49e4700)
    at pthread_create.c:312
#5  0x00007ffff59ef30d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

int64_t nFees = 0;
int64_t minerValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
int64_t sharePerAddress = 0;
if (coinAddressStrings.size() == 0)
    minerValue -= fallbackReduction;
else
    sharePerAddress = roundint64((int64_t)share / (int64_t)coinAddressStrings.size());

LogPrintf("coinAddressStrings: %d\n", coinAddressStrings.size());
for (unsigned int i=0; i<coinAddressStrings.size(); i++)
{

This is the code in miner.cpp. I think what you should try is changing the following line:

sharePerAddress = roundint64((int64_t)share / (int64_t)coinAddressStrings.size());

change it to

sharePerAddress = 0;

That should remove any payment to the beneficiary.


why is the number of confirmations rising yet i haven't been credited with the bitcoins? I have been waiting to receive bitcoins for close to 7 hours now. The number of confirmations is currently 111, so why is it so? here is the transaction batch 95d5dcb612446d67e38ef9246fdcd20a5f500766431321ba9ff7280567d01e59

TL;DR: when you interact with a custodial service (ie you don't own the privkeys), it is entirely up to that service to 'credit your account' appropriately.

There are many types of Bitcoin wallets, but on a fundamental level we can draw a line between two types of wallets: those that give you access to your private keys (non-custodial), and those that do not give you access to your private keys (custodial).

If you send funds to a non-custodial wallet, you will retain the ability to do whatever you please with those funds, because you own the private keys (which are what allow the software to create valid transactions). Even if the wallet software you use ends up being broken, you can always just import the keys to some different wallet to recover your funds (assuming the wallets being used follow the industry standards of BIP 32/39/44/84 etc).

If you send funds to a non-custodial wallet, there will generally be a waiting period between the transaction confirming on-chain, and the service you sent funds to 'crediting your account'. The length of this waiting period is entirely up to to the service, but generally it will be several confirmations on-chain (meaning, you have to wait for a few blocks after the one your transaction confirmed in). This waiting period is a safety mechanism for the service: it helps ensure they are protected in the case of a chain re-org that could potentially erase recent deposit transactions from their customers.

So with all that in mind, if you are waiting for your custodial account to be credited, the most you can do is contact the service in question to see what the status of your account is. Since they own the private keys for the address you deposited to, they are the only ones that can now spend the coins you sent to them.

Remember: you must fully trust a custodial service to credit your account properly. When you choose to interact with any custodial service, it is prudent to consider what recourse you will have in the case they do not properly credit your account. Are they a legitimate business located in a jurisdiction that will hold them accountable to theft or other abuses? Or are they a service run by anonymous individuals, against whom you will have no possibility of recourse?


What exactly happens when I import private keys to my wallet? I can create addresses with private keys and import those keys into my wallet to receive their unspent outputs to later spend.

My question is split into two parts:

What exactly happens when you import a private key? Is that private key now stored and its corresponding address now tracked by your wallet?
A new transaction is signed with a private key. Therefore, if I have 1 BTC on one address and import its private key, and 1 BTC on another address and import that, how is it I can now spend 2 BTC in one transaction, which key was used to sign this new transaction?

Yes
Both. Each of the two keys is used to prove control over the corresponding UTXO of  the two UTXOs used as an input to the transaction


What is scriptpubkey for in the coinbase transaction ? (and more..) I'm about to mine and I reached a part when I want to generate the coinbase transaction.
I won't complicate things by putting in the new block transactions and getting the fees for them.
All that matters is to mine a block (seems that the coinbase transaction is counted as 1 transaction for the whole block? True?)
Take a look at this PHP function and check the comments (let me know if I'm wrong somewhere)
function coinbase_gen($block_height){         //(decimal)$block_height would be the last official block number +1
$ver='01000000';                             // seems that this version won't change anytime soon?
$i_count='01';                              // In that situation it is always 01?
$txid='0000000000000000000000000000000000000000000000000000000000000000';   //always as well
$vout='ffffffff';                          // always?

$coin_nextbytes=dechex(strlen($block_height)/2);

$block_height=SwapEndianess(dechex($block_height)); //reassign the height to VarInt
$sig=$coin_nextbytes.$block_height."f48616f4254432f53756e204368756e2059753a205a6875616e67205975616e2c2077696c6c20796f75206d61727279206d653f2f06fcc9cacc19c5f278560300";
$sig_size=dechex(strlen($sig)/2);

$sequence='ffffffff';                 // Some people put 0000000 in here.. Why?
$o_count='01';
$o_value='40be402500000000';          //6.25 BTC !!!
$pubkeysize='19';
$script_pubkey='76a914bfd3ebb5485b49a6cf1657824623ead693b5a45888ac'; //Please answer..
$locktime='00000000'; // Seems good
return $ver.$i_count.$txid.$vout.$sig_size.$sig.$sequence.$o_count.$o_value.$pubkeysize.$script_pubkey.$locktime;
}
coinbase_gen((int)$last_blockn); // just example how I'll generate it.

As you can see I have many questions in the code, but I need to know about that $script_pubkey. Some blog posted it as example to mine,but I feel that any bitcoin mined will reward $script_pubkey which is somebodies wallet public key (encrypted) ? OR this does not matter for the coinbase transaction and when I submit the block with bitcoind RPC it will make sure that it will go to my wallet?
This is important to know. Thanks.

The mined Bitcoin "goes" to the scriptPubKey(s) in the coinbase transaction.
Bitcoin operates on spending transaction outputs. Submitting a block does not magically cause a transaction output to appear, you need to specifically create them. This is done through the coinbase transaction (and is really the purpose of it). The only different between a coinbase transaction is that it doesn't have any real inputs. But just like with normal transactions, coinbase transactions can create any number of transaction outputs as it wants, and these just need to follow the rules for output validity.
Thus for a miner to be paid, they need to make sure that the coinbase transaction has transaction outputs that they can spend, and that the amounts for those outputs are what they want to be paid. This means that if you want to collect transaction fees, you need to set the amount to also include the transaction fees of the block, otherwise that Bitcoin will be gone forever. The rule for output amounts in a coinbase transaction is that they must not be greater than the block subsidy + transaction fees for that block.


technical question: receiving wallet.dat error I have ~5 BTC on an old laptop (Windows 7) and I tried moving the balance to another client. At first I tried moving about 0.1 BTC just to see what would happen. The client debitted the balance but it never "took" (that is, I never received the 0.1 BTC, and I know it is a good address). The client informed me I should update immediately so I updated to the latest version (v 0.8.0). The client would not load the wallet so I googled around and found a solution that said try to move all the files out of this directory EXCEPT for wallet.dat:

c:\Users[Me]\AppData\Roaming\Bitcoin

I made a copy of this folder elsewhere and emptied all the files except for wallet.dat, and I am now downloading the blockchain. However, intermittently I get this error:

System error: CDB(): can't open database file wallet.dat, error -30974

The error is thrown by this part of bitcoin's code.

ret = pdb->open(NULL,      // Txn pointer
                        fMockDb ? NULL : pszFile,   // Filename
                        fMockDb ? pszFile : "main", // Logical db name
                        DB_BTREE,  // Database type
                        nFlags,    // Flags
                        0);
// snip 7 lines
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));

Which causes the client to close. Right now I am simply re-opening bitcoin, where it will run for awhile (download a maybe a few hundred blocks or so) and then close again.

So the current issues are:
1. The 0.1 BTC I mentioned above is still showing as being debited from the total inside the local bitcoin client though there is no receipt at the receiving address, and this is confirmed by blockchain.info
 2. I cannot create a new address to send coins
 3. The client will not load the blockchain without indicating the error above and closing

Your wallet.dat hold the keys.  If the client is intermittently seeing errors you will not want to continue using it.

You essentially want to create a new, empty wallet and then import the keys into the new wallet.

One approach is to use Blockchain.info/wallet which can import the wallet.dat, and then you can export the keys from their web interface.

If that doesn't work, then you can try running the client (with no blockchain data files and no network connectivity) and from the Debug console export (dump) the private keys.

Another approach is to use joric's pywallet tool to export the keys.


How can I create smaller transactions? Can a vanity address make things smaller? I'm trying to understand the relationship between a vanity address and how that relates to the size of a transaction.  Is there anything I can do with my public key / address

Is it possible to create a public key address that helps keep transactions small?

Take a look at the specification for transaction messages, particularly the sample transaction: https://en.bitcoin.it/wiki/Protocol_specification#tx

The best way to minimize transaction size is to minimize the number of inputs. Avoid accumulating "dust" balances of very tiny amounts. This is why mining pools have minimum payouts.

Vanity addresses are still the full 20 bytes. Even if you use a firstbits address, you have to look up the full address before using it.

[Moved the answer from the comment below to here:

You don't get a transaction size saving from using firstbits, because it is not legal in the protocol and you will have to use the full address anyway.]


Are there any risks to giving someone your wallet address? I set up a fundraiser for my friend and I got a message from a stranger asking for a wallet address so they can donate using BitCoin. I don’t know a whole lot about BitCoin beyond the basics, so I wanted to ask if this person does happen to be a scammer, are there are any potential risks in giving this person a BitCoin wallet address to send the donation to?
I know if he tries to send me any links or files or anything I won’t click it, I know that much, so I wouldn’t do anything more than give the address to an empty wallet. I just don’t know much about BitCoin scammers and if they have any methods other than the obvious to screw me over somehow.

As long as you make sure you give them a new Bitcoin address (not one you're used in the past) there are no risks in just giving them an address.
If you give them an address you're used before, they may be able to see some of your old payment history.
A scammer could try to convince you they've paid you when in reality they haven't. To avoid that, give them the new address, check for the payment on your own wallet or a trusted blockchain explorer, and don't click links they give you to "prove" they've sent the money or believe that they've sent you money until you see the coins on your own wallet or blockchain explorer yourself.


How to know if bitcoind synced? I installed the bitcoind and started it as daemon.
After 10hours I've tried "du -h"

ubuntu@ip-172-31-37-93:~/.bitcoin$ du -h
16K     ./database
59M     ./blocks/index
29G     ./blocks
646M    ./chainstate
30G     .

How to know if it synced or not?

UPD found an interesting script to monitor node sync status How to check Bitcoind block chain download progress level

You can compare the block count from Blockexplorer with your local block count. Something like this:

$ wget -q -O- https://blockchain.info/q/getblockcount; echo
359721
$ bitcoin-cli -conf=/u0/bitcoin/bitcoin.conf getblockcount
359721

As you can see above my node is synched since the counter is equal.


Is there a more space-efficient way to prove that a transaction is contained within a block? SPV clients, like Electrum, ask for cryptographic proof that a transaction is contained in a block. This is done by including each merkle branch necessary to get a hash that's equal to the merkle root of the block. This takes log(2, N) * 32 bytes, where N is the number of transactions in the block.

Is there a more space-efficient way to cryptographically prove that a transaction is contained within a block?

For the sake of argument, let's assume that you're allowed to change how the block header and merkle tree is calculated, or replace it altogether.

An example of a possible improvement would be to change the hash function used for building merkle trees from SHA256d to RIPEMD-160 (or another 160 bit hash function, like SHA512/160). This would only take log(2, N) * 20 bytes.

Other than shortening the hash used, there is no way of making the proof take less space.

On a side note, the hash can be made shorter by just using the first n bits.  The checksum of a bitcoin address (first 4 bytes of sha256(body))is made in this way.  I don't know why ripe160 is used instead of a truncated form of sha256 for the main body of the address.


How do exchanges store and transfer bitcoin? When I buy bitcoin on an exchange I instantly get them and can withdraw my coins 5 seconds after the transaction. This means the exchange must record your account balance in some database independent of a bitcoin wallet (otherwise buying the coins would take ~10 minutes) and when I withdraw them it is sending a request to withdraw X bitcoin from the exchanges wallet.

However, when I check the wallet that BTC is coming from on blockchain.info etc the source wallet is always different, and I'm unable to see what wallet's balance over time.

How are exchanges storing bitcoin so you can buy/sell on the exchange instantly, and how are they managing that system for withdrawls?

It is important to keep in mind that addresses are not the same as wallets. A wallet contains multiple addresses, not each address is a wallet.

Exchanges maintain their own wallet with thousands of addresses and thousands of coins. When you deposit Bitcoin at an exchange, they will give you an address from their wallet, and you are sending to their wallet. The Bitcoin is now theirs. When you withdraw from the exchange, they send Bitcoin from their wallet to the address that you provide. When they send, their wallet uses some coin selection algorithm to select which coins it will spend to send to you. Since an exchange processes thousands of deposits and withdrawals per day and since the coin selection algorithm may include some randomness, the addresses associated with the coins being spent for each withdraw that you make will likely be different.


Removing old public keys Part2 I've managed to create a wallet with some old private keys from Armory.

After verifying that there are no funds on these addresses, I've closed Electrum
and deleted all files in C:\Users\MyName\AppData\Roaming\Electrum\wallets\ and the config file. The cache folder was empty.

After restarting Electrum and creating a NEW wallet the old addresses (and Keys) where still there.

Where are these keys stored?
How can I remove these old addresses?

In the answer to Removing old public keys @rdymac writes something about
"second click options". I was not able to find informations about this option.

Clicking an address a second time or double clicking gives no result.
Right-click doesn't give the option to delete the address.

After restarting Electrum and creating a NEW wallet the old addresses (and Keys) where still there.

So you went through the process of creating a new wallet? You got asked what wallet type you wanted to create, you chose standard wallet, a seed was generated and displayed and then in the step after that you were asked to re-enter the seed to confirm that you wrote it down properly. After that it asks you to enter a password if you like. You did all this?

If you created a new wallet file then it should not contain your old addresses. The only way it can contain your old addresses are:

the old wallet file is still on your hard drive and you have that opened. you can switch wallet files via file > open or file  > recently open. it's also possible to specify a specific wallet file via the -w command line switch. For example c:\path\to\electrum.exe -w c:\path\to\wallet. If you don't specify a specific wallet file it'll open the default_wallet file in the \Users\YourUserName\AppData\Roaming\Electrum\wallets folder
you have a malware infection and those addresses aren't really yours. they belong to the malware author and the malware is injecting all your wallets with those addresses in the hope that you will send bitcoin to them.

Also note that public keys are not private keys. You imported armory private keys not public keys.


Upgrading from classic to hd Trying to upgrade. I can open my wallet in Multibit classic without entering a password. I have never needed a password to open it and don't remember ever setting one up. I certainly have none recorded. But I can't export a key without entering a password. I tried sending the contents of the wallet to a new wallet in Multibit-HD but I don't know how much to send to allow for the transaction fee. There does not seem to be an "empty wallet" option.

MultiBit developer here. You should be able to simply spend from your Classic wallet into your new HD wallet. Don't try moving private keys around - that's really easy to get wrong and is one of the reasons we wrote HD in the first place.

There are full instructions on upgrading on the MultiBit website: https://multibit.org/en/help/hd0.1/how-to-upgrade-from-classic.html


Verify value of input address Think about a bitcoin transaction:

Inputs: Address1: 2 BTC, Address2: 1 BTC

Output: Address3: 3 BTC

So the value of Address1 is because of two previous transactions where every one of those 2 transactions sent 1 BTC to Address1. How is a full node now be able to verify that the amount of "2" is correct for the transaction?

Transactions don't work like that, so this issue does not arise.

Inputs of a transaction don't specify addresses, they specify previous transactions; more precisely, a particular output from a previous transaction.  The data included in an input is a transaction ID and an output index.

So in the example you cite, the transaction would have to have three inputs: one for each of the two Address1 transctions, and a third for the Address2 transaction.


Bitcoind confirmations during fork I'm using bitcoind's JSONRPC interface to get transaction information for my wallet, specifically, I'm running a little script every time a block gets broadcast (using -blocknotify) which calls the getrawtransaction method to get the parsed raw transaction.

Among the fields returned by getrawtransaction we have confirmations, but what does this field contain during a fork? Ie. if one were to call the getrawtransaction method when there are two "current" blocks, what would this field contain? (bare in mind that in case of a fork, one of the two "current" blocks may include a transaction while the other may not).

All of the information provided by Bitcoin Core applies only to the chain it currently thinks is the best block chain.  Any blocks which are not part of that chain are not counted towards the confirmation score.

If you're using Bitcoin Core in a merchant application, you should probably test what happens during various-length forks.  You can do this using the regression test (regtest) mode.  For example (I haven't tested this):

nodeA_options="-regtest -rpcpassword=foo"
nodeB_options="-regtest -rpcpassword=foo -datadir=/tmp/regtest -port=9999 -rpcport=10000"

## start node A
bitcoind -daemon $nodeA_options

## Create a block to get its coinbase in your wallet (unspendable for 100 blocks)
bitcoin-cli $nodeA_options setgenerate true 1

## start node B and connect it to node A; it'll sync the block
bitcoind -daemon $nodeB_options -connect=localhost

## stop node A to break the connection
bitcoin-cli $nodeA_options stop

## generate a block on node B
bitcoin-cli $nodeB_options setgenerate true 1

## Restart node A and generate a block
bitcoind -daemon $nodeA_options
bitcoin-cli $nodeA_options setgenerate true 1

## Stop and restart node B with a connection to node A
## At this point, both nodes have a different block #2 so you can see
##   what a fork looks like to the nodes
bitcoin-cli $nodeB_options stop
bitcoind -daemon $nodeB_options -connect=localhost

Of particular use, you will probably want to set the -alertnotify command, which can warn you about longer forks and allow you to automatically shutdown your payment processing system until the fork is resolved or you intervene manually.  You may also want to look at the listsinceblock RPC which can work in conjunction with -blocknotify to tell you what's changed in the most recently-accepted block.


Can the fee produced by estimatefee be artificially manipulated? Could a miner who wanted more transaction fees manipulate the fee produced by estimatefee? If so, what percentage of hashpower would it take, and how long would you need it?

No, estimatefee is calculated locally by bitcoind in function of some statistics done on mempool.


How to catch the fees on regtest mode? I'm developing on regtest mode and it seems that the fees I specify in every transaction are not included on every new mined block (generate). I only view (listunspent) a new 50 btc coinbase utxo at the miner node. So how can I catch the fees on regtest mode?

I guess you are missing the coinbase immaturity here.
Coinbase transaction can only be spent after 100 blocks.
A single generate will not make the coinbase-transaction appear in listunspent. If you do a generate 101 it will (because you mine 100 blocks on top of your "fee block").

Then you should get something like:

{
    "txid": "11cc285148b32fd312260a67193875420931b8511b5f34f2991feb5d94901b8e",
    "vout": 0,
    "address": "n3y4wCJcY8zzim3CWuKpFi6BPPAf6DzhVm",
    "scriptPubKey": "2103559b1d5cd126e03b8ee0887ffc1ffd74d34fae49e2e2e65f7708071b032aabf5ac",
    "amount": 25.01920001,
    "confirmations": 101,
    "spendable": true,
    "solvable": true
  },


Format of comment parameters on bitcoind sendfrom command unclear. Attempts result in 'error: type mismatch' The way to specify comment and comment-to parameters when calling bitcoind sendfrom at the comment line is not clear.

When using sendtoaddress, this format works:

bitcoind sendtoaddress 'sendToBitCoinAddress' '0.42' 'comment' 'comment-to'

The man page specifies sendfrom has this format:

sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]

However a similar usage to sendtoaddress results in an error. I've tried various permutations like:

bitcoind sendfrom 'testAccount69' 'sendToBitCoinAddress' '0.69' 'comment 'comment-to'

Thanks for any help

It appears that you are missing the field "minconf", probably setting that to any value would allow you to call the function properly.


How to know whether my transaction is fraudlent after one confirmation? Let's say if the transaction tx_1 has one confirmation. But the tx_1 is fraudulent. Can it be rolled back? Here I am storing the confirmed blocks and if my transaction is in the block-1 then the confirmation of tx_1 is 1 and whenever the blocks come after the block-1 the confirmation will keep on incrementing. But after one confirmation, if the tx_1 is fraudulent then how to stop that transaction?

You cannot undo a confirmed transaction trivially. That is one of the key benefits of a network like Bitcoin.

If your tx has only 1 confirmation, you might yet be able to drop it by mining two blocks on the parent of the block that contains tx_1. However, this requires you to have enough hashpower to be able to do so before someone extends the chain building on the block containing tx_1, which is non-trivial. Additionally, even if you succeed in this, there is still a chance that someone might mine on the block you dropped and turn that into the longer chain again.

Usually, blocks which have been confirmed 6 times are considered irreversible. Practically, unless you have access to a large amount of hashpower, even 1 confirmation is effectively irreversible on the bitcoin chain (although orphan blocks do occasionally happen)


Migration from Bitcoin wallet (Schildbach) to bitcoin core Is there a standard way of migrating from Bitcoin Wallet (Schildbach) to Bitcoin Core?

I understand that backups are not compatible.

Just get an address from Bitcoin Core and make a transaction which sends all of your Bitcoin from the Schildbach wallet to the address from Bitcoin Core.


Is freebitco.in legit site? Is freebitco.in a legit site? This is faucet.  What is the use of faucets in bitcoin. Is it also a mining business?Please tell me more about faucets.

concerning the mentioned website i advise you to read this extended discussion about : https://bitcointalk.org/index.php?topic=341659.0

concerning the faucets systems

  Bitcoin faucets are a reward system, in the form of a website or app,
  that dispenses rewards in the form of a satoshi, which is a hundredth
  of a millionth BTC, for visitors to claim in exchange for completing a
  captcha or task as described by the website.

purpose :

To introduce users to bitcoin
To get traffic
To make money

Besides, in the testnet the faucets are worthless bitcoins distributed for test purposes.


Initial Connection to Bitcoin If this is the first connection of a new client to the network, I would like to know after the exchange of version & verack messages from both peers, which message is exchanged. I guess every time a getblocks message is needed because our client needs to check if the blockchain we have is the latest. So the getaddr messages follow the getblocks message?

And if the client had connected in the past will he need any getaddr messages or his database of peers would be enough?

I guess every time a getblocks message is needed because our client
  needs to check if the blockchain we have is the latest.

Thats right. You can also compare the blockheight from the version message, but you will still need to check if you are not on a fork.

  So the getaddr messages follow the getblocks message

I would say that up to you. If you connect to a new peer, and the chains are different, you dont know directly if he is on the wrong chain or you are. So it would be good to know some other peers to ask as well.
I think its better when you first call the getaddr message, because thats a one time command you run. If you ask for blocks, seeing you dont got all, you will start calling the getdata message and so on. Than your getaddr message would continuous be delayed.

  And if the client had connected in the past will he need any getaddr
  messages or his database of peers would be enough?

The stored peers should be enough. Remember, once a node is connected to a peer node, they share new peers by exchanging addr messages whenever a new peer is discovered. So you also get new peers without asking for them.
You will just have one problem, those peers which have disconnected. So its always a good idea to ask again for peers, just to be up to date.


Does my wallet secured I have an aged notebook, and find there is an wallet on it.

Does this mean that this wallet is unsecured and I can transfer btn from it without passphrase?

Based on the screenshot your wallet is not encrypted and does not need a password; HOWEVER since your node is still syncing, note where it says "3 years and 4 weeks behind", you cannot trust the balance. So wait for it to finish syncing. If you still have a balance after fully synced then your coins are still on that wallet and should be spendable.


Bitcoinj unable to load wallet So I want to load a wallet and get its balance also sending some funds with the corresponding wallet, here is my code

public class DumpWallet {
public static void main(String[] args) throws Exception {

    Wallet wallet = Wallet.loadFromFile(new File("wallet.dat"));
    System.out.println(wallet.toString());
}
}

Why does it throw these followings error (I am using wallet.dat that created automatically on C:\Users\<username>\AppData\Roaming\Bitcoin\testnet3

Exception in thread "main" org.bitcoinj.wallet.UnreadableWalletException: Could not parse input stream to protobuf
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:427)
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:399)
at org.bitcoinj.wallet.Wallet.loadFromFileStream(Wallet.java:1581)
at org.bitcoinj.wallet.Wallet.loadFromFile(Wallet.java:1487)
at org.bitcoinj.examples.DumpWallet.main(DumpWallet.java:33)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:89)
    at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:158)
    at org.bitcoinj.wallet.Protos$Wallet.<init>(Protos.java:14789)
    at org.bitcoinj.wallet.Protos$Wallet.<init>(Protos.java:14778)
    at org.bitcoinj.wallet.Protos$Wallet$1.parsePartialFrom(Protos.java:14956)
    at org.bitcoinj.wallet.Protos$Wallet$1.parsePartialFrom(Protos.java:1)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:89)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:95)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
    at org.bitcoinj.wallet.Protos$Wallet.parseFrom(Protos.java:15822)
    at org.bitcoinj.wallet.WalletProtobufSerializer.parseToProto(WalletProtobufSerializer.java:606)
    at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:420)
    ... 4 more

Bitcoinj doesn't read Bitcoin Core wallet.dat files. You need to start a
fresh wallet and move coins into it using a standard Bitcoin transaction


how to solve this error ? and use detachdb? I got the following error

Error initializing database environment /home/rune/.bitcoin!
To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.

when I run bitcoin-qt..
I am using Ubuntu.

back up all the files in .bitcoin.  then delete them all restart the wallet see if it errors.  If it does, re-download / re-install the client otherwise corupt configs.


How to consolidate a large amount of unspent outputs? I have tried different solutions to consolidate a large amount of unspent outputs, but I am stuck:
1st option: Create transaction using "coinb.in/#newTransaction". But I need private key to create transaction and I am cant find option to export private key. There are steps given on support site for new and classic blockchain.info wallets. But I do not see option of "Private Key" when I click on Manage - More Options.

2nd step: there are some steps showing transfer/sweep funds - which I have tried but it did not work.

To consolidate coins to a single address, just send a transaction for the entire amount stored in your wallet to a new address. You shouldn’t need any outside tools, just use the wallet software to send a transaction to yourself.

You should pretty much never enter your private keys into an online website/service. Access to your private keys could allow that service to steal your coins, there is very seldom a reason you should need to trust someone else to not rob you of your bitcoin.


Bitcore explorer insight testnet initialisation I am using bitcore explorer and I want to initialize insight api in testnet.
It has the following code.
I try var insight = new Insight('testnet') but it is not working.
What value for url should i input so that  Networks.get(url) === testnet

function Insight(url, network) {
  if (!url && !network) {
    return new Insight(Networks.defaultNetwork);
  }
  if (Networks.get(url)) {
    network = Networks.get(url);
    if (network === Networks.livenet) {
      url = 'https://insight.bitpay.com';
    } else {
      url = 'https://test-insight.bitpay.com';
    }
  }
  JSUtil.defineImmutable(this, {
    url: url,
    network: Networks.get(network) || Networks.defaultNetwork
  });
  this.request = request;
  return this;
}

Try this

const bitcore = require("bitcore-lib");
const Insight = require("bitcore-explorers").Insight;
insight = new Insight(bitcore.Networks.testnet);

then do the rest.


Is Proof of Stake a hard-fork? Proof of Stake is a proposed modification to the Bitcoin protocol.

maaku claimed that it doesn't require a hard fork / alt chain.

Is this true?

It depends on what PoS system is considered (or not, since I think the answer is the same either way).

Cunicula's system is completely different from what we have now. There's no way to "half" switch to it since a block which is valid in the current system means nothing in his system, and vice versa.

My system uses a skeleton which resembles the current system, so in theory you could solicit signatures in parallel and let anyone use them or not as he pleases. As theymos says a fork will still occur once there's a disagreement between the two systems about which is valid; and anyway, I think the process of collecting signatures and embedding them in the blockchain requires enough rethinking of the network that it is meaningless to regard it as anything but a hard fork.

Of course, even if you make an entirely new alt for it, you can always provide a built-in mechanism to allow bitcoin owners to import or copy their wealth, to make sure the early adopters of decentralized digital currencies at large don't suffer from the advent of a new and potentially better alternative to the original Bitcoin.


Why is this transaction referred to as "low fee"? Why does Blockchain.info refer to this transaction as "low fee", when it has the normal fee? What is wrong with it? Its size is less than 1000 bytes, with a fee of 0.1 mBTC – yet, this transaction just got stuck?

Could anyone please explain please what happened and why it got stuck?

It is 1343 bytes, larger than 1000 bytes, so you should have paid 0.2mBTC.

You have too many inputs in this transactions. If you had used a compressed public key, you might be able to save some bytes and shrink the transaction size down to under 1kB.


Why my bitcoin trading on coinbase.com is not in blockchain? I deposited USD in coinbase.com and bought some BTC, which shows in my wallet in coinbase.com. But when I search my address in blockchain.info, I saw no transaction associated with my address. I bought this about 2 month ago so it's not about delay of the transaction to blockchain. Is coinbase.com lying about my transaction? If it's not in blockchain, how can I claim that I own those bitcoin? My addresses are "1KqS8GcH9qpT9sHDuv1JXgTicCPQfBdZho", "1HMP3S6jWWnXc6nJNqPnCB3g9xMPk3iyF2" and "1A5Ttr8pfsmYFLavPjkCoKKUwoMSxbEFNV".

Trades within exchanges do not occur on the blockchain. That would severely bloat the blockchain and produce a lot of unnecessary transactions. These trades are simply done by updating your account's balance within the service's internal database. You are not actually sent Bitcoin and there is no way to prove that you own that much Bitcoin except by showing your account.

The addresses that an exchange gives you are not your addresses. They are addresses to the exchanges wallet and once you send Bitcoin to that address, they will update your account's balance in their internal database system. The exchange is holding your Bitcoin for you, and they can do whatever they want with it. It isn't really yours until you choose to withdraw the Bitcoin. When you withdraw, you likely won't be sent Bitcoin from "your" addresses either, but rather from other addresses in the exchange's wallet and often times your withdrawal will be part of the same transaction as other people's withdrawals.


What happens when transaction bandwidth is exceeded? A search for definitive information turned up literally nothing, so, what happens when transaction bandwidth is exceeded for an extended period?

After a period of two weeks (default) transactions are dropped from mempool, if this continues for three months then all transactions from weeks one through eleven will need to be resubmitted a) when the load on mempool dies down a bit or b) with higher fees excluding some other transaction in its place.

I have seen mempool with over 50,000 transactions for many days in a row, perhaps weeks, so, should this actually be called a quasi-payment system where it is possible any given transaction may eventually be forgotten about if the user does not keep on top of it?

A search for definitive information turned up literally nothing, so, what happens when transaction bandwidth is exceeded for an extended period?

The same thing as always happens: miners decide, at their own discretion, which transactions to include in their blocks.  Most likely they will choose those that have the highest fees.  Transactions that don't go in the blocks remain unconfirmed.  There is no special handling for such a case.

  After a period of two weeks (default) transactions are dropped from mempool, if this continues for three months then all transactions from weeks one through eleven will need to be resubmitted a) when the load on mempool dies down a bit or b) with higher fees excluding some other transaction in its place.

That's correct.  If the user still cares about having the transaction confirmed, they (or their software or their wallet provider) will need to do one of those two things.

  I have seen mempool with over 50,000 transactions for many days in a row, perhaps weeks, so, should this actually be called a quasi-payment system where it is possible any given transaction may eventually be forgotten about if the user does not keep on top of it?

It's true that Bitcoin does not provide any guarantee that a given transaction will ever be confirmed, and it never did.  That simply isn't a design feature.  Feel free to call it a "quasi-payment system" if you like that term better.


Can you help with Bitcoin block hashing algorithm ( PHP, C, Python, Javascript)? can you help with Bitcoin block hashing algorithm ( PHP, C, Python, Javascript) ?

I was working really hard to write block hashing algorithm in plain Javascript.
Unfortunately the developed Javascript code is not generating the correct hash.

Yesterday installed Python for Windows XP 32 and run Python hashing code
from
https://en.bitcoin.it/wiki/Block_hashing_algorithm

and run code to get the correct hash.

Python is very slow so I plan to test block hashing algorithm in C
http://pastebin.com/bW3fQA2a

in PHP and modify my Javascript code to generate the correct hash.

Next step is to download hashed blocks from Blockchain via getJason API
to verify every nonce generated for the blocks hashed in the past.

Can you help or join me ?

for a sample Bitcoin hashing in JS you could have a look at this:
https://github.com/KaSt/Jilaku
It's a repo I first forked and then modified to have a "web miner" on top of GAE.
I started the thing as a toy and then dropped the idea... Because...

Well, before the "because", I still don't know your actual purpose. In case it's to experiment and learn the basics of how a miner works... Then any language will do.

In case your aim is to produce a fully functional and efficient miner, then I'll continue with the "because".

I dropped the idea of developing a Javascript miner because there is no way that any interpreted code can be as fast as modern ways of mining, which include ASIC chips and the lot. Your computer will be running for ages, might find a good hash but by the time it found it, other miners might be 10 blocks ahead.
That Javascript miner achieves a few thousands hashes per second.
A single ASIC USB thingy will achieve 300 million hashes per second.

In case your aim is actually to experiment, then that JS piece of code could be of help.

Have fun!


Litecoin address starting with ltc my litecoin wallet (shared 2 of 2) on electrum-ltc generated an address to receive LTC. I transfered some LTC to that address and tried to check in block explorer. Unfortunately got such message:
Sorry, 'ltc1qy4rwhdkujk35ga26774gqmng67kgggtqnsx9vp0xgzp3wz3yjkhqashszw' is not a valid LTC address, wallet name, transaction or block.

Is it something wrong with my LTC address? Electrum-ltc v 3.1.3.1. From what I know it is Bech32 Segwit address.

Your address is in the native-segwit format (also known as bech32).

It's an entirely new address encoding scheme for segwit addresses, and many exchanges, explorers, and wallets don't currently support it.

If you are unable to send coins to it due to the sender not supporting these addresses, you will need to set up a new Electrum wallet, and during the setup process, use P2SH-P2PKH addresses, which will start with M.

If the sender still does not accept the address, you can convert it to one starting with 3 using https://litecoin-project.github.io/p2sh-convert/.

https://insight.litecore.io will accept addresses starting with M for balance checks, and show outputs to the ltc1 addresses, but it will not have an address page for the latter.


Are there decentralized bitcoin asset management systems out there? Are there any decentralized/shared bitcoin asset/investment management systems out there?

It should be applicable to the following case:

Many peers and nobody trusts each other. But trust is gained by investing bitcoins in that system.
Nobody should be able to withdraw more money, than they invested.

I cross-posted this question on

http://www.reddit.com/r/Bitcoin/comments/1zsjr8/are_there_decentralized_bitcoin_asset_management/

I hope it's ok, if not i'll take the link out of this question.

I think that these systems maybe what you are looking for:

Open Transactions -  A general open peer to peer crypto asset system.
CounterpartyD - a New Asset system based on on Cryptocurrency

EDIT 20/05/2014

You should also check out NXT Crypto Its looking very promising the system they have developed.


How to transfer hash power from one pool to another Is it possible to transfer hash power from one pool to another? If yes, how?

If you want to move all your computational power (hash power) suppose you could just disconnect from your current pool and connect to the other one

If you want to divide between different pool I suppose you could just connect to them then use a tactic of process priority to choose how much power you want to devote to each pool depending on its process, for Ubuntu you could have a look at a thread like this one: https://askubuntu.com/questions/656771/process-niceness-vs-priority but it depend on your operating system


Will g'root be included in the Taproot soft-fork? G'root, which I understands as generalised Taproot, was announced a year and a half ago. I'm wondering what the development is on it and if it is part of the taproot softfork.

It is not part of the BIP drafts we're working on for Taproot, and there has not been any development on it apart from publishing the basic idea.

The reason is simply that there are far too many ideas to include all at once; ultimately everything boils down to costs/benefits, and I think just G'root is only marginally useful. And softforks are more than a technical process: we don't need to just propose a technical improvement, but also find adoption for it. The more complex the ideas involved are, the harder the latter becomes.

As I explained on the ML a while ago, I think that G'root does have actual tangible benefits when combined with cross-input aggregation. We deliberately chose to not include that in the current taproot proposal as it interacts in complicated ways with OP_SUCCESS, but perhaps a future change that includes both is possible.


Mining income calculation - H/s, MH/s or GH/s for hashing power? I've seen online calculators use hashing power in H/s, MH/s and GH/s for various algorithms. How does one decide hashing power denomination must be used for mining income calculation? I feel like it has something to do with a specific coin Nethash but I can't figure it out...

Thanks in advance!

EDIT: or should I simply convert Nethash as well as user's hashing power into H/s and be done with it?

You need to put in the hashrate you have \ planning to have. The hashrate depends on the hardware and hash function.

For example, this Bitcoin mining device gives 16 TH/s, which is 16,000 GH/s - https://halongmining.com/shop/dragonmint-16t-miner/.

For GPUs, there are tables online that can give estimates for hashrate of GPU/function combinations, e.g. https://miningchamp.com/.


How is mining time validated? New target is calculated from the T(new_block-1) - T(new_block-2016).
Here T is the time miner mined the block.

Miner itself sets this time for the block.

Thus miner can falsify this time.

I see a rule that this time:

  Must be strictly greater than the median time of the previous 11
  blocks. Full nodes will not accept blocks with headers more than two
  hours in the future according to their clock.

Is this the mechanism used to prevent time falsification (thus target falsification)?

Is this mechanism itself enough? If yes, how so?

In Bitcoin the median time past (as in your quote) is used for all operations where the clock matters which limits the effect of any given miners timestamp. Miners can skew the timestamp of their block quite heavily with no ill effect to the network, some previous mining optimisations involved skewing the timestamp forward to avoid needing to do expensive operations to load a new merle root.

There's one exception where some nastiness can occur, which is an off by one error in the difficulty window calculation which means the timestamp of a single block falls outside the calculation window. This is generally known as the timewarp attack, but isn't a significant threat in the real world, it is useful for abusively resetting the difficulty on the test network if it is too high however.


Transfer money from crypto account to normal bank account I'm totally unknown about this topic so I come to all of you with my question.

I sold something online and the buyer wants to pay me through his cryptoaccount. But then he told me that there is an issue with his account and that he needs me to buy a Steam gift card of 50 euro. When I buy this I will receive an e-code that he needs to convert crypto into money?

Is this all legit or is this a total scam?

You cannot transfer money from crypto to banks directly. You would have to sell the crypto currencies on a special marketplace for cryptos, after that you can get them paid out to your bank account. But you will have varying exchange rates depending on which amount you will sell and what the actual market price is at the time you sell it. Plus additional transaction costs.


Is the bitdigger chrome extension fraud? Today, while I was watching a video on YouTube, I found the video on the bitdigger extension that mine bitcoins with chrome browser. I just want to know if it is fraud or legit? Is it possible to mine via JavaScript?

Edit: My computer is always turn on, let's say at least 20h in a day. Is it bad if I leave bitdigger run in a part?

I just want to know is it fraud or legit?

I have never used it. But: It's not profitable. Big mining pools use ASICs to mine bitcoins. In the past, people used GPU. But mining in your browser means mining with CPU which is completly unprofitable as you will probably never be the first one with a hash of 20 zeros but you'll waste energy.

  Is it possible mining via Javascript?

Yes. There is Coinhive. They offer a script you can implement in your website. And if a user with activated Javascript visits this site, the mining starts. But it's not bitcoin what is mined. It's Monero because it's much more profitable.


How to generate bitcoin address? I'm currently studying Bitcoin and I followed Bitcoin wiki's instructions to make an address.

But my program never responds as the site above does.

Supposedly, the ECDSA key 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6's SHA-256 should be 600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408, but my code returns 32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce and I don't think it's wrong because alot of online SHA-256 service returns the same.

Need I convert the hex into something else like binary to generate the hash?

The hashes are computed on the raw byte value of the key, not the hex-encoded string:

from hashlib import sha256
key = '0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6'
sha256(key).hexdigest()
# Output: '32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce'
sha256(key.decode('hex')).hexdigest()
# Output: '600ffe422b4e00731a59557a5cca46cc183944191006324a447bdb2d98d4b408'

So the trick is to hex-decode the string into its original form before hashing it.


Where does bitcoin-qt try to connect to when running for the first time? My question is, where does bitcoin-qt try to connect to when running for the first time? How does it know where to connect?

Is blockchain.info some domain that has discovery services? If yes, then what happens if this domain goes down? Would that mean that bitcoin is not really decentralized in the end?

It only needs one node to connect to to discover the network. After that it has a cache of several thousand other nodes that were once on the network, and most of those will still be.

On initial startup that is not available yet though, so the reference client will try to either find it in the configuration file (seed), try to find it via DNS, or even IRC if configured to do that.


Is instant profitable arbitrage impossible? Case #1: Trade coins after an arbitrage opportunity appears.

Buy Coin B with Coin A at a low price.
Move Coin B to the buyer's market.
Sell Coin B for Coin A at a higher price.

However, transaction fees, withdrawal fees, the time withdrawals take, and the presence of other arbitrage bots ruin its success. I've monitored the market for opportunities and tested this case, and so far I've only found the impracticality of it: stuck-withdrawals, opportunities that disappear, transaction minimums and fees, etc...

Case #2: Hold 50/50 coins and instantly trade them.

This case puzzles me. It is simply not practical.

There are over one hundred alt-coins of which one would have to have funds.
Apart from the alt-coin opportunity funds, one would need a proportional amount of LTC & BTC.
Most (if not all) of the alt-coins' value is volatile. It makes no sense to steadily hold funds in those "currencies". Whatever small gains acquired by arbitrage would soon dilute.
If one had the hundreds of alt-coins required, and some (mysterious) way to manage their volatility. The size of the arbitrage opportunities available wouldn't match the ROI a traditional investment offers.

Edit 1: Nitpicking the issue, it is possible to perform arbitrage on counted occasions. But I'm referring to the fact that #1 is not instant, and it's riskier and possibly not profitable. And case #2 is flawed in the sense that is not straightforward to hold (and increase) value in a portfolio of crypto-currencies.

I've seen some "professional" crypto-coin arbitrage services, but they look more like scams than anything else. Is there any truth to crypto-coin arbitrage? Is there a case #3, 4, 5, ..., n?

Both are possible; in fact, I do both when the opportunity arises.

For #1, for example, I have successfully conducted an arbitrage on UTC, by buying in at Crypto Rush for 0.00018 and selling it on Mintpal for 0.00019. You definitely have some risk here of not executing the trade quickly enough, so look for markets that are reasonably liquid (i.e. relatively low bid-ask spread). I've done similar arbitrages at least five times. It's not going to be super profitable, but it's a nice opportunity to take advantage of.

For #2, it all comes down to what kind of a long position you wish to hold. So for instance, if you wanted to hold 0.2 BTC and 100,000 DOGE in the first place, then it makes sense to spread them across two exchanges, with 0.1 BTC and 50,000 DOGE at each. When the bid of one becomes higher than the ask of the other, execute the arbitrage ASAP. Of course, it goes without saying that you should not attempt this strategy on a coin that you did not intend to gain exposure to in the first place.


How to know there is a new transaction? I am developing a program that monitors transactions.
The first question is how can I know there is a new transaction? I can consider the command listtransactions. However, there is a bit of an issue about this command which I posted in another thread. In short, I can't list transactions from all accounts by NOT providing the account parameter.
Even if it works for me. The API says:
listtransactions    [account] [count=10] [from=0]    Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] is not provided it will return recent transactions from all accounts.

I ran this command with parameters: "", 1,3. I still got the first 3 transactions.

Does anybody have a better idea about how to get new transactions that have not been checked?

First: to get transactions from all accounts, use the "*" wildcard.

Second: Bitcoin version 0.5 includes a new listsinceblock RPC command that makes polling for new transactions more efficient.

I wrote a monitorreceived patch that does an HTTP POST whenever a new block or transaction-to-or-from-your-wallet was received, but I haven't pulled it into mainline bitcoin because it would make it VERY easy for websites to do the wrong thing and treat 0-confirmation transactions as "paid" and because it isn't clear what (if anything) to do when block chain re-organizations happen or transactions are orphaned (double-spent).


Is there any way to tell if an address has been created on an exchange? (e.g., Coinbase) I am wondering if there is any way to check that a bitcoin address was created on an exchange.

For example, if I want to only interact with (send BTC to) people that have verified their identity (like on Coinbase), is there any way to check that their address is connected to a Coinbase account?

Thanks.

No, it's not possible at all. read more How does Bitcoin work


Wallet gone, how to get it back? So I had my Bitcoin wallet at Multibit and due to computer problems I formatted my hard drive and the wallet within it. I have no backups of the wallet, I have only my account name. Are my Bitcoins now gone forever?

I would check these help pages out. The first one explains that your wallet may not be fully deleted.

  https://multibit.org/en/help/v0.5/help_support_missingWallets.html
  https://multibit.org/en/help/v0.5/help_lostOrForgottenPassword.html

Multibit has a pretty good troubleshooting page too, which explains where all their data is stored. I would check and see if you have any data in your system specific directory.

  https://multibit.org/en/help/v0.5/help_troubleshooting.html

If the wallet is truly deleted, and you don't have any backups, then yes, unfortunately your bitcoins are gone forever. :/


Bitcoin Core telling me transaction is not "trusted" I'm running a full node without the GUI, so I'm controlling it with bitcoin-cli.

I sent bitcoin to another address, same as I always do, but this time I can't pull up the transaction on any of the block explorers and when I use bitcoin-cli gettransaction ad2dfbd06b15f0721c2c1864e4cf0989833727c6eec038472c2a2789f4b5d024, it comes back with:

  "amount": -0.01949732,
  "fee": -0.00007460,
  "confirmations": 0,
  "trusted": false,
  "txid": "ad2dfbd06b15f0721c2c1864e4cf0989833727c6eec038472c2a2789f4b5d024",
  "walletconflicts": [
  ],
  "time": 1479664206,
  "timereceived": 1479664206,
  "bip125-replaceable": "unknown"

I've never seen "trusted": false on any other transaction, so I assume that has something to do with it, but I can't find any information online to tell me what it means.

EDIT:
Pasting the hex format of the raw transaction into blockchain.info/pushtx and pushing it that way has set it to trusted: true and now it's showing up. I'd still like to know why it happened and/or how I can fix it myself without relying on blockchain.info's pushtx tool.

A transaction will be distrusted if

it conflicts with a transaction already in the blockchain, or
it is from someone else, and it is not confirmed.

A transaction will be trusted if

it has confirmations.

If a transaction is not trusted, the client won't create transactions that spend it. (You wouldn't want a transaction you created to be in limbo because one of its inputs wasn't confirmed.)

Once that transaction is confirmed, the trusted field in listtransactions will be true.


Does the ZeroCoin protocol fulfill its promise of anonymity? Zerocoin is a new cryptographic extension to Bitcoin that (if adopted) would bring true cryptographic anonymity to Bitcoin.

Has anyone seriously analyzed the protocol and verified it works as advertised?

This is the zerocoin paper, but as far as I can tell, they haven't released source code yet, so all we can really do is speculate.

The single largest problem it has is that a zerocoin spend requires about 100x more disk space/bandwidth/cpu than a normal bitcoin transaction. However, the intended use case is that you use normal bitcoin transactions most of the time, then run through zerocoin when you want more anonymity.

Second, because all zerocoins are indistinguishable, they must either

all be the same denomination, which sucks for people making very large transactions and for people making very small transactions, or
Have a handful of predefined denominations, like 1-zerocoins, 10-zerocoins, etc. The problem with this is that it reduces your anonymity set.

As far as security/anonymity goes, I believe that they have a workable system unless there's some problem with their zero-knowledge proof, which I've repeated below.


Blockchain API Bitcoin transaction list to a wallet I wanted to write a small script to parse all incoming transactions to a wallet. The wallet I'm looking at is from an OpenSource project I'm working for, to get an overview of the amounts given to the project in a certain time-range. I use the Blockchain Data API and try to parse the information from this call (includes the wallet-adress). But I can't seem to get the amount of Bitcoins that were transferred to the wallet. Sometimes there are amounts as big as 266 BTC listed, even though the real transaction was just a couple of Satoshis.

So, the question is: When I have a JSON Transaction Block like this:

   "ver":1,
   "inputs":[
      {
         "sequence":4294967295,
         "prev_out":{
            "spent":true,
            "tx_index":273950706,
            "type":0,
            "addr":"12tPhkHLjmkDfqTfvbagbnkYDU5UTu2pMp",
            "value":461323,
            "n":1,
            "script":"76a91414b04a7b66d06dd399bdb689df209ed688e9bcaa88ac"
         },
         "script":"483045022100f38ffd67d53b4c5a6f6a2543ca6217863be5b4f3a43e885a2520dbb768ba5df702203d9782af024ee9e213fb59cee1c788c70e66d66addb553b74610a1fed3df10390121026b138ff61ffeaf459c4916889d2c53894fc029c9729886714fe23ebd8a15bb32"
      }
   ],
   "block_height":480392,
   "relayed_by":"52.59.6.61",
   "out":[
      {
         "spent":false,
         "tx_index":274914673,
         "type":0,
         "addr":"1M3GipkG2YyHPDMPewqTpup83jitXvBg9N",
         "value":295902,
         "n":0,
         "script":"76a914dbd0788d294dd15704d232053790c555d1cb337888ac"
      },
      {
         "spent":false,
         "tx_index":274914673,
         "type":0,
         "addr":"18h2yt8cJSYwGSWV5nUodTgPZj9Vi5aCJS",
         "value":124987,
         "n":1,
         "script":"76a914545b2c20e7d8ded3853a2336ebedf7752cf823dd88ac"
      }
   ],
   "lock_time":0,
   "result":0,
   "size":226,
   "time":1502650024,
   "tx_index":274914673,
   "vin_sz":1,
   "hash":"02a7bf19417db6d975d48e27199cd65dcc415c5bf81ed447f945b2a4f3dc1d24",
   "vout_sz":2
},

What is the amount of Satoshis that have been added (or redeemed) from that wallet? How should I interpret the values in the json?

Transaction has inputs and outputs. "value" is Satoshi count:

  "inputs":[
  {
...
         "prev_out":{
...
            "value":461323,
...
         },
...
      }
   ],
...
   "out":[
      {
...
         "value":295902,
...
      },
      {
...
         "value":124987,
...
      }
   ],
...

To calculate fee you should calculate the difference between all inputs and outputs.


How accurate is Bitcoin network time? Have any observations been made to conclude the accuracy of Bitcoin network time?

It would be interesting to know if NIST or any other authority has tracked the phenomenon.

From this blog post describing the timejacking attack:

  Each node internally maintains a counter that represents the network time. This is based on the median time of a node's peers which is sent in the version message when peers connect. The network time counter reverts to the system time however if the median time differs by more than 70 minutes from the system time. A very reasonable way to estimate the median network time.

So block timestamps are based on "network time" which is in turn one of:

The median time advertised by peers (if between ±70 minutes from system time)
System time

  The network time is used to validate new blocks. As a precaution, nodes reject any block timestamp that is greater than 2 hours from the current network time. Block timestamps that are earlier than the median time of the past 11 blocks are also rejected. This validation puts upper and lower bounds on the acceptable range of block timestamps.

So block timestamps are:

< 2 hours from "network time".
> median of last 11 blocks.

I have to refresh my error propagation lessons, but I guess this leads to an accuracy at around ±3 hours.

Of course this is just an upper bound on error, but the actual question remains: what is the real blockchain accuracy? (which is a very interesting question.) The only way to be sure is actually tracking it and comparing with a known perfect timestamp. I don't know if anyone has ever done that before and couldn't find any references.


How propagation delay depends on the block size? According the paper 'Information propagation in the bitcoin network'. by Decker and Wattenhofer.
For sizes larger than 20kB the cost can be said to be constant, whereas for small sizes there is a considerable overhead. Actually, I didn't get how small blocks take more time than messages whose size is greater than 20KB ?
How delay taken by blocks with size greater than 20KB is almost constant? As shown in image below:
.

The y axis of the plot shows the delay/size, that is, the number of seconds of delay produced by each kilobyte of data of the block.

Therefore, as blocks get bigger, the overall delay of the block also gets bigger. However, the delay per kilobyte of data approaches a constant value. This is produced because the overhead generated by the bitcoin protocol when sending blocks (anounce the block via an inv message, send getdata to retrieve content, etc.) is less significant as the block gets bigger.


How to change user permissions on the /blocks/ folder in linux? I have three users on my linux system. root, daemonuser, and abeuser.

daemonuser runs bitcoind

abeuser runs ABE

I cannot seem to change the permission of my "blocks" folder so that abeuser can read from it.

I have tried placing the bitcoin data directory in the /opt/ folder and then running the command:

  chmod -R +r /opt/bitcoinBlockchain

with no luck.

/opt/bitcoinBlockchain/blocks is always locked to daemonuser and abeuser cannot read anything inside of it.

You should be able to change the permissions of the block files using the following command:

sudo chmod -R go+r .bitcoin/

(replacing .bitcoin/ with your Bitcoin data directory)

The problem is that bitcoind will create all new files with permissions so that only allow the owner of the files can read from and write to them (600), because of the following line in init.cpp:

umask(077);

I have created a patch and a pull request that should fix this, though: https://github.com/bitcoin/bitcoin/pull/4286


Can you register a .com domain with namecoin? Namecoin is a generic name-value store, so I'm wondering if its possible to register .com domains in namecoin. The answer here seems to suggest you can register any domain you want How do I register a .bit domain name with Namecoin?

Namecoin was the first fork from Bitcoin, and is a blockchain based peer-to-peer network which maintains a decentral ledger of registered names.

It is the convention, that when you register a Namecoin name starting with d/ that appropriate DNS resolution software would translate this information to a .bit address. E.g. d/myself would be resolved to myself.bit.
On the other hand, the responsibility for managing regular top-level domains (TLD) is assigned by the Internet Corporation for Assigned Names and Numbers (ICANN) to specific organizations, with which a regular user can then register a domain directly or through intermediaries.

The ".bit" domain used by Namecoin didn't exist in the Domain Name System (DNS) before. As far as I am aware, there are no conventions for established top-level domains. That would be especially problematic in the case, when the two resources managing the same namespace would end up with conflicting information:
It would be somewhat detrimental to the user experience if domains were to resolve to different pages depending on whether you used the Namecoin extension or not.

Another example of Namecoin usage is the application OneName, which resolves names starting with u/ to point to Bitcoin addresses of their users.


Can bitcoin core verify a third party blockchain download? If you were to obtain a copy of the bitcoin blockchain, i.e. a copy of someone's data dir excluding his wallet files on a removable drive or other storage medium, could bitcoin core verify that or not? This would be useful in developing countries where the initial blockchain download is hard to do but keeping up with the chain is easy.

If you give Bitcoin Core a fully populated data directory, it will use it without any validation.

However, if you only give it the blocks/ subdirectory, it will fully validate it to recreate the chainstate directory, exactly as if it were received over the network.


Is it possible to create a Bitcoin URI with multiple outputs? The Bitcoin URI scheme allows for the creation of single-click payment request, using the format

bitcoin:<address>&amount=<amount>

such as

bitcoin:1AzGoMQfrQ7fYaE12dAvEVkke8111rxwCm&amount=0.01

Does the URI scheme also allow multiple payments to multiple destination addresses?

No, this is not possible according to BIP 0021. The BNF grammar for the bitcoin: URI scheme starts with:

bitcoinurn     = "bitcoin:" bitcoinaddress [ "?" bitcoinparams ]

Since bitcoinparams has no address information, this means that exactly one output address is required.


multisig tx 1 out of 2 Here is an example of multisig tx

https://blockchain.info/tx/09dd94f2c85262173da87a745a459007bb1eed6eeb6bfa238a0cd91a16cf7790?show_adv=true

the 3rd one output is 1 of 2 keys.

So the question is what is going to happen if
both addresses will try to spend that transaction ?

Each private key can send the transaction fully, similar to having a joint account, the other party can cash out the account at any time and so can you.


Bitcoin's script expressivity I'm conscious that Bitcoin's script is not turing complete, as multiple answers point out (e.g., this answer and this one). But I'm wondering if script can express the language of a PDA or equivalently, of a context-free-grammar.

I think it should be so, because of script's stack, but I'm not sure and therefore I ask for some clarifications/confirmations.

No, it's much less expressive than a PDA, or even a DFA.  There's a stack, but what you don't have is the ability to return to the same program state with different stack contents, or for that matter, to return to the same program state at all.

Execution is linear and there are no loops, so any given instruction in the script is executed at most once.  And each instruction can only inspect a bounded number of stack or input elements.  So a Bitcoin script cannot even recognize the language x* (any number of xs) because a script of length n will only ever be able to look at, say, 4n elements of input, and it cannot distinguish xxxx....xx from xxxx....xy if both strings have length greater than, say, 4n+1.  Even a DFA can recognize that language.


dollars being sent to me for no reason? I bought 200 ($700 worth) bitcoins in 2012, and I found them last week. Now, my wallet says they are worth $2371959.00 apparently. Is this a scam or do I need to sync my wallet? The computer is pretty old so I'm not sure if it is a virus. Has anyone had this issue?

I'm not sure if you're trolling or not, but 200 bitcoins is currently worth ~2,357,000$. ( Which seems to pretty aligned with the number you are giving.)

There's no virus/scam or bug, the price simply increased. Congratulations.

I'd advise you to make a backup of the private key of the adress you're currently storing the 200 bitcoins on, and either memorize it, or hide it, in case your old PC / ( the harddrive of your old pc) breaks.

Or even better, buy a hardware wallet (such as a trezor or Ledger Nano S) Or a secure new PC/Laptop, and store the bitcoins on there.


how to calculate Entropy from series of outcome? I want to generate my own private key with dice and/or other very entropic phenomenon. But how can I calculate if my data have a good entropy ? I mean if I throw dice in a certain way too much time maybe my outcome will not be trully random, maybe my dice is not a very good dice and have imperfection etc.

So can I just throw it 300+ and if I don't have 0.166666% each result (1,2,3,4,5,6) it's not good ?

Also I want to write my own series of dice result just to compare how deficient is my brain when I try to generate true randomness.

Thanks

Try using the an open source program called ent. Here are the results for rolling a die six times with the result vector of <666666>.

% echo -n "666666" | ./ent

Entropy = 0.000000 bits per byte.

Optimum compression would reduce the size
of this 6 byte file by 100 percent.

Chi square distribution for 6 samples is 1530.00, and randomly
would exceed this value less than 0.01 percent of the times.

Arithmetic mean value of data bytes is 54.0000 (127.5 = random).
Monte Carlo value for Pi is 4.000000000 (error 27.32 percent).
Serial correlation coefficient is undefined (all values equal!).


How do you type the ₿ Bitcoin Symbol in Android Google Keyboard? Is there a way to enable the Bitcoin symbol on my Android 9 Google Keyboard? I don't see it anywhere.

Gboard settings (cogwheel on keyboard) > Dictionary > Personal Dictionary > (your language) > + button

For the shortcut box, add whatever symbol or word you want that will make the symbol appear on the autocorrect list in the moddle. Copy and paste the symbol for the shortcut field.

Yours may vary. Razer Phone 2, Android 9, Gboard v9.1.8